Hi,
from time to time when I’m driving a vehicle through obstacle the vehicle suddenly changes orientation. I was able to reproduce this issue in the Vehicle Sample.
I tried to mark down cause of this issue through debuggger at functions:
setAngularVelocity
setLinearVelocity
addForce
addTorque
setGlobalPose
setCMassLocalPose
None of these functions were fired during debugging, so they aren’t problem here.
I also tried to increase velocity interation count(8) setSolverIterationCounts, problem still exist.
Limit to 5.f setMaxDepenetrationVelocity doesn’t solve the problem.
FPS is stable 120 fps.
Enabling/disabling physics substep doesn’t solve the problem.
Tweaking wheels SuspensionDampingRatio / SuspensionNaturalFrequency doesn’t solve the problem.
Distribution of spring forces from left spring to right and vice versa with stabilize bars doesn’t solve the problem.
Object to observe:
PxPhyscs->Scenes->PxScene[2]->RigidDynamics->Component: Sedan_C_8.VehicleMesh Sedan_SkelMesh Bone: Vehicle_Base
I can even send to you guys whole project with this obstacle, but this is simple box a little narrower than length between front-rear wheels.
I’m thinking that the problem here is spring force applied to vehicle body, but I don’t know how to check this and how to fix this:( Maybe I should wait for physics 3.3.2 ;(
Could you describe a little more what you’re seeing? Do you mean the rotation of the vehicle changes when you drive over an obstacle? What kind of obstacle are you driving over that this is happening?
Hi,
I think I see the basic problem here, not quite sure what to do about it yet. Looking from above, it is clear that the right-rear tire contacts the obstacle a few frames before the left-rear tire at frame 2933, and the first raycast contact of the right-rear tire on the obstacle is on the front edge of the obstacle (which apparently isn’t quite vertical), not the horizontal surface of the obstacle (the long, thin, blue triangle where the ray intersects the obstacle):
In frame 2934, the right-rear tire raycast now encounters the horizontal surface of the obstacle (the big, fat blue triangle where the red ray intersects the obstacle:
In all of the other frames where the car first contacts the obstacle, the first raycast hits the horizontal surface, not the vertical edge. I believe that the suspension is reacting harshly to the normal produced by the raycast with the leading edge of the obstacle at frame 2933. I would try to filter that out somehow.