Class CalculatedPoint

java.lang.Object
net.thewinnt.cutscenes.path.CalculatedPoint
All Implemented Interfaces:
PathLike

public class CalculatedPoint extends Object implements PathLike
  • Field Details

    • weight

      public final int weight
    • x

      public final Easing x
    • y

      public final Easing y
    • z

      public final Easing z
  • Constructor Details

  • Method Details

    • getPoint

      public net.minecraft.world.phys.Vec3 getPoint(double t, net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart)
      Description copied from interface: PathLike
      Returns the position at the given moment. Depending on the context, it may be treated differently:
      • If the segment is representing the camera position, the resulting position will be treated as an offset from the cutscene starting position, which will then be rotated around the starting point by three axes, depending on the parameters the cutscene was started with.
      • If the segment is representing camera rotation, this method's output will be treated as an offset from the starting camera rotation of the cutscene.
      Specified by:
      getPoint in interface PathLike
      Parameters:
      t - the progress of the current segment, in range [0, 1]. 0 corresponds to the starting position and 1 is the end position.
      level - the level where the cutscene is run
      cutsceneStart - the starting position of the cutscene
      Returns:
      a point corresponding to the given progress value of the segment.
    • getStart

      public PointProvider getStart(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart)
      Description copied from interface: PathLike
      Returns a PointProvider representing the starting position for this segment. Ideally, this should match the output of getPoint(0, level, cutsceneStart). Used in paths and path transitions.
      Specified by:
      getStart in interface PathLike
      Parameters:
      level - the level where the cutscene is run
      cutsceneStart - the starting position of the cutscene
      Returns:
      the PointProvider representing the starting position for this segment
    • getEnd

      public PointProvider getEnd(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart)
      Description copied from interface: PathLike
      Returns a PointProvider representing the end position for this segment. Ideally, this should match the output of getPoint(1, level, cutsceneStart). Used in paths and path transitions.
      Specified by:
      getEnd in interface PathLike
      Parameters:
      level - the level where the cutscene is run
      cutsceneStart - the starting position of the cutscene
      Returns:
      the PointProvider representing the end position for this segment
    • getWeight

      public int getWeight()
      Description copied from interface: PathLike
      Returns the weight of this segment. Used for timing in paths. The higher the value, the more time is dedicated to this segment and the slower it runs, and vice versa.
      Specified by:
      getWeight in interface PathLike
      Returns:
      this segment's weight
    • fromNetwork

      public static CalculatedPoint fromNetwork(net.minecraft.network.FriendlyByteBuf buf, Path path)
    • toNetwork

      public void toNetwork(net.minecraft.network.FriendlyByteBuf buf)
      Description copied from interface: PathLike
      Writes this segment's parameters to the provided FriendlyByteBuf. This data should be enough to fully reconstruct this segment on the client.
      Specified by:
      toNetwork in interface PathLike
      See Also:
    • getSerializer

      Description copied from interface: PathLike
      Returns the serializer that is associated with this segment type. Preferably, this should return the same object every time it's called.
      Specified by:
      getSerializer in interface PathLike
      Returns:
      a serializer for this segment's type
    • fromJSON

      public static CalculatedPoint fromJSON(com.google.gson.JsonObject json, Path path)