Moving Sphere - Stationary AABB Intersection Test


I'm busy implementing the collision detection section of my 3d engine, and have hit a snag. I have created an octree and divided the polys into the tree where they should be. What i want to be able to do is to find if there is a collision between my moving camera (sphere) and a node's bounding box (an AABB). So far I have managed to find lots of info about every configuration of collision detection, except the one i actually need. I have a good stationary sphere intersection routine, but that won't help if the sphere is moving too fast and passes right through the AABB. No intersection will be found, because there is no intersection between the sphere and the AABB at the starting point, and none found at the end point. I have a starting position, and ending position, and a radius for the sphere, and the center and the half distances on each axis for the AABB. With this info, I need to find out if the sphere will intersect the AABB. This section of code is going to be running in a time critical section, so can't afford to be slow.

Any help would be greatly appreciated.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If the sphere is moving in a straight line, then you want to detect an intersection between a cylinder and a box, which you can do by seeing if the distance from the line representing the path of the centre of the sphere is less than the radius of the sphere.
phoenix260182Author Commented:
The distance of what? I kind of understand, but where are you getting the distance from? Between the line and what?
phoenix260182Author Commented:
The link that you posted is to an algorithm for a stationary sphere, but thanks anyway.
The distance between the line and the bounding box.
If the line does not intersect the bounding box, this would be the minimum of the distances between the line and the edges of the box.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Game Programming

From novice to tech pro — start learning today.