Exemplo n.º 1
0
        protected override void LoadContent()
        {
            var gltfFactory = new MonoScene.Graphics.Pipeline.GltfModelFactory(this.GraphicsDevice);

            _AvodadoTemplate      = gltfFactory.LoadModel("Content\\Avocado.glb");
            _BrainStemTemplate    = gltfFactory.LoadModel("Content\\BrainStem.glb");
            _CesiumManTemplate    = gltfFactory.LoadModel("Content\\CesiumMan.glb");
            _HauntedHouseTemplate = gltfFactory.LoadModel("Content\\haunted_house.glb");
            _SharkTemplate        = gltfFactory.LoadModel("Content\\shark.glb");
        }
Exemplo n.º 2
0
        public static DeviceModelCollection ConvertToDevice(Assimp.Scene srcScene, DeviceMeshFactory meshFactory)
        {
            if (meshFactory == null)
            {
                throw new ArgumentNullException();
            }

            var content = ConvertToContent(srcScene);

            return(DeviceModelCollection.CreateFrom(content, meshFactory.CreateMeshCollection));
        }
Exemplo n.º 3
0
        public DeviceModelCollection ConvertToDevice(SharpGLTF.Schema2.ModelRoot srcModel, DeviceMeshFactory meshFactory)
        {
            if (meshFactory == null)
            {
                throw new ArgumentNullException();
            }

            var content = ConvertToContent(srcModel);

            return(DeviceModelCollection.CreateFrom(content, meshFactory.CreateMeshCollection));
        }
Exemplo n.º 4
0
        protected override void UnloadContent()
        {
            _AvodadoTemplate?.Dispose();
            _AvodadoTemplate = null;

            _BrainStemTemplate?.Dispose();
            _BrainStemTemplate = null;

            _CesiumManTemplate?.Dispose();
            _CesiumManTemplate = null;

            _HauntedHouseTemplate?.Dispose();
            _HauntedHouseTemplate = null;

            _SharkTemplate?.Dispose();
            _SharkTemplate = null;
        }