#### Archived

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

# Efficient Collision Detection..

This topic is 5521 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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? "

##### 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 on other sites
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? "

##### 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.

1. 1
Rutin
47
2. 2
3. 3
4. 4
5. 5

• 10
• 27
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633405
• Total Posts
3011681
• ### Who's Online (See full list)

There are no registered users currently online

×