• Advertisement
Sign in to follow this  

Non axis aligned collision detection

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, would any of you guys please be able to point me in the right direct, I would like to implement collision detection for 3d objects that are not axis alligned, I already know that I should use a simply detection method like aabb so the game knows when to perform a more detailed detection but which detection should I use?

thanks :)

Share this post


Link to post
Share on other sites
Advertisement

Generally, the fastest collision algorithms are for simple geometric shapes (spheres, ellipses, orientated bounding boxes, capsules, cylinders, etc), if you really need arbitrary geometry, then it's a lot faster to implement collision for convex hulls, finally and slowest, if necessary you might need to collide against polygon soup.

 

So, your question is pretty broad. You need to work out what you can get away with for your use case. You might conclude that your characters are well represented by capsules and your environment is a polygon soup, then you'll need some sort of hierarchical representation of your environment to collect relevant triangles, and you'd need to google triangle vs capsule collision detection to find out how that's done.

 

This is an excellent book that I'd thoroughly recommend: http://realtimecollisiondetection.net/books/rtcd/

 

But if you're just looking for a quick plug-in solution, then you need to at least work out what shapes you're going to collide.

Share this post


Link to post
Share on other sites

http://www.realtimerendering.com/intersections.html is a good source for links on intersection tests. Also since you say that you know how to test for object intersection when the objects are axis aligned, I presume you instead refer to testing intersection against axis aligned bounding boxes (AABB), or otherwise that statement makes little sense. There exists fast and simple algorithms for performing collision detection between oriented bounding boxes as well, see e.g. http://clb.demon.fi/MathGeoLib/nightly/docs/OBB_Intersects.php . For intersecting more complex shapes, typically one uses convex polyhedrons, for which the GJK and SAT algorithms apply, see e.g. https://github.com/juj/MathGeoLib/tree/master/src/Algorithm . Intersecting arbitrary concave polyhedrons in 3D becomes an art by itself, for which heavy use of spatial query structures like OBBTree and RAPID can be used, but for real-time uses, these are not very fast, and therefore not recommended.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement