コード例 #1
0
        public void AddDungeon(WorldModelRoot model, WorldModelHandler.WorldModelDefinition def)
        {
            var verts = new List <Vector3>();
            var tris  = new List <Triangle <uint> >();

            WorldModelHandler.InsertModelGeometry(verts, tris, def, model);
            AddData(verts, tris);
        }
コード例 #2
0
 public void TestDungeonWithWater()
 {
     //MpqManager.Initialize("S:\\World of Warcraft");
     var wdt = new WDT("world\\maps\\orgrimmarinstance\\orgrimmarinstance.wdt");
     Assert.IsTrue(wdt.IsValid && wdt.IsGlobalModel);
     var file = wdt.ModelFile;
     var model = new WorldModelRoot(file);
     var verts = new System.Collections.Generic.List<Vector3>();
     var tris = new System.Collections.Generic.List<Triangle<uint>>();
     WorldModelHandler.InsertModelGeometry(verts, tris, wdt.ModelDefinition, model);
     Assert.IsFalse(verts.Any(v => float.IsNaN(v.X) || float.IsNaN(v.Y) || float.IsNaN(v.Z)));
 }
コード例 #3
0
ファイル: WmoDrawer.cs プロジェクト: zbx91/meshReader
        protected override void LoadContent()
        {
            var model = new WorldModelRoot(_path);
            var verts = new List <Vector3>();
            var tris  = new List <Triangle <uint> >();

            WorldModelHandler.InsertModelGeometry(verts, tris, _def, model);
            SaveMeshToDisk(verts, tris);
            meshDisplay.Game.Camera.Camera.Position = new Vector3(verts[0].Y, verts[0].Z, verts[0].X);

            _drawer = new GeometryDrawer();
            _drawer.Initialize(Game, Color.Red, verts, tris);

            _effect     = new BasicEffect(GraphicsDevice);
            _depthState = new DepthStencilState {
                DepthBufferEnable = true
            };
        }