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

#include <OgreLodCollapser.h>

+ Collaboration diagram for Ogre::LodCollapser:

Classes

struct  CollapsedEdge
 

Public Member Functions

virtual ~LodCollapser ()
 
bool _getLastVertexCollapseTo (LodData *data, Vector3 &outVec)
 Returns the destination of the edge, which was last reduced. More...
 
bool _getLastVertexPos (LodData *data, Vector3 &outVec)
 Returns the last reduced vertex. More...
 
virtual void collapse (LodData *data, LodCollapseCost *cost, LodOutputProvider *output, int vertexCountLimit, Real collapseCostLimit)
 Reduces vertices until vertexCountLimit or collapseCostLimit is reached. More...
 

Protected Types

typedef vector< CollapsedEdge >
::type 
CollapsedEdges
 

Protected Member Functions

void assertOutdatedCollapseCost (LodData *data, LodCollapseCost *cost, LodData::Vertex *vertex)
 
void assertValidMesh (LodData *data)
 
void assertValidVertex (LodData *data, LodData::Vertex *v)
 
void collapseVertex (LodData *data, LodCollapseCost *cost, LodOutputProvider *output, LodData::Vertex *src)
 Collapses a single vertex. More...
 
size_t findDstID (unsigned int srcID, unsigned short submeshID)
 
bool hasSrcID (unsigned int srcID, unsigned short submeshID)
 
void removeTriangleFromEdges (LodData::Triangle *triangle, LodData::Vertex *skip)
 
void replaceVertexID (LodData::Triangle *triangle, unsigned int oldID, unsigned int newID, LodData::Vertex *dst)
 

Protected Attributes

LodData::VertexmLastReducedVertex
 Last reduced vertex. Can be used for debugging purposes. For example the Mesh Lod Editor uses it to select edge. More...
 
CollapsedEdges tmpCollapsedEdges
 tmp variable, to overcome allocation on every collapse. More...
 

Detailed Description

Definition at line 39 of file OgreLodCollapser.h.

Member Typedef Documentation

Definition at line 74 of file OgreLodCollapser.h.

Constructor & Destructor Documentation

virtual Ogre::LodCollapser::~LodCollapser ( )
inlinevirtual

Definition at line 42 of file OgreLodCollapser.h.

Member Function Documentation

bool Ogre::LodCollapser::_getLastVertexCollapseTo ( LodData data,
Vector3 outVec 
)

Returns the destination of the edge, which was last reduced.

You should call this function after generateLodLevels!

Parameters
dataThis parameter is not used, but this will guarantee that data is alive.
outVecThe vector receiving the CollapseTo position.
Returns
Whether the outVec was changed. If the mesh is reduced at least 1 vertex, then it returns true.
bool Ogre::LodCollapser::_getLastVertexPos ( LodData data,
Vector3 outVec 
)

Returns the last reduced vertex.

You should call this function after generateLodLevels!

Parameters
dataThis parameter is not used, but this will guarantee that data is alive.
outVecThe vector receiving the position of the vertex.
Returns
Whether the outVec was changed. If the mesh is reduced at least 1 vertex, then it returns true.
void Ogre::LodCollapser::assertOutdatedCollapseCost ( LodData data,
LodCollapseCost cost,
LodData::Vertex vertex 
)
protected
void Ogre::LodCollapser::assertValidMesh ( LodData data)
protected
void Ogre::LodCollapser::assertValidVertex ( LodData data,
LodData::Vertex v 
)
protected
virtual void Ogre::LodCollapser::collapse ( LodData data,
LodCollapseCost cost,
LodOutputProvider output,
int  vertexCountLimit,
Real  collapseCostLimit 
)
virtual

Reduces vertices until vertexCountLimit or collapseCostLimit is reached.

void Ogre::LodCollapser::collapseVertex ( LodData data,
LodCollapseCost cost,
LodOutputProvider output,
LodData::Vertex src 
)
protected

Collapses a single vertex.

size_t Ogre::LodCollapser::findDstID ( unsigned int  srcID,
unsigned short  submeshID 
)
protected
bool Ogre::LodCollapser::hasSrcID ( unsigned int  srcID,
unsigned short  submeshID 
)
protected
void Ogre::LodCollapser::removeTriangleFromEdges ( LodData::Triangle triangle,
LodData::Vertex skip 
)
protected
void Ogre::LodCollapser::replaceVertexID ( LodData::Triangle triangle,
unsigned int  oldID,
unsigned int  newID,
LodData::Vertex dst 
)
protected

Member Data Documentation

LodData::Vertex* Ogre::LodCollapser::mLastReducedVertex
protected

Last reduced vertex. Can be used for debugging purposes. For example the Mesh Lod Editor uses it to select edge.

Definition at line 80 of file OgreLodCollapser.h.

CollapsedEdges Ogre::LodCollapser::tmpCollapsedEdges
protected

tmp variable, to overcome allocation on every collapse.

Definition at line 77 of file OgreLodCollapser.h.


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