Jump to content

[SOLVED] Improper values of Axis0/Axis1 for Joints


photo

Recommended Posts

Posted

Bug occurs when creating JointHinge/Cylindrical/Prismatic for bodies whose positions differs only in Z axis.

 

Values of Axis0/Axis1 are improper because vector for axis is always calculated as cross product with (0,0,1):

 


// code from JointHinge::JointHinge(Body *body_0,Body *body_1)
//...


axis = cross(vec3(p1 - p0),vec3(0.0f,0.0f,1.0f));

 

Reproduction steps:

1. Add 2 meshes to scene. Set position of 1st to (0.0, 0.0, 0.0), 2nd to (0.0, 0.0, 3.0).

2. Add BodyRigid for each of these objects.

3. Set JointHinge from 1st to 2nd object.

 

Values of Axis0/Axis1 for JointHinge will be (0,0,0).

  • Like 1
×
×
  • Create New...