I want to have some advices on how to implement an efficient physX3 update loop. What I want is something like the physX 2 behavior.
I am creating a physX3 plugin for 3dgamestudio. Basically, I have done the following :
- Get current time step
- Subdivide timestep into substeps
- Execute scene.simulate per substep
- Sync render objects based on physX objects
All of these are done without using pXtask and are completelly synchronous to the engine’s update loop.
Now, the problem is that when defining the engine and the physX simulation to run at different frequencies, this method partially fails :
- Getting the velocity of a PH_CHAR is not working (returning 0)
- Setting targetpose for kinematic characters also fails
I then wanted to ask if someone have some theory on how to implement a working physX simulation loop. The physX2 update loop (with physX managed substep) is working perfetlly in this case. Will implementing a multithreaded/async stepper solve my problem?