Mindshifter.OrbitCamera Class Reference

OrbitCamera is a spherical coordinate camera in which the eye position is defined by an azimuth, declination and radius around an arbitrary target point in world space. Smooth spring-based movement is supported for both the eye and look at positions. More...

Inherits Mindshifter.ICamera.

Inheritance diagram for Mindshifter.OrbitCamera:

Inheritance graph
[legend]
Collaboration diagram for Mindshifter.OrbitCamera:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OrbitCamera ()
 Creates a new instance of OrbitCamera with an azimuth of 0 degrees, declination of 90 degrees and radius of 1 using a perspective projection with a field of view of 45 degrees, aspect ratio of 4/3, near plane distance of 1 and far plane distance of 1000.
 OrbitCamera (float azimuth, float declination, float radius)
 Creates a new instance of OrbitCamera with with the specified azimuth, declination and radius using a perspective projection with a field of view of 45 degrees, aspect ratio of 4/3, near plane distance of 1 and far plane distance of 1000.
 OrbitCamera (float azimuth, float declination, float radius, float fov, float aspect, float near, float far)
 Creates a new instance of OrbitCamera with the specified azimuth, declination and radius using a perspective projection with the specified projection parameters.
 OrbitCamera (float azimuth, float declination, float radius, Rectangle rect, float near, float far)
 Creates a new instance of OrbitCamera with the specified azimuth, declination and radius using an orthographic projection.
void Yaw (float value)
 Adjusts the camera's azimuth by the specified number of radians.
void Pitch (float value)
 Adjusts the camera's declination by the specified number of radians.
void Zoom (float value)
 Adjusts the camera's radius by the specified value.
void Update (float elapsedSeconds)
 Performs any required updates to the camera's values based on the specified elapsed time.
Ray GetPickRay (Vector2 position, Viewport viewport)
 Returns a world space ray cast from the specified screen projected position.

Properties

Matrix ViewMatrix [get]
 Gets the camera's view matrix.
Matrix ProjectionMatrix [get]
 Gets the camera's projection matrix.
Projection Projection [get]
 Gets the camera's projection.
BoundingFrustum Frustum [get]
 Gets the camera's bounding frustum.
Vector3 Position [get]
 Gets the camera's eye position.
Vector3 LookAtPoint [get, set]
 Gets or sets the camera's look at position.
bool EyeSpringEnabled [get, set]
 Gets or sets the value determining whether the camera's eye spring is enabled or disabled.
float EyeSpringStiffness [get, set]
 Gets or sets the stiffness of the camera's eye spring.
float EyeSpringDamping [get, set]
 Gets or sets the damping coefficient of the camera's eye spring.
bool LookAtSpringEnabled [get, set]
 Gets or sets the value determining whether the camera's look at spring is enabled or disabled.
float LookAtSpringStiffness [get, set]
 Gets or sets the stiffness of the camera's look at spring.
float LookAtSpringDamping [get, set]
 Gets or sets the damping coefficient of the camera's look at spring.
float Azimuth [get, set]
 Gets or sets the camera's azimuth around its look at point.
float Declination [get, set]
 Gets or sets the camera's declination around its look at point.
float Radius [get, set]
 Gets or sets the camera's distance from its look at point.
float MinimumAzimuth [get, set]
 Gets or sets the camera's minimum azimuth around its look at point. Value is clamped to [float.MinValue, float.MaxValue].
float MaximumAzimuth [get, set]
 Gets or sets the camera's maximum azimuth around its look at point. Value is clamped to [float.MinValue, float.MaxValue].
float MinimumDeclination [get, set]
 Gets or sets the camera's minimum declination around its look at point. Value is clamped to [float.Epsilon, Math.PI - float.Epsilon].
float MaximumDeclination [get, set]
 Gets or sets the camera's maximum declination around its look at point Value is clamped to [float.Epsilon, Math.PI - float.Epsilon].
float MinimumRadius [get, set]
 Gets or sets the camera's minimum radius from its look at point. Value is clamped to [float.Epsilon, float.MaxValue].
float MaximumRadius [get, set]
 Gets or sets the camera's maximum radius from its look at point. Value is clamped to [float.Epsilon, float.MaxValue].

Private Attributes

Matrix mViewMatrix
Projection mProjection
CameraSpring mLookAtSpring
CameraSpring mEyeSpring
bool mLookAtSpringEnabled
bool mEyeSpringEnabled
float mAzimuth
float mDeclination
float mRadius
float mMinAzimuth
float mMaxAzimuth
float mMinDeclination
float mMaxDeclination
float mMinRadius
float mMaxRadius

Detailed Description

OrbitCamera is a spherical coordinate camera in which the eye position is defined by an azimuth, declination and radius around an arbitrary target point in world space. Smooth spring-based movement is supported for both the eye and look at positions.

Definition at line 13 of file OrbitCamera.cs.


Constructor & Destructor Documentation

Mindshifter.OrbitCamera.OrbitCamera (  ) 

Creates a new instance of OrbitCamera with an azimuth of 0 degrees, declination of 90 degrees and radius of 1 using a perspective projection with a field of view of 45 degrees, aspect ratio of 4/3, near plane distance of 1 and far plane distance of 1000.

Definition at line 294 of file OrbitCamera.cs.

Mindshifter.OrbitCamera.OrbitCamera ( float  azimuth,
float  declination,
float  radius 
)

Creates a new instance of OrbitCamera with with the specified azimuth, declination and radius using a perspective projection with a field of view of 45 degrees, aspect ratio of 4/3, near plane distance of 1 and far plane distance of 1000.

Parameters:
azimuth The camera's azimuth (in radians)
declination The camera's declination (in radians)
radius The camera's radius

Definition at line 308 of file OrbitCamera.cs.

Mindshifter.OrbitCamera.OrbitCamera ( float  azimuth,
float  declination,
float  radius,
float  fov,
float  aspect,
float  near,
float  far 
)

Creates a new instance of OrbitCamera with the specified azimuth, declination and radius using a perspective projection with the specified projection parameters.

Parameters:
azimuth The camera's azimuth (in radians)
declination The camera's declination (in radians)
radius The camera's radius
fov The camera's perspective projection field of view
aspect The camera's perspective projection aspect ratio
near The near frustum plane distance of the camera's projection
far The far frustum plane distance of the camera's projection

Definition at line 325 of file OrbitCamera.cs.

References Mindshifter.OrbitCamera.mAzimuth, Mindshifter.OrbitCamera.mDeclination, Mindshifter.OrbitCamera.mEyeSpring, Mindshifter.OrbitCamera.mEyeSpringEnabled, Mindshifter.OrbitCamera.mLookAtSpring, Mindshifter.OrbitCamera.mLookAtSpringEnabled, Mindshifter.OrbitCamera.mMaxAzimuth, Mindshifter.OrbitCamera.mMaxDeclination, Mindshifter.OrbitCamera.mMaxRadius, Mindshifter.OrbitCamera.mMinAzimuth, Mindshifter.OrbitCamera.mMinDeclination, Mindshifter.OrbitCamera.mMinRadius, Mindshifter.OrbitCamera.mProjection, Mindshifter.OrbitCamera.mRadius, and Mindshifter.OrbitCamera.Projection.

Mindshifter.OrbitCamera.OrbitCamera ( float  azimuth,
float  declination,
float  radius,
Rectangle  rect,
float  near,
float  far 
)

Creates a new instance of OrbitCamera with the specified azimuth, declination and radius using an orthographic projection.

Parameters:
azimuth The camera's azimuth (in radians)
declination The camera's declination (in radians)
radius The camera's radius
rect The camera's orthographic projection rectangle
near The near frustum plane distance of the camera's projection
far The far frustum plane distance of the camera's projection

Definition at line 358 of file OrbitCamera.cs.

References Mindshifter.OrbitCamera.mAzimuth, Mindshifter.OrbitCamera.mDeclination, Mindshifter.OrbitCamera.mEyeSpring, Mindshifter.OrbitCamera.mEyeSpringEnabled, Mindshifter.OrbitCamera.mLookAtSpring, Mindshifter.OrbitCamera.mLookAtSpringEnabled, Mindshifter.OrbitCamera.mMaxAzimuth, Mindshifter.OrbitCamera.mMaxDeclination, Mindshifter.OrbitCamera.mMaxRadius, Mindshifter.OrbitCamera.mMinAzimuth, Mindshifter.OrbitCamera.mMinDeclination, Mindshifter.OrbitCamera.mMinRadius, Mindshifter.OrbitCamera.mProjection, Mindshifter.OrbitCamera.mRadius, and Mindshifter.OrbitCamera.Projection.


Member Function Documentation

void Mindshifter.OrbitCamera.Yaw ( float  value  ) 

Adjusts the camera's azimuth by the specified number of radians.

Parameters:
value The amount by which to adjust the camera's azimuth

Definition at line 385 of file OrbitCamera.cs.

References Mindshifter.OrbitCamera.Azimuth.

void Mindshifter.OrbitCamera.Pitch ( float  value  ) 

Adjusts the camera's declination by the specified number of radians.

Parameters:
value The amount (in radians) by which to adjust the camera's declination

Definition at line 394 of file OrbitCamera.cs.

References Mindshifter.OrbitCamera.Declination.

void Mindshifter.OrbitCamera.Zoom ( float  value  ) 

Adjusts the camera's radius by the specified value.

Parameters:
value The amount by which to adjust the camera's radius

Definition at line 403 of file OrbitCamera.cs.

References Mindshifter.OrbitCamera.Radius.

void Mindshifter.OrbitCamera.Update ( float  elapsedSeconds  ) 

Performs any required updates to the camera's values based on the specified elapsed time.

Parameters:
elapsedSeconds The elapsed time in seconds since the last call to Update()

Implements Mindshifter.ICamera.

Definition at line 412 of file OrbitCamera.cs.

References Mindshifter.OrbitCamera.LookAtPoint, Mindshifter.OrbitCamera.mAzimuth, Mindshifter.OrbitCamera.mDeclination, Mindshifter.OrbitCamera.mEyeSpring, Mindshifter.OrbitCamera.mLookAtSpring, Mindshifter.OrbitCamera.mRadius, Mindshifter.OrbitCamera.mViewMatrix, Mindshifter.CameraSpring.Origin, Mindshifter.OrbitCamera.Position, and Mindshifter.CameraSpring.Update().

Ray Mindshifter.OrbitCamera.GetPickRay ( Vector2  position,
Viewport  viewport 
)

Returns a world space ray cast from the specified screen projected position.

Parameters:
position The position in screen space to cast a ray from
viewport The viewport through which to unproject the specified position

Implements Mindshifter.ICamera.

Definition at line 433 of file OrbitCamera.cs.

References Mindshifter.OrbitCamera.ProjectionMatrix, and Mindshifter.OrbitCamera.ViewMatrix.


Member Data Documentation

Matrix Mindshifter.OrbitCamera.mViewMatrix [private]

Definition at line 15 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.Update().

Projection Mindshifter.OrbitCamera.mProjection [private]

Definition at line 16 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

CameraSpring Mindshifter.OrbitCamera.mLookAtSpring [private]

Definition at line 18 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera(), and Mindshifter.OrbitCamera.Update().

CameraSpring Mindshifter.OrbitCamera.mEyeSpring [private]

Definition at line 19 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera(), and Mindshifter.OrbitCamera.Update().

bool Mindshifter.OrbitCamera.mLookAtSpringEnabled [private]

Definition at line 21 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

bool Mindshifter.OrbitCamera.mEyeSpringEnabled [private]

Definition at line 22 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

float Mindshifter.OrbitCamera.mAzimuth [private]

Definition at line 24 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera(), and Mindshifter.OrbitCamera.Update().

float Mindshifter.OrbitCamera.mDeclination [private]

Definition at line 25 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera(), and Mindshifter.OrbitCamera.Update().

float Mindshifter.OrbitCamera.mRadius [private]

Definition at line 26 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera(), and Mindshifter.OrbitCamera.Update().

float Mindshifter.OrbitCamera.mMinAzimuth [private]

Definition at line 28 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

float Mindshifter.OrbitCamera.mMaxAzimuth [private]

Definition at line 29 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

float Mindshifter.OrbitCamera.mMinDeclination [private]

Definition at line 30 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

float Mindshifter.OrbitCamera.mMaxDeclination [private]

Definition at line 31 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

float Mindshifter.OrbitCamera.mMinRadius [private]

Definition at line 32 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

float Mindshifter.OrbitCamera.mMaxRadius [private]

Definition at line 33 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().


Property Documentation

Matrix Mindshifter.OrbitCamera.ViewMatrix [get]

Gets the camera's view matrix.

Implements Mindshifter.ICamera.

Definition at line 39 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.GetPickRay().

Matrix Mindshifter.OrbitCamera.ProjectionMatrix [get]

Gets the camera's projection matrix.

Implements Mindshifter.ICamera.

Definition at line 47 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.GetPickRay().

Projection Mindshifter.OrbitCamera.Projection [get]

Gets the camera's projection.

Definition at line 55 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.OrbitCamera().

BoundingFrustum Mindshifter.OrbitCamera.Frustum [get]

Gets the camera's bounding frustum.

Implements Mindshifter.ICamera.

Definition at line 63 of file OrbitCamera.cs.

Vector3 Mindshifter.OrbitCamera.Position [get]

Gets the camera's eye position.

Implements Mindshifter.ICamera.

Definition at line 71 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.Update().

Vector3 Mindshifter.OrbitCamera.LookAtPoint [get, set]

Gets or sets the camera's look at position.

Definition at line 85 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.Update().

bool Mindshifter.OrbitCamera.EyeSpringEnabled [get, set]

Gets or sets the value determining whether the camera's eye spring is enabled or disabled.

Definition at line 102 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.EyeSpringStiffness [get, set]

Gets or sets the stiffness of the camera's eye spring.

Definition at line 111 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.EyeSpringDamping [get, set]

Gets or sets the damping coefficient of the camera's eye spring.

Definition at line 120 of file OrbitCamera.cs.

bool Mindshifter.OrbitCamera.LookAtSpringEnabled [get, set]

Gets or sets the value determining whether the camera's look at spring is enabled or disabled.

Definition at line 130 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.LookAtSpringStiffness [get, set]

Gets or sets the stiffness of the camera's look at spring.

Definition at line 139 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.LookAtSpringDamping [get, set]

Gets or sets the damping coefficient of the camera's look at spring.

Definition at line 148 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.Azimuth [get, set]

Gets or sets the camera's azimuth around its look at point.

Definition at line 157 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.Yaw().

float Mindshifter.OrbitCamera.Declination [get, set]

Gets or sets the camera's declination around its look at point.

Definition at line 166 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.Pitch().

float Mindshifter.OrbitCamera.Radius [get, set]

Gets or sets the camera's distance from its look at point.

Definition at line 175 of file OrbitCamera.cs.

Referenced by Mindshifter.OrbitCamera.Zoom().

float Mindshifter.OrbitCamera.MinimumAzimuth [get, set]

Gets or sets the camera's minimum azimuth around its look at point. Value is clamped to [float.MinValue, float.MaxValue].

Definition at line 185 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.MaximumAzimuth [get, set]

Gets or sets the camera's maximum azimuth around its look at point. Value is clamped to [float.MinValue, float.MaxValue].

Definition at line 203 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.MinimumDeclination [get, set]

Gets or sets the camera's minimum declination around its look at point. Value is clamped to [float.Epsilon, Math.PI - float.Epsilon].

Definition at line 221 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.MaximumDeclination [get, set]

Gets or sets the camera's maximum declination around its look at point Value is clamped to [float.Epsilon, Math.PI - float.Epsilon].

Definition at line 239 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.MinimumRadius [get, set]

Gets or sets the camera's minimum radius from its look at point. Value is clamped to [float.Epsilon, float.MaxValue].

Definition at line 257 of file OrbitCamera.cs.

float Mindshifter.OrbitCamera.MaximumRadius [get, set]

Gets or sets the camera's maximum radius from its look at point. Value is clamped to [float.Epsilon, float.MaxValue].

Definition at line 275 of file OrbitCamera.cs.


The documentation for this class was generated from the following file:
Generated on Mon Mar 31 03:29:21 2008 for Cameras by  doxygen 1.5.1-p1