Record Class OBBRot

java.lang.Object
java.lang.Record
com.hammy275.immersivemc.common.obb.OBBRot
Record Components:
rot - The amount of rotation, in radians.
rotType - The type of rotation (pitch/yaw/roll).

public record OBBRot(float rot, RotType rotType) extends Record
Record containing a rotation for an OBB.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OBBRot(float rot, RotType rotType)
    Creates an instance of a OBBRot record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    static OBBRot
    of(double rot, RotType rotType)
    Convenience function to create an OBBRot instance
    static OBBRot
    of(float rot, RotType rotType)
    Convenience function to create an OBBRot instance
    float
    rot()
    Returns the value of the rot record component.
    Returns the value of the rotType record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OBBRot

      public OBBRot(float rot, RotType rotType)
      Creates an instance of a OBBRot record class.
      Parameters:
      rot - the value for the rot record component
      rotType - the value for the rotType record component
  • Method Details

    • of

      public static OBBRot of(double rot, RotType rotType)
      Convenience function to create an OBBRot instance
      Parameters:
      rot - The amount of rotation, in radians.
      rotType - The type of rotation (pitch/yaw/roll).
      Returns:
      A new OBBRot instance.
    • of

      public static OBBRot of(float rot, RotType rotType)
      Convenience function to create an OBBRot instance
      Parameters:
      rot - The amount of rotation, in radians.
      rotType - The type of rotation (pitch/yaw/roll).
      Returns:
      A new OBBRot instance.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • rot

      public float rot()
      Returns the value of the rot record component.
      Returns:
      the value of the rot record component
    • rotType

      public RotType rotType()
      Returns the value of the rotType record component.
      Returns:
      the value of the rotType record component