Skip to content

Multiple Simulations #179

Discussion options

You must be logged in to vote

Yup- nothing fancy about it, there's no shared state in the background. Just create separate simulations.

To use the demos as an example, this works just fine:

NewtDemo newtDemo = new();
RagdollDemo ragdollDemo = new();
ColosseumDemo colosseumDemo = new();
newtDemo.Initialize(content, camera);
ragdollDemo.Initialize(content, camera);
colosseumDemo.Initialize(content, camera);
for (int i = 0; i < 100; ++i)
{
    newtDemo.Update(window, camera, null, 1 / 60f);
    ragdollDemo.Update(window, camera, null, 1 / 60f);
    colosseumDemo.Update(window, camera, null, 1 / 60f);
}
newtDemo.Dispose();
ragdollDemo.Dispose();
colosseumDemo.Dispose();

If you intend to run them on multiple threads simult…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Tetragrammatonsodr
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