Skip to content

Conversation

AmityWilder
Copy link
Contributor

Relating to #4809

Added math functions

GetSplineVelocityLinear
GetSplineVelocityBezierQuad
GetSplineVelocityBezierCubic
GetSplineAccelerationBezierQuad
GetSplineAccelerationBezierCubic
GetSplineJoltBezierCubic

GetSplineBoundsBezierLinear
GetSplineBoundsBezierQuad
GetSplineBoundsBezierCubic

GetSplineCurvatureBezierCubic
GetSplineNearestTLinear

Added draw function

DrawSplineSegmentBezierCubicVar

@raysan5 raysan5 changed the title More spline functions [rshapes] More spline functions Mar 4, 2025
@raysan5
Copy link
Owner

raysan5 commented Aug 20, 2025

@AmityWilder I'm afraid this PR has become too big with too many additions, increasing complexity. Despite useful, probably many of those spline-specific functions are not required for most raylib users and they increase API complexity and maintenance cost...

I can add the 2 new draw functions but all the GetSpline*() functions should be moved to a separate spline-specific header-only library or just included in the example as static functions for now.

What do you think? Please, let me know to move this PR forward...

EDIT: An ideal option would be to have a separate single-file header-only library, maybe rsplines.h that could implement the generation of spline-vertex-triangle data, independently of raylib-rlgl, like a pure-spline-math library, so raylib could use that library on the DrawSpline*() functions and users could include it if further spline functionality was required.

@AmityWilder
Copy link
Contributor Author

@AmityWilder I'm afraid this PR has become too big with too many additions, increasing complexity. Despite useful, probably many of those spline-specific functions are not required for most raylib users and they increase API complexity and maintenance cost...

I can add the 2 new draw functions but all the GetSpline*() functions should be moved to a separate spline-specific header-only library or just included in the example as static functions for now.

What do you think? Please, let me know to move this PR forward...

EDIT: An ideal option would be to have a separate single-file header-only library, maybe rsplines.h that could implement the generation of spline-vertex-triangle data, independently of raylib-rlgl, like a pure-spline-math library, so raylib could use that library on the DrawSpline*() functions and users could include it if further spline functionality was required.

That sounds alright with me, would you like me to filter this PR down to just those draw functions?

@AmityWilder
Copy link
Contributor Author

AmityWilder commented Aug 20, 2025

@raysan5

EDIT: An ideal option would be to have a separate single-file header-only library, maybe rsplines.h that could implement the generation of spline-vertex-triangle data, independently of raylib-rlgl, like a pure-spline-math library, so raylib could use that library on the DrawSpline*() functions and users could include it if further spline functionality was required.

How does something like this look? (based a good chunk of it off of raygui and copied over the already-implemented functions from the PR with the addition of optional 1D and 3D variations of them—I'm not opposed to changing the names of them before release)
https://github.com/AmityWilder/rsplines

@raysan5
Copy link
Owner

raysan5 commented Aug 21, 2025

@AmityWilder Thanks! It looks great!

Let me see how it can be integrated into DrawSpline*() to request the points...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants