Changing the settings seems to either result in the wheels penetrating the ground (and the body penetrating with other physics objects under it), or the car tipping over or even flipping upside down. I'm wondering if anyone has had experience playing with the vehicle controller that might be able to shed some light on what's happening?
If I increase the weight to something realistic (>800kg) the wheels will be under the ground, and any smaller objects will be sandwiched between the car and the ground. This is confusing because it shouldn't happen in any case?
Here is an image of the car (orange boxes are the physics objects, axes are centre points).

And the relevant code:
Code: Select all
var carBody = new Box(pos.ToBP(), 2.2f, 0.8f, 5.0f, 6.0f);
carBody.CollisionInformation.LocalPosition = new BEPUutilities.Vector3(0.0f, 0.4f, 0.0f);
vehicle.VehiclePhysics = new Vehicle(carBody);
float stiffness = 1000.0f;
float dampening = 100.0f;
//float maxSpringCorrectionSpeed = 10000000.0f;
float radius = 0.38f;
float widthFront = 0.25f;
float widthBack = 0.4f;
float suspensionLength = 0.2f;
float wheelHeight = -0.4f;
// front left
Vector3 attachPoint;
attachPoint = new Vector3(-0.93f, wheelHeight, -1.8f);
var wheelFrontLeft = new Wheel(
new CylinderCastWheelShape(radius, widthFront, localWheelRotation, wheelGraphicRotationLeft, false),
new WheelSuspension(stiffness, dampening, BEPUutilities.Vector3.Down, suspensionLength, attachPoint) { /*MaximumSpringCorrectionSpeed = maxSpringCorrectionSpeed*/ },
new WheelDrivingMotor(2.5f, 30000, 10000),
new WheelBrake(1.5f, 2, .02f),
new WheelSlidingFriction(4, 5));