Klasse Bounds

java.lang.Object
net.risingworld.api.utils.Bounds
Alle implementierten Schnittstellen:
Serializable

public class Bounds extends Object implements Serializable
Describes a bounding volume, represented as an axis-aligned bounding box (AABB), i.e the extends of the object along the x, y and z axis as well as the position of the center of the object.
Siehe auch:
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Creates "empty" bounds.
    Bounds(float x, float y, float z, float xExtent, float yExtent, float zExtent)
    Creates a new bounds object.
    Bounds(Vector3f center, float xExtent, float yExtent, float zExtent)
    Creates a new bounds object.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    boolean
     
    Gets the bounds center.
    float
    Gets the (half) extent along the x axis.
    float
    Gets the (half) extent along the y axis.
    float
    Gets the (half) extent along the z axis.
    int
     
    boolean
    Checks if the given point (represented as a Vector3f) is inside the bounds.
    Gets a String representation of the bounds.

    Von Klasse geerbte Methoden java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • Bounds

      public Bounds()
      Creates "empty" bounds.
    • Bounds

      public Bounds(Vector3f center, float xExtent, float yExtent, float zExtent)
      Creates a new bounds object.
      Parameter:
      center - the center of the bounds.
      xExtent - the half extent along the x axis.
      yExtent - the half extent along the y axis.
      zExtent - the half extent along the z axis.
    • Bounds

      public Bounds(float x, float y, float z, float xExtent, float yExtent, float zExtent)
      Creates a new bounds object.
      Parameter:
      x - the x position of the bounds center.
      y - the x position of the bounds center.
      z - the x position of the bounds center.
      xExtent - the half extent along the x axis.
      yExtent - the half extent along the y axis.
      zExtent - the half extent along the z axis.
  • Methodendetails

    • getXExtent

      public float getXExtent()
      Gets the (half) extent along the x axis.
      Gibt zurück:
      the extent along the x axis.
    • getYExtent

      public float getYExtent()
      Gets the (half) extent along the y axis.
      Gibt zurück:
      the extent along the y axis.
    • getZExtent

      public float getZExtent()
      Gets the (half) extent along the z axis.
      Gibt zurück:
      the extent along the z axis.
    • getCenter

      public Vector3f getCenter()
      Gets the bounds center.
      Gibt zurück:
      the position of the center.
    • isPointInVolume

      public boolean isPointInVolume(Vector3f point)
      Checks if the given point (represented as a Vector3f) is inside the bounds.
      Parameter:
      point - the point in 3d space (i.e world position).
      Gibt zurück:
      true if the point is inside the bounds, false if not.
    • toString

      public String toString()
      Gets a String representation of the bounds.
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      a string representing the bounds.
    • equals

      public boolean equals(Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object