Package 

Class Box


  • 
    public class Box
    
                        

    An axis-aligned 3D box represented by its center and half-extent. The half-extent is a vector representing the distance from the center to the edge of the box in each dimension. For example, a box of size 2 units in X, 4 units in Y, and 10 units in Z would have a half-extent of (1, 2, 5).

    • Constructor Summary

      Constructors 
      Constructor Description
      Box() Default-initializes the 3D box to have a center and half-extent of (0,0,0).
      Box(float centerX, float centerY, float centerZ, float halfExtentX, float halfExtentY, float halfExtentZ) Initializes the 3D box from its center and half-extent.
      Box(Array<float> center, Array<float> halfExtent) Initializes the 3D box from its center and half-extent.
    • Method Summary

      Modifier and Type Method Description
      void setCenter(float centerX, float centerY, float centerZ) Sets the center of of the 3D box.
      void setHalfExtent(float halfExtentX, float halfExtentY, float halfExtentZ) Sets the half-extent of the 3D box.
      Array<float> getCenter() Returns the center of the 3D box.
      Array<float> getHalfExtent() Returns the half-extent from the center of the 3D box.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Box

        Box()
        Default-initializes the 3D box to have a center and half-extent of (0,0,0).
      • Box

        Box(float centerX, float centerY, float centerZ, float halfExtentX, float halfExtentY, float halfExtentZ)
        Initializes the 3D box from its center and half-extent.
      • Box

        Box(Array<float> center, Array<float> halfExtent)
        Initializes the 3D box from its center and half-extent.
        Parameters:
        center - a float array with XYZ coordinates representing the center of the box
        halfExtent - a float array with XYZ coordinates representing half the size of the box ineach dimension
    • Method Detail

      • setCenter

         void setCenter(float centerX, float centerY, float centerZ)

        Sets the center of of the 3D box.

      • setHalfExtent

         void setHalfExtent(float halfExtentX, float halfExtentY, float halfExtentZ)

        Sets the half-extent of the 3D box.