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

#include <ProceduralPlaneGenerator.h>

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

Public Member Functions

 PlaneGenerator ()
 
void addToTriangleBuffer (TriangleBuffer &buffer) const
 Builds the mesh into the given TriangleBuffer. More...
 
PlaneGeneratorsetNumSegX (unsigned int numSegX)
 Sets the number of segements along local X axis. More...
 
PlaneGeneratorsetNumSegY (unsigned int numSegY)
 Sets the number of segments along local Y axis. More...
 
PlaneGeneratorsetNormal (Ogre::Vector3 normal)
 Sets the normal of the plane. More...
 
PlaneGeneratorsetSizeX (Ogre::Real sizeX)
 Sets the size of the plane along local X axis. More...
 
PlaneGeneratorsetSizeY (Ogre::Real sizeY)
 Sets the size of the plane along local Y axis. More...
 
PlaneGeneratorsetSize (Ogre::Vector2 size)
 Sets the size (default=1,1) More...
 
Ogre::MeshPtr realizeMesh (const std::string &name="", const Ogre::String &group="General")
 Builds a mesh. More...
 
TriangleBuffer buildTriangleBuffer () const
 Outputs a triangleBuffer. More...
 
PlaneGeneratorsetUTile (Ogre::Real uTile)
 Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1) More...
 
PlaneGeneratorsetVTile (Ogre::Real vTile)
 Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1) More...
 
PlaneGeneratorsetTextureRectangle (const Ogre::RealRect &textureRectangle)
 Sets the texture rectangle. More...
 
PlaneGeneratorsetEnableNormals (bool enableNormals)
 Sets whether normals are enabled or not (default=true) More...
 
PlaneGeneratorsetNumTexCoordSet (unsigned char numTexCoordSet)
 Sets the number of texture coordintate sets (default=1) More...
 
PlaneGeneratorsetSwitchUV (bool switchUV)
 Sets whether to switch U and V texture coordinates. More...
 
PlaneGeneratorsetOrientation (const Ogre::Quaternion &orientation)
 Sets an orientation to give when building the mesh. More...
 
PlaneGeneratorsetPosition (const Ogre::Vector3 &position)
 Sets a translation baked into the resulting mesh. More...
 
PlaneGeneratorsetPosition (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a translation baked into the resulting mesh. More...
 
PlaneGeneratorsetScale (const Ogre::Vector3 &scale)
 Sets a scale baked into the resulting mesh. More...
 
PlaneGeneratorsetScale (Ogre::Real scale)
 Sets a uniform scale baked into the resulting mesh. More...
 
PlaneGeneratorsetScale (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a scale baked into the resulting mesh. More...
 
PlaneGeneratorresetTransforms ()
 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

Builds a plane mesh

Note
Note that X and Y values in that generator are not global X and Y, but are computed to be : X = normal x global X and Y = normal x X

Constructor & Destructor Documentation

◆ PlaneGenerator()

Procedural::PlaneGenerator::PlaneGenerator ( )

Member Function Documentation

◆ addPoint()

void Procedural::MeshGenerator< PlaneGenerator >::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::PlaneGenerator::addToTriangleBuffer ( TriangleBuffer buffer) const
virtual

Builds the mesh into the given TriangleBuffer.

Parameters
bufferThe TriangleBuffer on where to append the mesh.

Implements Procedural::MeshGenerator< PlaneGenerator >.

◆ buildTriangleBuffer()

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

Outputs a triangleBuffer.

◆ realizeMesh()

Ogre::MeshPtr Procedural::MeshGenerator< PlaneGenerator >::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()

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

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

◆ setEnableNormals()

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

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

◆ setNormal()

PlaneGenerator& Procedural::PlaneGenerator::setNormal ( Ogre::Vector3  normal)

Sets the normal of the plane.

Exceptions
Ogre::InvalidParametersExceptionNormal must not be null

References Ogre::Exception::ERR_INVALIDPARAMS, Vector< 3, Real >::isZeroLength(), and OGRE_EXCEPT.

◆ setNumSegX()

PlaneGenerator& Procedural::PlaneGenerator::setNumSegX ( unsigned int  numSegX)

Sets the number of segements along local X axis.

Exceptions
Ogre::InvalidParametersExceptionMinimum of numSegX is 1

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

◆ setNumSegY()

PlaneGenerator& Procedural::PlaneGenerator::setNumSegY ( unsigned int  numSegY)

Sets the number of segments along local Y axis.

Exceptions
Ogre::InvalidParametersExceptionMinimum of numSegY is 1

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

◆ setNumTexCoordSet()

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

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

◆ setOrientation()

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

Sets an orientation to give when building the mesh.

◆ setPosition() [1/2]

PlaneGenerator & Procedural::MeshGenerator< PlaneGenerator >::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.

◆ setScale() [1/3]

PlaneGenerator & Procedural::MeshGenerator< PlaneGenerator >::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.

◆ setSize()

PlaneGenerator& Procedural::PlaneGenerator::setSize ( Ogre::Vector2  size)

Sets the size (default=1,1)

◆ setSizeX()

PlaneGenerator& Procedural::PlaneGenerator::setSizeX ( Ogre::Real  sizeX)

Sets the size of the plane along local X axis.

Exceptions
Ogre::InvalidParametersExceptionX size must be larger than 0!

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

◆ setSizeY()

PlaneGenerator& Procedural::PlaneGenerator::setSizeY ( Ogre::Real  sizeY)

Sets the size of the plane along local Y axis.

Exceptions
Ogre::InvalidParametersExceptionY size must be larger than 0!

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

◆ setSwitchUV()

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

Sets whether to switch U and V texture coordinates.

◆ setTextureRectangle()

PlaneGenerator & Procedural::MeshGenerator< PlaneGenerator >::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< PlaneGenerator >::mEnableNormals
protectedinherited

Whether to produces normals or not.

◆ mNumTexCoordSet

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

The number of texture coordinate sets to include.

◆ mOrientation

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

Orientation to apply the mesh.

◆ mPosition

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

Position to apply to the mesh.

◆ mScale

Scale to apply the mesh.

◆ mSwitchUV

bool Procedural::MeshGenerator< PlaneGenerator >::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< PlaneGenerator >::mTransform
protectedinherited

◆ mUTile

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

A pointer to the default scene manager.

U tile for texture coords generation

◆ mUVOrigin

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

Rectangle in which the texture coordinates will be placed.

◆ mVTile

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

V tile for texture coords generation.


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