First of all, I'll just paste my general setup here for reference:
Code: Select all
centerOfMass = btVector3(0.f, 0.3f, 0.08f);
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
localTrans.setOrigin(centerOfMass);
compound->addChildShape(localTrans, chassisShape);
btTransform tr;
tr.setIdentity();
tr.setOrigin(btVector3(0, 0, 0));
carChassis = CreateRigidBody(tr, compound, GetMotionState());
carChassis->setDamping(0.2f, 0.2f);
adam23 wrote:The Kart tips over very easily.
We use a low center of mass along with a Roll Influence value of 1.
adam23 wrote:Steering is all or nothing
Are you changing your steering value over time or directly setting it upon a key press? You need to make sure the turning happens over time (just like a real car).
adam23 wrote:Do you guys use OgreBullet to handle your physics?
No, I wrote my own wrapper as we needed to simulate most of the physics on the server which doesn't have any concept of Ogre.
adam23 wrote:How do you get your karts so low to the ground
This was just a matter of tweaking the suspension and mass until it looked and felt right.
adam23 wrote:Anytime I lower the box closer to the road, the box will hit parts of the road ( especially when going up a ramp or anything similar ).
Try stiffening your suspension I suppose. We had the same problem when the kart hit a ramp too fast. To fix this we designed our ramps on a curve instead of a hard angle.
adam23 wrote:Are you using just a bounding box for the car
Yep. btCollisionShape * chassisShape = new btBoxShape(btVector3(0.5f, 0.2f, 0.625f));
adam23 wrote:How do you make your suspension almost non-existent
It actually does exist and is necessary to give the whole thing some damping upon landing from a ramp, etc. It isn't visible on the client because I don't send the wheel positions over the network. It was determined to be too much data to transfer for something that isn't even expected on a kart type vehicle.
Here are the suspension values we use:
SuspensionStiffness = 100
SuspensionDamping = 20
SuspensionCompression = 4.2
SuspensionRestLength = 0.3
(Note: these values are most likely dependent on other values such as mass)
adam23 wrote:Are your vehicles front wheel, rear wheel, or 4 wheel drive?
2 rear wheel drive.
adam23 wrote:What is the average mass your using for vehicles
We use 400 now for all our karts.
Hope the info helps. Good luck!
