Efficient Collision Detection..

Started by
2 comments, last by HellRiZZer 20 years, 6 months ago
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

Advertisement
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.
enum Bool { True, False, FileNotFound };
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? "


Ionware Productions - Games and Game Tools Development

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.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V

This topic is closed to new replies.

Advertisement