Exemplo n.º 1
0
        protected override void LoadContent()
        {
            _mesh = new NavMesh();
            if (File.Exists(@"S:\meshReader\meshes\" + _continent + "\\" + _continent + ".dmesh"))
            {
                _mesh.Initialize(File.ReadAllBytes(@"S:\meshReader\meshes\" + _continent + "\\" + _continent + ".dmesh"));
            }
            else
            {
                _mesh.Initialize(32768, 128, World.Origin, Constant.TileSize, Constant.TileSize);
                MeshTile discard;
                _mesh.AddTile(
                    File.ReadAllBytes(@"C:\\Users\\Sebastian\\CactusWOW\\MeshReader\\meshReader\\meshBuilderGui\\bin\\Debug\\" + _continent + "\\" + _continent + "_" + _tileX + "_"
                                      _tileY + ".tile"), out discard);
            }
            float[] vertices;
            int[]   tris;
            _mesh.BuildRenderGeometry(_tileX, _tileY, out vertices, out tris);
            _drawer = new GeometryDrawer();
            _drawer.Initialize(Game, new Color(0.1f, 0.1f, 0.9f, 0.5f), vertices, tris);

            _effect     = new BasicEffect(GraphicsDevice);
            _depthState = new DepthStencilState {
                DepthBufferEnable = true
            };
        }
Exemplo n.º 2
0
        protected override void LoadContent()
        {
            _adt = new ADT(_path);
            _adt.Read();

            _terrain = new GeometryDrawer();
            _terrain.Initialize(Game, Color.Green, _adt.MapChunks.Select(mc => mc.Vertices),
                                _adt.MapChunks.Select(mc => mc.Triangles));

            var firstVert = _adt.MapChunks[0].Vertices[0];
            meshDisplay.Game.Camera.Camera.Position = new Vector3(firstVert.Y, firstVert.Z, firstVert.X);

            if (_adt.DoodadHandler.Triangles != null)
            {
                _doodads = new GeometryDrawer();
                _doodads.Initialize(Game, Color.Yellow, _adt.DoodadHandler.Vertices, _adt.DoodadHandler.Triangles);
            }

            if (_adt.WorldModelHandler.Triangles != null)
            {
                _wmos = new GeometryDrawer();
                _wmos.Initialize(Game, Color.Red, _adt.WorldModelHandler.Vertices, _adt.WorldModelHandler.Triangles);
            }

            if (_adt.LiquidHandler.Triangles != null)
            {
                _liquid = new GeometryDrawer();
                _liquid.Initialize(Game, Color.Blue, _adt.LiquidHandler.Vertices, _adt.LiquidHandler.Triangles);
            }

            _effect = new BasicEffect(GraphicsDevice);
            _depthState = new DepthStencilState {DepthBufferEnable = true};
        }
Exemplo n.º 3
0
        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 };
        }
Exemplo n.º 4
0
        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
            };
        }
Exemplo n.º 5
0
        protected override void LoadContent()
        {
            string Folder = @"G:\Meshes\6.0\";

            _mesh = new NavMesh();
            if (File.Exists(Folder + _continent + "\\" + _continent + ".dmesh"))
            {
                _mesh.Initialize(File.ReadAllBytes(Folder + _continent + "\\" + _continent + ".dmesh"));
            }
            else
            {
                MeshTile discard;
                if (Constant.Division == 1)
                {
                    _mesh.Initialize(150000, 4096, World.Origin, Constant.BaseTileSize, Constant.BaseTileSize);
                    _mesh.AddTile(File.ReadAllBytes(Folder + _continent + "\\" + _continent + "_" + _tileX + "_" + _tileY + ".tile"), out discard);
                }
                else
                {
                    _mesh.Initialize(150000, 4096, World.Origin, Constant.TileSize, Constant.TileSize);
                    string name = _continent + "\\" + _continent + "_" + _tileX + "_" + _tileY + "_" + _i + _j + ".tile";
                    _mesh.AddTile(File.ReadAllBytes(Folder + name), out discard);
                    System.Console.WriteLine(name);
                }
            }
            float[] vertices;
            int[]   tris;
            if (Constant.Division == 1)
            {
                _mesh.BuildRenderGeometry(_tileX, _tileY, out vertices, out tris);
            }
            else
            {
                _mesh.BuildRenderGeometry(_tileX * Constant.Division + _i, _tileY * Constant.Division + _j, out vertices, out tris);
            }
            _drawer = new GeometryDrawer();
            _drawer.Initialize(Game, new Color(0.1f, 0.1f, 0.9f, 0.5f), vertices, tris);
            _effect     = new BasicEffect(GraphicsDevice);
            _depthState = new DepthStencilState {
                DepthBufferEnable = true
            };
        }
Exemplo n.º 6
0
        protected override void LoadContent()
        {
            _mesh = new NavMesh();
            if (File.Exists(@"S:\meshReader\meshes\" + _continent + "\\" + _continent + ".dmesh"))
            {
                _mesh.Initialize(File.ReadAllBytes(@"S:\meshReader\meshes\" + _continent + "\\" + _continent + ".dmesh"));
            }
            else
            {
                _mesh.Initialize(32768, 128, World.Origin, Constant.TileSize, Constant.TileSize);
                MeshTile discard;
                _mesh.AddTile(
                    File.ReadAllBytes(@"S:\meshReader\meshes\" + _continent + "\\" + _continent + "_" + _tileX + "_" +
                                      _tileY + ".tile"), out discard);
            }
            float[] vertices;
            int[] tris;
            _mesh.BuildRenderGeometry(_tileX, _tileY, out vertices, out tris);
            _drawer = new GeometryDrawer();
            _drawer.Initialize(Game, new Color(0.1f, 0.1f, 0.9f, 0.5f), vertices, tris);

            _effect = new BasicEffect(GraphicsDevice);
            _depthState = new DepthStencilState { DepthBufferEnable = true };
        }
Exemplo n.º 7
0
        protected override void LoadContent()
        {
            _adt = new ADT(_path);
            _adt.Read();

            _terrain = new GeometryDrawer();
            _terrain.Initialize(Game, Color.Green, _adt.MapChunks.Select(mc => mc.Vertices),
                                _adt.MapChunks.Select(mc => mc.Triangles));

            var firstVert = _adt.MapChunks[0].Vertices[0];

            meshDisplay.Game.Camera.Camera.Position = new Vector3(firstVert.Y, firstVert.Z, firstVert.X);

            if (_adt.DoodadHandler.Triangles != null)
            {
                _doodads = new GeometryDrawer();
                _doodads.Initialize(Game, Color.Yellow, _adt.DoodadHandler.Vertices, _adt.DoodadHandler.Triangles);
            }

            if (_adt.WorldModelHandler.Triangles != null)
            {
                _wmos = new GeometryDrawer();
                _wmos.Initialize(Game, Color.Red, _adt.WorldModelHandler.Vertices, _adt.WorldModelHandler.Triangles);
            }

            if (_adt.LiquidHandler.Triangles != null)
            {
                _liquid = new GeometryDrawer();
                _liquid.Initialize(Game, Color.Blue, _adt.LiquidHandler.Vertices, _adt.LiquidHandler.Triangles);
            }

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