If I want to use physics engine for my game then how should I go to learn collision-detection algorithms?

When I read AI book for games, the book talks about collision detection, so I want to learn it, but what kind of book would be best?

If I had to choose to go and learn it what would you advise me to read?

  1. A physics book. (Game physics H.Ebrely)

  2. A real-time collision detection book. (Same author)

I don't know much about algorithms, some people say it's better to start with a physics book, because real-time collision detection book depend heavily on algorithms.

  • \$\begingroup\$ Hello members where are game developers !!! \$\endgroup\$ – Mohammad Ahmed Jul 26 '12 at 2:20
  • \$\begingroup\$ It's pretty late in the US, where most of the site's traffic comes from. \$\endgroup\$ – 3Dave Jul 26 '12 at 4:34
  • \$\begingroup\$ If you mentioned Eberly, he has a nice WildMagic engine with online support. Here's the collision detection part: geometrictools.com/LibPhysics/CollisionDetection/… \$\endgroup\$ – teodron Jul 26 '12 at 9:35
  • \$\begingroup\$ @DavidLively Yeah you are tight I had forgotten this !! \$\endgroup\$ – Mohammad Ahmed Jul 26 '12 at 20:23

It depends on how complex simulations are you going to need in your game, and if you're writing your own physics engine, or using an existing one.

In most games, the collisions aren't more complex than in Pong or Arkanoid. Reading a game physics book might be overkill unless you have something more complex in mind. I recommend you to follow these steps:

  1. Read an online tutorial on the basics of collision detection. There are dozens of good articles, just do a search. Start with rectangle and circle collisions in 2D.

  2. Try to implement the stuff you've read in these tutorials. Once it's up and running, start playing with it, to see how it "feels", what are the caveats etc.

  3. Once you see what should be improved in the collision detection you implemented, you can do the necessary research. Some examples keywords might be polygon collision, pixel-perfect collision, Verlet collision etc.

  4. Then if you still think you need to know more about collision detection, to make your simulation (almost) perfect, then you should look for some books to read.

  • \$\begingroup\$ Wow Marton thanks for the steps I will try it ,again thanks so much Marton :) \$\endgroup\$ – Mohammad Ahmed Jul 26 '12 at 20:26

Most physics engines have collision detection algorithms already built in since that is one of the more basic functions in a physics engine. Still, it is a good idea to learn, at least the basics, of what such algorithms do since it will aid you in your usage of the engine.

Bullet is a well known open source physics engine, and you can download it here: http://code.google.com/p/bullet/downloads/list

In the zip-file for the latest version there is a manual which explains - among other things - some basics regarding collision detection.

Good luck! ///JmD

  • \$\begingroup\$ thanks so much JmD I don't know how to thanks you :) , I had already download this Lib but did not know how to use it I will see the Doc . \$\endgroup\$ – Mohammad Ahmed Jul 26 '12 at 20:21
  • \$\begingroup\$ So JmD you advice me to start with Library which is Bullet Lib? \$\endgroup\$ – Mohammad Ahmed Jul 26 '12 at 20:29
  • \$\begingroup\$ Well, it is open source and has been getting quite a good reputation. It has been used in several commercial projects, and it seems to be on par with PhysX and Havok. Some will say it is even better in some respects. So I would recommend Bullet, yes. \$\endgroup\$ – JmD Jul 27 '12 at 0:08
  • \$\begingroup\$ I will start with physics library then later I will read some good physics books I thinks that's much better \$\endgroup\$ – Mohammad Ahmed Jul 27 '12 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.