Skip to content

Locking multiple physics systems from a single thread #403

Answered by jrouwe
mihe asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

That's a good point that I didn't think about! The PhysicsSystems are completely independent of each other as long as you make sure that you don't mix bodies or constraints between them (mixing shapes should be ok). It is totally fine to lock bodies from multiple PhysicsSystems at the same time. All the thread_locals that are used for validating consistency were not made with multiple PhysicsSystems in mind and will falsely assert that you're doing something wrong. I'll have to come up with a better way of tracking the PhysicsLocks (and also BodyAccess, BodyManager::sOverride*).

Note that there are a couple of globals that make the PhysicsSystems not completely independent:

  • There …

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@mihe
Comment options

@mihe
Comment options

@jrouwe
Comment options

@mihe
Comment options

@jrouwe
Comment options

Answer selected by mihe
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