C# Class world3D.Camera

Represents a camera - an imaginary observer of a scene in 3D space. The camera uses perspective projection.
Afficher le fichier Open project: denniskb/asvo_cuda

Méthodes publiques

Méthode Description
Camera ( float nearPlane, float farPlane, Vector3 pos, Vector3 lookAt, float ratio )

Constructs a new camera with common properties.

getEyeVector ( ) : Vector3

Returns the eye vector. That's a normalized vector pointing from the look-at point towards the camera's position.

getFov ( ) : float

Returns the field of vision of this camera in radians.

getLookAt ( ) : Vector3

Returns the camera's look-at point.

getPosition ( ) : Vector3

Returns the camera's position.

getProjectionMatrix ( ) : Matrix

Returns the projection matrix of this camera.

getViewMatrix ( ) : Matrix

Returns the view matrix of this camera.

getViewProjectionMatrix ( ) : Matrix

Retuns the view matrix multiplied by the projection matrix.

setFov ( float newFov ) : void

Sets the field of vision of the camera in radians.

setLookAt ( Vector3 newLookAt ) : void

Sets the point the camera looks-at.

setPosition ( Vector3 newPosition ) : void

Sets the camera's position.

update ( GameTime time, int horRes, int vertRes ) : void

Used to animate camera movement which is caused by user input. The user can steer the camera with the mouse: By clicking and holding the left mouse button and then dragging the mouse, the camera will rotate around its look-at point. The scroll wheel can be used to zoom in and out of the scene. Note: Scrolling doesn't change the camera's fov, but its distance from its look-at position.

Private Methods

Méthode Description
updateMatrices ( ) : void

Caches the view, projection and viewProjection matrices after each change to data which they depend on (like position for example).

Method Details

Camera() public méthode

Constructs a new camera with common properties.
public Camera ( float nearPlane, float farPlane, Vector3 pos, Vector3 lookAt, float ratio )
nearPlane float Near clipping plane distance.
farPlane float Far clipping plane distance.
pos Vector3 Position of the camera.
lookAt Vector3 Target the camera is pointing at.
ratio float Aspect ratio of the projection (width/height)

getEyeVector() public méthode

Returns the eye vector. That's a normalized vector pointing from the look-at point towards the camera's position.
public getEyeVector ( ) : Vector3
Résultat Vector3

getFov() public méthode

Returns the field of vision of this camera in radians.
public getFov ( ) : float
Résultat float

getLookAt() public méthode

Returns the camera's look-at point.
public getLookAt ( ) : Vector3
Résultat Vector3

getPosition() public méthode

Returns the camera's position.
public getPosition ( ) : Vector3
Résultat Vector3

getProjectionMatrix() public méthode

Returns the projection matrix of this camera.
public getProjectionMatrix ( ) : Matrix
Résultat Matrix

getViewMatrix() public méthode

Returns the view matrix of this camera.
public getViewMatrix ( ) : Matrix
Résultat Matrix

getViewProjectionMatrix() public méthode

Retuns the view matrix multiplied by the projection matrix.
public getViewProjectionMatrix ( ) : Matrix
Résultat Matrix

setFov() public méthode

Sets the field of vision of the camera in radians.
public setFov ( float newFov ) : void
newFov float Field of vision in radians.
Résultat void

setLookAt() public méthode

Sets the point the camera looks-at.
public setLookAt ( Vector3 newLookAt ) : void
newLookAt Vector3 The new look-at point.
Résultat void

setPosition() public méthode

Sets the camera's position.
public setPosition ( Vector3 newPosition ) : void
newPosition Vector3 The camera's new position.
Résultat void

update() public méthode

Used to animate camera movement which is caused by user input. The user can steer the camera with the mouse: By clicking and holding the left mouse button and then dragging the mouse, the camera will rotate around its look-at point. The scroll wheel can be used to zoom in and out of the scene. Note: Scrolling doesn't change the camera's fov, but its distance from its look-at position.
public update ( GameTime time, int horRes, int vertRes ) : void
time GameTime Elapsed time since last frame.
horRes int Horizontal resolution of the screen.
vertRes int Vertical resolution of the screen.
Résultat void