public HudViewModel(Lidar lidar, VehicleSprite vehicle, Camera camera, Picking2D picking)
        {
            _uiSyncContext = SynchronizationContext.Current;

            _lidar   = lidar;
            _vehicle = vehicle;
            _camera  = camera;
            _picking = picking;
        }
Пример #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _simulatorMap = new SimulatorMap(Content, mapName: "RealMapFinite.tmx", scale: Screen.ScaleToHighDPI(1.0f * GlobalScale));

            Texture2D carTexture = Content.Load <Texture2D>("SpriteImages/SensorVehicleTop_300x300");

            _vehicle = new VehicleSprite(GraphicsDevice, carTexture, Screen.ScaleToHighDPIWithoutRounding(0.1f * GlobalScale), Screen.ScaleToHighDPI(1.0f * GlobalScale));

            _vehicle.Position = _simulatorMap.VehicleStartPosition;
            _vehicle.Angle    = 4.712f;

            _lidar = new Lidar(_vehicle);

            HUDViewModel = new HudViewModel(_lidar, _vehicle, _camera, _picking2D);

            ((App)Application.Current).AppServiceProvider.InstantiateSimulatedEquipment(_vehicle, _lidar);
        }