0
\$\begingroup\$

So I decided on using OBB as the main collision detection in my 3D game but I started to wonder how OBB can be used to detect collisions if a player is in a building, an object you can walk into. Should the building object be broken up into dozens of OBBs or is there like an OBB to mesh check I can do. Or maybe there's some other better way of doing this.

Thanks for the help guys.

\$\endgroup\$
2
\$\begingroup\$

Split the building into more basic forms (walls, platforms, etc.) and also create a bounding box for the whole building. So, unless your tested object collides with the bounding box, you ignore everything being inside. Depending on the complexity you can group this even further, e.g. by building, by floor, by room, etc. Once you're sure you're indeed colliding with something small, like a char or table, you can check the actual faces of the object to determine collisions.

This way you can ensure lots of details (like windows or gaps you can shoot through) while still keeping the overall complexity of most comparisons low.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.