Added option to disable mesh LOD. Closes #400.

This commit is contained in:
Leonardo Zide
2019-11-28 12:47:19 -08:00
parent 9e41edfef0
commit 0ecc4b5966
12 changed files with 73 additions and 44 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ lcScene::lcScene()
{
mActiveSubmodelInstance = nullptr;
mAllowWireframe = true;
mAllowLOD = true;
}
void lcScene::Begin(const lcMatrix44& ViewMatrix)
@@ -60,7 +61,7 @@ void lcScene::AddMesh(lcMesh* Mesh, const lcMatrix44& WorldMatrix, int ColorInde
RenderMesh.ColorIndex = ColorIndex;
RenderMesh.State = State;
float Distance = fabsf(lcMul31(WorldMatrix[3], mViewMatrix).z);
RenderMesh.LodIndex = RenderMesh.Mesh->GetLodIndex(Distance);
RenderMesh.LodIndex = mAllowLOD ? RenderMesh.Mesh->GetLodIndex(Distance) : LC_MESH_LOD_HIGH;
bool Translucent = lcIsColorTranslucent(ColorIndex);
lcMeshFlags Flags = Mesh->mFlags;