Jump to content
  • Advertisement

Archived

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

LordMyren

Octrees In General and Potential for Collision Detection

This topic is 6507 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

Hello all, I''ve been slowly designing a 3d space shooter style game, and I need a relatively fast way of doing locational damage sensing. Having half a million bounding spheres just aint cool. One thought that keeps reoccuring in my mind is finding a way to use octotrees to detect collisions. It''d take a bit of memory overhead, but it would work. Right? Damn, that''s going to be a lot of memory overhead. I was originally just thinking or running down the tree to the projectiles current location and describing whats in that location in the leaf node, but there is a considerable problem with this. You either have to be checking for collisions non-stop, or theres a chance than the projectile will travel through the ship. Anyone have ideas for this? Also, if anyone knows of any half decent articles on octrees, please please please send them my way. My knowledge of octrees is pretty much just inference. I''d like to also use octrees for the planetside views of the cities. Thanks! Myren

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by LordMyren
One thought that keeps reoccuring in my mind is finding a way to use octotrees to detect collisions. It''d take a bit of memory overhead, but it would work. Right? Damn, that''s going to be a lot of memory overhead.


Octrees would work, and the memory overhead should be acceptible if you don''t build the tree right down to the individual polygon level. Keep several polygons in each leaf - experiment to find out how many best suits your particular needs.

quote:
I was originally just thinking or running down the tree to the projectiles current location and describing whats in that location in the leaf node, but there is a considerable problem with this. You either have to be checking for collisions non-stop, or theres a chance than the projectile will travel through the ship.


If you''re using oriented bounding boxes for the projectiles, you can extend the projectile''s box so that it contains the entire space through which the projectile will move between the current and the next frame (I hope that makes sense). You can then test for intersections in all octree nodes that intersect this extended box.

Also, you could consider creating bounding sphere trees for the contents of your octree''s leaves. The sphere trees would be far less deep than they would be for the entire map, so the memory overhead should be smaller.

If you need documentation on octrees, there''s an article on Gamasutra, I''m sure you''ll also find a few on Flipcode, and I have one (a bad one, of course ) on my site: http://www.gamedeveloper.org/delphi3d/3de/3de_21.shtml.

Good luck!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

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!