private void Reset() { mShouldRedraw = true; mModel?.Dispose(); mModel = null; ResetCamera(); }
public void SetModel(Mesh mesh, TextureSet textureSet) { if (!CanRender) { return; } Reset(); mModel = new GLMesh(mesh, new Dictionary <int, GLTexture>(), textureSet); SetCamera(mesh.BoundingSphere); }
public void SetModel(Object obj, TextureSet textureSet) { if (!CanRender) { return; } Reset(); mModel = new GLObject(obj, new Dictionary <int, GLTexture>(), textureSet); SetCamera(obj.BoundingSphere); }
public void SetModel(Mesh mesh, TextureSet textureSet) { if (mDefaultShader == null || mGridShader == null) { return; } mModel?.Dispose(); mModel = new GLMesh(mesh, new Dictionary <int, GLTexture>(), textureSet); SetDefaultCamera(mesh.BoundingSphere); }
public void SetModel(Model model, TextureSet textureSet) { if (mDefaultShader == null || mGridShader == null) { return; } mModel?.Dispose(); mModel = new GLModel(model, textureSet); var bSphere = new BoundingSphere(); foreach (var mesh in model.Meshes) { bSphere.Merge(mesh.BoundingSphere); } SetDefaultCamera(bSphere); }
public void SetModel(Model model, TextureSet textureSet) { if (!CanRender) { return; } Reset(); mModel = new GLModel(model, textureSet); var boundingSphere = new BoundingSphere(); foreach (var mesh in model.Meshes) { boundingSphere.Merge(mesh.BoundingSphere); } SetCamera(boundingSphere); }
public void SetModel(ObjectSet objectSet, TextureSet textureSet) { if (!CanRender) { return; } Reset(); mModel = new GLObjectSet(objectSet, textureSet); var boundingSphere = new BoundingSphere(); foreach (var mesh in objectSet.Objects) { boundingSphere.Merge(mesh.BoundingSphere); } SetCamera(boundingSphere); }
public void SetModel(SubMesh subMesh, Mesh mesh, TextureSet textureSet) { if (!CanRender) { return; } Reset(); var materials = new List <GLMaterial>(new GLMaterial[mesh.Materials.Count]); var dictionary = new Dictionary <int, GLTexture>(); foreach (var indexTable in subMesh.IndexTables) { if (materials[indexTable.MaterialIndex] == null) { materials[indexTable.MaterialIndex] = new GLMaterial(mesh.Materials[indexTable.MaterialIndex], dictionary, textureSet); } } mModel = new GLSubMesh(subMesh, materials); SetCamera(subMesh.BoundingSphere); }
public void SetModel(Mesh mesh, Object obj, TextureSet textureSet) { if (!CanRender) { return; } Reset(); var materials = new List <GLMaterial>(new GLMaterial[obj.Materials.Count]); var dictionary = new Dictionary <int, GLTexture>(); foreach (var subMesh in mesh.SubMeshes) { if (materials[subMesh.MaterialIndex] == null) { materials[subMesh.MaterialIndex] = new GLMaterial(obj.Materials[subMesh.MaterialIndex], dictionary, textureSet); } } mModel = new GLMesh(mesh, materials); SetCamera(mesh.BoundingSphere); }