I currently have multiple objects, each moving forward randomly like this
model.lookAt(position_x, 0, position_z);
setInterval(function(){
model.translateZ(0.015);
}, 10);
I need each object to avoid crashing into each other during forward movements. I found this solution suggesting bounding boxes for collision detection but it only seems to be for collisions between two objects:
How to detect collision between two objects in JavaScript with Three.js?
Is it possible to have multiple objects each having their own collision detections?
Thanks!
Box3andisIntersectionBox, the only thing you have to do is to make a loop. You keep all your objects in an array, and at each frame, you check for all your objects if they collide with one of the objects