Ogre Procedural
0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
|
Builds a mesh by rotating a shape 360 degrees around Y-axis. More...
#include <ProceduralLathe.h>
Public Member Functions | |
Lathe (Shape *shapeToExtrude=0, unsigned int numSeg=16) | |
Contructor with arguments. More... | |
Lathe & | setNumSeg (unsigned int numSeg) |
Sets the number of segments when rotating around the axis (default=16) More... | |
Lathe & | setAngleBegin (Ogre::Radian angleBegin) |
Sets the angle to begin lathe with (default=0) Automatically makes the lathe not closed. More... | |
Lathe & | setAngleEnd (Ogre::Radian angleEnd) |
Sets the angle to end lathe with (default=2PI) Automatically makes the lathe not closed. More... | |
Lathe & | setClosed (bool closed) |
Sets whether the lathe is closed or not. More... | |
Lathe & | setCapped (bool capped) |
Sets whether the lathe is capped or not (default=true) Only makes sense if the lathe is not closed. More... | |
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. More... | |
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. 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... | |
Lathe & | setUTile (Ogre::Real uTile) |
Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1) More... | |
Lathe & | setVTile (Ogre::Real vTile) |
Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1) More... | |
Lathe & | setTextureRectangle (const Ogre::RealRect &textureRectangle) |
Sets the texture rectangle. More... | |
Lathe & | setEnableNormals (bool enableNormals) |
Sets whether normals are enabled or not (default=true) More... | |
Lathe & | setNumTexCoordSet (unsigned char numTexCoordSet) |
Sets the number of texture coordintate sets (default=1) More... | |
Lathe & | setSwitchUV (bool switchUV) |
Sets whether to switch U and V texture coordinates. More... | |
Lathe & | setOrientation (const Ogre::Quaternion &orientation) |
Sets an orientation to give when building the mesh. More... | |
Lathe & | setPosition (const Ogre::Vector3 &position) |
Sets a translation baked into the resulting mesh. More... | |
Lathe & | setPosition (Ogre::Real x, Ogre::Real y, Ogre::Real z) |
Sets a translation baked into the resulting mesh. More... | |
Lathe & | setScale (const Ogre::Vector3 &scale) |
Sets a scale baked into the resulting mesh. More... | |
Lathe & | setScale (Ogre::Real scale) |
Sets a uniform scale baked into the resulting mesh. More... | |
Lathe & | setScale (Ogre::Real x, Ogre::Real y, Ogre::Real z) |
Sets a scale baked into the resulting mesh. More... | |
Lathe & | resetTransforms () |
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 |
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
Procedural::Lathe::Lathe | ( | Shape * | shapeToExtrude = 0 , |
unsigned int | numSeg = 16 |
||
) |
Contructor with arguments.
|
protectedinherited |
Adds a new point to a triangle buffer, using the format defined for that MeshGenerator.
buffer | the triangle buffer to update |
position | the position of the new point |
normal | the normal of the new point |
uv | the uv texcoord of the new point |
|
virtual |
Builds the mesh into the given TriangleBuffer.
buffer | The TriangleBuffer on where to append the mesh. |
Ogre::InvalidStateException | Either shape or multishape must be defined! |
Ogre::InvalidStateException | Required parameter is zero! |
Implements Procedural::MeshGenerator< Lathe >.
|
inherited |
Outputs a triangleBuffer.
|
inherited |
Builds a mesh.
name | of the mesh for the MeshManager |
group | ressource group in which the mesh will be created |
|
inherited |
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values.
Lathe& Procedural::Lathe::setAngleBegin | ( | Ogre::Radian | angleBegin | ) |
Sets the angle to begin lathe with (default=0) Automatically makes the lathe not closed.
Lathe& Procedural::Lathe::setAngleEnd | ( | Ogre::Radian | angleEnd | ) |
Sets the angle to end lathe with (default=2PI) Automatically makes the lathe not closed.
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.
Lathe& Procedural::Lathe::setClosed | ( | bool | closed | ) |
Sets whether the lathe is closed or not.
|
inherited |
Sets whether normals are enabled or not (default=true)
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.
Lathe& Procedural::Lathe::setNumSeg | ( | unsigned int | numSeg | ) |
Sets the number of segments when rotating around the axis (default=16)
Ogre::InvalidParametersException | Minimum of numSeg is 1 |
References Ogre::Exception::ERR_INVALIDPARAMS, and OGRE_EXCEPT.
|
inherited |
Sets the number of texture coordintate sets (default=1)
|
inherited |
Sets an orientation to give when building the mesh.
|
inherited |
Sets a translation baked into the resulting mesh.
|
inherited |
Sets a translation baked into the resulting mesh.
|
inherited |
Sets a scale baked into the resulting mesh.
|
inherited |
Sets a uniform scale baked into the resulting mesh.
|
inherited |
Sets a scale baked into the resulting mesh.
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.
|
inherited |
Sets whether to switch U and V texture coordinates.
|
inherited |
Sets the texture rectangle.
|
inherited |
Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1)
|
inherited |
Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1)
|
protectedinherited |
Whether to produces normals or not.
|
protectedinherited |
The number of texture coordinate sets to include.
|
protectedinherited |
Orientation to apply the mesh.
|
protectedinherited |
Position to apply to the mesh.
|
protectedinherited |
Scale to apply the mesh.
|
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.
|
protectedinherited |
|
protectedinherited |
A pointer to the default scene manager.
U tile for texture coords generation
|
protectedinherited |
Rectangle in which the texture coordinates will be placed.
|
protectedinherited |
V tile for texture coords generation.