views:

194

answers:

1

And now after some work, I finally understand how the KDop bounding volume are created and how the collisions are intersected and I maked a working implementation of them. Now the problem is another. :D

How can I intersect (it has to be possible, or it would not make any sense) 2 K-Dop of different K values? (obviously we know beforehand which axis has been used to create those 2 K-Dop.)

Like how can i intersect a DOP6 (AABB) and a DOP14 (AABB + corners cut off)? Or a DOP14 (AABB + corners cut off) and a DOP26 (AABB + Corners cut off + Edges cut off)?

The simple method (between KDOP with the same K) is

 public Boolean Intersects(kDOP a, kDOP b)
        {
            // TODO : How to do if the K is not the same?
            for (int i = 0; i < a.K / 2; i++)
                if ((a.Min[i] > b.Max[i]) || (a.Max[i] < b.Min[i]))
                    return false;
            return true;
        }

Another question is. How to do intersection between KDOP and say a Sphere? KDOP and a Capsule? KDOP and a OOB? KDOP and a AABB? (this should be easier if we know how to do with different K (as AABB is a DOP6 basically)) I mean what's the common way to do intersection between these simple structures?

Thanks a lot for the answers!!!

EDIT : From some search on the net it seems that the separation axis is the way to go, but I can't find any detailed information on how to implement it on the K-DOP. :P

EDIT 2 : Someone has a working implementation of a separation axis theorem over KDOP? :|

+1  A: 

If the Ks are a different order, just run your i loop to the minimum of a.K/2 or b.K/2.

Greg
Its that simple? XD I mean the axis can be different in order or do I have to order them to be the same in both structures? Comparing a KDOP 14 (AABB, Corners) with a KDOP26 (AABB, Corners, Edges). Should i have them in the same order (in order to check AABB with AABB, Corners with Corners, and leave alone the edges?)What about the other volumes? Like Spheres and such? Some idea?
feal87
Another note, if i have to order them how would I check a DOP6 (AABB) with a DOP8 (Corners)?
feal87
It only works if they are subsets. KDOP6, KDOP14, KDOP26 and if the axes are in the same order. The book Real Time Collision Detection (http://realtimecollisiondetection.net/) has a very good chapter on intersections between lots of different BB.
Greg
Nice, anyway i would not need DOP8. :PLast question, how to do collision between a KDOP and a non complex other structure (like a sphere?)? (I have that book, but it doesn't talk in depth on these structures)
feal87