public void Update(GameTime gameTime) { if (Map.CursorPositionVisible.X < 0 || Map.CursorPositionVisible.Y < 0 || Map.CursorPositionVisible.X >= Map.MapSize.X || Map.CursorPositionVisible.Y >= Map.MapSize.Y) { return; } Cursor = CreateCursor(Map, Map.CursorPositionVisible.X, Map.CursorPositionVisible.Y, Grid.ArrayTerrain[(int)Map.CursorPositionVisible.X, (int)Map.CursorPositionVisible.Y].Position.Z, sprCursor.Width, sprCursor.Height, Radius); Camera.TeleportCamera(new Vector3(Map.CursorPosition.X * 30, 400, 100 + Map.CursorPosition.Y * 30)); Camera.SetRotation(0, (float)-Math.PI / 4f, 0f); Camera.Update(gameTime); DicDrawablePointPerColor.Clear(); }
public Map3D(SorcererStreetMap Map, MapLayer Grid, Map2D GroundLayer, GraphicsDevice g) { this.Map = Map; this.Grid = Grid; this.GroundLayer = GroundLayer; sprCursor = Map.sprCursor; Camera = new SorcererStreetCamera(g); Radius = (Map.MapSize.X * Map.TileSize.X) / 2; PolygonEffect = new BasicEffect(g); PolygonEffect.VertexColorEnabled = true; PolygonEffect.TextureEnabled = true; float aspectRatio = g.Viewport.Width / (float)g.Viewport.Height; Matrix Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, aspectRatio, 1, 10000); PolygonEffect.Projection = Projection; PolygonEffect.World = Matrix.Identity; PolygonEffect.View = Matrix.Identity; DicDrawablePointPerColor = new Dictionary <Color, List <Tile3D> >(); DicTile3D = new Dictionary <Texture2D, List <Tile3D> >(); CreateMap(Map); int CursorWidth = sprCursor == null ? 32 : sprCursor.Width; int CursorHeight = sprCursor == null ? 32 : sprCursor.Height; Cursor = CreateCursor(Map, Map.CursorPositionVisible.X, Map.CursorPositionVisible.Y, Grid.ArrayTerrain[(int)Map.CursorPositionVisible.X, (int)Map.CursorPositionVisible.Y].Position.Z, CursorWidth, CursorHeight, Radius); }
public Tile3D(Tile3D Clone) { this.ArrayVertex = (VertexPositionColorTexture[])Clone.ArrayVertex.Clone(); this.ArrayIndex = (short[])Clone.ArrayIndex.Clone(); TriangleCount = Clone.TriangleCount; }