[ODE] Distance constraint

i-photon@comcast.net i-photon at comcast.net
Mon Dec 25 07:37:02 MST 2006


Ok, I spent some time sifting through the list and found that some guy already
asked a question like this (although it was "ball and socket with some radius"
instead of "distance constraint", which was what I was looking for). Anyhoo,
James Golding was right, it is as simple as a one DOF joint written as follows:

D = p1-p0;
r0 = R0*a0;
r1 = R1*a1;

m = 1/(sqrt(dot(D,D))-dist);  <- this done safely, of course

JL0 = D/m;
JA0 = Cross(D/m,r0);

JL1 = -D/m;
Ja1 = Cross(r1,D/m);

I tested it and it works flawlessly for one and two bodies at any velocity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20061225/77832ef0/attachment.htm


More information about the ODE mailing list