[ODE] bug in amotorComputeGlobalAxes
Jon Watte
hplus-ode at mindcontrol.org
Wed Sep 29 11:56:37 MST 2004
> I'm a bit confused about why this would change anything at all.
> The existing code is:
if (joint->rel[i] == 1) {
// relative to b1
dMULTIPLY0_331 (ax[i],joint->node[0].body->R,joint->axis[i]);
}
if (joint->rel[i] == 2) {
// relative to b2
if (joint->node[1].body) { // jds: don't assert, just ignore
dMULTIPLY0_331 (ax[i],joint->node[1].body->R,joint->axis[i]);
}
You're forgetting the "else" right after the second if(). So,
when joint->rel[i] == 1, it would run the first if(), then it
wouldn't run the second if(), but the else{} of that second if(),
which clobbers the output of the first if() block.
Cheers,
/ h+
More information about the ODE
mailing list