Skip to content

How to handle an unknown/changing number of layers? #999

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

You must be logged in to vote

DocAce has a lot more experience than I have in making space games, but I just want to comment on this:

At first I was thinking of give each cell their own broadphase (so bodies in multiple cells won't collide despite being at the same location), but Jolt has to know how many broadphase layer exists and it's a dynamic count in my case.

There is only 1 broadphase per PhysicsSystem so you can't do this, I'm assuming you meant 1 broadphase layer per cell. I guess this could work, but the number of layers is fixed at initialization time and that is not easily changed. I think the better solution is to use 1 PhysicsSystem per cell. Note that this would involve destroying and recreating the b…

Replies: 2 comments 2 replies

Comment options

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

Comment options

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

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