CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csSpline Class Reference
[Geometry utilities]

A spline superclass. More...

#include <spline.h>

Inheritance diagram for csSpline:

csBSpline csCubicSpline csCatmullRomSpline csPath List of all members.

Public Methods

 csSpline (int d, int p)
 Create a spline with d dimensions and p points. More...

virtual ~csSpline ()
 Destroy the spline. More...

int GetDimensionCount ()
 Get the number of dimensions. More...

int GetPointCount ()
 Get the number of points. More...

void InsertPoint (int idx)
 Insert a point after some index. More...

void RemovePoint (int idx)
 Remove a point at the index. More...

void SetTimeValues (float *t)
 Set the time values. More...

void SetTimeValue (int idx, float t)
 Set one time point. More...

float * GetTimeValues ()
 Get the time values. More...

float GetTimeValue (int idx)
 Get one time point. More...

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. More...

float * GetDimensionValues (int dim)
 Get the values for some dimension. More...

float GetDimensionValue (int dim, int idx)
 Get the value for some dimension. More...

virtual void Calculate (float time)=0
 Calculate internal values for this spline given some time value. More...

int GetCurrentIndex ()
 Get the index of the current point we are in (valid after Calculate()). More...

virtual float GetInterpolatedDimension (int dim)=0
 After calling Calculate() you can use this to fetch the value of some dimension. More...


Detailed Description

A spline superclass.

This spline can control several dimensions at once.

Definition at line 32 of file spline.h.


Constructor & Destructor Documentation

csSpline::csSpline int    d,
int    p
 

Create a spline with d dimensions and p points.

virtual csSpline::~csSpline   [virtual]
 

Destroy the spline.


Member Function Documentation

virtual void csSpline::Calculate float    time [pure virtual]
 

Calculate internal values for this spline given some time value.

Implemented in csCubicSpline.

int csSpline::GetCurrentIndex   [inline]
 

Get the index of the current point we are in (valid after Calculate()).

Definition at line 124 of file spline.h.

int csSpline::GetDimensionCount   [inline]
 

Get the number of dimensions.

Definition at line 50 of file spline.h.

float csSpline::GetDimensionValue int    dim,
int    idx
[inline]
 

Get the value for some dimension.

Definition at line 110 of file spline.h.

Referenced by csPath::GetForwardVector, csPath::GetPositionVector, and csPath::GetUpVector.

float* csSpline::GetDimensionValues int    dim [inline]
 

Get the values for some dimension.

Definition at line 105 of file spline.h.

virtual float csSpline::GetInterpolatedDimension int    dim [pure virtual]
 

After calling Calculate() you can use this to fetch the value of some dimension.

Implemented in csCubicSpline.

int csSpline::GetPointCount   [inline]
 

Get the number of points.

Definition at line 53 of file spline.h.

float csSpline::GetTimeValue int    idx [inline]
 

Get one time point.

Definition at line 87 of file spline.h.

References GetTimeValues.

float* csSpline::GetTimeValues   [inline]
 

Get the time values.

Definition at line 82 of file spline.h.

Referenced by GetTimeValue.

void csSpline::InsertPoint int    idx
 

Insert a point after some index.

If index == -1 add a point before all others.

void csSpline::RemovePoint int    idx
 

Remove a point at the index.

void csSpline::SetDimensionValue int    dim,
int    idx,
float    d
 

Set a value for some dimension.

Referenced by csPath::SetForwardVector, csPath::SetPositionVector, and csPath::SetUpVector.

void csSpline::SetDimensionValues int    dim,
float *    d
 

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.

void csSpline::SetTimeValue int    idx,
float    t
 

Set one time point.

void csSpline::SetTimeValues float *    t
 

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.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14