rigComponent 0.1.1
RigKit pack API - rigComponent
Loading...
Searching...
No Matches
CCurve.h File Reference

CCurve transfer-curve component with its preset, evaluation, and LUT helpers. More...

#include <glm/glm.hpp>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include "ecs/PropertyReflection.h"
Include dependency graph for CCurve.h:

Classes

struct  rigkit::ecs::CCurve
 1D transfer curve - speaks rig.anim.curve. More...

Functions

void rigkit::curve::applyPreset (ecs::CCurve &c, ecs::CCurve::Preset p)
 Replace points from a named preset (Custom is a no-op).
void rigkit::curve::toBezier (ecs::CCurve &c)
 Convert the polyline to cubic Bezier with Catmull-Rom tangents.
float rigkit::curve::solveBezierS (float ax, float c1x, float c2x, float bx, float t)
 Solve cubic Bezier x(s) = t for s in [0,1].

Detailed Description

CCurve transfer-curve component with its preset, evaluation, and LUT helpers.

Data and pure functions only; the point-dragging widget lives in rigVectorEditor.

Function Documentation

◆ applyPreset()

void rigkit::curve::applyPreset ( ecs::CCurve & c,
ecs::CCurve::Preset p )
inline

Replace points from a named preset (Custom is a no-op).

Linear uses linear interpolation, so the diagonal is a straight line. The other presets use smooth interpolation. Handles are cleared.

◆ solveBezierS()

float rigkit::curve::solveBezierS ( float ax,
float c1x,
float c2x,
float bx,
float t )
inline

Solve cubic Bezier x(s) = t for s in [0,1].

Newton with bisection clamp.