Class Bounds

java.lang.Object
eu.mihosoft.vrl.v3d.Bounds

public class Bounds extends Object
Bounding box for CSGs.
Author:
Michael Hoffer <info@michaelhoffer.de>
  • Constructor Details

    • Bounds

      public Bounds(Vector3d min, Vector3d max)
      Constructor.
      Parameters:
      min - min x,y,z values
      max - max x,y,z values
  • Method Details

    • clone

      public Bounds clone()
      Overrides:
      clone in class Object
    • getCenter

      public Vector3d getCenter()
      Returns the position of the center.
      Returns:
      the center position
    • getBounds

      public Vector3d getBounds()
      Returns the bounds (width,height,depth).
      Returns:
      the bounds (width,height,depth)
    • toCSG

      public CSG toCSG()
      Returns this bounding box as csg.
      Returns:
      this bounding box as csg
    • toCube

      public Cube toCube()
      Returns this bounding box as cube.
      Returns:
      this bounding box as cube
    • contains

      public boolean contains(Vertex v)
      Indicates whether the specified vertex is contained within this bounding box (check includes box boundary).
      Parameters:
      v - vertex to check
      Returns:
      true if the vertex is contained within this bounding box; false otherwise
    • contains

      public boolean contains(Vector3d v)
      Indicates whether the specified point is contained within this bounding box (check includes box boundary).
      Parameters:
      v - vertex to check
      Returns:
      true if the point is contained within this bounding box; false otherwise
    • contains

      public boolean contains(Polygon p)
      Indicates whether the specified polygon is contained within this bounding box (check includes box boundary).
      Parameters:
      p - polygon to check
      Returns:
      true if the polygon is contained within this bounding box; false otherwise
    • intersects

      @Deprecated public boolean intersects(Polygon p)
      Deprecated.
      not implemented yet
      Indicates whether the specified polygon intersects with this bounding box (check includes box boundary).
      Parameters:
      p - polygon to check
      Returns:
      true if the polygon intersects this bounding box; false otherwise
    • intersects

      public boolean intersects(Bounds b)
      Indicates whether the specified bounding box intersects with this bounding box (check includes box boundary).
      Parameters:
      b - box to check
      Returns:
      true if the bounding box intersects this bounding box; false otherwise
    • getMin

      public Vector3d getMin()
      Returns:
      the min x,y,z values
    • getMax

      public Vector3d getMax()
      Returns:
      the max x,y,z values
    • toString

      public String toString()
      Overrides:
      toString in class Object