Archived

This topic is now archived and is closed to further replies.

HellRiZZer

Efficient Collision Detection..

Recommended Posts

Hi guys, I''ve been wondering if you ever met the following problem: You have an AABB octree for a single object. That object has a model matrix. You can pretty much test collisions when the matrix is used for translating and/or scaling, but not for rotation, because you cannot simply rotate box'' vertices and have the same old test for a point inside a AABB box as you do with scaling and translation. So, the question is: is it really worth investing time into OBB octree? I''ve seen an algorithm for checking if a point is inside an OBB or OBB intersects OOB. And that takes HEAPS more time than doing a simple AABB point-in-box or AABB vs AABB intersection. So, what should I do? Thanks. " Do we need us? "

Ionware Productions - Games and Game Tools Development

Share this post


Link to post
Share on other sites
If all you''re testing is a point, you can transform the point through the inverse of the object matrix, and then test that point against the un-transformed AABB of the object. That''ll work fine (and faster than transforming the entire box, to boot!)

To make finding inverses fast, you might consider storing your objects as PRS rather than matrices (Position as vec3, Rotation as quat, Scale as vec3). Then finding/applying the inverse is trivial.

Share this post


Link to post
Share on other sites
Nope. If you''re going to do it that way you would take each point of the second AABB, transform them into the coordinate system of the first AABB and then do the test. I wouldn''t recommend doing this though.

Look up the "separating axes theorem". At least that''s what I think its called.

Share this post


Link to post
Share on other sites