Problems with btRaycastVehicle

josemarin02
Posts: 3
Joined: Thu Mar 06, 2008 12:00 pm

Problems with btRaycastVehicle

Post by josemarin02 »

Hello!


I´m having some problems with btRaycastVehicle.
I´m trying to solve them myself, but maybe you guys could help-me.

1) The vehicle is allways turning upside down when turning on high speeds (sometimes, even in slow speeds)
Is there a way of make the vehicle more "stable"?
btRigidBody::setAngularFactor cold be a good option?
Is there a way of make the vehicle heavier on the bottom, and lighter on the top? This could make it more stable?
2) The vehicle isn´t following moving platforms (this is already on another thread)
It simply slips away!



Thanks!
Murphy
Posts: 32
Joined: Fri Aug 31, 2007 6:36 am

Re: Problems with btRaycastVehicle

Post by Murphy »

1. Look into m_rollInfluence in the wheels. You should also set the center of mass to be lower on the body. Here is how I generally do that:

Code: Select all

btCollisionShape * chassisShape = new btBoxShape(btVector3(0.5f, 0.2f, 0.625f));
btCompoundShape * compound = new btCompoundShape();
btTransform localTrans;
localTrans.setIdentity();
//localTrans effectively shifts the center of mass with respect to the chassis
centerOfMass = btVector3(0.f, 0.3f, 0.08f);
localTrans.setOrigin(centerOfMass);

compound->addChildShape(localTrans, chassisShape);
2. I would like to know this as well actually. I know some people are making their character be kinematic but I would like to avoid doing this...