wow, I see what the bug is now.
This could be either good of really bad.
basically I made a mistake when I was starting to add the skeleton, I though I should use the Skelton as a IK solver, but after a while I realize that it is too much problem, because it makes code pathway to complicated. So I comment out the code by I left something uncomment.
I made this huge mistake, I declared a flag to determine when the solver was in IK or on dynamics mode, but I made the flag a union with the Motor flag instead of a struct.
- Code: Select all
class dgFlags
{
public:
union {
dgInt8 m_flags;
struct {
dgInt32 m_isMotor : 1;
dgInt32 m_applyCorrection : 1;
};
};
};
but is should have been declared as
- Code: Select all
class dgFlags
{
public:
union {
dgInt8 m_flags;
struct {
dgInt32 m_isMotor : 1;
dgInt32 m_applyCorrection : 1;
};
};
};
what this does is that I map isMotor rown and kinematic row to the same variable
since when a each time a morter was set the code the function also rest applyCorrection
whi meat that moter are turn of each time function like
- Code: Select all
void dgBilateralConstraint::SetMotorAcceleration (dgInt32 index, dgFloat32 acceleration, dgContraintDescritor& desc)
{
m_rowIsMotor[index] = -1;
m_motorAcceleration[index] = acceleration;
desc.m_flags[index].m_isMotor = -1;
// huge mistake here, .m_applyCorrectionis sterring motro mode to zero again
desc.m_flags[index].m_applyCorrection = 0;
desc.m_jointAccel[index] = acceleration;
}
This is in fact good new in disguised.
for some feature I am using motors more and more, but I notice that some how motor are not as strong as I expect then to be, so I have to increase power more and more.
this si the good new, the reason is that the is a bug in the code.
The bad new is that I have to revisit all the place where I am using Motors.
what you are seen, in the vehicle is actually a very good thing. basically the tire are getting all 550 (I believe HP to the tire) and that is enough spin the tire lie crazy
this if the tire spins the Brush tire model (because of cycle of fruition) reduce the lateral fruition to the minimum.
I am no reverting the code so that it as is was by tonight I will fixed so that it work as it should for everything.
I really like the fact that we found that Bug because I hate when thing works because of the side effect of a bug.