This class reduces the complexity of the geometry it is given. More...
#include <OgreProgressiveMesh.h>
Classes | |
class | PMFaceVertex |
A vertex as used by a face. More... | |
class | PMTriangle |
A triangle in the progressive mesh, holds extra info like face normal. More... | |
class | PMVertex |
A vertex in the progressive mesh, holds info like collapse cost etc. More... | |
struct | PMWorkingData |
Data used to calculate the collapse costs. More... | |
Public Types | |
typedef vector< IndexData * >::type | LODFaceList |
enum | VertexReductionQuota { VRQ_CONSTANT, VRQ_PROPORTIONAL } |
The way to derive the quota of vertices which are reduced at each LOD. More... | |
Public Member Functions | |
ProgressiveMesh (const VertexData *vertexData, const IndexData *indexData) | |
Constructor, takes the geometry data and index buffer. More... | |
virtual | ~ProgressiveMesh () |
virtual void | addExtraVertexPositionBuffer (const VertexData *vertexData) |
Adds an extra vertex position buffer. More... | |
virtual void | build (ushort numLevels, LODFaceList *outList, VertexReductionQuota quota=VRQ_PROPORTIONAL, Real reductionValue=0.5f) |
Builds the progressive mesh with the specified number of levels. 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) |
Protected Types | |
typedef vector< PMVertex >::type | CommonVertexList |
typedef vector< PMFaceVertex > ::type | FaceVertexList |
typedef vector< PMTriangle >::type | TriangleList |
typedef vector< PMWorkingData > ::type | WorkingDataList |
typedef vector< Real >::type | WorstCostList |
Protected Member Functions | |
void | addWorkingData (const VertexData *vertexData, const IndexData *indexData) |
Internal method for building PMWorkingData from geometry data. More... | |
void | bakeNewLOD (IndexData *pData) |
Internal method builds an new LOD based on the current state. More... | |
void | collapse (PMVertex *collapser) |
Internal method, collapses vertex onto it's saved collapse target. More... | |
void | computeAllCosts (void) |
Internal method to compute edge collapse costs for all buffers /. More... | |
Real | computeEdgeCollapseCost (PMVertex *src, PMVertex *dest) |
Internal calculation method for deriving a collapse cost from u to v. More... | |
void | computeEdgeCostAtVertex (size_t vertIndex) |
Internal method evaluates all collapse costs from this vertex for every buffer and returns the worst. More... | |
Real | computeEdgeCostAtVertexForBuffer (WorkingDataList::iterator idata, size_t vertIndex) |
Internal method evaluates all collapse costs from this vertex and picks the lowest for a single buffer. More... | |
void | dumpContents (const String &log) |
Internal debugging method. More... | |
size_t | getNextCollapser (void) |
Internal method for getting the index of next best vertex to collapse. More... | |
void | initialiseEdgeCollapseCosts (void) |
Internal method for initialising the edge collapse costs. More... | |
Protected Attributes | |
size_t | mCurrNumIndexes |
size_t | mNumCommonVertices |
const IndexData * | mpIndexData |
const VertexData * | mpVertexData |
WorkingDataList | mWorkingData |
Multiple copies, 1 per vertex buffer. More... | |
WorstCostList | mWorstCosts |
The worst collapse cost from all vertex buffers for each vertex. More... | |
This class reduces the complexity of the geometry it is given.
This class is dedicated to reducing the number of triangles in a given mesh taking into account seams in both geometry and texture co-ordinates and meshes which have multiple frames.
Definition at line 64 of file OgreProgressiveMesh.h.
|
protected |
Definition at line 192 of file OgreProgressiveMesh.h.
|
protected |
Definition at line 191 of file OgreProgressiveMesh.h.
typedef vector<IndexData*>::type Ogre::ProgressiveMesh::LODFaceList |
Definition at line 77 of file OgreProgressiveMesh.h.
|
protected |
Definition at line 190 of file OgreProgressiveMesh.h.
|
protected |
Definition at line 203 of file OgreProgressiveMesh.h.
|
protected |
Definition at line 193 of file OgreProgressiveMesh.h.
The way to derive the quota of vertices which are reduced at each LOD.
Enumerator | |
---|---|
VRQ_CONSTANT |
A set number of vertices are removed at each reduction. |
VRQ_PROPORTIONAL |
A proportion of the remaining number of vertices are removed at each reduction. |
Definition at line 69 of file OgreProgressiveMesh.h.
Ogre::ProgressiveMesh::ProgressiveMesh | ( | const VertexData * | vertexData, |
const IndexData * | indexData | ||
) |
Constructor, takes the geometry data and index buffer.
|
virtual |
|
virtual |
Adds an extra vertex position buffer.
buffer | Pointer to x/y/z buffer with vertex positions. The number of vertices must be the same as in the original GeometryData passed to the constructor. |
|
protected |
Internal method for building PMWorkingData from geometry data.
|
protected |
Internal method builds an new LOD based on the current state.
|
virtual |
Builds the progressive mesh with the specified number of levels.
numLevels | The number of levels to include in the output excluding the full detail version. |
outList | Pointer to a list of LOD geometry data which will be completed by the application. Each entry is a reduced form of the mesh, in decreasing order of detail. |
quota | The way to derive the number of vertices removed at each LOD |
reductionValue | Either the proportion of vertices to remove at each level, or a fixed number of vertices to remove at each level, depending on the value of quota |
|
protected |
Internal method, collapses vertex onto it's saved collapse target.
|
protected |
Internal method to compute edge collapse costs for all buffers /.
Internal calculation method for deriving a collapse cost from u to v.
|
protected |
Internal method evaluates all collapse costs from this vertex for every buffer and returns the worst.
|
protected |
Internal method evaluates all collapse costs from this vertex and picks the lowest for a single buffer.
|
protected |
Internal debugging method.
|
protected |
Internal method for getting the index of next best vertex to collapse.
|
protected |
Internal method for initialising the edge collapse costs.
|
inlineinherited |
Definition at line 95 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 101 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 107 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 112 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 118 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
operator new, with debug line info
Definition at line 67 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 72 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
placement operator new
Definition at line 78 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
array operator new, with debug line info
Definition at line 85 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 90 of file OgreMemoryAllocatedObject.h.
|
protected |
Definition at line 121 of file OgreProgressiveMesh.h.
|
protected |
Definition at line 122 of file OgreProgressiveMesh.h.
|
protected |
Definition at line 119 of file OgreProgressiveMesh.h.
|
protected |
Definition at line 118 of file OgreProgressiveMesh.h.
|
protected |
Multiple copies, 1 per vertex buffer.
Definition at line 205 of file OgreProgressiveMesh.h.
|
protected |
The worst collapse cost from all vertex buffers for each vertex.
Definition at line 208 of file OgreProgressiveMesh.h.