Solved

# Moving Sphere - Stationary AABB Intersection Test

Posted on 2006-03-20
1,056 Views
Hi

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.

Thanks
PhoeniX260182
0
Question by:phoenix260182

LVL 84

Expert Comment

http://www.realtimerendering.com/int/#I335
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.
0

Author Comment

The distance of what? I kind of understand, but where are you getting the distance from? Between the line and what?
0

Author Comment

The link that you posted is to an algorithm for a stationary sphere, but thanks anyway.
0

LVL 84

Accepted Solution

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.
0

## Featured Post

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…