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()
        {
            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.º 3
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 };
        }