MxEngine
Public Member Functions | List of all members
MxEngine::LODGenerator Class Reference

#include <LODGenerator.h>

Public Member Functions

 LODGenerator (const MeshData &mesh)
 
MeshData CreateObject (float threshold)
 

Detailed Description

LODGenerator is a special class which encapsulates mesh LOD generation algorithm The idea is quite simple, fast and straightforward (but rather inaccurate) - we try to delete vertecies which are close to each other and then reconstruct the mesh Ofc this results in slight holes in mesh or its deformation, but corretcly selected distance for LODs will hide such errors

Constructor & Destructor Documentation

§ LODGenerator()

MxEngine::LODGenerator::LODGenerator ( const MeshData mesh)

construct LODGenerator object. Calls PrepareIndexData() method. Note that MeshData must not be destroyed till LODGenerator is used

Parameters
meshmesh of object from which LODs will be generated

Member Function Documentation

§ CreateObject()

MeshData MxEngine::LODGenerator::CreateObject ( float  threshold)

creates new LOD as MeshData object.

Parameters
thresholdminimal value in vertecies components from which vertecies are considered equal (see Vector3Cmp comparator)
Returns
mesh LOD as MeshData
Warning
this function is not Thread-safe even across multiple LODGenerator instances, as Vector3Cmp uses static field (TODO fix this)

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