box-box collision

Blitz3D Forums/Blitz3D Programming/box-box collision

Damien Sturdy(Posted 2004) [#1]
Hey all...

I Need to know if two meshes are colliding, they are both cubes.

Now, i could use "polygon-polygon" collision, which is working now, but, considering a cube has 12 triangles, thats doing 12x12 checks per cube...

is there a quicker way, mathematically?

cheers


Sweenie(Posted 2004) [#2]
Separating Axis test...
http://www.gamasutra.com/features/19991018/Gomez_5.htm


Damien Sturdy(Posted 2004) [#3]
I cant get into that site, and the registration seems to want to know an awful amount of stuff..


Could you gimme some details? :D


Sweenie(Posted 2004) [#4]
Short explanation(Bad explanation?):
You project the vertices of both boxes onto the boxes unique planes and check if the projected vertices overlap.

Gamedev discussion here-> http://www.gamedev.net/community/forums/topic.asp?topic_id=201240


Damien Sturdy(Posted 2004) [#5]
HMmm, i will take a look, thanks.. i cant see it being all that much faster though :/


Damien Sturdy(Posted 2004) [#6]
ouch....just managed to login.. thats gota be slower than the way im doing it :S Cheers for the help anyway... Preliminary tests show meshesintersect isnt causing a point of bother anyway.... would like to avoid that commend :/


big10p(Posted 2004) [#7]
Yeah, I've never used MeshesIntersect but would image it would be usable with just 2 cubes, as you say they only have 12 tris each. Maybe you could have bounding spheres on the cubes and initially check for collisions between them before performing the MeshesIntersect? Could be of benefit, I dunno. :)


Damien Sturdy(Posted 2004) [#8]
Im already doing that.. :) :D