Ejemplo n.º 1
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        public ThirdPersonCameraObject(CharacterControllerObject characterControllerObject, IServiceLocator services)
        {
            Name = "ThirdPersonCamera";

            _characterControllerObject = characterControllerObject;

            _services     = services;
            _inputService = services.GetInstance <IInputService>();
        }
Ejemplo n.º 2
0
    //--------------------------------------------------------------
    #region Creation & Cleanup
    //--------------------------------------------------------------

    public ThirdPersonCameraObject(CharacterControllerObject characterControllerObject, IServiceLocator services)
    {
      Name = "ThirdPersonCamera";

      _characterControllerObject = characterControllerObject;

      _services = services;
      _inputService = services.GetInstance<IInputService>();
    }
Ejemplo n.º 3
0
    public CharacterControllerSample(Microsoft.Xna.Framework.Game game)
      : base(game)
    {
      Services.Register(typeof(DebugRenderer), null, GraphicsScreen.DebugRenderer);

      // Add basic force effects.
      Simulation.ForceEffects.Add(new Gravity());
      Simulation.ForceEffects.Add(new Damping());

      // Add a game object which loads and updates the test obstacles.
      GameObjectService.Objects.Add(new CharacterControllerLevelObject(Services));

      // Add a game object which uses a character controller.
      _characterControllerObject = new CharacterControllerObject(Services);
      GameObjectService.Objects.Add(_characterControllerObject);

      // Add a camera that is attached to the character controller.
      var cameraObject = new ThirdPersonCameraObject(_characterControllerObject, Services);
      GameObjectService.Objects.Add(cameraObject);
      GraphicsScreen.CameraNode = cameraObject.CameraNode;
    }
Ejemplo n.º 4
0
        public CharacterControllerSample(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            Services.Register(typeof(DebugRenderer), null, GraphicsScreen.DebugRenderer);

            // Add basic force effects.
            Simulation.ForceEffects.Add(new Gravity());
            Simulation.ForceEffects.Add(new Damping());

            // Add a game object which loads and updates the test obstacles.
            GameObjectService.Objects.Add(new CharacterControllerLevelObject(Services));

            // Add a game object which uses a character controller.
            _characterControllerObject = new CharacterControllerObject(Services);
            GameObjectService.Objects.Add(_characterControllerObject);

            // Add a camera that is attached to the character controller.
            var cameraObject = new ThirdPersonCameraObject(_characterControllerObject, Services);

            GameObjectService.Objects.Add(cameraObject);
            GraphicsScreen.CameraNode = cameraObject.CameraNode;
        }