Differential Lock


I am working for an oil truck simulator, and I need the truck to have a differential lock (in case of driving in mud / sand). I use a PxVehicleNoDrive in order to command the torque on the wheels, but I don’t know if it is possible to add contraints on wheels, in order to force them to have the same rotation speed.
Did I miss something, or is it not possible ?
Thank you.

PxVehicleNoDrive doesn’t provide a differential. The only types that provide an editable differential are PxVehicleDrive4W and PxVehicleDriveNW. PxVehicleDriveTank has a very specific type of differential that is hard-coded and not editable.

If you want to carry on using PxVehicleNoDrive then you will probably need to implement the differential yourself. You can do that by a combination of PxVehicleWheels::setWheelRotationSpeed and by applying less drive torque to the slipping wheel.

You could try something more sophisticated than what I described above. You could look at the tank differential code in PxVehicleUpdate.cpp and attempt to replicate something like that outside the sdk to calculate the drive torque that leads to a differential lock.

Thank you for the answer.
I will check that code to get inspired.