Class RectangularSolid

java.lang.Object
jme3utilities.math.RectangularSolid

public class RectangularSolid extends Object
A rectangular solid whose axes might not be aligned with the world axes. Immutable.
  • Field Details

    • logger

      public static final Logger logger
      message logger for this class
  • Constructor Details

    • RectangularSolid

      public RectangularSolid()
      Instantiate a zero-extent rectangular solid at the origin.
    • RectangularSolid

      public RectangularSolid(Vector3f halfExtents)
      Instantiate a centered solid with the specified half extents.
      Parameters:
      halfExtents - half extents the axis-aligned bounding box (not null, unaffected)
  • Method Details

    • halfExtents

      public Vector3f halfExtents(Vector3f storeResult)
      Determine the half extents of the solid.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the half extent of each local axis (either storeResult or a new vector, not null, all components non-negative)
    • localToWorld

      public Vector3f localToWorld(Vector3f local, Vector3f storeResult)
      Rotate from local coordinates to world coordinates.

      It is safe for local and storeResult to be the same object.

      Parameters:
      local - the input coordinates (not null, unaffected)
      storeResult - storage for the result (modified if not null)
      Returns:
      the corresponding world coordinates (either storeResult or a new vector, not null)
    • maxima

      public Vector3f maxima(Vector3f storeResult)
      Copy the maximum coordinate value for each local axis.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the maxima (either storeResult or a new vector, not null)
    • minima

      public Vector3f minima(Vector3f storeResult)
      Copy minimum coordinate value for each local axis.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the minima (either storeResult or a new vector, not null)
    • toString

      public String toString()
      Represent this solid as a text string.
      Overrides:
      toString in class Object
      Returns:
      descriptive string of text (not null, not empty)