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

Builds a mesh by rotating a shape 360 degrees around Y-axis. More...

#include <ProceduralLathe.h>

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

Public Member Functions

 Lathe (Shape *shapeToExtrude=0, unsigned int numSeg=16)
 Contructor with arguments. More...
 
LathesetNumSeg (unsigned int numSeg)
 Sets the number of segments when rotating around the axis (default=16) More...
 
LathesetAngleBegin (Ogre::Radian angleBegin)
 Sets the angle to begin lathe with (default=0) Automatically makes the lathe not closed. More...
 
LathesetAngleEnd (Ogre::Radian angleEnd)
 Sets the angle to end lathe with (default=2PI) Automatically makes the lathe not closed. More...
 
LathesetClosed (bool closed)
 Sets whether the lathe is closed or not. More...
 
LathesetCapped (bool capped)
 Sets whether the lathe is capped or not (default=true) Only makes sense if the lathe is not closed. More...
 
LathesetShapeToExtrude (Shape *shapeToExtrude)
 Sets the shape to extrude If a multishape is already defined, auto-disables it The shape is assumed to be defined in the X>=0 half-plane. More...
 
LathesetMultiShapeToExtrude (MultiShape *multiShapeToExtrude)
 Sets the multiShape to extrude If a shape is already defined, auto-disables it The shapes in this multi-shape are assumed to be defined in the X>=0 half-plane. 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...
 
LathesetUTile (Ogre::Real uTile)
 Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1) More...
 
LathesetVTile (Ogre::Real vTile)
 Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1) More...
 
LathesetTextureRectangle (const Ogre::RealRect &textureRectangle)
 Sets the texture rectangle. More...
 
LathesetEnableNormals (bool enableNormals)
 Sets whether normals are enabled or not (default=true) More...
 
LathesetNumTexCoordSet (unsigned char numTexCoordSet)
 Sets the number of texture coordintate sets (default=1) More...
 
LathesetSwitchUV (bool switchUV)
 Sets whether to switch U and V texture coordinates. More...
 
LathesetOrientation (const Ogre::Quaternion &orientation)
 Sets an orientation to give when building the mesh. More...
 
LathesetPosition (const Ogre::Vector3 &position)
 Sets a translation baked into the resulting mesh. More...
 
LathesetPosition (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a translation baked into the resulting mesh. More...
 
LathesetScale (const Ogre::Vector3 &scale)
 Sets a scale baked into the resulting mesh. More...
 
LathesetScale (Ogre::Real scale)
 Sets a uniform scale baked into the resulting mesh. More...
 
LathesetScale (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a scale baked into the resulting mesh. More...
 
LatheresetTransforms ()
 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 mesh by rotating a shape 360 degrees around Y-axis.

The shape is assumed to be defined in the X>=0 half-plane

Generic lathe (360 degree)
Lathe with a specific angle

Constructor & Destructor Documentation

◆ Lathe()

Procedural::Lathe::Lathe ( Shape shapeToExtrude = 0,
unsigned int  numSeg = 16 
)

Contructor with arguments.

Member Function Documentation

◆ addPoint()

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

Builds the mesh into the given TriangleBuffer.

Parameters
bufferThe TriangleBuffer on where to append the mesh.
Exceptions
Ogre::InvalidStateExceptionEither shape or multishape must be defined!
Ogre::InvalidStateExceptionRequired parameter is zero!

Implements Procedural::MeshGenerator< Lathe >.

◆ buildTriangleBuffer()

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

Outputs a triangleBuffer.

◆ realizeMesh()

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

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

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

◆ setAngleBegin()

Lathe& Procedural::Lathe::setAngleBegin ( Ogre::Radian  angleBegin)

Sets the angle to begin lathe with (default=0) Automatically makes the lathe not closed.

◆ setAngleEnd()

Lathe& Procedural::Lathe::setAngleEnd ( Ogre::Radian  angleEnd)

Sets the angle to end lathe with (default=2PI) Automatically makes the lathe not closed.

◆ setCapped()

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

Sets whether the lathe is capped or not (default=true) Only makes sense if the lathe is not closed.

◆ setClosed()

Lathe& Procedural::Lathe::setClosed ( bool  closed)

Sets whether the lathe is closed or not.

◆ setEnableNormals()

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

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

◆ setMultiShapeToExtrude()

Lathe& Procedural::Lathe::setMultiShapeToExtrude ( MultiShape multiShapeToExtrude)

Sets the multiShape to extrude If a shape is already defined, auto-disables it The shapes in this multi-shape are assumed to be defined in the X>=0 half-plane.

◆ setNumSeg()

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

Sets the number of segments when rotating around the axis (default=16)

Exceptions
Ogre::InvalidParametersExceptionMinimum of numSeg is 1

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

◆ setNumTexCoordSet()

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

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

◆ setOrientation()

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

Sets an orientation to give when building the mesh.

◆ setPosition() [1/2]

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

Sets a translation baked into the resulting mesh.

◆ setPosition() [2/2]

Lathe & Procedural::MeshGenerator< Lathe >::setPosition ( Ogre::Real  x,
Ogre::Real  y,
Ogre::Real  z 
)
inherited

Sets a translation baked into the resulting mesh.

◆ setScale() [1/3]

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

Sets a scale baked into the resulting mesh.

◆ setScale() [2/3]

Lathe & Procedural::MeshGenerator< Lathe >::setScale ( Ogre::Real  scale)
inherited

Sets a uniform scale baked into the resulting mesh.

◆ setScale() [3/3]

Lathe & Procedural::MeshGenerator< Lathe >::setScale ( Ogre::Real  x,
Ogre::Real  y,
Ogre::Real  z 
)
inherited

Sets a scale baked into the resulting mesh.

◆ setShapeToExtrude()

Lathe& Procedural::Lathe::setShapeToExtrude ( Shape shapeToExtrude)

Sets the shape to extrude If a multishape is already defined, auto-disables it The shape is assumed to be defined in the X>=0 half-plane.

◆ setSwitchUV()

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

Sets whether to switch U and V texture coordinates.

◆ setTextureRectangle()

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

Sets the texture rectangle.

◆ setUTile()

Lathe & Procedural::MeshGenerator< Lathe >::setUTile ( Ogre::Real  uTile)
inherited

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

◆ setVTile()

Lathe & Procedural::MeshGenerator< Lathe >::setVTile ( Ogre::Real  vTile)
inherited

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

Member Data Documentation

◆ mEnableNormals

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

Whether to produces normals or not.

◆ mNumTexCoordSet

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

The number of texture coordinate sets to include.

◆ mOrientation

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

Orientation to apply the mesh.

◆ mPosition

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

Position to apply to the mesh.

◆ mScale

Ogre::Vector3 Procedural::MeshGenerator< Lathe >::mScale
protectedinherited

Scale to apply the mesh.

◆ mSwitchUV

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

◆ mUTile

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

A pointer to the default scene manager.

U tile for texture coords generation

◆ mUVOrigin

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

Rectangle in which the texture coordinates will be placed.

◆ mVTile

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

V tile for texture coords generation.


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