I do not know if it is a problem, this is my first touch with Box2D, but in the real world, if something lie on a desk for example, so it is not moving without reason.
I am very surprised, that a Joint can get into moving the two bodies by this way. 1.4cm is relatively big movement.
It depends what kind of joint it is, for example joint that has a spring and damper, with zero damping, can cause an endless oscillation. It's really hard to even guess what's going on just from a screenshot.
You can use the b2World::Dump function to dump the state of the world, maybe someone can take a look to see what you have there. (You would need to fill in the b2Log function in b2Settings.cpp to write the output to a file.)
I have RevoluteJoint.
BDX::RevoluteJointDef^ _jointDef = gcnew BDX::RevoluteJointDef();
_jointDef->bodyA = _bodyList[1];
_jointDef->bodyB = _bodyList[2];
_jointDef->collideConnected = false;
_jointDef->localAnchorA = MXF::Vector2( +0.080f, +0.100f );
_jointDef->localAnchorB = MXF::Vector2( +0.080f, +0.100f );
_jointDef->referenceAngle = 0.0f;
_jointDef->enableLimit = true;
_jointDef->lowerAngle = (float)( (-1)*Math::PI*0.5 );
_jointDef->upperAngle = (float)( (+1)*Math::PI*0.25 );
_jointDef->enableMotor = false;
_jointList[1] = dynamic_cast<BDX::RevoluteJoint^>(_world->CreateJoint( _jointDef ));
and this BodyDef
BDX::BodyDef^ _bodyDef = gcnew BDX::BodyDef();
_bodyDef->type = BDX::BodyType::Dynamic;
_bodyDef->bullet = true;
_bodyDef->position = Vector2(0.0f, 0.0f);
_bodyDef->allowSleep = true;
_bodyDef->linearDamping = 0.0f;
_bodyDef->angularDamping = 0.01f;
At time of creation I can set the ReferenceAngle for RevoluteJoint using
_jointDef->referenceAngle = 0.0f;
At running time I can get this angle using
_jointList[0]->GetJointAngle()
but How I can set ReferenceAngle at running time ? there is no SetJointAngle() .....
I am trying to get my 2D figure into motion.
I think, that only way how to set angle between two bodies is to use Revolution motor.
_jointDef->enableMotor = true;
Here is _jointList[2]->GetJointAngle, but no _jointList[2]->SetJointAngle