29 #ifndef __ProgressiveMeshGenerator_H_ 30 #define __ProgressiveMeshGenerator_H_ 50 virtual void generateLodLevels(
LodConfig& lodConfig) = 0;
57 virtual void generateAutoconfiguredLodLevels(
MeshPtr& mesh);
82 void generateLodLevels(
LodConfig& lodConfig);
90 template<
typename T,
unsigned S>
95 void addNotExists(
const T& item);
96 void remove(iterator it);
97 iterator add(
const T& item);
98 void removeExists(
const T& item);
99 bool remove(
const T& item);
100 void replaceExists(
const T& oldItem,
const T& newItem);
101 bool has(
const T& item);
102 iterator find(
const T& item);
103 iterator findExists(
const T& item);
111 struct PMCollapseCostLess;
133 size_t operator() (
const PMVertex* v)
const;
169 unsigned int vertexID[3];
171 void computeNormal();
172 bool hasVertex(
const PMVertex* v)
const;
173 unsigned int getVertexID(
const PMVertex* v)
const;
215 size_t calcLodVertexCount(
const LodLevel& lodConfig);
216 void tuneContainerSize();
217 void addVertexData(
VertexData* vertexData,
bool useSharedVertexLookup);
218 void addIndexData(
IndexData* indexData,
bool useSharedVertexLookup,
unsigned short submeshID);
219 template<
typename IndexType>
221 VertexLookupList& lookup,
222 unsigned short submeshID)
226 for (; iPos < iEnd; iPos += 3) {
228 OgreAssert(mTriangleList.capacity() > mTriangleList.size(),
"");
233 for (
int i = 0; i < 3; i++) {
237 tri->
vertex[i] = lookup[iPos[i]];
242 str <<
"In " << mMeshName <<
" malformed triangle found with ID: " << getTriangleID(tri) <<
". " <<
244 printTriangle(tri, str);
245 str <<
"It will be excluded from LOD level calculations.";
249 mIndexBufferInfoList[tri->
submeshID].indexCount -= 3;
253 addTriangleToEdges(tri);
258 bool isBorderVertex(
const PMVertex* vertex)
const;
260 void computeVertexCollapseCost(
PMVertex* vertex);
262 virtual void bakeLods();
266 void updateVertexCollapseCost(
PMVertex* src);
268 bool hasSrcID(
unsigned int srcID,
unsigned short submeshID);
269 size_t findDstID(
unsigned int srcID,
unsigned short submeshID);
270 void replaceVertexID(
PMTriangle* triangle,
unsigned int oldID,
unsigned int newID,
PMVertex* dst);
273 void assertValidVertex(
PMVertex* v);
274 void assertValidMesh();
275 void assertOutdatedCollapseCost(
PMVertex* vertex);
276 #endif // ifndef NDEBUG 278 void addTriangleToEdges(
PMTriangle* triangle);
287 void cleanupMemory();
CollapsedEdges tmpCollapsedEdges
IndexBufferInfoList mIndexBufferInfoList
Real mMeshBoundingSphereRadius
Summary class collecting together vertex source information.
ProgressiveMeshGenerator * mGen
CollapseCostHeap::iterator costHeapPosition
float Real
Software floating point type.
TriangleList mTriangleList
Summary class collecting together index data source information.
multimap< Real, PMVertex * >::type CollapseCostHeap
SmallVector< T, S >::iterator iterator
vector< PMVertex * >::type VertexLookupList
vector< PMVertex >::type VertexList
Improved version of ProgressiveMesh.
HashSet< PMVertex *, PMVertexHash, PMVertexEqual > UniqueVertexSet
void computeNormal()
Vertex ID in the buffer associated with the submeshID.
Standard 3-dimensional vector.
StringStream stringstream
PMVertexHash(ProgressiveMeshGenerator *gen)
vector< PMCollapsedEdge >::type CollapsedEdges
virtual ~ProgressiveMeshGeneratorBase()
vector< PMTriangle >::type TriangleList
vector< PMIndexBufferInfo >::type IndexBufferInfoList
void addIndexDataImpl(IndexType *iPos, const IndexType *iEnd, VertexLookupList &lookup, unsigned short submeshID)
unsigned int vertexID[3]
ID of the submesh. Usable with mMesh.getSubMesh() function.
String mMeshName
The name of the mesh being processed.
PMVertex * collapseTo
Triangle ID set, which are using this vertex.
UniqueVertexSet mUniqueVertexSet
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
CollapseCostHeap mCollapseCostHeap
VectorSet< PMTriangle *, 7 > VTriangles
Structure for automatic LOD configuration.
SmallVector - This is a 'vector' (really, a variable-sized array), optimized for the case when the ar...
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
VertexLookupList mSharedVertexLookup
VertexLookupList mVertexLookup
VectorSet< PMEdge, 8 > VEdges
Log::Stream stream(LogMessageLevel lml=LML_NORMAL, bool maskDebug=false)
Get a stream on the default log.
static LogManager & getSingleton(void)
Override standard Singleton retrieval.
bool operator<(SharedPtr< T > const &a, SharedPtr< U > const &b)