# Non axis aligned collision detection

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

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

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

1. 1
Rutin
22
2. 2
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633308
• Total Posts
3011294
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!