Toby
30-11-2006 10:41:00
Hi, I experiment a strange comportement when I get contact point.
Then a shapeGroup that contains first my body actor and four wheels.
When my actor does not move wheel are at good position but when my actor move, contact point of wheels seams to be late.
Distance between body actor and fronts' wheels is smaller. And with rears' wheels taller.
Then suspension react well, but when we accelerate front well up and rear well down.
Must I introduce velocity in my calcul? I think no.
Thanks for your reply.
Then a shapeGroup that contains first my body actor and four wheels.
When my actor does not move wheel are at good position but when my actor move, contact point of wheels seams to be late.
Distance between body actor and fronts' wheels is smaller. And with rears' wheels taller.
NxWheelContactData contactData;
NxShape* ContactShape = mWheels[i].mWheel->getContact( contactData );
if(ContactShape != NULL)
{
Vector3 mDirection = mBody->mNode->getWorldOrientation().Inverse() * (NxTools::convert(contactData.contactPoint - mBody->mActor->getGlobalPosition()));
float mDistance = mDirection.length();
mWheels[i].mNode->setPosition(mWheels[i].mInitialLocalPos.x, 0.5f -mWheels[i].mInitialLocalPos.y + mWheels[i].mWheel->getRadius() - mDistance, mWheels[i].mInitialLocalPos.z);
}
else
{
mWheels[i].mNode->setPosition(mWheels[i].mInitialLocalPos.x, mWheels[i].mInitialLocalPos.y + mWheels[i].mWheel->getSuspensionTravel() - mWheels[i].mWheel->getRadius(), mWheels[i].mInitialLocalPos.z);
}
Then suspension react well, but when we accelerate front well up and rear well down.
Must I introduce velocity in my calcul? I think no.
Thanks for your reply.