This is @kjerandp’s Curve Interpolator implemented into Roblox and fully-typed in Luau.
A module meant for creating paths from a group of points and then being able to interact with the path to get what you want (examples demonstrated in the Demo).
Roblox Files and Code: GitHub - surfbryce/Path: Takes @kjerandp's Curve Interpolator and ports it to Roblox (with better Terminology, Documentation, and Optimizations)
Roblox Model: https://create.roblox.com/marketplace/asset/15493350845/Path
What you are seeing in this Demo are a few things you can do with this Module:
- Rendering a Path from any number of points
- Getting the Point AND Curvature on a Path at any Progress point
- Black dot traveling along the Path with its Pink (Tangent)/Blue (Normal) directional lines
- Locating the Closest Point on the Path to a Provided Position
- Bright Yellow dot and Light Yellow dot
- Getting all the Points that INTERSECT an Axis at the Provided Value
-
Paths with different Curviness/Softness values
- All with Curviness = 1 and Softness: Red = 0, Green = 0.5, Blue = 1)
You can download this demo from the GitHub and run (using the Server-View) exactly what is in the video.
This is a fully-typed and documented Roblox Luau implementation.
So if you ever need to see how something works, understand a concept, check the types, or find out what certain options do, it’ll all be in the code and explained.
This implementation is also extremely optimized compared to the original, being able to call the GetPointAtTime method 100,000 TIMES in only 18ms with an equal amount of unique "time"s being used. It is also the fastest implementation available on the Roblox platform with an API this extensive.
If you are interested in seeing if anything else could be optimized/improved please go ahead and take a look at the codebase, and if you do find anything, make a PR! Once a PR is made I will update everything accordingly.