[ODE] Question about a change in the source for dJointSetAMotorAxis

Russ Smith russ at q12.org
Fri Apr 30 11:35:25 MST 2004


> The new joint.cpp has the line of code 
> 
>   // adjust rel to match the internal body order
>   if (joint->node[1].body && rel==2) rel = 1;

this was part of a set of changes that permit the amotor to be connected
to just one body. now that you mention it, that does seem wrong.
i believe the correct line of code is:

	if (!joint->node[1].body && rel==2) rel = 1;

hmmm, let me work this through ... the idea is that, if you're only
connected to one body (node[1].body==0) then 'rel' can not equal one of:
1 or 2 ('rel' is the body that an axis is relative to). the assertions
above this line of code will check that you have specified the correct
'rel' in this case. this line of code makes sure 'rel' is correct for
the internal body order ... the internal order is that the second body
is 0 if there is only one body. so: if there is no second body, make
sure rel refers to the first body. i *think* that's correct but others
might want to sanity check the reasoning.

i've checked in the fix.

russ.

-- 
Russell Smith
http://www.q12.org


More information about the ODE mailing list