Closed SNMetamorph closed 9 months ago
Are you by any chance adding forces within contact callbacks? That could be a scenario that triggers this. Write operations are not allowed in contact callbacks.
Are you by any chance adding forces within contact callbacks? That could be a scenario that triggers this. Write operations are not allowed in contact callbacks.
@msauter-nvidia yes, exactly this happens. Interesting that I didn't found any information about write operations restrictions inside contact callbacks in documentation.
So next, I need to do actions that now runs in contact callback. How can I do these actions? Create some queue, push information in it inside contact callback, and before running simulation code use this information to do actions. Will this work?
It is documented in PxSimulationEventCallback:
"SDK state should not be modified from within the callbacks. In particular objects should not be created or destroyed. If state modification is needed then the changes should be stored to a buffer and performed after the simulation step"
The solution is exactly what you described: you need to write the changes you want to do into some sort of buffer and apply them after fetchResults() has returned.
It is documented in PxSimulationEventCallback:
"SDK state should not be modified from within the callbacks. In particular objects should not be created or destroyed. If state modification is needed then the changes should be stored to a buffer and performed after the simulation step"
The solution is exactly what you described: you need to write the changes you want to do into some sort of buffer and apply them after fetchResults() has returned.
Thanks
I getting these errors spamming from PhysX (version 4.1.2), but I don't use any multithreading since my application is completely single-threaded.![изображение](https://github.com/NVIDIAGameWorks/PhysX/assets/25657591/f666c2d3-6a7e-4ccd-9f8b-ac307a1b4618)
Also my code of running simulation is pretty simple and looks like this
What i'm doing wrong?