Is my idea of collision detection correct?

Hi, welcome to three.js !

This is a perfect use-case for Axis-Aligned Bounding Box (AABB) collision detection.
Check this video, the guy explains everything : https://www.youtube.com/watch?v=ghqD3e37R7E

Besides, if you are doing a brick game, you can expect the ball to sometimes go through bricks undetected if you don’t check for collision 120 times/sec.
I had this issue for which I asked for help here.
The issue was solved by updating game state several times per frame, depending on frame rate, by putting this into the function that get called with requestAnimationFrame :

delta = clock.getDelta();

ticks =  Math.round( delta / ( 1 / 120 ) );

for ( let i = 0 ; i < ticks ; i++ ) {

    updateGameLogic( delta / ticks );

};

You just have to update the position of the ball then check for collision into the function “updateGameLogic”.

2 Likes