Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rigid bodies without colliders escape from joint with a rigid body with collider. #388

Closed
robertocapuano opened this issue Jun 4, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@robertocapuano
Copy link
Contributor

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);

@robertocapuano
Copy link
Contributor Author

This commit breaks the functionality:
8f46764

robertocapuano added a commit to robertocapuano/reactphysics3d that referenced this issue Jun 16, 2024
Applying a force a RigidBody without collider this escapes from actual Joints.

DanielChappuis#388
@DanielChappuis DanielChappuis self-assigned this Jun 20, 2024
@DanielChappuis DanielChappuis added this to the v0.10.1 milestone Jun 20, 2024
@DanielChappuis
Copy link
Owner

This issue should now be fixed in release of version v0.10.1. Thanks again for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants