math

Distance from point to plane implementation

Calculation of closest points between objects gives us the distance between these objects. These calculations are one of the most powerful in collision detection algorithms in a sense that they can minimize calculations a lot. If the combined maximum movement of the objects is less than the distance between them, a collision will not occur and we can save us a lot of time detecting the impact.

Sphere vs AABB collision detection test

As the sphere is being the simplest primitive there is, the test for Sphere and AABB intersection is easy. This solution works also for Sphere Cube intersection tests.