[ODE] dSolveLCP question.
steve at rubiconmobile.com
Thu May 4 04:46:35 MST 2006
This is my first post to the ODE mailing list.
You may have seen this message in a slightly different form on the Bullet
Physics forum. I've since realized my problems are more with my
understanding than ODE specifics, but please bare with me.
I'm using the ODE LCP solver (dSolveLCP) as part of my own physics engine,
which is a learning exersize I'm enjoying, greatly but finding very
challenging. The maths involved is right on my limit.
I'm getting some unexpected results coming back from the dSolveLCP routine.
I'm using the solver to compute the constraints on an object's acceleration
and I'm not convinced (but I'm fairly sure!) I'm passing the solver correct
values. The values I pass to dSolveLCP are the Matrix M and the scalar array
B. I set the high array to dInfinity and the low array to 0, the nub = 0 and
findex = NULL.
(I'm basing the M and B values on the Baraff code in the Physically Based
Modelling paper (http://www.pixar.com/companyinfo/research/pbm2001/).
I'm resting a ball of mass 10, on a plane of infinite mass. This means just
1 contact point. This should be easy to debug. The A matrix boils down to
invmass (0.1) and the B vector = force (10 * -9.8) / mass = -9.8.
Plugging the 2 values (Matrix A = 0.1, B = -9.8) into the solver gives me an
X value of 0 and a W of 9.8. This is not what I expected. As this signifies
the objects are accelerating away from each other which is not the case with
the negative value in B. I'm after a force (x) to counteract the downwards
acceleration. I then multiply this force by the contact normal to get the
force direction and simply add this to the external force and torque (which
should then be cancelled out).
I've even tried using David Eberly's code in the Game Physics book for
compute the M and B values, this yields the same results, an acceleration,
not a force. I was expecting an X of 98 and W of 0.
Can anyone shed any light on this? I'm really stuck. Have I over simplified
/ misunderstood things?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ODE