Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="game"></param>
        public GlobeLayer(Game game, LayerServiceConfig config) : base(game, config)
        {
            shader      = Game.Content.Load <Ubershader>(@"Globe.hlsl");
            constBuffer = new ConstBufferGeneric <ConstData>(Game.GraphicsDevice);

            frame        = Game.Content.Load <Texture2D>("redframe.tga");
            railRoadsTex = Game.Content.Load <Texture2D>("Urban/Railroads.tga");

            UpdateProjectionMatrix(Game.GraphicsDevice.DisplayBounds.Width, Game.GraphicsDevice.DisplayBounds.Height);

            maxPitch = DMathUtil.DegreesToRadians(87.5);
            minPitch = DMathUtil.DegreesToRadians(-87.5);

            GoToPlace(Places.SaintPetersburg_VO);

            InitDots();

            InitAirLines();

            Game.GetService <LayerService>().MapLayer.OnProjectionChanged += (s) => { updateTiles = true; };

            CreateSphere(100, 50);

            //AddDebugLine(new DVector3(10000, 0, 0), Color.Red, new DVector3(0, 0, 0), Color.Red);
            //AddDebugLine(new DVector3(0, 10000, 0), Color.Green, new DVector3(0, 0, 0), Color.Green);
            //AddDebugLine(new DVector3(0, 0, 10000), Color.Blue, new DVector3(0, 0, 0), Color.Blue);


            myMiniFactory = new MyMiniFactory(Game, shader);
        }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="game"></param>
 /// <param name="config"></param>
 public ElevationLayer(Game game, LayerServiceConfig config) : base(game, config)
 {
     if (!Directory.Exists("cache/Elevation"))
     {
         IsElevationDataAvailable = false;
     }
 }
Beispiel #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="game"></param>
 /// <param name="config"></param>
 public ElevationLayer(Game game, LayerServiceConfig config)
     : base(game, config)
 {
     if (!Directory.Exists("cache/Elevation")) {
         IsElevationDataAvailable = false;
     }
 }
Beispiel #4
0
        public MapLayer(Game game, LayerServiceConfig config) : base(game, config)
        {
            Transform = Matrix.Transformation(Vector3.Zero, Quaternion.Identity, Vector3.One, Vector3.Zero, Quaternion.Identity, Vector3.Zero);

            sb = Game.GetService <SpriteBatch>();

            RegisterMapSources();
            CurrentMapSource = MapSources[0];

            //Game.InputDevice.MouseMove += InputDeviceOnMouseMove;

            InitShaderAndBuffer();
        }
Beispiel #5
0
        public MapLayer(Game game, LayerServiceConfig config)
            : base(game, config)
        {
            Transform = Matrix.Transformation(Vector3.Zero, Quaternion.Identity, Vector3.One, Vector3.Zero, Quaternion.Identity, Vector3.Zero);

            sb = Game.GetService<SpriteBatch>();

            RegisterMapSources();
            CurrentMapSource = MapSources[0];

            //Game.InputDevice.MouseMove += InputDeviceOnMouseMove;

            InitShaderAndBuffer();
        }
        public SimpleBuildings(Game game, List <SimpleBuilding> buildings, LayerServiceConfig config) : base(game, config)
        {
            var rs = game.GraphicsDevice;
            var ml = Game.GetService <LayerService>().MapLayer;

            constBuffer = rs.CreateConstBuffer <ConstData>();
            drawShader  = rs.CreateUberShader("SimpleBuildings.hlsl", typeof(BuildingsFlags));


            vertexBuffer = rs.CreateVertexBuffer(typeof(SimpleBuilding), buildings.Count);
            vertexBuffer.SetData(buildings.ToArray(), 0, buildings.Count);

            //MeshInstance mi = new MeshInstance(rs, GenerateMesh(buildings), Matrix.Scaling(ml.Zoom)*Matrix.Translation(ml.Offset.X, 0.0f, ml.Offset.Y), "Ololo");
            //rs.Instances.Add(mi);
        }
Beispiel #7
0
 public GeoObjectsLayer(Game game, LayerServiceConfig config)
     : base(game, config)
 {
     LoadMunicipalDivisions();
 }
 public GeoObjectsLayer(Game game, LayerServiceConfig config) : base(game, config)
 {
     LoadMunicipalDivisions();
 }
Beispiel #9
0
 public BaseLayer(Game game, LayerServiceConfig config)
 {
     Game   = game;
     Config = config;
 }
Beispiel #10
0
 public BaseLayer(Game game, LayerServiceConfig config)
 {
     Game	= game;
     Config	= config;
 }