Ogre Procedural  0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
Public Member Functions | Protected Attributes | List of all members
Procedural::CatmullRomSpline3 Class Reference

Builds a path from a Catmull-Rom Spline. More...

#include <ProceduralPathGenerators.h>

Inheritance diagram for Procedural::CatmullRomSpline3:
Inheritance graph
[legend]

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...
 
CatmullRomSpline3addPoint (const Ogre::Vector3 &pt)
 Adds a control point. More...
 
CatmullRomSpline3addPoint (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Adds a control point. More...
 
const Ogre::Vector3safeGetPoint (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...
 
CatmullRomSpline3setNumSeg (unsigned int numSeg)
 Sets the number of segments between 2 control points. More...
 
CatmullRomSpline3close ()
 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...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ CatmullRomSpline3() [1/2]

Procedural::CatmullRomSpline3::CatmullRomSpline3 ( )

Default constructor.

◆ CatmullRomSpline3() [2/2]

Procedural::CatmullRomSpline3::CatmullRomSpline3 ( const Ogre::SimpleSpline input)

Copy constructor from an Ogre simplespline.

References Ogre::SimpleSpline::getNumPoints(), and Ogre::SimpleSpline::getPoint().

Member Function Documentation

◆ addPoint() [1/2]

CatmullRomSpline3& Procedural::CatmullRomSpline3::addPoint ( const Ogre::Vector3 pt)

Adds a control point.

◆ addPoint() [2/2]

CatmullRomSpline3& Procedural::CatmullRomSpline3::addPoint ( Ogre::Real  x,
Ogre::Real  y,
Ogre::Real  z 
)

Adds a control point.

◆ close()

Closes the spline.

◆ getPointCount()

const size_t Procedural::CatmullRomSpline3::getPointCount ( ) const

Gets the number of control points.

◆ realizePath()

Path Procedural::CatmullRomSpline3::realizePath ( )

Build a path from Catmull-Rom control points.

◆ safeGetPoint()

const Ogre::Vector3& Procedural::CatmullRomSpline3::safeGetPoint ( unsigned int  i) const

Safely gets a control point.

References Procedural::Utils::cap(), and Procedural::Utils::modulo().

◆ setNumSeg()

CatmullRomSpline3 & Procedural::BaseSpline3< CatmullRomSpline3 >::setNumSeg ( unsigned int  numSeg)
inherited

Sets the number of segments between 2 control points.

Exceptions
Ogre::InvalidParametersExceptionMinimum of numSeg is 1

◆ toSimpleSpline()

Ogre::SimpleSpline Procedural::CatmullRomSpline3::toSimpleSpline ( ) const

Outputs current spline to an Ogre spline.

References Ogre::SimpleSpline::addPoint().

Member Data Documentation

◆ mClosed

bool Procedural::BaseSpline3< CatmullRomSpline3 >::mClosed
protectedinherited

Tells if the spline is closed or not.

◆ mNumSeg

unsigned int Procedural::BaseSpline3< CatmullRomSpline3 >::mNumSeg
protectedinherited

The number of segments between 2 control points.


The documentation for this class was generated from the following file: