OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::Volume::MeshBuilder Class Reference

Class to build up a mesh with vertices and indices. More...

#include <OgreVolumeMeshBuilder.h>

+ Inheritance diagram for Ogre::Volume::MeshBuilder:
+ Collaboration diagram for Ogre::Volume::MeshBuilder:

Public Member Functions

 MeshBuilder (void)
 Constructor. More...
 
void addTriangle (const Vector3 &v0, const Vector3 &n0, const Vector3 &v1, const Vector3 &n1, const Vector3 &v2, const Vector3 &n2)
 Adds a triangle to the mesh with reusing already existent vertices via their index. More...
 
void executeCallback (MeshBuilderCallback *callback, const SimpleRenderable *simpleRenderable, size_t level, int inProcess) const
 Executes a MeshBuilderCallback on this instance. More...
 
size_t generateBuffers (RenderOperation &operation)
 Generates the vertex- and indexbuffer of this mesh on the given RenderOperation. More...
 
EntitygenerateWithManualObject (SceneManager *sceneManager, const String &name, const String &material)
 Generates an entity via a ManualObject. More...
 
AxisAlignedBox getBoundingBox (void)
 Gets the bounding box of the mesh. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 

Static Public Member Functions

static void addCubeToManualObject (ManualObject *manual, const Vector3 &c0, const Vector3 &c1, const Vector3 &c2, const Vector3 &c3, const Vector3 &c4, const Vector3 &c5, const Vector3 &c6, const Vector3 &c7, uint32 &baseIndex)
 Adds a cube to a manual object rendering lines. More...
 

Protected Types

typedef map< Vertex, size_t >::type UMapVertexIndex
 Map to get a vertex index. More...
 

Protected Member Functions

void addVertex (const Vertex &v)
 Adds a vertex to the data structure, reusing the index if it is already known. More...
 

Protected Attributes

AxisAlignedBox mBox
 Holds the bounding box. More...
 
bool mBoxInit
 Holds whether the initial bounding box has been set. More...
 
UMapVertexIndex mIndexMap
 
VecIndices mIndices
 Holds the indices of the mesh. More...
 
VecVertex mVertices
 Holds the vertices of the mesh. More...
 

Static Protected Attributes

static const unsigned short MAIN_BINDING
 The buffer binding. More...
 

Detailed Description

Class to build up a mesh with vertices and indices.

Definition at line 129 of file OgreVolumeMeshBuilder.h.

Member Typedef Documentation

typedef map<Vertex, size_t>::type Ogre::Volume::MeshBuilder::UMapVertexIndex
protected

Map to get a vertex index.

Definition at line 137 of file OgreVolumeMeshBuilder.h.

Constructor & Destructor Documentation

Ogre::Volume::MeshBuilder::MeshBuilder ( void  )

Constructor.

Member Function Documentation

static void Ogre::Volume::MeshBuilder::addCubeToManualObject ( ManualObject manual,
const Vector3 c0,
const Vector3 c1,
const Vector3 c2,
const Vector3 c3,
const Vector3 c4,
const Vector3 c5,
const Vector3 c6,
const Vector3 c7,
uint32 baseIndex 
)
inlinestatic

Adds a cube to a manual object rendering lines.

Corner numeration: 4 5 7 6 0 1 3 2

Parameters
manualThe manual for the cube lines.
c0The corner 0.
c1The corner 1.
c2The corner 2.
c3The corner 3.
c4The corner 4.
c5The corner 5.
c6The corner 6.
c7The corner 7.
baseIndexThe next free index of this manual object. Is incremented by 8 in this function.

Definition at line 235 of file OgreVolumeMeshBuilder.h.

References Ogre::ManualObject::index(), and Ogre::ManualObject::position().

void Ogre::Volume::MeshBuilder::addTriangle ( const Vector3 v0,
const Vector3 n0,
const Vector3 v1,
const Vector3 n1,
const Vector3 v2,
const Vector3 n2 
)
inline

Adds a triangle to the mesh with reusing already existent vertices via their index.

Parameters
v0The first vertex of the triangle.
n0The normal of the first vertex.
v1The second vertex of the triangle.
n1The normal of the second vertex.
v2The third vertex of the triangle.
n2The normal of the third vertex.

Definition at line 292 of file OgreVolumeMeshBuilder.h.

void Ogre::Volume::MeshBuilder::addVertex ( const Vertex v)
inlineprotected

Adds a vertex to the data structure, reusing the index if it is already known.

Parameters
vThe vertex.

Definition at line 156 of file OgreVolumeMeshBuilder.h.

References Ogre::Volume::Vertex::x, Ogre::Volume::Vertex::y, and Ogre::Volume::Vertex::z.

void Ogre::Volume::MeshBuilder::executeCallback ( MeshBuilderCallback callback,
const SimpleRenderable simpleRenderable,
size_t  level,
int  inProcess 
) const

Executes a MeshBuilderCallback on this instance.

Parameters
callbackThe callback to execute.
simpleRenderableContains the SimpleRenderable for which the triangles were built.
levelThe LOD level of this mesh.
inProcessThe amount of other meshes/LOD-Chunks still to be loaded.
size_t Ogre::Volume::MeshBuilder::generateBuffers ( RenderOperation operation)

Generates the vertex- and indexbuffer of this mesh on the given RenderOperation.

Parameters
operationThe RenderOperation for the buffers.
Returns
The amount of generated triangles.
Entity* Ogre::Volume::MeshBuilder::generateWithManualObject ( SceneManager sceneManager,
const String name,
const String material 
)

Generates an entity via a ManualObject.

Parameters
sceneManagerThe creating sceneManager.
nameThe name for the entity.
materialThe material to use.
Returns
The created entity.
AxisAlignedBox Ogre::Volume::MeshBuilder::getBoundingBox ( void  )

Gets the bounding box of the mesh.

Returns
The bounding box.
template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

Member Data Documentation

const unsigned short Ogre::Volume::MeshBuilder::MAIN_BINDING
staticprotected

The buffer binding.

Definition at line 134 of file OgreVolumeMeshBuilder.h.

AxisAlignedBox Ogre::Volume::MeshBuilder::mBox
protected

Holds the bounding box.

Definition at line 147 of file OgreVolumeMeshBuilder.h.

bool Ogre::Volume::MeshBuilder::mBoxInit
protected

Holds whether the initial bounding box has been set.

Definition at line 150 of file OgreVolumeMeshBuilder.h.

UMapVertexIndex Ogre::Volume::MeshBuilder::mIndexMap
protected

Definition at line 138 of file OgreVolumeMeshBuilder.h.

VecIndices Ogre::Volume::MeshBuilder::mIndices
protected

Holds the indices of the mesh.

Definition at line 144 of file OgreVolumeMeshBuilder.h.

VecVertex Ogre::Volume::MeshBuilder::mVertices
protected

Holds the vertices of the mesh.

Definition at line 141 of file OgreVolumeMeshBuilder.h.


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