Collision made faster by James Lynch


#1

I have been coding simple physics myself writing game engines from scratch. Collision detection is probably faster when using spheres as fast code. I do not know what playCanvas uses but puting simpler shapes with fewer polygons will speed up collision detection I assume. See if you can select AABB boxes or spheres. A sphere is only using a radius and origin(x, y, z) to detect collision. I used spheres and a game of 3D Asteroids ran smoothly. Fired 80 rounds per second with no noticible slowdowns. But it was on a 386 computer in the 80’s before books on games were out. Running under Qbasic 16 bit with DOS 16 bit OS.


#2

Playcanvas uses Ammo.js, that is a full blown physics simulation to do collision detection. You have a valid point, that for simpler systems using spheres to detect collision can be quite fast if your use case justifies that.

I know that @Mr_F did something similar in his Robostorm game:

You can read more about that here: