Class BoundingBox

java.lang.Object
com.jme3.bounding.BoundingBox

public class BoundingBox extends Object
BoundingBox describes a bounding volume as an axis-aligned box.
Instances may be initialized by invoking the containAABB method.
  • Constructor Details

    • BoundingBox

      public BoundingBox()
      Instantiate a BoundingBox without initializing it.
    • BoundingBox

      public BoundingBox(Vector3f c, float x, float y, float z)
      Instantiate a BoundingBox with given center and extents.
      Parameters:
      c - the coordinates of the center of the box (not null, not altered)
      x - the X-extent of the box (0 or greater, may be +Infinity)
      y - the Y-extent of the box (0 or greater, may be +Infinity)
      z - the Z-extent of the box (0 or greater, may be +Infinity)
    • BoundingBox

      public BoundingBox(Vector3f min, Vector3f max)
      Instantiate a BoundingBox with the specified extremes.
      Parameters:
      min - the desired minimum coordinate value for each axis (not null, not altered)
      max - the desired maximum coordinate value for each axis (not null, not altered)
  • Method Details

    • getCenter

      public Vector3f getCenter(Vector3f storeResult)
      Return the location of the center.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      a location vector (either storeResult or a new vector)
    • getExtent

      public Vector3f getExtent(Vector3f store)
      Query extent.
      Parameters:
      store - where extent gets stored - null to return a new vector
      Returns:
      store / new vector
    • getXExtent

      public float getXExtent()
      Determine the X-axis distance between the center and the boundary.
      Returns:
      the distance
    • getYExtent

      public float getYExtent()
      Determine the Y-axis distance between the center and the boundary.
      Returns:
      the distance
    • getZExtent

      public float getZExtent()
      Determine the Z-axis distance between the center and the boundary.
      Returns:
      the distance
    • setXExtent

      public void setXExtent(float xExtent)
      Alter the X-axis distance between the center and the boundary.
      Parameters:
      xExtent - the desired distance (≥0)
    • setYExtent

      public void setYExtent(float yExtent)
      Alter the Y-axis distance between the center and the boundary.
      Parameters:
      yExtent - the desired distance (≥0)
    • setZExtent

      public void setZExtent(float zExtent)
      Alter the Z-axis distance between the center and the boundary.
      Parameters:
      zExtent - the desired distance (≥0)
    • getMin

      public Vector3f getMin(Vector3f store)
      Determine the minimum coordinate value for each axis.
      Parameters:
      store - storage for the result (modified if not null)
      Returns:
      either storeResult or a new vector
    • getMax

      public Vector3f getMax(Vector3f store)
      Determine the maximum coordinate value for each axis.
      Parameters:
      store - storage for the result (modified if not null)
      Returns:
      either storeResult or a new vector
    • setMinMax

      public void setMinMax(Vector3f min, Vector3f max)
      Reconfigure with the specified extremes.
      Parameters:
      min - the desired minimum coordinate value for each axis (not null, not altered)
      max - the desired maximum coordinate value for each axis (not null, not altered)