Class BezierSpline
java.lang.Object
de.luckymcdev.foundryengine.common.easing.BezierSpline
Represents a cubic Bézier spline with control points and coefficients.
Provides interpolation and rendering functionality.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionBezierSpline(BezierPoint point, BezierPath owner, net.minecraft.world.entity.player.Player player) BezierSpline(BezierPoint point, BezierPath owner, net.minecraft.world.entity.player.Player player, boolean startAtPlayer) BezierSpline(BezierPoint point, BezierPath owner, net.minecraft.world.phys.Vec3 newEnd) BezierSpline(BezierSpline prevSpline, net.minecraft.world.phys.Vec3 v1_tangent, net.minecraft.world.phys.Vec3 v2_tangent, net.minecraft.world.phys.Vec3 v2, BezierPath path) BezierSpline(net.minecraft.world.phys.Vec3 initialPos, BezierPath owner) BezierSpline(net.minecraft.world.phys.Vec3 v1, net.minecraft.world.phys.Vec3 v1_tangent, net.minecraft.world.phys.Vec3 v2_tangent, net.minecraft.world.phys.Vec3 v2, BezierPath path) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsPoint(BezierPoint point) net.minecraft.world.phys.Vec3derivative(double t) Gets the derivative (tangent) of the spline at parameter t.doubleCalculates the approximate length of the spline segment.booleannet.minecraft.world.phys.Vec3lerp(double t) Interpolates a position on the spline at parameter t (0 to 1).voidUpdates the cubic Bézier coefficients.
-
Field Details
-
v1
-
v1_tangent
-
v2
-
v2_tangent
-
path
-
points
-
-
Constructor Details
-
BezierSpline
public BezierSpline(net.minecraft.world.phys.Vec3 v1, net.minecraft.world.phys.Vec3 v1_tangent, net.minecraft.world.phys.Vec3 v2_tangent, net.minecraft.world.phys.Vec3 v2, BezierPath path) -
BezierSpline
public BezierSpline(BezierSpline prevSpline, net.minecraft.world.phys.Vec3 v1_tangent, net.minecraft.world.phys.Vec3 v2_tangent, net.minecraft.world.phys.Vec3 v2, BezierPath path) -
BezierSpline
-
BezierSpline
-
BezierSpline
public BezierSpline(BezierPoint point, BezierPath owner, net.minecraft.world.entity.player.Player player, boolean startAtPlayer) -
BezierSpline
public BezierSpline(BezierPoint point, BezierPath owner, net.minecraft.world.entity.player.Player player)
-
-
Method Details
-
isSinglePoint
public boolean isSinglePoint() -
containsPoint
-
updateCoeffs
public void updateCoeffs()Updates the cubic Bézier coefficients. Only recalculates if the spline is not a single point. -
lerp
public net.minecraft.world.phys.Vec3 lerp(double t) Interpolates a position on the spline at parameter t (0 to 1). Uses cubic Bézier curve formula: B(t) = (1-t)³P0 + 3(1-t)²tP1 + 3(1-t)t²P2 + t³P3 -
derivative
public net.minecraft.world.phys.Vec3 derivative(double t) Gets the derivative (tangent) of the spline at parameter t. Used for calculating arc length and velocity. -
getLength
public double getLength()Calculates the approximate length of the spline segment.
-