Advertisement

COLLISION DETECTION ARGHHHHHHH!!!!

Started by January 18, 2000 08:02 PM
1 comment, last by Nomad 24 years, 11 months ago
I am a member of a group writing a 3d, and we need help with collision detection. Basically we need to know how to do it, i''m not asking for someone,s source, cause they probably don''t wanna give it, but we just need a general idea of how to do collision detection. Thanx, Nomad p.s. our webpage wll be up soon at aftermath3d.cjb.net
You basically want to start off with very quick inaccurate tests to throw out things that definately don''t collide and refine the collision tests until it''s good enough.

Depending on how your map is set up, you might be able to throw out some obvious non-collides, but I don''t know how that''s set up.

After that, you probably want to do a bounding sphere test. This is a sphere that encloses the object. If the distance between the center points of object 1 and object 2 is less than or equal to the sum of each objects radius, then their bounding spheres intersect, and they might collide.

The next step is a bounding box test. Each object has a rectangle around it that is the basic shape/size of the object. If these two intersect, it''s getting pretty likely that the objects collide. There are different ways to test this. I use a matrix to get one of the boxes axis aligned (where the edges are parallel to the X-Y-Z axis) and then check to see if a corner-point of the other object falls inside the box. Then I do the same thing where the other box is axis aligned. If any point falls inside either box, they collide.

After those two tests, things get a bit tricky. The two tests can be enough for reasonably good collision detection. If you implement these and find out they''re not accurate enough for your purposes you''ll be in a better position to investigate more detailed methods.

-the logistical one-http://members.bellatlantic.net/~olsongt
Advertisement
There''s a rather terse, but very useful article on gamesutra that describes the algorithms for various intersection checks, and also what is called a sweep test, which prevents high velocity objects from passing through eachother between colision checks.

The article is right
here.

This topic is closed to new replies.

Advertisement