12 #ifndef __ICEBOUNDINGSPHERE_H__
13 #define __ICEBOUNDINGSPHERE_H__
39 bool FastCompute(
udword nb_verts,
const Point* verts);
61 return mCenter.SquareDistance(p) <= mRadius*mRadius;
74 if(mRadius < sphere.
mRadius)
return false;
76 float r = mRadius - sphere.
mRadius;
77 return mCenter.SquareDistance(sphere.
mCenter) <= r*r;
91 float R2 = mRadius * mRadius;
93 const Point& Max = ((ShadowAABB&)&aabb).mMax;
94 const Point& Min = ((ShadowAABB&)&aabb).mMin;
100 p.
x=Max.
x; p.
y=Max.
y; p.
z=Max.
z;
if(mCenter.SquareDistance(p)>=R2)
return FALSE;
101 p.
x=Min.
x;
if(mCenter.SquareDistance(p)>=R2)
return FALSE;
102 p.
x=Max.
x; p.
y=Min.
y;
if(mCenter.SquareDistance(p)>=R2)
return FALSE;
103 p.
x=Min.
x;
if(mCenter.SquareDistance(p)>=R2)
return FALSE;
104 p.
x=Max.
x; p.
y=Max.
y; p.
z=Min.
z;
if(mCenter.SquareDistance(p)>=R2)
return FALSE;
105 p.
x=Min.
x;
if(mCenter.SquareDistance(p)>=R2)
return FALSE;
106 p.
x=Max.
x; p.
y=Min.
y;
if(mCenter.SquareDistance(p)>=R2)
return FALSE;
107 p.
x=Min.
x;
if(mCenter.SquareDistance(p)>=R2)
return FALSE;
121 float r = mRadius + sphere.
mRadius;
122 return mCenter.SquareDistance(sphere.
mCenter) <= r*r;
134 if(mRadius < 0.0
f)
return FALSE;
142 #endif // __ICEBOUNDINGSPHERE_H__