phoenix260182
asked on
Moving Sphere - Stationary AABB Intersection Test
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
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
ASKER
The distance of what? I kind of understand, but where are you getting the distance from? Between the line and what?
ASKER
The link that you posted is to an algorithm for a stationary sphere, but thanks anyway.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.