Jump to content
  • Advertisement
Sign in to follow this  
zurekx

Basic collision detection

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

I've been doing 3D graphics for quite some time now, but the one thing I've never tried is collision detection. What method do you recommend? Basically I want to add basic collision detection to a FPS game. What are the alternatives?

Share this post


Link to post
Share on other sites
Advertisement
I recommend using one of the free physics libraries. I'm using Bullet but you can also Google for PhysX or ODE.

Even Havok (of Half Life 2 fame) is now free for commercial use on PC.

3D collision detection and response is very hard to write yourself and even harder to get stable and bug free. Writing your own is like writing your own triangle rasteriser or string class in my opinion - interesting as an exercise but ultimately futile.

HTH

[EDIT - I wasn't aware there was such a comprehensive sticky topic on the math forum for physics libraries. Apologies for my half-baked library "list" above [smile]]

[Edited by - EasilyConfused on June 10, 2008 3:33:51 PM]

Share this post


Link to post
Share on other sites
Thanks

Yeah, but I want to do it as an exercise, I'm not interested in using any engines written by others (Im not gonna do anything fancy or anything, I just want to learn basic collision detection). This is strictly for learning purposes.

Any directions?

Share this post


Link to post
Share on other sites
Two of the basic "categories" are simple intersection tests, and continuous collision detection (CCD). The former is generally easier to code, and checks to see if an object overlaps another at a moment in time. This can be unreliable if the objects move quickly, since if the frame rate is too low an object could move/jump through another object as if it were a ghost...this effect is called "tunneling." CCD tries to avoid tunneling by either tracking the motion of an object over time, capturing and responding to any collision that happens within a frame no matter how slow or fast the frame rate, or tracks separating planes between objects, enabling collision response to prevent objects from moving so close that no separating plane exists between them.

So, I could continue to ramble, but I strongly recommend looking at the GDC tutorial on game physics that is available over at Jim van Verth's Essential Math website. The tutorial is done each year by a group of industry experts, and talks about game physics...including the various collision detection issues. You can find a link to that website in the sticky thread in this forum about physics engines.

Share this post


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

  • 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!