Ogre Procedural
0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
|
Builds a path from a Catmull-Rom Spline. More...
#include <ProceduralPathGenerators.h>
Public Member Functions | |
CatmullRomSpline3 () | |
Default constructor. More... | |
CatmullRomSpline3 (const Ogre::SimpleSpline &input) | |
Copy constructor from an Ogre simplespline. More... | |
Ogre::SimpleSpline | toSimpleSpline () const |
Outputs current spline to an Ogre spline. More... | |
CatmullRomSpline3 & | addPoint (const Ogre::Vector3 &pt) |
Adds a control point. More... | |
CatmullRomSpline3 & | addPoint (Ogre::Real x, Ogre::Real y, Ogre::Real z) |
Adds a control point. More... | |
const Ogre::Vector3 & | safeGetPoint (unsigned int i) const |
Safely gets a control point. More... | |
const size_t | getPointCount () const |
Gets the number of control points. More... | |
Path | realizePath () |
Build a path from Catmull-Rom control points. More... | |
CatmullRomSpline3 & | setNumSeg (unsigned int numSeg) |
Sets the number of segments between 2 control points. More... | |
CatmullRomSpline3 & | close () |
Closes the spline. More... | |
Protected Attributes | |
unsigned int | mNumSeg |
The number of segments between 2 control points. More... | |
bool | mClosed |
Tells if the spline is closed or not. More... | |
Builds a path from a Catmull-Rom Spline.
Catmull-Rom Spline is the exact equivalent of Ogre's simple spline, ie a spline for which position is smoothly interpolated between control points
Procedural::CatmullRomSpline3::CatmullRomSpline3 | ( | ) |
Default constructor.
Procedural::CatmullRomSpline3::CatmullRomSpline3 | ( | const Ogre::SimpleSpline & | input | ) |
Copy constructor from an Ogre simplespline.
References Ogre::SimpleSpline::getNumPoints(), and Ogre::SimpleSpline::getPoint().
CatmullRomSpline3& Procedural::CatmullRomSpline3::addPoint | ( | const Ogre::Vector3 & | pt | ) |
Adds a control point.
CatmullRomSpline3& Procedural::CatmullRomSpline3::addPoint | ( | Ogre::Real | x, |
Ogre::Real | y, | ||
Ogre::Real | z | ||
) |
Adds a control point.
|
inherited |
Closes the spline.
const size_t Procedural::CatmullRomSpline3::getPointCount | ( | ) | const |
Gets the number of control points.
Path Procedural::CatmullRomSpline3::realizePath | ( | ) |
Build a path from Catmull-Rom control points.
const Ogre::Vector3& Procedural::CatmullRomSpline3::safeGetPoint | ( | unsigned int | i | ) | const |
Safely gets a control point.
References Procedural::Utils::cap(), and Procedural::Utils::modulo().
|
inherited |
Sets the number of segments between 2 control points.
Ogre::InvalidParametersException | Minimum of numSeg is 1 |
Ogre::SimpleSpline Procedural::CatmullRomSpline3::toSimpleSpline | ( | ) | const |
Outputs current spline to an Ogre spline.
References Ogre::SimpleSpline::addPoint().
|
protectedinherited |
Tells if the spline is closed or not.
|
protectedinherited |
The number of segments between 2 control points.