I am currently trying to implement a simple continuous collision detection system. I wondered whether it was possible, for a moving AABB, to compute the distance it can translate in an arbitrary direction d
before it intersects a convex polyhedron. Here is a simple explanation in 2D:
What I want here is the length of the green lines (the orange AABB is the initial position, and the red AABB is the position where both colliders intersect).
This is also equivalent to trying to raycast the minkowski difference A⊕-B from the origin in the direction d
, where A is my static convex polyhedron and B my moving AABB:
But computing a minkowski difference seems to be really performance-consuming, so I would like to know if a fast algorithm for doing that exists.
When Googling, I saw an algorithm to do that called GJK, but it only seems to return the overall minimum distance, and not the directional distance.
Thanks in advance for your answers!
PS: Please excuse my poor english and my total lack of artistic talent using paint.