Large mesh collisions (Cameras/Collisions/Theoretical)

If it is a very large mesh with many vertices it will require some heavy computation to check for collisions against it. even for a well optimized physics engine.
Some physics engines can support a convex hull, which will be a better approximation of the mesh’s shape. There is a short discussion about it here - Ammo.js convex mesh hull - #3 by MackeyK24

A different approach would be to collide against the bounding sphere or bounding box, depending on the mesh you are colliding against. Another one would be to separate the mesh into smaller meshes.
The reason that would work is the algorithm that is used to check for collisions. It inspects every triangle until it finds one that collides against the player. If you are “lucky” and it is one of the first triangles then it will be rather quick. but most of the time (because that’s how things are :slight_smile: ) the colliding triangle will be deep in the positions array. now checking 100, 200, 1000 of those - that is fast and can be done every frame. but when it gets to be very big - the performance goes bad.

Of course, the best solution IMO is making your mesh more low-end friendly. But that’s not the nicest solution is a lot of cases. It really depends on your usecase.

3 Likes