java.lang.Object
org.scilab.forge.scirenderer.implementation.g2d.motor.BoundingBox

public class BoundingBox extends Object
Author:
Calixte DENIZET Bounding box of a 3D object, useful to speed-up intersection detection.
  • Constructor Details

    • BoundingBox

      public BoundingBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
      Default constructor
      Parameters:
      minX - the minimal X
      maxX - the maximal X
      minY - the minimal Y
      maxY - the maximal Y
      minZ - the minimal Z
      maxZ - the maximal Z
  • Method Details

    • 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 String toString()
      Overrides:
      toString in class Object