You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I create a chain of rigid bodies with a colliders interleaved with a rigid bodies without colliders, they are connected via slider joint and ball and socket joints. The last element is a rigid body without collider linked by a fixed joint to the last rigid body with a collider. I apply a force on this last one.
Sometimes it happens that the body escapes the joint and returns to position only by moving the first object.
Below is a snippet of code of the last two bodies to make the example clearer:
I create a chain of rigid bodies with a colliders interleaved with a rigid bodies without colliders, they are connected via slider joint and ball and socket joints. The last element is a rigid body without collider linked by a fixed joint to the last rigid body with a collider. I apply a force on this last one.
Sometimes it happens that the body escapes the joint and returns to position only by moving the first object.
Below is a snippet of code of the last two bodies to make the example clearer:
RP3D::RigidBody body1 = m_world->createRigidBody( { pos1, QUAT_I } );
RP3D::CollisionShape shape =m_common.createSphereShape( radius );
Fx::ColliderRef coll = m_world-> createCollider( body1, shape, Fx::Transform {} );
body1->addCollider( shape, Fx::Transform {} );
RP3D::Transform tr { pos2, QUAT_I };
Fx::RigidBodyRef body2 = m_world->createRigidBody ( tr );
const RP3D::Transform &tr1 = body1->getTransform();
const RP3D::Transform &tr2 = body2->getTransform();
const RP3D::Vector3 anchor_point = .5f * ( tr1.getPosition() + tr2.getPosition() );
RP3D::FixedJointInfo jointInfo(body1, body2, anchor_point );
RP3D::FixedJoint joint = (RP3D::FixedJoint) m_world->createJoint(jointInfo);
The text was updated successfully, but these errors were encountered: