Record Class GivensParameters

java.lang.Object
java.lang.Record
com.mojang.math.GivensParameters

public record GivensParameters(float sinHalf, float cosHalf) extends Record
  • Field Details

    • sinHalf

      private final float sinHalf
      The field for the sinHalf record component.
    • cosHalf

      private final float cosHalf
      The field for the cosHalf record component.
  • Constructor Details

    • GivensParameters

      public GivensParameters(float sinHalf, float cosHalf)
      Creates an instance of a GivensParameters record class.
      Parameters:
      sinHalf - the value for the sinHalf record component
      cosHalf - the value for the cosHalf record component
  • Method Details

    • fromUnnormalized

      public static GivensParameters fromUnnormalized(float sinHalf, float cosHalf)
    • fromPositiveAngle

      public static GivensParameters fromPositiveAngle(float angle)
    • inverse

      public GivensParameters inverse()
    • aroundX

      public Quaternionf aroundX(Quaternionf input)
    • aroundY

      public Quaternionf aroundY(Quaternionf input)
    • aroundZ

      public Quaternionf aroundZ(Quaternionf input)
    • cos

      public float cos()
    • sin

      public float sin()
    • aroundX

      public Matrix3f aroundX(Matrix3f input)
    • aroundY

      public Matrix3f aroundY(Matrix3f input)
    • aroundZ

      public Matrix3f aroundZ(Matrix3f input)
    • 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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.
    • sinHalf

      public float sinHalf()
      Returns the value of the sinHalf record component.
      Returns:
      the value of the sinHalf record component
    • cosHalf

      public float cosHalf()
      Returns the value of the cosHalf record component.
      Returns:
      the value of the cosHalf record component