All Implemented Interfaces:
ConstAaBox, ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public final class AaBox extends JoltPhysicsObject implements ConstAaBox
An axis-aligned box. (native type: AABox)
  • Constructor Details

    • AaBox

      public AaBox()
      Instantiate an invalid box.
    • AaBox

      public AaBox(RVec3Arg minimum, RVec3Arg maximum)
      Instantiate a box with the specified minimum and maximum coordinates.
      Parameters:
      minimum - the desired minimum coordinates (not null, unaffected)
      maximum - the desired maximum coordinates (not null, unaffected)
    • AaBox

      public AaBox(Vec3Arg center, float halfExtent)
      Instantiate a cubic box with the specified center coordinates and half extent.
      Parameters:
      center - the desired center coordinates (not null, unaffected)
      halfExtent - the desired half extent
    • AaBox

      public AaBox(Vec3Arg minimum, Vec3Arg maximum)
      Instantiate a box with the specified minimum and maximum coordinates.
      Parameters:
      minimum - the desired minimum coordinates (not null, unaffected)
      maximum - the desired maximum coordinates (not null, unaffected)
  • Method Details

    • encapsulate

      public void encapsulate(Vec3Arg location)
      Enlarge the box to include the specified location.
      Parameters:
      location - the location to include (not null, unaffected)
    • expandBy

      public void expandBy(Vec3Arg deltas)
      Enlarge the box on all sides by the specified amounts.
      Parameters:
      deltas - the amount to increase the half extent on each axis (not null, unaffected)
    • sBiggest

      public static AaBox sBiggest()
      Instantiate the biggest finite box.
      Returns:
      a new JVM object with a new native object assigned
    • setEmpty

      public void setEmpty()
      Alter the box to be empty.
    • setMax

      public void setMax(Vec3Arg max)
      Alter the maximum coordinates. (native attribute: mMax)
      Parameters:
      max - the desired maximum coordinate for each axis (not null, unaffected)
    • setMin

      public void setMin(Vec3Arg min)
      Alter the minimum coordinates. (native attribute: mMin)
      Parameters:
      min - the desired minimum coordinate for each axis (not null, unaffected)
    • translate

      public void translate(Vec3Arg offset)
      Move by the specified offset.
      Parameters:
      offset - the amount to move (not null, unaffected)
    • contains

      public boolean contains(Vec3Arg point)
      Test whether the box contains the specified point. The box is unaffected.
      Specified by:
      contains in interface ConstAaBox
      Parameters:
      point - the point to test (not null, unaffected)
      Returns:
      true if contained, otherwise false
    • getCenter

      public Vec3 getCenter()
      Locate the center of the box. The box is unaffected.
      Specified by:
      getCenter in interface ConstAaBox
      Returns:
      a new location vector
    • getExtent

      public Vec3 getExtent()
      Copy the (half) extent of the box. The box is unaffected.
      Specified by:
      getExtent in interface ConstAaBox
      Returns:
      a new vector
    • getMax

      public Vec3 getMax()
      Copy the maximum contained coordinate on each axis. The box is unaffected. (native attribute: mMax)
      Specified by:
      getMax in interface ConstAaBox
      Returns:
      a new vector
    • getMin

      public Vec3 getMin()
      Copy the minimum contained coordinate on each axis. The box is unaffected. (native attribute: mMin)
      Specified by:
      getMin in interface ConstAaBox
      Returns:
      a new vector
    • getSize

      public Vec3 getSize()
      Copy the size (full extent) on each axis. The box is unaffected.
      Specified by:
      getSize in interface ConstAaBox
      Returns:
      a new vector
    • getVolume

      public float getVolume()
      Return the volume of the box. The box is unaffected.
      Specified by:
      getVolume in interface ConstAaBox
      Returns:
      the volume
    • isValid

      public boolean isValid()
      Test whether the box is valid. It is unaffected.
      Specified by:
      isValid in interface ConstAaBox
      Returns:
      true if valid, otherwise false