#include <spline.h>
Inheritance diagram for csSpline:
Public Methods | |
csSpline (int d, int p) | |
Create a spline with d dimensions and p points. | |
virtual | ~csSpline () |
Destroy the spline. | |
int | GetDimensionCount () |
Get the number of dimensions. | |
int | GetPointCount () |
Get the number of points. | |
void | InsertPoint (int idx) |
Insert a point after some index. More... | |
void | RemovePoint (int idx) |
Remove a point at the index. | |
void | SetTimeValues (float *t) |
Set the time values. More... | |
void | SetTimeValue (int idx, float t) |
Set one time point. | |
float* | GetTimeValues () |
Get the time values. | |
float | GetTimeValue (int idx) |
Get one time point. | |
void | SetDimensionValues (int dim, float *d) |
Set the values for some dimension. More... | |
void | SetDimensionValue (int dim, int idx, float d) |
Set a value for some dimension. | |
float* | GetDimensionValues (int dim) |
Get the values for some dimension. | |
float | GetDimensionValue (int dim, int idx) |
Get the value for some dimension. | |
virtual void | Calculate (float time)=0 |
Calculate internal values for this spline given some time value. | |
int | GetCurrentIndex () |
Get the index of the current point we are in (valid after Calculate()). | |
virtual float | GetInterpolatedDimension (int dim)=0 |
After calling Calculate() you can use this to fetch the value of some dimension. | |
Protected Attributes | |
int | dimensions |
int | num_points |
float* | time_points |
float* | points |
bool | precalculation_valid |
int | idx |
This spline can control several dimensions at once.
|
Insert a point after some index. If index == -1 add a point before all others. |
|
Set the values for some dimension. 'd' should point to an array containing 'num_points' values. These are the values that will be interpolated. The given array is copied. |
|
Set the time values. 't' should point to an array containing 'num_points' values. These values typically start with 0 and end with 1. Other values are also possible the but the values should rise. The given array is copied. |