Efficient Collision Detection..
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? "
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.
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.
Let''s say I want to test one AABB(OBB?) box against other. So, can I really take untransformed vertice of one box and test it against the other box (e.g is the point inside)?
" Do we need us? "
" Do we need us? "
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.
Look up the "separating axes theorem". At least that''s what I think its called.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement