vehicle roll influence bug?

dahart
Posts: 4
Joined: Mon Sep 28, 2009 8:42 pm

vehicle roll influence bug?

Post by dahart »

Is this the right place to report bugs?

Someone correct me if I'm wrong, but the handling of the roll influence appears to have a bug in it:

btRayCastVehicle.cpp:692 (v.2.75)
rel_pos[m_indexUpAxis] *= wheelInfo.m_rollInfluence;

rel_pos is a world space offset, not a local space vector, so the vehicle's track width can't be faked by poking only the Z element, right? If I display the forces being applied to a vehicle, and use a roll influence that is not 1.0, I can see that the side forces resulting from the roll influence calculation are changing position relative to the tires depending on the vehicle heading, and consequently my vehicle's turning behavior is heading-dependent.

I think I get something closer to what was intended here by replacing that line with this one:
rel_pos += m_axle[wheel] * (rel_pos.dot(m_axle[wheel]) * (wheelInfo.m_rollInfluence - 1.0f));

Another option would be to transform rel_pos to local space somewhere before the line in question (and convert back to world space before sending it to applyImpulse()).

--
David.
dahart
Posts: 4
Joined: Mon Sep 28, 2009 8:42 pm

Re: vehicle roll influence bug?

Post by dahart »

:oops: Nevermind!

For some reason we had m_indexForwardAxis, not m_indexUpAxis in our code... that changes things.

--
David.