Emergency 2017 Dokumentation  v3.0.1
qsf::OgreManualObjectHelper Class Reference

Helper class for building OGRE manual object geometry. More...

#include <OgreManualObjectHelper.h>

Public Member Functions

 OgreManualObjectHelper (Ogre::ManualObject &ogreManualObject)
 Constructor. More...
 
virtual ~OgreManualObjectHelper ()
 Destructor. More...
 
void setMaterial (const Ogre::String &materialName)
 Set material name to be used for geometry created by following calls. More...
 
void setColor (const Ogre::ColourValue &color)
 Set vertex color to be used for geometry created by following calls. More...
 
void addBox (const Ogre::Vector3 &center, const Ogre::Matrix3 &transformation, const Ogre::Vector3 &extents)
 Add box geometry to the manual object instance. More...
 
void addTorus (const Ogre::Vector3 &center, const Ogre::Matrix3 &transformation, float outerRadius, float innerRadius, int segments, int slices)
 Add torus geometry around the x-axis to the manual object instance. More...
 
void addCylinderMantle (const Ogre::Vector3 &startPoint, const Ogre::Matrix3 &transformation, float radius, float height, int slices)
 Add cylinder mantle geometry along x-axis to the manual object instance. More...
 
void addCylinderMantle (const Ogre::Vector3 &startPoint, const Ogre::Matrix3 &transformation, float radius, float radiusAtTop, float height, int slices)
 
void addConeMantle (const Ogre::Vector3 &startPoint, const Ogre::Matrix3 &transformation, float radius, float height, int slices)
 Add cone mantle geometry to the manual object instance. More...
 
void addPolygon (const std::vector< glm::vec3 > &vertices, float filledOpacity, bool closed=true)
 Add a polygon to the manual object instance. More...
 

Detailed Description

Helper class for building OGRE manual object geometry.

Todo:
  • TODO(fw): Should we rewrite method interface to use GLM and QSF classes instead of OGRE? (This is already done for addPolygon, which was added last.)

Definition at line 45 of file OgreManualObjectHelper.h.

Constructor & Destructor Documentation

qsf::OgreManualObjectHelper::OgreManualObjectHelper ( Ogre::ManualObject &  ogreManualObject)
explicit

Constructor.

Parameters
[in]ogreManualObjectTarget OGRE manual object to be edited/expanded, must stay valid as long as this OGRE manual object helper instance exists
virtual qsf::OgreManualObjectHelper::~OgreManualObjectHelper ( )
virtual

Destructor.

Member Function Documentation

void qsf::OgreManualObjectHelper::addBox ( const Ogre::Vector3 &  center,
const Ogre::Matrix3 &  transformation,
const Ogre::Vector3 &  extents 
)

Add box geometry to the manual object instance.

Parameters
[in]centerCenter point of the box. Transformation matrix not automatically applied to this.
[in]transformationTransformation matrix that is applied to all generated vertices
[in]extentsExtents of the box describing HALF side lengths (x, y, z)
void qsf::OgreManualObjectHelper::addConeMantle ( const Ogre::Vector3 &  startPoint,
const Ogre::Matrix3 &  transformation,
float  radius,
float  height,
int  slices 
)

Add cone mantle geometry to the manual object instance.

Parameters
[in]startPointCenter point of lower ring in local space. Transformation matrix not automatically applied to this.
[in]transformationTransformation matrix that is applied to all generated vertices
[in]radiusRadius of the cone's base surface (results in expansion along y- and z-axis)
[in]heightHeight of the cone (along x-axis)
[in]slicesNumber of slices, i.e. detail level for cones's curved surface. Recommended values range from 8 to 64.
void qsf::OgreManualObjectHelper::addCylinderMantle ( const Ogre::Vector3 &  startPoint,
const Ogre::Matrix3 &  transformation,
float  radius,
float  height,
int  slices 
)

Add cylinder mantle geometry along x-axis to the manual object instance.

Parameters
[in]startPointCenter point of lower ring in local space. Transformation matrix not automatically applied to this.
[in]transformationTransformation matrix that is applied to all generated vertices
[in]radiusRadius of the cylinder (results in expansion along y- and z-axis)
[in]heightHeight of the cylinder (along x-axis)
[in]slicesNumber of slices, i.e. detail level for cylinder's curved surface. Recommended values range from 8 to 64.
void qsf::OgreManualObjectHelper::addCylinderMantle ( const Ogre::Vector3 &  startPoint,
const Ogre::Matrix3 &  transformation,
float  radius,
float  radiusAtTop,
float  height,
int  slices 
)
void qsf::OgreManualObjectHelper::addPolygon ( const std::vector< glm::vec3 > &  vertices,
float  filledOpacity,
bool  closed = true 
)

Add a polygon to the manual object instance.

Parameters
[in]verticesArray of vertices forming the polygon
[in]filledOpacityOpacity between 0.0f and 1.0f of the inner area; if 0.0f (or below), the inner area will not be drawn at all
[in]closedIf true, a closed polygon is drawn (i.e. first and last vertices are connected by a segment)
void qsf::OgreManualObjectHelper::addTorus ( const Ogre::Vector3 &  center,
const Ogre::Matrix3 &  transformation,
float  outerRadius,
float  innerRadius,
int  segments,
int  slices 
)

Add torus geometry around the x-axis to the manual object instance.

Parameters
[in]centerCenter point of the torus in local space. Transformation matrix not automatically applied to this.
[in]transformationTransformation matrix that is applied to all generated vertices
[in]outerRadiusOuter radius of the torus, i.e. radius of the circle the torus is built around
[in]innerRadiusInner radius of the torus, i.e. distance of every point of the torus surface from the circle with outerRadius. Should be less than outerRadius.
[in]segmentsNumber of segments, i.e. detail level for the circle with outerRadius that the torus is built around. Recommended values range from 8 to 64.
[in]slicesNumber of slices, i.e. detail level for torus curved surface around the circle the torus is built around. Recommended values range from 4 to 32.
void qsf::OgreManualObjectHelper::setColor ( const Ogre::ColourValue &  color)

Set vertex color to be used for geometry created by following calls.

void qsf::OgreManualObjectHelper::setMaterial ( const Ogre::String &  materialName)

Set material name to be used for geometry created by following calls.


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