I’ve been writing a car simulation in C++ reading the PhysX guide’s vehicles part (SDK version 3.2.1) and the provided SampleVehicle code. Most parts are copied from the sample vehicle.
My problem is that the suspension of the car is not working, any value I set when I configure it the suspension remains stiff and doesn’t move at all. The only parameter working is PxVehicleSuspensionData::mMaxDroop, if I set that one bigger, the length of the suspension increases.
The second problem is that I can turn the front wheels, I can set the acceleration flag in the cehicle controller and the wheels are spinning but the car doesn’t move at all, it stays there as if it was on ice.
What I do:
- I set the SimulationFilterData and the QueryFilterData for the ground shape, to be drivable and have COLLISION_FLAG_GROUND and COLLISION_FLAG_GROUND_AGAINST flags as in the sample vehicle code, and it is a convex mesh
- Create a PxVehicleDrive4W as in the sample vehicle code
- When updating the vehicle:
- first I set the new keyboard inputs, and update the vehicle controller
- then call PxVehicleSuspensionRaycasts function
- and finally PxVehicleUpdates function
Could you help me what did I miss to set up?