29 #ifndef __ProgressiveMeshGenerator_H_
30 #define __ProgressiveMeshGenerator_H_
49 virtual void generateLodLevels(
LodConfig& lodConfig) = 0;
56 virtual void generateAutoconfiguredLodLevels(
MeshPtr& mesh);
81 void generateLodLevels(
LodConfig& lodConfig);
89 template<
typename T,
unsigned S>
94 void addNotExists(
const T& item);
97 void removeExists(
const T& item);
98 bool remove(
const T& item);
99 void replaceExists(
const T& oldItem,
const T& newItem);
100 bool has(
const T& item);
110 struct PMCollapseCostLess;
132 size_t operator() (
const PMVertex* v)
const;
168 unsigned int vertexID[3];
170 void computeNormal();
171 bool hasVertex(
const PMVertex* v)
const;
172 unsigned int getVertexID(
const PMVertex* v)
const;
214 size_t calcLodVertexCount(
const LodLevel& lodConfig);
215 void tuneContainerSize();
216 void addVertexData(
VertexData* vertexData,
bool useSharedVertexLookup);
217 template<
typename IndexType>
218 void addIndexDataImpl(IndexType* iPos,
const IndexType* iEnd,
VertexLookupList& lookup,
unsigned short submeshID);
219 void addIndexData(
IndexData* indexData,
bool useSharedVertexLookup,
unsigned short submeshID);
222 bool isBorderVertex(
const PMVertex* vertex)
const;
224 void computeVertexCollapseCost(
PMVertex* vertex);
226 virtual void bakeLods();
230 void updateVertexCollapseCost(
PMVertex* src);
232 bool hasSrcID(
unsigned int srcID,
unsigned short submeshID);
233 size_t findDstID(
unsigned int srcID,
unsigned short submeshID);
234 void replaceVertexID(
PMTriangle* triangle,
unsigned int oldID,
unsigned int newID,
PMVertex* dst);
237 void assertValidVertex(
PMVertex* v);
238 void assertValidMesh();
239 void assertOutdatedCollapseCost(
PMVertex* vertex);
240 #endif // ifndef NDEBUG
242 void addTriangleToEdges(
PMTriangle* triangle);
251 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
Standard 3-dimensional vector.
StringStream stringstream
PMVertexHash(ProgressiveMeshGenerator *gen)
vector< PMCollapsedEdge >::type CollapsedEdges
virtual ~ProgressiveMeshGeneratorBase()
vector< PMTriangle >::type TriangleList
vector< PMIndexBufferInfo >::type IndexBufferInfoList
String mMeshName
The name of the mesh being processed.
PMVertex * collapseTo
Triangle ID set, which are using this vertex.
UniqueVertexSet mUniqueVertexSet
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
bool operator<(SharedPtr< T > const &a, SharedPtr< U > const &b)