Scene queries without stepping the simulation.

I have an application where I need to be able to move actors in the scene and then perform overlap queries. Whenever I query the scene the list of actors seems to be outdated - as if the moving actors have not moved since they were created.

Since I’m not stepping the simulation (no calls to collide(), fetchCollision(), advance() and fetchResults()), do I need to perform some other actions before querying the scene?

How are you moving the actors? If you are using setGlobalPose(…), these changes should be reflected in the next query after you set the pose. If you are using setKinematicTarget, the kinematic doesn’t move until the next simulation step so, if you don’t actually simulate, it will never move. Setting a kinematic target tells the simulation to move the object to this location using velocity in the next simulation frame. However, if you raise the flag PxRigidBodyFlag::eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES on the rigid bodies, scene queries should use the kinematic target so queries will behave like the object’s pose was set using setGlobalPose().

Thanks Kier!

The PxRigidBodyFlag::eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES flag is exactly what I was looking for.