Class BoundingBox
- java.lang.Object
-
- org.scilab.forge.scirenderer.implementation.g2d.motor.BoundingBox
-
public class BoundingBox extends java.lang.Object
- Author:
- Calixte DENIZET Bounding box of a 3D object, useful to speed-up intersection detection.
-
-
Constructor Summary
Constructors Constructor Description BoundingBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
Default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BoundingBox
getBoundingBox(AbstractDrawable3DObject object)
Get the bounding box of an objectboolean
isIntersecting(BoundingBox box)
boolean
isStrictlyIntersecting(BoundingBox box)
java.lang.String
toString()
int
xCompare(BoundingBox box)
Get the relative x-position of this bounding-box and of the boxint
yCompare(BoundingBox box)
Get the relative y-position of this bounding-box and of the boxint
zCompare(BoundingBox box)
Get the relative z-position of this bounding-box and of the box
-
-
-
Method Detail
-
xCompare
public int xCompare(BoundingBox box)
Get the relative x-position of this bounding-box and of the box- Parameters:
box
- a BoundingBox- Returns:
- 1 if box is on the right, -1 if on the left and 0 if nothing.
-
yCompare
public int yCompare(BoundingBox box)
Get the relative y-position of this bounding-box and of the box- Parameters:
box
- a BoundingBox- Returns:
- 1 if box is on the bottom, -1 if on the top and 0 if nothing.
-
zCompare
public int zCompare(BoundingBox box)
Get the relative z-position of this bounding-box and of the box- Parameters:
box
- a BoundingBox- Returns:
- 1 if box is on the front, -1 if behind and 0 if nothing.
-
isIntersecting
public boolean isIntersecting(BoundingBox box)
- Parameters:
box
- a BoundingBox- Returns:
- true if this BoundingBox and the box have an intersection
-
isStrictlyIntersecting
public boolean isStrictlyIntersecting(BoundingBox box)
- Parameters:
box
- a BoundingBox- Returns:
- true if this BoundingBox and the box have a strict intersection
-
getBoundingBox
public static BoundingBox getBoundingBox(AbstractDrawable3DObject object)
Get the bounding box of an object- Parameters:
object
- a 3D object- Returns:
- the corresponding bounding-box
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-