示例#1
0
        private void Reset()
        {
            mShouldRedraw = true;
            mModel?.Dispose();
            mModel = null;

            ResetCamera();
        }
示例#2
0
        public void SetModel(Mesh mesh, TextureSet textureSet)
        {
            if (!CanRender)
            {
                return;
            }

            Reset();
            mModel = new GLMesh(mesh, new Dictionary <int, GLTexture>(), textureSet);
            SetCamera(mesh.BoundingSphere);
        }
示例#3
0
        public void SetModel(Object obj, TextureSet textureSet)
        {
            if (!CanRender)
            {
                return;
            }

            Reset();
            mModel = new GLObject(obj, new Dictionary <int, GLTexture>(), textureSet);
            SetCamera(obj.BoundingSphere);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        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);
        }
示例#8
0
        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);
        }
示例#9
0
        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);
        }