after lot of debugging it seem that some how the tire alignment is wrong by some tiny value
if I hack the vehicle to be a fix value the vehicle can accelerate straight indefinitely.
- Code: Select all
for (void* contact = NewtonContactJointGetFirstContact(contactJoint); contact; contact = NewtonContactJointGetNextContact(contactJoint, contact)) {
dVector contactPoint(0.0f);
dVector contactNormal(0.0f);
[b]// some how this direction vector seems wrong[/b]
// const dVector& lateralPin = tireMatrix.m_front;
dVector lateralPin (0, 0, 1,0);
I have no found any thong wrong on the calculations, but there has to be something wrong some where. In any case this is actually very bad even if I can fix it.
what this mean means is that the vehicle is unstable, in vehicle dynamics the call this condition Understeer gradient vehicle. But in stability this is called unstable equilibrium.
what this mean is that when a system is on steady state, in this case moving straight at a fix velocity)
when applying a small perturbation the system three thing can happens.
1-the system is indifferent to the perturbation, like a ball rolling on a flat floor
2-the system recover form the perturbation, like a ball rolling on a valley.
3-the system become more and more unstable, lie a ball on the top of a hill, any small change makes fall down hill.
right now the vehicle system is acting as the their condition, and what is desired is that is acct some where in between 1 and 2.
I am hopping there is a bad bug some where, but I can no find it, and I hate to have to result to hack the equilibrium.
Anyway now that It seem I have a clue as to where the bug may be, I will continue debugging it.
I am not sure how is was better before, but for what I can see this has always been that way.
what is difference now is that before there was lot of vehicle dynamics implemented on the custom joints side, now this is on the engine solver side so is much harder to debug.