void DrawSimple(ICamera cam, bool wireFrame) { if (hiddenModels.Count > 0) { return; } if (skinning != null) { skinning.Update(); } Material mat = null; var matrix = Matrix4.Identity; if (isStarsphere) { matrix = Matrix4.CreateTranslation(cam.Position); } else { matrix = GetModelMatrix(); } if (wireFrame || viewMode == M_FLAT) { mat = wireframeMaterial3db; mat.Update(cam); } else if (viewMode == M_NORMALS) { mat = normalsDebugMaterial; mat.Update(cam); } ModelFile mdl = drawable as ModelFile; if (viewMode == M_LIT) { if (mdl != null) { mdl.DrawBufferLevel(mdl.Levels[GetLevel(mdl.Switch2, mdl.Levels.Length - 1)], buffer, matrix, ref lighting); } else { drawable.DrawBuffer(buffer, matrix, ref lighting, mat); } } else { if (mdl != null) { mdl.DrawBufferLevel(mdl.Levels[GetLevel(mdl.Switch2, mdl.Levels.Length - 1)], buffer, matrix, ref Lighting.Empty, mat); } else { drawable.DrawBuffer(buffer, matrix, ref Lighting.Empty, mat); } } }
void DrawSimple(ICamera cam, bool wireFrame) { Material mat = null; if (wireFrame || viewMode == M_FLAT) { mat = wireframeMaterial3db; mat.Update(cam); } else if (viewMode == M_NORMALS) { mat = normalsDebugMaterial; mat.Update(cam); } var matrix = Matrix4.CreateRotationX(rotation.Y) * Matrix4.CreateRotationY(rotation.X); ModelFile mdl = drawable as ModelFile; if (viewMode == M_LIT) { if (mdl != null) { mdl.DrawBufferLevel(mdl.Levels[GetLevel(mdl.Switch2, mdl.Levels.Length - 1)], buffer, matrix, ref lighting); } else { drawable.DrawBuffer(buffer, matrix, ref lighting, mat); } } else { if (mdl != null) { mdl.DrawBufferLevel(mdl.Levels[GetLevel(mdl.Switch2, mdl.Levels.Length - 1)], buffer, matrix, ref Lighting.Empty, mat); } else { drawable.DrawBuffer(buffer, matrix, ref Lighting.Empty, mat); } } }