Passing Matrix and Vector to LCP solver.

steveh
Posts: 22
Joined: Mon Dec 19, 2005 3:15 pm

Passing Matrix and Vector to LCP solver.

Post by steveh »

Hi all,
I'm having real problems working out my solver why (I'm using ODE solver as reference) is comming out with odd values. I'm using the solver to compute the constraints on objects acceleration and I'm not convinced I'm passing the solver correct values. I'm basing it on the Baraff code.

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 wrong. As this signifies the objects are accelerating away from each other. I'm after a force (x) to counteract the downwards acceleration.

I'm pulling my hair out and would really appreciate some help, without being told that I'm using an obselete method and should start from scratch :P

Thanks,

Steve.