Moving Sphere - Stationary AABB Intersection Test

Posted on 2006-03-20
Last Modified: 2013-12-26

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.

Question by:phoenix260182
    LVL 84

    Expert Comment

    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.

    Author Comment

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

    Author Comment

    The link that you posted is to an algorithm for a stationary sphere, but thanks anyway.
    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.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    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…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now