PxScene::getActiveTransforms memory behaviour

Where can I find clarification of the behaviour of getActiveTransforms? Specifically, how is the memory that the pointer it returns refers to managed? The scene update implementation used in the PhysX samples simply copies the buffer into an application-allocated buffer immediately after calling getActiveTransforms. Is this the only safe way to use the result of getActiveTransforms, i.e. is the result only valid until the next physics update is called? The API documentation does not provide an answer. It only specifies that calls to getActiveTransforms must be made when the simulation is not running.

Thanks in advance.

P.S. Is there syntax on this forum for inline code quotes?

Hi,

Yes, the docs are sparse on this subject. I’ll file a defect to have that fixed.

I’m checking on the answer and will post it ASAP.

Thanks,
Mike

Hi,

In PhysX 3.2 the active transform array is cleared and rebuilt during fetchResults(). As such, it is possible to access the memory returned by getActiveTransforms() during the next simulate call, before calling fetchResults(). Note that in 3.2, it is documented that calling getActiveTransforms() while simulation is running results in undefined behavior, and the ability to access this memory during simulate() in the current release may not be supported in future releases

Further, it is highly recommended that you process this array as soon as fetchResults() completes, as it will not include the results of any user modifications to the scene that are made subsequent to fetchResults().

Thanks,
Mike