I’m using Unreal Engine, and I need to add a PhysX function to advance the simulation only for an actor. So I need simulate its movement separately from the scene.
My idea is to add a boolean parameter to PxRigidDynamic that indicate if this actor must be moved or not with the scene simulation.
Then my new function that acept the pointer of PxRigidDynamic and a DeltaTime can simulate only the movement for this actor.
What I done
To do this I’ve checked the code to find out where the simulation algorithm is.
I’ve discovered that the class responsible for the simulation is NpScene with function simulateOrCollide, this function initialize all dispatchers that are managing the execution process, then is called the function executeScene by one of dispatcher init before.
At this point is called the function Scb::Scene::simulate that calls the function Sc::Scene::simulate.
The problem is that the function “Sc::Scene::simulate” call “Sc::Scene::advanceStep” that starts other dispatchers, but where is the real algorithm that perform the movement?
I know the existence of instant API but I prefer to use the scene that UE already created instead of create a new to add this feature.