[ODE] possible bug regarding dJointAddHingeTorque and dJOINT_REVERSE

Martin C. Martin martin at metahuman.org
Mon Jan 19 12:45:17 MST 2004


By the way, it looks like you need to set the hinge's anchor or axis 
*after* you call dJointAttach(), or the angle it returns won't be 
relative to the initial angle.

 > This is currently not the case -- when
 > dJOINT_REVERSE is set, a positive torque will cause a negative
 > velocity (as reported by dJointGetHingeAngle).

By jove, you're right!  Can someone with CVS access make the following 
change to dJointGetHingeAngle() in joint.cpp:

Change "return getHingeAngle(blah blah blah)" to:

     dReal ang = getHingeAngle 
(joint->node[0].body,joint->node[1].body,joint->axis1,
			  joint->qrel);
	if (joint->flags & dJOINT_REVERSE)
	   return -ang;
	else
	   return ang;

And in dJointGetHingeAngleRate(), just before the "return rate," add:

    if (joint->flags & dJOINT_REVERSE) rate = - rate;

The other hinge functions do the right thing, as do all the universal 
joint functions.

Enjoy,
Martin




More information about the ODE mailing list