ecurtiss / CatRom

Creates Catmull-Rom splines for Roblox
https://ecurtiss.github.io/CatRom/
Mozilla Public License 2.0
45 stars 11 forks source link

Improve spline types #22

Open ecurtiss opened 2 months ago

ecurtiss commented 2 months ago

Today, a spline can be created from a list of all Vector2s, Vector3s, or CFrames. Many spline methods accept arguments of type Vector2 | Vector3 | CFrame, but the type checker does not know that each argument will have the same type in the intersection. For example, there are a few instances where the type checker dislikes a:Lerp(b) because it does not know that a and b are both Vector2s, Vector3s, or CFrames. This issue also extends to users since many methods return Vector2 | Vector3 even though the user knows which type they used to create the spline.