Tesla Graphics Engine Documentation (January 2012)
Camera Class
TeslaTesla.GraphicsCamera
A camera represents how we view the 3D scene. It handles setting/updating the view and projection matrices and holds onto a viewport which the renderer uses to setup where and how the 3D scene is rendered to the screen. This allows for multiple cameras to exist, each containing all the details of how the scene is to be mapped to the 2D screen.
Declaration Syntax
C#
public class Camera : ICamera, ISavable
Members
All Members Constructors Methods Properties



Icon Member Description
Camera()()()()
Instantiates a new camera.

Camera(Viewport)
Instantiates a new camera with the associated viewport.

Camera(String)
Instantiates a new camera with the specified name.

Camera(String, Viewport)
Instantiates a new camera with the associated viewport and name.

Camera(ICamera)
Instantiates a new camera copied from the specified camera.

Contains(BoundingVolume)
Tests if a bounding volume is contained in the camera's frustum. Used to make cull checks. If the volume is null, it will always return ContainmentType.Inside

CreatePickRay(Vector2)
Creates a ray to do picking tests, where the origin is on the near plane. This is the same as using GetWorldCoordinates for (x,y,0) and (x,y,1) and using the normalized difference as the ray's direction.

CreatePickRay(Vector2%, Ray%)
Creates a ray to do picking tests, where the origin is on the near plane. This is the same as using GetWorldCoordinates for (x,y,0) and (x,y,1) and using the normalized difference as the ray's direction.

Direction
Gets or sets the direction the camera is facing in (forward vector of the camera's frame). This will be normalized automatically.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetFrustumCorners(array<Vector3>[]()[][])
Fills the provided array with the 8 positions representing the corners of the camera's view frustum. The array must have the appropiate length (8 corners).

GetFrustumCorners()()()()
Returns an array of 8 positions, representing the corners of the camera's view frustum.

GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetScreenCoordinates(Vector3)
Gets the screen position based on the world position.

GetScreenCoordinates(Vector3%, Vector2%)
Gets the screen position based on the world position.

GetType()()()()
Gets the Type of the current instance.
(Inherited from Object.)
GetWorldCoordinates(Vector3)
Gets the world position based on the x,y screen coordinates.

GetWorldCoordinates(Vector3%, Vector3%)
Gets the world position based on the x,y screen position.

LookAt(Vector3, Vector3)
Makes the camera look at the target.

MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Name
Gets or sets the name of the camera.

Position
Gets or sets the position of the camera in world space.

ProjectionMatrix
Gets the projection matrix of the camera.

ProjectionMode
Gets the projection mode of the camera. This can be set in the SetProjection methods.

Read(ISavableReader)
Deserializes the object and populates it from the input.

Right
Gets or set the left vector of the camera's frame. This will be normalized automatically.

Set(ICamera)
Sets this camera to match the values of the source camera.

SetAxes(Vector3, Vector3, Vector3)
Sets the axes of the camera's frame. This will normalize the axes.

SetAxes(Quaternion)
Sets the axes of the camera's frame from a quaternion rotation. This will normalize the axes.

SetAxes(Matrix)
Sets the axes of the camera's frame from a matrix rotation. This will normalize the axes.

SetFrame(Vector3, Vector3, Vector3, Vector3)
Set's the camera's frame. This will normalize the axes.

SetFrame(Vector3, Quaternion)
Sets the camera's frame from the Quaternion rotation. This will normalize the axes.

SetFrame(Vector3, Matrix)
Set's the camera's frame from the Matrix rotation. This will normalize the axes.

SetProjection(ProjectionMode, Single, Single, Single, Single)
Set the camera's projection, either an orthographic camera or a perspective camera.

SetProjection(Single, Single, Single)
Sets the camera's projection. This will always create a perspective camera.

SetProjection(ProjectionMode, Single, Single, Single, Single, Single, Single)
Sets the camera's projection, either an orthographic camera or a perspective camera.

ToString()()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Up
Gets or sets the up vector of the camera's frame. This will be normalized automatically.

Update()()()()
Updates the camera's view matrix and bounding frustum. This should be called whenever the projection matrix is changed or the camera's frame is changed.

ViewMatrix
Gets the view matrix of the camera.

Viewport
Gets or sets the viewport associated with the camera.

ViewProjectionMatrix
Gets the View x Projection matrix.

Write(ISavableWriter)
Serializes the object and writes it to the output.

Inheritance Hierarchy
Object
Camera

Assembly: Tesla (Module: Tesla) Version: 0.5.0.0 (0.5.0.0)