Klasse BezierPath

java.lang.Object
de.luckymcdev.foundryengine.common.easing.BezierPath

public class BezierPath extends Object
Represents a complete Bézier path composed of multiple splines. Provides arc-length parameterization for constant-speed motion.
  • Feldübersicht

    Felder
    Modifikator und Typ
    Feld
    Beschreibung
     
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    BezierPath(net.minecraft.nbt.ListTag list)
    Creates a BezierPath from serialized NBT data.
    BezierPath(net.minecraft.world.phys.Vec3 startPos)
    Creates a new BezierPath starting at the given position.
  • Methodenübersicht

    Modifikator und Typ
    Methode
    Beschreibung
    int
    Returns the number of non-tangent ("node") points in this path.
    Returns all non-tangent ("node") points in order from start to end.
    double
    getDistanceAtTime(double time)
    Returns the approximate arc-length distance (in blocks) along the path at the given time parameter (0..1) of lerp(double).
    double
    Returns the normalized arc-length distance (0..1) along the path at the given time parameter (0..1) of lerp(double).
    Gets all control points in the path.
    double
    Gets the total arc length of the path.
    void
    Invalidates the LUT cache, forcing recalculation on next use.
    boolean
    Checks if a point is at the start or end of the path.
    boolean
    Returns true if the path consists of a single point with no spline.
    net.minecraft.world.phys.Vec3
    Interpolates a position using arc-length parameterization.
    void
    Removes a point and its associated spline(s).
    net.minecraft.nbt.ListTag
    Serializes the path to NBT format.
    void
    Updates the Look-Up Table (LUT) for arc-length parameterization.
    withPlayerEnd(net.minecraft.world.entity.player.Player player)
    Creates a new path with the player's eye position as the ending point.
    withPlayerOrigin(net.minecraft.world.entity.player.Player player)
    Creates a new path with the player's eye position as the starting point.

    Von Klasse geerbte Methoden Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

  • Konstruktordetails

    • BezierPath

      public BezierPath(net.minecraft.world.phys.Vec3 startPos)
      Creates a new BezierPath starting at the given position.
    • BezierPath

      public BezierPath(net.minecraft.nbt.ListTag list)
      Creates a BezierPath from serialized NBT data.
  • Methodendetails

    • isSinglePoint

      public boolean isSinglePoint()
      Returns true if the path consists of a single point with no spline.
    • withPlayerOrigin

      public BezierPath withPlayerOrigin(net.minecraft.world.entity.player.Player player)
      Creates a new path with the player's eye position as the starting point.
    • withPlayerEnd

      public BezierPath withPlayerEnd(net.minecraft.world.entity.player.Player player)
      Creates a new path with the player's eye position as the ending point.
    • updateLUT

      public void updateLUT()
      Updates the Look-Up Table (LUT) for arc-length parameterization. This should be called whenever any point on the path changes.
    • getDistanceAtTime

      public double getDistanceAtTime(double time)
      Returns the approximate arc-length distance (in blocks) along the path at the given time parameter (0..1) of lerp(double). This is derived from the same LUT used for constant-speed motion.
    • getNormalizedDistanceAtTime

      public double getNormalizedDistanceAtTime(double time)
      Returns the normalized arc-length distance (0..1) along the path at the given time parameter (0..1) of lerp(double).
    • lerpSpeedWeighted

      public net.minecraft.world.phys.Vec3 lerpSpeedWeighted(double t)
      Interpolates a position using arc-length parameterization. This provides constant-speed motion along the path.
      Parameter:
      t - parameter from 0 to 1 representing distance along the path
    • getPoints

      public ArrayList<BezierPoint> getPoints()
      Gets all control points in the path.
    • getAnchorPoints

      public ArrayList<BezierPoint> getAnchorPoints()
      Returns all non-tangent ("node") points in order from start to end.
    • getAnchorPointCount

      public int getAnchorPointCount()
      Returns the number of non-tangent ("node") points in this path.
    • removePoint

      public void removePoint(BezierPoint point)
      Removes a point and its associated spline(s).
    • isPointFirstOrLast

      public boolean isPointFirstOrLast(BezierPoint point)
      Checks if a point is at the start or end of the path.
    • toNbt

      public net.minecraft.nbt.ListTag toNbt()
      Serializes the path to NBT format.
    • getTotalLength

      public double getTotalLength()
      Gets the total arc length of the path.
    • invalidateLUT

      public void invalidateLUT()
      Invalidates the LUT cache, forcing recalculation on next use.