Record Class AnimationMovement

java.lang.Object
java.lang.Record
kr.toxicity.model.api.animation.AnimationMovement
Record Components:
time - keyframe time
transform - position
scale - scale
rotation - rotation
All Implemented Interfaces:
Comparable<Timed>, Timed

public record AnimationMovement(float time, @Nullable org.joml.Vector3f transform, @Nullable org.joml.Vector3f scale, @Nullable org.joml.Vector3f rotation) extends Record implements Timed
A movement of animation.
  • Field Details

  • Constructor Details

    • AnimationMovement

      public AnimationMovement(float time)
    • AnimationMovement

      public AnimationMovement(float time, @Nullable @Nullable org.joml.Vector3f transform, @Nullable @Nullable org.joml.Vector3f scale, @Nullable @Nullable org.joml.Vector3f rotation)
      Creates an instance of a AnimationMovement record class.
      Parameters:
      time - the value for the time record component
      transform - the value for the transform record component
      scale - the value for the scale record component
      rotation - the value for the rotation record component
  • Method Details

    • time

      @NotNull public @NotNull AnimationMovement time(float newTime)
      Sets keyframe time.
      Parameters:
      newTime - new time
      Returns:
      new movement
    • plus

      @NotNull public @NotNull AnimationMovement plus(@NotNull @NotNull AnimationMovement other)
      Adds other movement.
      Parameters:
      other - other movement
      Returns:
      new movement
    • minus

      @NotNull public @NotNull AnimationMovement minus(@NotNull @NotNull AnimationMovement other)
      Subtracts other movement.
      Parameters:
      other - other movement
      Returns:
      new movement
    • 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.
    • time

      public float time()
      Returns the value of the time record component.
      Specified by:
      time in interface Timed
      Returns:
      the value of the time record component
    • transform

      @Nullable public @Nullable org.joml.Vector3f transform()
      Returns the value of the transform record component.
      Returns:
      the value of the transform record component
    • scale

      @Nullable public @Nullable org.joml.Vector3f scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component
    • rotation

      @Nullable public @Nullable org.joml.Vector3f rotation()
      Returns the value of the rotation record component.
      Returns:
      the value of the rotation record component