# Thread: Collision methods?

1. ## Collision methods?

OK...lemme list 'em off:

-Distance
-Box Collision

These are the methods I'm able to use. Silence mortals, for I speak:

Unfort-tune-ate-ly...I need a more accurate collision method to handle collision detection with more complex and/or irregularly shaped objects. Since my math skills are only at the Grade 11 Pre-Cal level...I can't really do too much advanced math. Can anyone please suggest something? Thanks!

2. ## Re: Collision methods?

The OpenGL API has no direct support for collision detection, though there are GPGPU techniques for performing some intra-object/particle collisions for effects.

Have a peek in the math & algos forum (where this belongs) or do a google search for "collision detection" or "physics SDK".

Have a nice day.

3. ## Re: Collision methods?

I don't know if I am doing this the way it should be done, because I'm still very new to this: But to do this I have a class PointCollection for each polygon, triangle, square that I draw. For me it's easy to implement the following 2 functions there:

public bool intersect(PointCollection p2);
public int distance(PointCollection p2);

Well to calculate distances it's really only a matter of using some pythagoras rules like:
C²=B²+A². If you are programming in Java Or .NET there are also Rectangle classes that contain intersect functions by default. Or you could write your own intersect function. Really shouldn't be so hard if you picture it in your mind like it's a 2D situation. (I used to program a SuperMario clone that had the same kind of functions for 2D collision.)

Next comparing if whole objects intersect is just a matter of looping through them.

But like I said before I am indeed a mortal . So maybe you experienced programmers have far better methods of doing this.

Greetings !

4. ## Re: Collision methods?

Here's a physics engine I have been trying out while learning openGL.

Works great for what I need....

http://www.tokamakphysics.com/

Zath

5. ## Re: Collision methods?

Thanks, when I go famous I'll thank you guys for all the support.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•