• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1103
  • Last Modified:

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
0
phoenix260182
Asked:
phoenix260182
  • 2
  • 2
1 Solution
 
ozoCommented:
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
 
phoenix260182Author Commented:
The distance of what? I kind of understand, but where are you getting the distance from? Between the line and what?
0
 
phoenix260182Author Commented:
The link that you posted is to an algorithm for a stationary sphere, but thanks anyway.
0
 
ozoCommented:
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now