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

#include <ProceduralSphereGenerator.h>

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

Public Member Functions

 SphereGenerator (Ogre::Real radius=1.f, unsigned int numRings=16, unsigned int numSegments=16)
 Constructor with arguments. More...
 
SphereGeneratorsetRadius (Ogre::Real radius)
 Sets the radius of the sphere (default=1) More...
 
SphereGeneratorsetNumRings (unsigned int numRings)
 Sets the number of rings (default=16) More...
 
SphereGeneratorsetNumSegments (unsigned int numSegments)
 Sets the number of segments (default=16) 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...
 
SphereGeneratorsetUTile (Ogre::Real uTile)
 Sets U Tile, ie the number by which u texture coordinates are multiplied (default=1) More...
 
SphereGeneratorsetVTile (Ogre::Real vTile)
 Sets V Tile, ie the number by which v texture coordinates are multiplied (default=1) More...
 
SphereGeneratorsetTextureRectangle (const Ogre::RealRect &textureRectangle)
 Sets the texture rectangle. More...
 
SphereGeneratorsetEnableNormals (bool enableNormals)
 Sets whether normals are enabled or not (default=true) More...
 
SphereGeneratorsetNumTexCoordSet (unsigned char numTexCoordSet)
 Sets the number of texture coordintate sets (default=1) More...
 
SphereGeneratorsetSwitchUV (bool switchUV)
 Sets whether to switch U and V texture coordinates. More...
 
SphereGeneratorsetOrientation (const Ogre::Quaternion &orientation)
 Sets an orientation to give when building the mesh. More...
 
SphereGeneratorsetPosition (const Ogre::Vector3 &position)
 Sets a translation baked into the resulting mesh. More...
 
SphereGeneratorsetPosition (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a translation baked into the resulting mesh. More...
 
SphereGeneratorsetScale (const Ogre::Vector3 &scale)
 Sets a scale baked into the resulting mesh. More...
 
SphereGeneratorsetScale (Ogre::Real scale)
 Sets a uniform scale baked into the resulting mesh. More...
 
SphereGeneratorsetScale (Ogre::Real x, Ogre::Real y, Ogre::Real z)
 Sets a scale baked into the resulting mesh. More...
 
SphereGeneratorresetTransforms ()
 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 an UV sphere mesh

Constructor & Destructor Documentation

◆ SphereGenerator()

Procedural::SphereGenerator::SphereGenerator ( Ogre::Real  radius = 1.f,
unsigned int  numRings = 16,
unsigned int  numSegments = 16 
)

Constructor with arguments.

Member Function Documentation

◆ addPoint()

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

Builds the mesh into the given TriangleBuffer.

Parameters
bufferThe TriangleBuffer on where to append the mesh.

Implements Procedural::MeshGenerator< SphereGenerator >.

◆ buildTriangleBuffer()

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

Outputs a triangleBuffer.

◆ realizeMesh()

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

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

◆ setEnableNormals()

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

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

◆ setNumRings()

SphereGenerator& Procedural::SphereGenerator::setNumRings ( unsigned int  numRings)

Sets the number of rings (default=16)

Exceptions
Ogre::InvalidParametersExceptionMinimum of numRings is 1

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

◆ setNumSegments()

SphereGenerator& Procedural::SphereGenerator::setNumSegments ( unsigned int  numSegments)

Sets the number of segments (default=16)

Exceptions
Ogre::InvalidParametersExceptionMinimum of numSegments is 1

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

◆ setNumTexCoordSet()

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

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

◆ setOrientation()

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

Sets an orientation to give when building the mesh.

◆ setPosition() [1/2]

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

◆ setRadius()

SphereGenerator& Procedural::SphereGenerator::setRadius ( Ogre::Real  radius)

Sets the radius of the sphere (default=1)

Exceptions
Ogre::InvalidParametersExceptionRadius must be larger than 0!

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

◆ setScale() [1/3]

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

◆ setSwitchUV()

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

Sets whether to switch U and V texture coordinates.

◆ setTextureRectangle()

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

Whether to produces normals or not.

◆ mNumTexCoordSet

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

The number of texture coordinate sets to include.

◆ mOrientation

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

Orientation to apply the mesh.

◆ mPosition

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

Position to apply to the mesh.

◆ mScale

Scale to apply the mesh.

◆ mSwitchUV

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

◆ mUTile

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

A pointer to the default scene manager.

U tile for texture coords generation

◆ mUVOrigin

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

Rectangle in which the texture coordinates will be placed.

◆ mVTile

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

V tile for texture coords generation.


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