Record Class CameraKeyframe

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.cutscene.CameraKeyframe
Record Components:
time - when the camera is here, in ticks from the cutscene's start (fractions allowed)
position - where, in the cutscene's own space (see CutsceneAnchor)
yaw - Minecraft's degrees (0 looks south, 90 west). The camera always turns the short way round between two keyframes; a full spin takes keyframes less than half a turn apart
pitch - degrees down from the horizon
roll - degrees of tilt around the line of sight
fov - the vertical field of view in degrees, or 0 for the player's own setting
easing - how the move into this keyframe is paced; its name must be known to Easings for the cutscene to be saved or sent
interpolation - the shape of the move into this keyframe

public record CameraKeyframe(float time, net.minecraft.world.phys.Vec3 position, float yaw, float pitch, float roll, float fov, Easing easing, Interpolation interpolation) extends Record
One pose a Cutscene's camera passes through, and how it gets there from the keyframe before.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<CameraKeyframe> CODEC
  • Constructor Details

    • CameraKeyframe

      public CameraKeyframe(float time, net.minecraft.world.phys.Vec3 position, float yaw, float pitch, float roll, float fov, Easing easing, Interpolation interpolation)
      Creates an instance of a CameraKeyframe record class.
      Parameters:
      time - the value for the time record component
      position - the value for the position record component
      yaw - the value for the yaw record component
      pitch - the value for the pitch record component
      roll - the value for the roll record component
      fov - the value for the fov record component
      easing - the value for the easing record component
      interpolation - the value for the interpolation record component
    • CameraKeyframe

      public CameraKeyframe(float time, net.minecraft.world.phys.Vec3 position, float yaw, float pitch)
      A keyframe reached smoothly at an even pace, with no roll and the player's own field of view.
  • Method Details

    • withTime

      public CameraKeyframe withTime(float time)
    • withRoll

      public CameraKeyframe withRoll(float roll)
    • withFov

      public CameraKeyframe withFov(float fov)
    • withEasing

      public CameraKeyframe withEasing(Easing easing)
    • withInterpolation

      public CameraKeyframe withInterpolation(Interpolation interpolation)
    • 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 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.
    • time

      public float time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • position

      public net.minecraft.world.phys.Vec3 position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • yaw

      public float yaw()
      Returns the value of the yaw record component.
      Returns:
      the value of the yaw record component
    • pitch

      public float pitch()
      Returns the value of the pitch record component.
      Returns:
      the value of the pitch record component
    • roll

      public float roll()
      Returns the value of the roll record component.
      Returns:
      the value of the roll record component
    • fov

      public float fov()
      Returns the value of the fov record component.
      Returns:
      the value of the fov record component
    • easing

      public Easing easing()
      Returns the value of the easing record component.
      Returns:
      the value of the easing record component
    • interpolation

      public Interpolation interpolation()
      Returns the value of the interpolation record component.
      Returns:
      the value of the interpolation record component