Skip to content

What is the best way to add a large static game level into the physics system? #1298

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

You must be logged in to vote

First is to merge all the level's meshes into one then add that as a mesh shape into the physics system

There's a limit to the number of triangles that fit into a single mesh, so you will eventually run into problems with this.

Second is to make a static compound shape consisting of the level's meshes as mesh shapes

Again, this could run into issues as the 32-bit SubShapeID may run out of space.

Third is same as the second but each separate entity is a static compound shape, meaning each building or tree is an independent body

That could work. Alternatively, you could cluster entities and create a single body per cluster. E.g. you could pick areas of 50x50 m and add everything in th…

Replies: 1 comment 1 reply

Comment options

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

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