Ogre Procedural
0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
|
#include <ProceduralMeshGenerator.h>
Public Member Functions | |
MeshGenerator () | |
Default constructor. More... | |
Ogre::MeshPtr | realizeMesh (const std::string &name="", const Ogre::String &group="General") |
Builds a mesh. More... | |
TriangleBuffer | buildTriangleBuffer () const |
Outputs a triangleBuffer. More... | |
virtual void | addToTriangleBuffer (TriangleBuffer &buffer) const =0 |
Overloaded by each generator to implement the specifics. More... | |
T & | setUTile (Ogre::Real uTile) |
Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1) More... | |
T & | setVTile (Ogre::Real vTile) |
Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1) More... | |
T & | setTextureRectangle (const Ogre::RealRect &textureRectangle) |
Sets the texture rectangle. More... | |
T & | setEnableNormals (bool enableNormals) |
Sets whether normals are enabled or not (default=true) More... | |
T & | setNumTexCoordSet (unsigned char numTexCoordSet) |
Sets the number of texture coordintate sets (default=1) More... | |
T & | setSwitchUV (bool switchUV) |
Sets whether to switch U and V texture coordinates. More... | |
T & | setOrientation (const Ogre::Quaternion &orientation) |
Sets an orientation to give when building the mesh. More... | |
T & | setPosition (const Ogre::Vector3 &position) |
Sets a translation baked into the resulting mesh. More... | |
T & | setPosition (Ogre::Real x, Ogre::Real y, Ogre::Real z) |
Sets a translation baked into the resulting mesh. More... | |
T & | setScale (const Ogre::Vector3 &scale) |
Sets a scale baked into the resulting mesh. More... | |
T & | setScale (Ogre::Real scale) |
Sets a uniform scale baked into the resulting mesh. More... | |
T & | setScale (Ogre::Real x, Ogre::Real y, Ogre::Real z) |
Sets a scale baked into the resulting mesh. More... | |
T & | 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 |
Superclass of everything that builds meshes
Procedural::MeshGenerator< T >::MeshGenerator | ( | ) |
Default constructor.
Ogre::InvalidStateException | Scene Manager is not set in OGRE root object |
|
protected |
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 |
|
pure virtual |
Overloaded by each generator to implement the specifics.
Implemented in Procedural::Triangulator, Procedural::SpringGenerator, Procedural::RoundedBoxGenerator, Procedural::BoxGenerator, Procedural::Lathe, Procedural::PrismGenerator, Procedural::SphereGenerator, Procedural::Extruder, Procedural::Boolean, Procedural::CapsuleGenerator, Procedural::CylinderGenerator, Procedural::TorusKnotGenerator, Procedural::TubeGenerator, Procedural::PlaneGenerator, Procedural::ConeGenerator, Procedural::TorusGenerator, and Procedural::IcoSphereGenerator.
Referenced by Procedural::MeshGenerator< TorusGenerator >::buildTriangleBuffer(), and Procedural::MeshGenerator< TorusGenerator >::realizeMesh().
TriangleBuffer Procedural::MeshGenerator< T >::buildTriangleBuffer | ( | ) | const |
Outputs a triangleBuffer.
Ogre::MeshPtr Procedural::MeshGenerator< T >::realizeMesh | ( | const std::string & | name = "" , |
const Ogre::String & | group = "General" |
||
) |
Builds a mesh.
name | of the mesh for the MeshManager |
group | ressource group in which the mesh will be created |
T& Procedural::MeshGenerator< T >::resetTransforms | ( | ) |
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values.
T& Procedural::MeshGenerator< T >::setEnableNormals | ( | bool | enableNormals | ) |
Sets whether normals are enabled or not (default=true)
T& Procedural::MeshGenerator< T >::setNumTexCoordSet | ( | unsigned char | numTexCoordSet | ) |
Sets the number of texture coordintate sets (default=1)
T& Procedural::MeshGenerator< T >::setOrientation | ( | const Ogre::Quaternion & | orientation | ) |
Sets an orientation to give when building the mesh.
T& Procedural::MeshGenerator< T >::setPosition | ( | const Ogre::Vector3 & | position | ) |
Sets a translation baked into the resulting mesh.
T& Procedural::MeshGenerator< T >::setPosition | ( | Ogre::Real | x, |
Ogre::Real | y, | ||
Ogre::Real | z | ||
) |
Sets a translation baked into the resulting mesh.
T& Procedural::MeshGenerator< T >::setScale | ( | const Ogre::Vector3 & | scale | ) |
Sets a scale baked into the resulting mesh.
T& Procedural::MeshGenerator< T >::setScale | ( | Ogre::Real | scale | ) |
Sets a uniform scale baked into the resulting mesh.
T& Procedural::MeshGenerator< T >::setScale | ( | Ogre::Real | x, |
Ogre::Real | y, | ||
Ogre::Real | z | ||
) |
Sets a scale baked into the resulting mesh.
T& Procedural::MeshGenerator< T >::setSwitchUV | ( | bool | switchUV | ) |
Sets whether to switch U and V texture coordinates.
T& Procedural::MeshGenerator< T >::setTextureRectangle | ( | const Ogre::RealRect & | textureRectangle | ) |
Sets the texture rectangle.
T& Procedural::MeshGenerator< T >::setUTile | ( | Ogre::Real | uTile | ) |
Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1)
T& Procedural::MeshGenerator< T >::setVTile | ( | Ogre::Real | vTile | ) |
Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1)
|
protected |
Whether to produces normals or not.
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), and Procedural::MeshGenerator< TorusGenerator >::setEnableNormals().
|
protected |
The number of texture coordinate sets to include.
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), and Procedural::MeshGenerator< TorusGenerator >::setNumTexCoordSet().
|
protected |
Orientation to apply the mesh.
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), Procedural::MeshGenerator< TorusGenerator >::resetTransforms(), and Procedural::MeshGenerator< TorusGenerator >::setOrientation().
|
protected |
Position to apply to the mesh.
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), Procedural::MeshGenerator< TorusGenerator >::resetTransforms(), and Procedural::MeshGenerator< TorusGenerator >::setPosition().
|
protected |
Scale to apply the mesh.
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), Procedural::MeshGenerator< TorusGenerator >::resetTransforms(), and Procedural::MeshGenerator< TorusGenerator >::setScale().
|
protected |
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.
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), and Procedural::MeshGenerator< TorusGenerator >::setSwitchUV().
|
protected |
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), Procedural::MeshGenerator< TorusGenerator >::resetTransforms(), Procedural::MeshGenerator< TorusGenerator >::setOrientation(), Procedural::MeshGenerator< TorusGenerator >::setPosition(), and Procedural::MeshGenerator< TorusGenerator >::setScale().
|
protected |
A pointer to the default scene manager.
U tile for texture coords generation
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), Procedural::MeshGenerator< TorusGenerator >::setTextureRectangle(), and Procedural::MeshGenerator< TorusGenerator >::setUTile().
|
protected |
Rectangle in which the texture coordinates will be placed.
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), and Procedural::MeshGenerator< TorusGenerator >::setTextureRectangle().
|
protected |
V tile for texture coords generation.
Referenced by Procedural::MeshGenerator< TorusGenerator >::addPoint(), Procedural::MeshGenerator< TorusGenerator >::setTextureRectangle(), and Procedural::MeshGenerator< TorusGenerator >::setVTile().