Skip to content

[rshapes] More spline functions #4810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,19 @@ WIP: Last update with commit from 02-Nov-2024
[rshapes] REVIEWED: `CheckCollisionCircleRec()` (#3584) by @ubkp
[rshapes] REVIEWED: Add more detail to function comment (#4344) by @Jeffery Myers
[rshapes] REVIEWED: Functions that draw point arrays take them as const (#4051) by @Jeffery Myers
[rshapes] ADDED: `DrawSplineSegmentBezierCubicVar()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineVelocityLinear()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineVelocityBezierQuad()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineVelocityBezierCubic()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineAccelerationBezierQuad()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineAccelerationBezierCubic()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineJoltBezierCubic()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineBoundsBezierLinear()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineBoundsBezierQuad()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineBoundsBezierCubic()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineCurvatureBezierCubic()` (#4809) by @AmityWilder
[rshapes] ADDED: `GetSplineNearestTLinear()` (#4809) by @AmityWilder
[rshapes] ADDED: Example of `DrawSplineSegmentBezierCubicVar` in splines drawing example (#4809) by @AmityWilder
[rtextures] ADDED: `ColorIsEqual()` by @Ray
[rtextures] ADDED: `ColorLerp()`, to mix 2 colors together (#4310) by @SusgUY446
[rtextures] ADDED: `LoadImageAnimFromMemory()` (#3681) by @IoIxD
Expand Down
295 changes: 237 additions & 58 deletions examples/shapes/shapes_splines_drawing.c

Large diffs are not rendered by default.

353 changes: 353 additions & 0 deletions parser/output/raylib_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -6564,6 +6564,68 @@
}
]
},
{
"name": "DrawSplineSegmentLinearVar",
"description": "Draw spline segment with variable thickness: Linear Bezier, 2 points",
"returnType": "void",
"params": [
{
"type": "Vector2",
"name": "p1"
},
{
"type": "Vector2",
"name": "p2"
},
{
"type": "const float*",
"name": "thicks"
},
{
"type": "int",
"name": "thickCount"
},
{
"type": "Color",
"name": "color"
}
]
},
{
"name": "DrawSplineSegmentBezierCubicVar",
"description": "Draw spline segment with variable thickness: Cubic Bezier, 2 points, 2 control points",
"returnType": "void",
"params": [
{
"type": "Vector2",
"name": "p1"
},
{
"type": "Vector2",
"name": "c2"
},
{
"type": "Vector2",
"name": "c3"
},
{
"type": "Vector2",
"name": "p4"
},
{
"type": "const float*",
"name": "thicks"
},
{
"type": "int",
"name": "thickCount"
},
{
"type": "Color",
"name": "color"
}
]
},
{
"name": "GetSplinePointLinear",
"description": "Get (evaluate) spline point: Linear",
Expand Down Expand Up @@ -6687,6 +6749,297 @@
}
]
},
{
"name": "GetSplineControlBezierQuad",
"description": "Get (evaluate) spline control point: Quadratic Bezier",
"returnType": "void",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "midPos"
},
{
"type": "Vector2",
"name": "endPos"
},
{
"type": "Vector2 *",
"name": "controlPos"
}
]
},
{
"name": "GetSplineControlBezierCubic",
"description": "Get (evaluate) spline control points: Cubic Bezier",
"returnType": "void",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "oneThirdsPos"
},
{
"type": "Vector2",
"name": "twoThirdsPos"
},
{
"type": "Vector2",
"name": "endPos"
},
{
"type": "Vector2 *",
"name": "startControlPos"
},
{
"type": "Vector2 *",
"name": "endControlPos"
}
]
},
{
"name": "GetSplineVelocityLinear",
"description": "Get (evaluate) spline velocity: Linear",
"returnType": "Vector2",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "endPos"
}
]
},
{
"name": "GetSplineVelocityBezierQuad",
"description": "Get (evaluate) spline velocity: Quadratic Bezier",
"returnType": "Vector2",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "controlPos"
},
{
"type": "Vector2",
"name": "endPos"
},
{
"type": "float",
"name": "t"
}
]
},
{
"name": "GetSplineVelocityBezierCubic",
"description": "Get (evaluate) spline velocity: Cubic Bezier",
"returnType": "Vector2",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "startControlPos"
},
{
"type": "Vector2",
"name": "endControlPos"
},
{
"type": "Vector2",
"name": "endPos"
},
{
"type": "float",
"name": "t"
}
]
},
{
"name": "GetSplineAccelerationBezierQuad",
"description": "Get (evaluate) spline acceleration: Quadratic Bezier",
"returnType": "Vector2",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "controlPos"
},
{
"type": "Vector2",
"name": "endPos"
}
]
},
{
"name": "GetSplineAccelerationBezierCubic",
"description": "Get (evaluate) spline acceleration: Cubic Bezier",
"returnType": "Vector2",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "startControlPos"
},
{
"type": "Vector2",
"name": "endControlPos"
},
{
"type": "Vector2",
"name": "endPos"
},
{
"type": "float",
"name": "t"
}
]
},
{
"name": "GetSplineJoltBezierCubic",
"description": "Get (evaluate) spline jolt: Cubic Bezier",
"returnType": "Vector2",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "startControlPos"
},
{
"type": "Vector2",
"name": "endControlPos"
},
{
"type": "Vector2",
"name": "endPos"
}
]
},
{
"name": "GetSplineBoundsBezierLinear",
"description": "Get (evaluate) spline bounds rectangle: Linear",
"returnType": "Rectangle",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "endPos"
}
]
},
{
"name": "GetSplineBoundsBezierQuad",
"description": "Get (evaluate) spline bounds rectangle: Quadratic Bezier",
"returnType": "Rectangle",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "controlPos"
},
{
"type": "Vector2",
"name": "endPos"
}
]
},
{
"name": "GetSplineBoundsBezierCubic",
"description": "Get (evaluate) spline bounds rectangle: Cubic Bezier",
"returnType": "Rectangle",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "startControlPos"
},
{
"type": "Vector2",
"name": "endControlPos"
},
{
"type": "Vector2",
"name": "endPos"
}
]
},
{
"name": "GetSplineCurvatureBezierCubic",
"description": "Get (evaluate) spline curvature: Cubic Bezier",
"returnType": "float",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "startControlPos"
},
{
"type": "Vector2",
"name": "endControlPos"
},
{
"type": "Vector2",
"name": "endPos"
},
{
"type": "float",
"name": "t"
}
]
},
{
"name": "GetSplineNearestTLinear",
"description": "Get (evaluate) nearest t value to point: Linear",
"returnType": "float",
"params": [
{
"type": "Vector2",
"name": "startPos"
},
{
"type": "Vector2",
"name": "endPos"
},
{
"type": "Vector2",
"name": "point"
}
]
},
{
"name": "CheckCollisionRecs",
"description": "Check collision between two rectangles",
Expand Down
Loading