Archived

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

smitty1276

Newbie basic collision detection question

Recommended Posts

Quickie... When you are detecting for any collisions for an object (player, bullet, etc.), do you test against every polygon in the scene (or the part of the scene you know you are in)? Presumably you can use an octree or something for your geometry to narrow the possibilities by a factor of 8, but is that how you do it? Is it not costly in terms of performance?

Share this post


Link to post
Share on other sites
Um, yeah, you use a subset of polygons.

Octrees are good, there are many other ways to do it, like a bsp-based approach.

Often for heavy-poly things (like a small statue), low-poly versions are used for collision detection, and high-poly versions for the graphics.

Collision detection systems are quite complex things to write, especially fast ones. It would help to know exactly what you are writing. I assume it''s a 3d fps style tho.

The available algorithms will depend on a few things, such as whether your levels are greatly dynamic, and what data structure you use to store your level.

Share this post


Link to post
Share on other sites
I was thinking that it might be good to keep two copies of all of the geometry, one local to the entity to which it belongs (model, map, etc.) organized for quick rendering, and another copy stored globally with all polys organized for quick collision detection... is that a bad idea do you think?

Share this post


Link to post
Share on other sites
quote:
Original post by smitty1276
Presumably you can use an octree or something for your geometry to narrow the possibilities by a factor of 8, but is that how you do it? Is it not costly in terms of performance?

The whole point is to find out which of the 2 methods is less costly and use that.

Share this post


Link to post
Share on other sites