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

Builds a shape from a Bezier-Curve. More...

#include <ProceduralShapeGenerators.h>

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

Public Member Functions

 BezierCurve2 ()
 Default constructor. More...
 
BezierCurve2setNumSeg (unsigned int numSeg)
 Sets number of segments per two control points. More...
 
BezierCurve2addPoint (const Ogre::Vector2 &pt)
 Adds a control point. More...
 
BezierCurve2addPoint (Ogre::Real x, Ogre::Real y)
 Adds a control point. More...
 
const Ogre::Vector2safeGetPoint (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...
 
BezierCurve2setOutSide (Side outSide)
 Sets the out side of the shape. More...
 
Side getOutSide () const
 Gets the out side of the shape. More...
 
BezierCurve2close ()
 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...
 

Detailed Description

Builds a shape from a Bezier-Curve.

Constructor & Destructor Documentation

◆ BezierCurve2()

Procedural::BezierCurve2::BezierCurve2 ( )

Default constructor.

Member Function Documentation

◆ addPoint() [1/2]

BezierCurve2& Procedural::BezierCurve2::addPoint ( const Ogre::Vector2 pt)

Adds a control point.

◆ addPoint() [2/2]

BezierCurve2& Procedural::BezierCurve2::addPoint ( Ogre::Real  x,
Ogre::Real  y 
)

Adds a control point.

◆ close()

Closes the spline.

◆ getOutSide()

Side Procedural::BaseSpline2< BezierCurve2 >::getOutSide
inherited

Gets the out side of the shape.

◆ getPointCount()

const size_t Procedural::BezierCurve2::getPointCount ( ) const

Gets the number of control points.

◆ realizeShape()

Shape Procedural::BezierCurve2::realizeShape ( )

Build a shape from bezier control points.

Exceptions
Ogre::InvalidStateExceptionThe curve must at least contain 2 points

◆ safeGetPoint()

const Ogre::Vector2& Procedural::BezierCurve2::safeGetPoint ( unsigned int  i) const

Safely gets a control point.

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

◆ setNumSeg()

BezierCurve2& Procedural::BezierCurve2::setNumSeg ( unsigned int  numSeg)

Sets number of segments per two control points.

Exceptions
Ogre::InvalidParametersExceptionMinimum of numSeg is 1

References Ogre::Exception::ERR_INVALIDPARAMS, and OGRE_EXCEPT.

◆ setOutSide()

BezierCurve2 & Procedural::BaseSpline2< BezierCurve2 >::setOutSide ( Side  outSide)
inherited

Sets the out side of the shape.

Member Data Documentation

◆ mClosed

bool Procedural::BaseSpline2< BezierCurve2 >::mClosed
protectedinherited

Whether the shape will be closed or not.

◆ mOutSide

Side Procedural::BaseSpline2< BezierCurve2 >::mOutSide
protectedinherited

The "out" side of the shape.


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