BoundingSphere sphere = (BoundingSphere)boundsObjects[i];
planes = new Vector4d[6];
mag = new double[planes.length];
pDotN = new double[planes.length];
planes[0] = new Vector4d( 1.0, 0.0, 0.0, -(sphere.center.x+sphere.radius) );
planes[1] = new Vector4d(-1.0, 0.0, 0.0, sphere.center.x-sphere.radius );
planes[2] = new Vector4d( 0.0, 1.0, 0.0, -(sphere.center.y+sphere.radius) );
planes[3] = new Vector4d( 0.0,-1.0, 0.0, sphere.center.y-sphere.radius );
planes[4] = new Vector4d( 0.0, 0.0, 1.0, -(sphere.center.z+sphere.radius) );
planes[5] = new Vector4d( 0.0, 0.0,-1.0, sphere.center.z-sphere.radius );
mag[0] = 1.0;
mag[1] = 1.0;
mag[2] = 1.0;
mag[3] = 1.0;
mag[4] = 1.0;
mag[5] = 1.0;
computeAllVerts(); // XXXX: lazy evaluate
} else if( boundsObjects[i].boundId == BOUNDING_BOX ){
BoundingBox box = (BoundingBox)boundsObjects[i];
planes = new Vector4d[6];
mag = new double[planes.length];
pDotN = new double[planes.length];
planes[0] = new Vector4d( 1.0, 0.0, 0.0, -box.upper.x );
planes[1] = new Vector4d(-1.0, 0.0, 0.0, box.lower.x );
planes[2] = new Vector4d( 0.0, 1.0, 0.0, -box.upper.y );
planes[3] = new Vector4d( 0.0,-1.0, 0.0, box.lower.y );
planes[4] = new Vector4d( 0.0, 0.0, 1.0, -box.upper.z );
planes[5] = new Vector4d( 0.0, 0.0,-1.0, box.lower.z );
mag[0] = 1.0;
mag[1] = 1.0;
mag[2] = 1.0;
mag[3] = 1.0;
mag[4] = 1.0;
mag[5] = 1.0;
computeAllVerts(); // XXXX: lazy evaluate
} else if( boundsObjects[i].boundId == BOUNDING_POLYTOPE ) {
BoundingPolytope polytope = (BoundingPolytope)boundsObjects[i];
planes = new Vector4d[polytope.planes.length];
mag = new double[planes.length];
pDotN = new double[planes.length];
nVerts = polytope.nVerts;
verts = new Point3d[nVerts];
for(i=0;i<planes.length;i++) {
planes[i] = new Vector4d(polytope.planes[i]);
pDotN[i] = polytope.pDotN[i];
mag[i] = polytope.mag[i];
}
for(i=0;i<verts.length;i++) {
verts[i] = new Point3d(polytope.verts[i]);