Class CatmulRomSpline

java.lang.Object
foundry.veil.api.util.CatmulRomSpline

public final class CatmulRomSpline extends Object
Generates a spline from control points without allocating new objects.
  • Constructor Details

    • CatmulRomSpline

      public CatmulRomSpline()
  • Method Details

    • generateJomlSpline

      public Iterable<org.joml.Vector3dc> generateJomlSpline(Collection<? extends org.joml.Vector3dc> controlPoints, int numSegments)
      Iterates through every point, generating intermediate catmul-rom spline segments.
      Parameters:
      controlPoints - The control points
      numSegments - The number of segments to split into
      Returns:
      An Iterable with all points
    • generateSpline

      public Iterable<org.joml.Vector3dc> generateSpline(Collection<? extends net.minecraft.core.Position> controlPoints, int numSegments)
      Iterates through every point, generating intermediate catmul-rom spline segments.
      Parameters:
      controlPoints - The control points
      numSegments - The number of segments to split into
      Returns:
      An Iterable with all points