C# Class Indiefreaks.Xna.Rendering.Camera.ChaseCamera3D

Inheritance: Camera3D
Exibir arquivo Open project: Indiefreaks/igf

Public Methods

Method Description
ChaseCamera3D ( float aspectRatio, float fieldOfView, float nearPlaneDistance, float farPlaneDistance ) : System

Creates a new instance of the camera

Reset ( ) : void

Forces camera to be at desired position and to stop moving. The is useful when the chased object is first created or after it has been teleported. Failing to call this after a large change to the chased object's position will result in the camera quickly flying across the world.

Protected Methods

Method Description
UpdateInput ( InputManager input ) : void

Override this method to catch input events and act on the camera

UpdateViewMatrix ( GameTime gameTime ) : Matrix

Animates the camera from its current position towards the desired offset behind the chased object. The camera's animation is controlled by a simple physical spring attached to the camera and anchored to the desired position.

Private Methods

Method Description
UpdateMatrices ( ) : Matrix

Rebuilds camera's view and projection matricies.

UpdateWorldPositions ( ) : void

Rebuilds object space values in world space. Invoke before publicly returning or privately accessing world space values.

Method Details

ChaseCamera3D() public method

Creates a new instance of the camera
public ChaseCamera3D ( float aspectRatio, float fieldOfView, float nearPlaneDistance, float farPlaneDistance ) : System
aspectRatio float
fieldOfView float
nearPlaneDistance float
farPlaneDistance float
return System

Reset() public method

Forces camera to be at desired position and to stop moving. The is useful when the chased object is first created or after it has been teleported. Failing to call this after a large change to the chased object's position will result in the camera quickly flying across the world.
public Reset ( ) : void
return void

UpdateInput() protected method

Override this method to catch input events and act on the camera
protected UpdateInput ( InputManager input ) : void
input InputManager The current input instance
return void

UpdateViewMatrix() protected method

Animates the camera from its current position towards the desired offset behind the chased object. The camera's animation is controlled by a simple physical spring attached to the camera and anchored to the desired position.
protected UpdateViewMatrix ( GameTime gameTime ) : Matrix
gameTime Microsoft.Xna.Framework.GameTime
return Matrix