Using the Advanced vehicle template, inside the actor vehicle I’ve written a function that call the Physics simulation 40 times for a particular frame.
So almost each tick I’m executing this function:
PxScene* PScene = GetWorld()->GetPhysicsScene()->GetPhysXScene(PST_Sync);
for (int32 a = 0; a < 40; ++a) {
PScene->simulate(1.f / 60.f);
PScene->fetchResults(true);
}
What I’m expecting is when this function is called the car should go a little bit further so as final result the car should be a little more speedy.
But the real result is this: https://youtu.be/1tfmbXuETRc where the physX simulation seems completelly broken.
What I think is that at the end of the cycle I should broadcast the event that render the scene because I think the problem is not in the physics simulation but in the syncronization with rendering phase.
Probably the problem is another (for example I must call “simulate” in another way) so I’ll be glad to ear your advices.