animation_curve_fit
Functions
Calculates a Catmull-Rom style tangent (slope) for a point in the dataset.
Fits a smooth AnimationCurve to a set of discrete 2D points using adaptive Cubic Hermite Spline fitting.
This utility performs data reduction (lossy compression) on dense time-series data.
It recursively subdivides the dataset, inserting Keyframes only where the interpolated curve deviates from the original points by more than maxError.
Tangents are automatically estimated based on the slope of the input data (Catmull-Rom style), ensuring smooth transitions between keyframes.
calculateTangent(points, points_offset, points_count, index)
Calculates a Catmull-Rom style tangent (slope) for a point in the dataset.
Kind: global function
| Param | Type |
|---|---|
| points | Array.<number> |
| points_offset | number |
| points_count | number |
| index | number |
animation_curve_fit(points, [input_offset], [input_count], [maxError]) ⇒ AnimationCurve
Fits a smooth AnimationCurve to a set of discrete 2D points using adaptive Cubic Hermite Spline fitting.
This utility performs data reduction (lossy compression) on dense time-series data.
It recursively subdivides the dataset, inserting Keyframes only where the interpolated curve deviates from the original points by more than maxError.
Tangents are automatically estimated based on the slope of the input data (Catmull-Rom style), ensuring smooth transitions between keyframes.
Kind: global function
| Param | Type | Description |
|---|---|---|
| points | Array.<number> | flat array of coordinates [x0, y0, x1, y1, ... xn, yn] |
| [input_offset] | number | flat offset into the input array where to start reading data |
| [input_count] | number | number of points to fit, counted in points i.e., pairs of (x,y) values |
| [maxError] | number | Maximum allowed deviation. Higher values produce fewer keys (more compression), lower values preserve more detail. |
- animation_curve_fit(points, [input_offset], [input_count], [maxError]) ⇒
AnimationCurve- ~resultKeys :
Array.<Keyframe> - ~fitSegment(firstIndex, lastIndex)
- ~resultKeys :
animation_curve_fit~resultKeys : Array.<Keyframe>
Kind: inner constant of animation_curve_fit
animation_curve_fit~fitSegment(firstIndex, lastIndex)
Recursive function to find split points
Kind: inner method of animation_curve_fit
| Param | Type |
|---|---|
| firstIndex | number |
| lastIndex | number |