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

Extrudes a 2D shape along a path to build an extruded mesh. More...

#include <ProceduralExtruder.h>

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

Public Types

typedef std::map< unsigned int, const Track * > TrackMap
 

Public Member Functions

 Extruder ()
 Default constructor. More...
 
void addToTriangleBuffer (TriangleBuffer &buffer) const
 Builds the mesh into the given TriangleBuffer. More...
 
ExtrudersetShapeToExtrude (const Shape *shapeToExtrude)
 Sets the shape to extrude. More...
 
ExtrudersetMultiShapeToExtrude (const MultiShape *multiShapeToExtrude)
 Sets the multishape to extrude. More...
 
ExtrudersetExtrusionPath (const Path *extrusionPath)
 Sets the extrusion path. More...
 
ExtrudersetExtrusionPath (const MultiPath *multiExtrusionPath)
 Sets the extrusion multipath. More...
 
ExtrudersetRotationTrack (const Track *rotationTrack, unsigned int index=0)
 Sets the rotation track (optional) More...
 
ExtrudersetScaleTrack (const Track *scaleTrack, unsigned int index=0)
 Sets the scale track (optional) More...
 
ExtrudersetShapeTextureTrack (const Track *shapeTextureTrack, unsigned int index=0)
 Sets the track that maps shape points to V texture coords (optional). More...
 
ExtrudersetPathTextureTrack (const Track *pathTextureTrack, unsigned int index=0)
 Sets the track that maps path points to V texture coord (optional). More...
 
ExtrudersetCapped (bool capped)
 Sets whether caps are added to the extremities or not (not closed paths only) More...
 
Ogre::MeshPtr realizeMesh (const std::string &name="", const Ogre::String &group="General")
 Builds a mesh. More...
 
TriangleBuffer buildTriangleBuffer () const
 Outputs a triangleBuffer. More...
 
ExtrudersetUTile (Ogre::Real uTile)
 Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1) More...
 
ExtrudersetVTile (Ogre::Real vTile)
 Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1) More...
 
ExtrudersetTextureRectangle (const Ogre::RealRect &textureRectangle)
 Sets the texture rectangle. More...
 
ExtrudersetEnableNormals (bool enableNormals)
 Sets whether normals are enabled or not (default=true) More...
 
ExtrudersetNumTexCoordSet (unsigned char numTexCoordSet)
 Sets the number of texture coordintate sets (default=1) More...
 
ExtrudersetSwitchUV (bool switchUV)
 Sets whether to switch U and V texture coordinates. More...
 
ExtrudersetOrientation (const Ogre::Quaternion &orientation)
 Sets an orientation to give when building the mesh. More...
 
ExtrudersetPosition (const Ogre::Vector3 &position)
 Sets a translation baked into the resulting mesh. More...
 
ExtrudersetPosition (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a translation baked into the resulting mesh. More...
 
ExtrudersetScale (const Ogre::Vector3 &scale)
 Sets a scale baked into the resulting mesh. More...
 
ExtrudersetScale (Ogre::Real scale)
 Sets a uniform scale baked into the resulting mesh. More...
 
ExtrudersetScale (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a scale baked into the resulting mesh. More...
 
ExtruderresetTransforms ()
 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

Extrudes a 2D shape along a path to build an extruded mesh.

Can be used to build things such as pipelines, roads...

Generic extrusion
Extrusion with rotation track
Extrusion with scale track
Extrusion with texture track
Multishape extrusion
 
Note
Concerning UV texCoords, U is along the path and V along the shape.

Member Typedef Documentation

◆ TrackMap

typedef std::map<unsigned int, const Track*> Procedural::Extruder::TrackMap

Constructor & Destructor Documentation

◆ Extruder()

Procedural::Extruder::Extruder ( )

Default constructor.

Member Function Documentation

◆ addPoint()

void Procedural::MeshGenerator< Extruder >::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::Extruder::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< Extruder >.

◆ buildTriangleBuffer()

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

Outputs a triangleBuffer.

◆ realizeMesh()

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

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

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

◆ setCapped()

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

Sets whether caps are added to the extremities or not (not closed paths only)

◆ setEnableNormals()

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

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

◆ setExtrusionPath() [1/2]

Extruder& Procedural::Extruder::setExtrusionPath ( const MultiPath multiExtrusionPath)

◆ setExtrusionPath() [2/2]

Extruder& Procedural::Extruder::setExtrusionPath ( const Path extrusionPath)

◆ setMultiShapeToExtrude()

Extruder& Procedural::Extruder::setMultiShapeToExtrude ( const MultiShape multiShapeToExtrude)

Sets the multishape to extrude.

Mutually exclusive with setShapeToExtrude.

References Procedural::MultiShape::addMultiShape(), and Procedural::MultiShape::clear().

◆ setNumTexCoordSet()

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

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

◆ setOrientation()

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

Sets an orientation to give when building the mesh.

◆ setPathTextureTrack()

Extruder& Procedural::Extruder::setPathTextureTrack ( const Track pathTextureTrack,
unsigned int  index = 0 
)

Sets the track that maps path points to V texture coord (optional).

◆ setPosition() [1/2]

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

Sets a translation baked into the resulting mesh.

◆ setPosition() [2/2]

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

Sets a translation baked into the resulting mesh.

◆ setRotationTrack()

Extruder& Procedural::Extruder::setRotationTrack ( const Track rotationTrack,
unsigned int  index = 0 
)

Sets the rotation track (optional)

◆ setScale() [1/3]

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

Sets a scale baked into the resulting mesh.

◆ setScale() [2/3]

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

Sets a uniform scale baked into the resulting mesh.

◆ setScale() [3/3]

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

Sets a scale baked into the resulting mesh.

◆ setScaleTrack()

Extruder& Procedural::Extruder::setScaleTrack ( const Track scaleTrack,
unsigned int  index = 0 
)

Sets the scale track (optional)

◆ setShapeTextureTrack()

Extruder& Procedural::Extruder::setShapeTextureTrack ( const Track shapeTextureTrack,
unsigned int  index = 0 
)

Sets the track that maps shape points to V texture coords (optional).

Warning : if used with multishape, all shapes will have the same track.

◆ setShapeToExtrude()

Extruder& Procedural::Extruder::setShapeToExtrude ( const Shape shapeToExtrude)

Sets the shape to extrude.

Mutually exclusive with setMultiShapeToExtrude.

References Procedural::MultiShape::addShape(), and Procedural::MultiShape::clear().

◆ setSwitchUV()

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

Sets whether to switch U and V texture coordinates.

◆ setTextureRectangle()

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

Sets the texture rectangle.

◆ setUTile()

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

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

◆ setVTile()

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

Whether to produces normals or not.

◆ mNumTexCoordSet

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

The number of texture coordinate sets to include.

◆ mOrientation

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

Orientation to apply the mesh.

◆ mPosition

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

Position to apply to the mesh.

◆ mScale

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

Scale to apply the mesh.

◆ mSwitchUV

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

◆ mUTile

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

A pointer to the default scene manager.

U tile for texture coords generation

◆ mUVOrigin

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

Rectangle in which the texture coordinates will be placed.

◆ mVTile

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

V tile for texture coords generation.


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