How do I properly use multithreading with Nvidia PhysX?
Posted
by
xcrypt
on Game Development
See other posts from Game Development
or by xcrypt
Published on 2012-04-07T13:56:32Z
Indexed on
2012/04/08
5:48 UTC
Read the original article
Hit count: 310
physics
|multithreading
I'm having a multithreading problem with Nvidia PhysX.
the SDK requires that you call Simulate()
(starts computing new physics positions within a new thread) and FetchResults()
(waits 'till the physics computations are done). Inbetween Simulate()
and FetchResults()
you may not "compute new physics".
It is proposed (in a sample) that we create a game loop as such:
- Logic (you may calculate physics here and other stuff)
Render
+Simulate()
at start ofRender
call andFetchResults
at end ofRender()
call
However, this has given me various little errors that stack up: since you actually render the scene that was computed in the previous iteration in the game loop.
Does anyone have a solution to this?
© Game Development or respective owner