I’m trying to better understand what is the proper way to check collision between a large number of meshes. I have seen other questions but I can’t seem to understand the right solution.
Imagine a simple game, where you shoot at tens of possible meshes, which are also created dynamically.
From my basic research, all the collision mechanisms require a mesh starting point and a given target. I have checked the following:
- Physics engine collision - https://playground.babylonjs.com/#KEPY4J#8
- Action manager or render loop specific collision checks - Collisions & Triggers | Babylon.js Documentation
One more requirement that I have is to be able to enable collision on entities that move using animation, and not move with velocity vector.
This means that on every creation of a new mesh(a bullet) I will need to either create an action manager target between each given entity.
But - does it make sense? does it make sense to create so many observers for every mesh upon creation? assume that the game should work super fast. Checking collision on the render loop or creating tons of actions managers doesn’t seem like the right solution.
Do I miss anything?
Thanks for any help,