Ogre Procedural
0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
|
Builds a shape from a Bezier-Curve. More...
#include <ProceduralShapeGenerators.h>
Public Member Functions | |
BezierCurve2 () | |
Default constructor. More... | |
BezierCurve2 & | setNumSeg (unsigned int numSeg) |
Sets number of segments per two control points. More... | |
BezierCurve2 & | addPoint (const Ogre::Vector2 &pt) |
Adds a control point. More... | |
BezierCurve2 & | addPoint (Ogre::Real x, Ogre::Real y) |
Adds a control point. More... | |
const Ogre::Vector2 & | safeGetPoint (unsigned int i) const |
Safely gets a control point. More... | |
const size_t | getPointCount () const |
Gets the number of control points. More... | |
Shape | realizeShape () |
Build a shape from bezier control points. More... | |
BezierCurve2 & | setOutSide (Side outSide) |
Sets the out side of the shape. More... | |
Side | getOutSide () const |
Gets the out side of the shape. More... | |
BezierCurve2 & | close () |
Closes the spline. More... | |
Protected Attributes | |
bool | mClosed |
Whether the shape will be closed or not. More... | |
Side | mOutSide |
The "out" side of the shape. More... | |
Builds a shape from a Bezier-Curve.
Procedural::BezierCurve2::BezierCurve2 | ( | ) |
Default constructor.
BezierCurve2& Procedural::BezierCurve2::addPoint | ( | const Ogre::Vector2 & | pt | ) |
Adds a control point.
BezierCurve2& Procedural::BezierCurve2::addPoint | ( | Ogre::Real | x, |
Ogre::Real | y | ||
) |
Adds a control point.
|
inherited |
Closes the spline.
|
inherited |
Gets the out side of the shape.
const size_t Procedural::BezierCurve2::getPointCount | ( | ) | const |
Gets the number of control points.
Shape Procedural::BezierCurve2::realizeShape | ( | ) |
Build a shape from bezier control points.
Ogre::InvalidStateException | The curve must at least contain 2 points |
const Ogre::Vector2& Procedural::BezierCurve2::safeGetPoint | ( | unsigned int | i | ) | const |
Safely gets a control point.
References Procedural::Utils::cap(), and Procedural::Utils::modulo().
BezierCurve2& Procedural::BezierCurve2::setNumSeg | ( | unsigned int | numSeg | ) |
Sets number of segments per two control points.
Ogre::InvalidParametersException | Minimum of numSeg is 1 |
References Ogre::Exception::ERR_INVALIDPARAMS, and OGRE_EXCEPT.
|
inherited |
Sets the out side of the shape.
|
protectedinherited |
Whether the shape will be closed or not.
|
protectedinherited |
The "out" side of the shape.