226227228229230231232233234235236
/* (non-Javadoc) * @see ca.eandb.jmist.framework.Bounded3#boundingBox() */ public Box3 boundingBox() { return new Box3( base.x() - radius, base.y(), base.z() - radius, base.x() + radius, base.y() + height,
9899100101102103104
public Box3 boundingBox() { double maxR = Math.max(radius1, radius2); double minH = Math.min(height1, height2); double maxH = Math.max(height1, height2); return new Box3(-maxR, minH, -maxR, maxR, maxH, maxR); }
361362363364365366367368369370371372373
private int split(int axis, double plane, int start, int end, Clip clip) { double min, max, mid; int split = start; clip.reset(); for (int i = start; i < end; i++) { Box3 bound = getBoundingBox(items[i]); min = bound.minimum(axis); max = bound.maximum(axis); mid = 0.5 * (min + max); if (mid < plane) { if (max > clip.left) { clip.left = max; }
104105106107108109110111
/* (non-Javadoc) * @see ca.eandb.jmist.framework.Bounded3#boundingSphere() */ public Sphere boundingSphere() { Box3 box = boundingBox(); return new Sphere(box.center(), 0.5 * box.diagonal()); }
979899100101102103104
} return bound.getBoundingBox(); } public Sphere boundingSphere() { Box3 box = boundingBox(); return new Sphere(box.center(), box.diagonal() / 2.0); }
96979899100101102103104105106107108
*/ public Box3 boundingBox() { BoundingBoxBuilder3 builder = new BoundingBoxBuilder3(); Box3 childBoundingBox = geometry.boundingBox(); for (int i = 0; i < 8; i++) { builder.add(this.model.apply(childBoundingBox.corner(i))); } return builder.getBoundingBox(); }
112113114115116117118119120121122123124
*/ public Sphere boundingSphere() { List<Point3> corners = new ArrayList<Point3>(8); Box3 childBoundingBox = geometry.boundingBox(); for (int i = 0; i < 8; i++) { corners.add(this.model.apply(childBoundingBox.corner(i))); } return Sphere.smallestContaining(corners); }
128129130131132133134135136137138139140
*/ public Box3 getBoundingBox(int index) { BoundingBoxBuilder3 builder = new BoundingBoxBuilder3(); Box3 childBoundingBox = geometry.getBoundingBox(index); for (int i = 0; i < 8; i++) { builder.add(this.model.apply(childBoundingBox.corner(i))); } return builder.getBoundingBox(); }
144145146147148149150151152153154155156
*/ public Sphere getBoundingSphere(int index) { List<Point3> corners = new ArrayList<Point3>(8); Box3 childBoundingBox = geometry.getBoundingBox(index); for (int i = 0; i < 8; i++) { corners.add(this.model.apply(childBoundingBox.corner(i))); } return Sphere.smallestContaining(corners); }
145146147148149150151152153154
/* (non-Javadoc) * @see ca.eandb.jmist.framework.Bounded3#boundingBox() */ public Box3 boundingBox() { return new Box3( -(major + minor), -minor, -(major + minor), major + minor , minor, major + minor ); }