Skip to content

[rshapes] More spline functions #4809

@AmityWilder

Description

@AmityWilder

Description

It would be helpful to have spline functions for velocity--to sample a curve's direction--and calculating bounds--for collision/rendering optimization. I think these would fit in nicely alongside the GetSplinePoint_ functions.

GetSplineVelocityLinear
GetSplineVelocityBezierQuad
GetSplineVelocityBezierCubic
GetSplineAccelerationBezierQuad
GetSplineAccelerationBezierCubic
GetSplineJoltBezierCubic

GetSplineBoundsBezierLinear
GetSplineBoundsBezierQuad
GetSplineBoundsBezierCubic

GetSplineCurvatureBezierCubic
GetSplineNearestTLinear

It might also be nice to have spline drawing with variable thickness along the curve, since this can't currently be accomplished without some pretty advanced trickery.

I have already written the code for these as part of my Raylib vector art program and thought they might be valuable for others as a contribution to Raylib.
The variable thickness one needs a little work because it doesn't translate 1:1 from object-oriented Rust directly into C (I will continue to work on that further), but it is already working pretty well as a basic calligraphic effect.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions