//-------------------------------------------------------------- #region Creation & Cleanup //-------------------------------------------------------------- public ThirdPersonCameraObject(CharacterControllerObject characterControllerObject, IServiceLocator services) { Name = "ThirdPersonCamera"; _characterControllerObject = characterControllerObject; _services = services; _inputService = services.GetInstance <IInputService>(); }
//-------------------------------------------------------------- #region Creation & Cleanup //-------------------------------------------------------------- public ThirdPersonCameraObject(CharacterControllerObject characterControllerObject, IServiceLocator services) { Name = "ThirdPersonCamera"; _characterControllerObject = characterControllerObject; _services = services; _inputService = services.GetInstance<IInputService>(); }
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; }