Jump to content
  • Advertisement
Sign in to follow this  
phil67rpg

collsion detection

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

Advertisement
Be a little more specific. Collision detection between what? Sphere's, poygoons, 2D, 3D, object pairs or many objects?

Share this post


Link to post
Share on other sites
Quote:
Original post by phil67rpg
well it is between a paddle and ball for a breakout game, I am using c++ and open gl


my old project done 4 years ago, in C/OpenGL (not perfect but should enough)

brick.zip
:)

Share this post


Link to post
Share on other sites
You should be able to do simple bounding box detection.

Do a few google searches for bounding box and to be more specific "axis aligned bounding boxes".

The general idea is you keep track of the 4 corners of each rectangle then if you want to check for a collision you just see if the extents of one rectangle are in the boundaries of a second rectangle. If they are then you have a collision.

It can be done with simple math and is very easy to do.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!