Skip to content

Running physics separately from the main game loop #131

Answered by RossNordby
Frooxius asked this question in Q&A
Discussion options

You must be logged in to vote

With the low level design of BEPUv2 I figure this is completely on the integration side. I remember BEPUv1 had some helpers for buffering the states, but I don't think that's present here.

Correct.

However one main thing I'm not certain if I understand correctly are queries - raycasts and sweeps. Those typically happen from the main game loop, but with the asynchronous run, the physics can be mid-update, so I assume it's not safe to execute them this way.

Yup.

Would the correct approach there be to collect all the raycasts and sweeps in the game loop and then schedule to run them in the physics update loop and then sync the results back with the main game loop?

Yup, some kind of mes…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Frooxius
Comment options

Answer selected by Frooxius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants