C# Class VoxelTerrain.Camera

Allows observing the scene with the mouse and keyboard.
Afficher le fichier Open project: barograf/VoxelTerrain Class Usage Examples

Méthodes publiques

Méthode Description
Camera ( Device graphicsDevice, System.Vector3 position, System.Vector3 look, float nearPlane, float farPlane ) : System

Creates a camera with specified values.

FixVectors ( ) : void

Fixes camera sphere point and look vector. Sphere point is fixed by camera look vector spherical unmapping. Look vector is fixed by putting it at a distance of one unit away from position vector.

MoveLook ( System.Vector2 mousePositionDelta, float speed ) : void

Moves camera look vector around a sphere.

MovePosition ( MoveDirection moveDirection, double deltaTime ) : void

Moves a camera position vector.

UpdateProjection ( ) : void

Updates camera projection matrix.

Private Methods

Méthode Description
ExtractPlanesFromFrustum ( ) : void

Computes plane equations used in frustum culling.

UpdateView ( ) : void

Updates camera view matrix.

Method Details

Camera() public méthode

Creates a camera with specified values.
public Camera ( Device graphicsDevice, System.Vector3 position, System.Vector3 look, float nearPlane, float farPlane ) : System
graphicsDevice Device Virtual adapter used to perform rendering.
position System.Vector3 Position of a camera.
look System.Vector3 A point the camera look at.
nearPlane float A near plane of a camera frustum.
farPlane float A far plane of a camera frustum.
Résultat System

FixVectors() public méthode

Fixes camera sphere point and look vector. Sphere point is fixed by camera look vector spherical unmapping. Look vector is fixed by putting it at a distance of one unit away from position vector.
public FixVectors ( ) : void
Résultat void

MoveLook() public méthode

Moves camera look vector around a sphere.
public MoveLook ( System.Vector2 mousePositionDelta, float speed ) : void
mousePositionDelta System.Vector2 Mouse position change.
speed float Desired moving speed.
Résultat void

MovePosition() public méthode

Moves a camera position vector.
public MovePosition ( MoveDirection moveDirection, double deltaTime ) : void
moveDirection MoveDirection Movement direction.
deltaTime double Performance timer delta time.
Résultat void

UpdateProjection() public méthode

Updates camera projection matrix.
public UpdateProjection ( ) : void
Résultat void