collsion detection

Started by
4 comments, last by atimes 15 years, 9 months ago
how do I do very simple collision detection
Advertisement
Like this:
Be a little more specific. Collision detection between what? Sphere's, poygoons, 2D, 3D, object pairs or many objects?
well it is between a paddle and ball for a breakout game, I am using c++ and open gl
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
:)
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.

This topic is closed to new replies.

Advertisement