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

#include <ProceduralPrismGenerator.h>

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

Public Member Functions

 PrismGenerator (Ogre::Real radius=1.f, Ogre::Real height=1.f, unsigned int numSides=3, unsigned int numSegHeight=1, bool capped=true)
 Contructor with arguments. More...
 
PrismGeneratorsetRadius (Ogre::Real radius)
 Sets the radius of the prism (default=1) More...
 
PrismGeneratorsetHeight (Ogre::Real height)
 Sets the height of the prism (default=1) More...
 
PrismGeneratorsetNumSides (unsigned int numSides)
 Sets the number of prism sides (default=3) More...
 
PrismGeneratorsetNumSegHeight (unsigned int numSegHeight)
 Sets the number of segments along the height of the prism (default=1) More...
 
PrismGeneratorsetCapped (bool capped)
 Sets whether the prism has endings or not (default=true) More...
 
void addToTriangleBuffer (TriangleBuffer &buffer) const
 Builds the mesh into the given TriangleBuffer. More...
 
Ogre::MeshPtr realizeMesh (const std::string &name="", const Ogre::String &group="General")
 Builds a mesh. More...
 
TriangleBuffer buildTriangleBuffer () const
 Outputs a triangleBuffer. More...
 
PrismGeneratorsetUTile (Ogre::Real uTile)
 Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1) More...
 
PrismGeneratorsetVTile (Ogre::Real vTile)
 Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1) More...
 
PrismGeneratorsetTextureRectangle (const Ogre::RealRect &textureRectangle)
 Sets the texture rectangle. More...
 
PrismGeneratorsetEnableNormals (bool enableNormals)
 Sets whether normals are enabled or not (default=true) More...
 
PrismGeneratorsetNumTexCoordSet (unsigned char numTexCoordSet)
 Sets the number of texture coordintate sets (default=1) More...
 
PrismGeneratorsetSwitchUV (bool switchUV)
 Sets whether to switch U and V texture coordinates. More...
 
PrismGeneratorsetOrientation (const Ogre::Quaternion &orientation)
 Sets an orientation to give when building the mesh. More...
 
PrismGeneratorsetPosition (const Ogre::Vector3 &position)
 Sets a translation baked into the resulting mesh. More...
 
PrismGeneratorsetPosition (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a translation baked into the resulting mesh. More...
 
PrismGeneratorsetScale (const Ogre::Vector3 &scale)
 Sets a scale baked into the resulting mesh. More...
 
PrismGeneratorsetScale (Ogre::Real scale)
 Sets a uniform scale baked into the resulting mesh. More...
 
PrismGeneratorsetScale (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a scale baked into the resulting mesh. More...
 
PrismGeneratorresetTransforms ()
 Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More...
 

Protected Member Functions

void addPoint (TriangleBuffer &buffer, const Ogre::Vector3 &position, const Ogre::Vector3 &normal, const Ogre::Vector2 &uv) const
 Adds a new point to a triangle buffer, using the format defined for that MeshGenerator. More...
 

Protected Attributes

Ogre::Real mUTile
 A pointer to the default scene manager. More...
 
Ogre::Real mVTile
 V tile for texture coords generation. More...
 
bool mEnableNormals
 Whether to produces normals or not. More...
 
unsigned char mNumTexCoordSet
 The number of texture coordinate sets to include. More...
 
Ogre::Vector2 mUVOrigin
 Rectangle in which the texture coordinates will be placed. More...
 
bool mSwitchUV
 If set to true, the UV coordinates coming from the mesh generator will be switched. More...
 
Ogre::Quaternion mOrientation
 Orientation to apply the mesh. More...
 
Ogre::Vector3 mScale
 Scale to apply the mesh. More...
 
Ogre::Vector3 mPosition
 Position to apply to the mesh. More...
 
bool mTransform
 

Detailed Description

Generates a prism mesh centered on the origin. Default size is 1.0 with 1 quad per face on 3 sides.

Constructor & Destructor Documentation

◆ PrismGenerator()

Procedural::PrismGenerator::PrismGenerator ( Ogre::Real  radius = 1.f,
Ogre::Real  height = 1.f,
unsigned int  numSides = 3,
unsigned int  numSegHeight = 1,
bool  capped = true 
)

Contructor with arguments.

Member Function Documentation

◆ addPoint()

void Procedural::MeshGenerator< PrismGenerator >::addPoint ( TriangleBuffer buffer,
const Ogre::Vector3 position,
const Ogre::Vector3 normal,
const Ogre::Vector2 uv 
) const
protectedinherited

Adds a new point to a triangle buffer, using the format defined for that MeshGenerator.

Parameters
bufferthe triangle buffer to update
positionthe position of the new point
normalthe normal of the new point
uvthe uv texcoord of the new point

◆ addToTriangleBuffer()

void Procedural::PrismGenerator::addToTriangleBuffer ( TriangleBuffer buffer) const
virtual

Builds the mesh into the given TriangleBuffer.

Parameters
bufferThe TriangleBuffer on where to append the mesh.

Implements Procedural::MeshGenerator< PrismGenerator >.

◆ buildTriangleBuffer()

TriangleBuffer Procedural::MeshGenerator< PrismGenerator >::buildTriangleBuffer
inherited

Outputs a triangleBuffer.

◆ realizeMesh()

Ogre::MeshPtr Procedural::MeshGenerator< PrismGenerator >::realizeMesh ( const std::string &  name = "",
const Ogre::String group = "General" 
)
inherited

Builds a mesh.

Parameters
nameof the mesh for the MeshManager
groupressource group in which the mesh will be created

◆ resetTransforms()

PrismGenerator & Procedural::MeshGenerator< PrismGenerator >::resetTransforms
inherited

Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values.

◆ setCapped()

PrismGenerator& Procedural::PrismGenerator::setCapped ( bool  capped)

Sets whether the prism has endings or not (default=true)

◆ setEnableNormals()

PrismGenerator & Procedural::MeshGenerator< PrismGenerator >::setEnableNormals ( bool  enableNormals)
inherited

Sets whether normals are enabled or not (default=true)

◆ setHeight()

PrismGenerator& Procedural::PrismGenerator::setHeight ( Ogre::Real  height)

Sets the height of the prism (default=1)

Exceptions
Ogre::InvalidParametersExceptionHeight must be larger than 0!

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

◆ setNumSegHeight()

PrismGenerator& Procedural::PrismGenerator::setNumSegHeight ( unsigned int  numSegHeight)

Sets the number of segments along the height of the prism (default=1)

Exceptions
Ogre::InvalidParametersExceptionMinimum of numSegHeight is 1

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

◆ setNumSides()

PrismGenerator& Procedural::PrismGenerator::setNumSides ( unsigned int  numSides)

Sets the number of prism sides (default=3)

Exceptions
Ogre::InvalidParametersExceptionMinimum of numSides is 3

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

◆ setNumTexCoordSet()

PrismGenerator & Procedural::MeshGenerator< PrismGenerator >::setNumTexCoordSet ( unsigned char  numTexCoordSet)
inherited

Sets the number of texture coordintate sets (default=1)

◆ setOrientation()

PrismGenerator & Procedural::MeshGenerator< PrismGenerator >::setOrientation ( const Ogre::Quaternion orientation)
inherited

Sets an orientation to give when building the mesh.

◆ setPosition() [1/2]

PrismGenerator & Procedural::MeshGenerator< PrismGenerator >::setPosition ( const Ogre::Vector3 position)
inherited

Sets a translation baked into the resulting mesh.

◆ setPosition() [2/2]

Sets a translation baked into the resulting mesh.

◆ setRadius()

PrismGenerator& Procedural::PrismGenerator::setRadius ( Ogre::Real  radius)

Sets the radius of the prism (default=1)

Exceptions
Ogre::InvalidParametersExceptionRadius must be larger than 0!

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

◆ setScale() [1/3]

PrismGenerator & Procedural::MeshGenerator< PrismGenerator >::setScale ( const Ogre::Vector3 scale)
inherited

Sets a scale baked into the resulting mesh.

◆ setScale() [2/3]

Sets a uniform scale baked into the resulting mesh.

◆ setScale() [3/3]

Sets a scale baked into the resulting mesh.

◆ setSwitchUV()

PrismGenerator & Procedural::MeshGenerator< PrismGenerator >::setSwitchUV ( bool  switchUV)
inherited

Sets whether to switch U and V texture coordinates.

◆ setTextureRectangle()

PrismGenerator & Procedural::MeshGenerator< PrismGenerator >::setTextureRectangle ( const Ogre::RealRect textureRectangle)
inherited

Sets the texture rectangle.

◆ setUTile()

Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1)

◆ setVTile()

Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1)

Member Data Documentation

◆ mEnableNormals

bool Procedural::MeshGenerator< PrismGenerator >::mEnableNormals
protectedinherited

Whether to produces normals or not.

◆ mNumTexCoordSet

unsigned char Procedural::MeshGenerator< PrismGenerator >::mNumTexCoordSet
protectedinherited

The number of texture coordinate sets to include.

◆ mOrientation

Ogre::Quaternion Procedural::MeshGenerator< PrismGenerator >::mOrientation
protectedinherited

Orientation to apply the mesh.

◆ mPosition

Ogre::Vector3 Procedural::MeshGenerator< PrismGenerator >::mPosition
protectedinherited

Position to apply to the mesh.

◆ mScale

Scale to apply the mesh.

◆ mSwitchUV

bool Procedural::MeshGenerator< PrismGenerator >::mSwitchUV
protectedinherited

If set to true, the UV coordinates coming from the mesh generator will be switched.

It can be used, for example, if your texture doesn't fit the mesh generator's assumptions about UV. If UV were to fit in a given rectangle, they still fit in it after the switch.

◆ mTransform

bool Procedural::MeshGenerator< PrismGenerator >::mTransform
protectedinherited

◆ mUTile

Ogre::Real Procedural::MeshGenerator< PrismGenerator >::mUTile
protectedinherited

A pointer to the default scene manager.

U tile for texture coords generation

◆ mUVOrigin

Ogre::Vector2 Procedural::MeshGenerator< PrismGenerator >::mUVOrigin
protectedinherited

Rectangle in which the texture coordinates will be placed.

◆ mVTile

Ogre::Real Procedural::MeshGenerator< PrismGenerator >::mVTile
protectedinherited

V tile for texture coords generation.


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