How about "bounding ellipsoilad spheres"? :P
Hi,
I just had a good idea that''s as easy as bounding spheres but 3 times more accurate...how about bounding spheres, but instead of a single radius, it''s scaled to fit the max x,y,z bounding box (like an ellipse, except in 3d).
I''m not sure how I''d test for this, would this work:
[pre]
xdist = abs(object1.x - object2.x);
ydist = abs(object1.y - object2.y);
zdist = abs(object1.z - object2.z);
abx = sqrt((xdist*xdist)+(ydist*ydist));
aby = sqrt((xdist*xdist)+(zdist*zdist));
adz = sqrt((ydist*ydist)+(xdist*xdist));
if ( (abx < (object1.xsize + object2.xsize)) &&
(aby < (object1.ysize + object2.ysize)) &&
(abz < (object1.zsize + object2.zsize)) &&
{
// collision
}
else
{
// no collision
}
[/pre]
I''m pretty much 103% sure that this will not work.
Any other ideas behind the math?
thx
---------------
kieren_j
ÿDesigned for Win32
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement