C# Class MyGame.ChaseCamera

This class represent a Chase camera that chase a certain object around
Inheritance: Camera
Show file Open project: mahmoudbahaa/XNA-Game-project Class Usage Examples

Public Properties

Property Type Description
Right Vector3
Up Vector3

Public Methods

Method Description
ChaseCamera ( MyGame game, Vector3 PositionOffset, Vector3 TargetOffset, Vector3 RelativeCameraRotation ) : System

Constructor that initialize the chase camera properties and set the mouse to the middle of the screen

Move ( Vector3 NewFollowTargetPosition, Vector3 NewFollowTargetRotation ) : void

Move the chase camera to follow the chased position and rotation

Rotate ( Vector3 RotationChange ) : void

Rotate the camera with the specifed rotate change vector

Update ( GameTime gameTime ) : void

Allows the component to run logic.

resetOffsets ( ) : void
setOffsetsFor1stPerson ( ) : void

Private Methods

Method Description
recalculatePosition ( ) : Matrix

Method Details

ChaseCamera() public method

Constructor that initialize the chase camera properties and set the mouse to the middle of the screen
public ChaseCamera ( MyGame game, Vector3 PositionOffset, Vector3 TargetOffset, Vector3 RelativeCameraRotation ) : System
game MyGame instance of MyGame this game component is attched to
PositionOffset Vector3 offset of the position from the chasee
TargetOffset Vector3 offset of the target from the chasee
RelativeCameraRotation Vector3 reletaive camera rotation with respect to the chasee
return System

Move() public method

Move the chase camera to follow the chased position and rotation
public Move ( Vector3 NewFollowTargetPosition, Vector3 NewFollowTargetRotation ) : void
NewFollowTargetPosition Vector3
NewFollowTargetRotation Vector3 the followed new target rotation
return void

Rotate() public method

Rotate the camera with the specifed rotate change vector
public Rotate ( Vector3 RotationChange ) : void
RotationChange Vector3 the change in the rotation
return void

Update() public method

Allows the component to run logic.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The gametime.
return void

resetOffsets() public method

public resetOffsets ( ) : void
return void

setOffsetsFor1stPerson() public method

public setOffsetsFor1stPerson ( ) : void
return void

Property Details

Right public property

public Vector3 Right
return Vector3

Up public property

public Vector3 Up
return Vector3