SilverLining
|
A Camera describes a given view, along with its associated view, projection, and viewport. More...
#include <Camera.h>
Public Member Functions | |
Camera (bool rightHanded) | |
Constructor; pass in whether this camera is within a right-handed or left-handed coordinate system. | |
Camera (const Camera *camera, bool copyXForms, bool needsFrustum) | |
Copy this Camera from another one. | |
virtual | ~Camera () |
Virtual destructor. | |
void | SetModelViewMatrix (const Matrix4 &modelViewMatrix) |
Associate a 4x4 view matrix with this camera. | |
void | SetProjectionMatrix (const Matrix4 &projectionMatrix) |
Associate a 4x4 projection matrix with this camera. | |
void | SetViewport (int x, int y, int w, int h) |
Set the viewport origin and size for this camera. | |
const Matrix4 & | GetModelViewMatrix () const |
Retrieve the camera's view matrix. | |
const Matrix4 & | GetProjectionMatrix () const |
Retrieve the camera's projection matrix. | |
const Matrix4 & | GetModelViewProjectionMatrix () const |
Retrieve the camera's combined view X projection matrix. | |
bool | GetViewport (int &x, int &y, int &w, int &h) const |
Retrieve the viewport origin and size. | |
bool | GetViewport (int viewport[4]) const |
Retrieve the viewport in a format useful for OpenGL. | |
bool | HasCameraMatrix (void) const |
Returns if this Camera has a view matrix associated with it yet. | |
bool | HasProjectionMatrix (void) const |
Returns if this Camera has a projection matrix associated with it yet. | |
bool | HasViewPort (void) const |
Returns if this Camera has a viewport associated with it yet. | |
void | SetUpVector (const Vector3 &upVector) |
Sets the assumption of what direction is "up". | |
void | SetUpVector (double x, double y, double z) |
This is same as the SetUpVector() above, but normalizes the incoming values. | |
void | SetRightVector (const Vector3 &rightVector) |
Sets the assumption of what direction is "right". | |
void | SetRightVector (double x, double y, double z) |
This is same as the SetRightVector() above, but normalizes the incoming values. | |
const Vector3 & | GetUpVector (void) const |
Retrieve the "up" direction for this camera. | |
const Vector3 & | GetRightVector (void) const |
Retrieve the "right" direction for this camera. | |
const Frustum & | GetFrustumWorldSpace (void) const |
Retrieve the camera's frustum, in world space. | |
const Vector3 & | GetPosition (void) const |
Retrieve the camera's position in world space. | |
double | GetAltitude (void) const |
Retrieve the camera's altitude in world space. | |
const Matrix4 & | GetBasis4x4 () const |
Returns a matrix4 defining the basis based on the current "up vector.". | |
const Matrix4 & | GetInverseBasis4x4 () const |
Returns a matrix4 defining the inverse basis based on the current "up vector.". | |
const Matrix3 & | GetBasis3x3 () const |
Returns a matrix4 defining the basis based on the current "up vector.". | |
const Matrix3 & | GetInverseBasis3x3 () const |
Returns a matrix4 defining the inverse basis based on the current "up vector.". | |
void SILVERLINING_API | SetName (const char *name) |
Set the name of the camera. | |
const char *SILVERLINING_API | GetName (void) const |
Get the name of the camera. | |
bool | operator== (const Camera &rhs) const |
Equality operator. | |
bool | operator!= (const Camera &rhs) const |
In-Equality operator. | |
void | SetRenderTarget (int _target) |
Set the renderer specific render target. | |
int | GetRenderTarget (void) const |
Get the renderer specific render target. | |
void | GetViewPortFast (int &x, int &y, int &w, int &h) const |
Get viewport without any checks as to whether viewport has been set or not. | |
bool | GetDepthRange (float &zmin, float &zmax) const |
Retrieves the depth range for rendering. | |
bool | SetDepthRange (float zmin, float zmax) |
Sets the depth range for rendering. | |
bool | HasDepthRange (void) const |
Whether the camera has a depth range set on it. | |
double | GetFieldOfView (void) const |
Get the field of view given the set projection matrix. | |
A Camera describes a given view, along with its associated view, projection, and viewport.
SilverLining::Camera::Camera | ( | bool | rightHanded | ) |
Constructor; pass in whether this camera is within a right-handed or left-handed coordinate system.
SilverLining::Camera::Camera | ( | const Camera * | camera, |
bool | copyXForms, | ||
bool | needsFrustum | ||
) |
Copy this Camera from another one.
If the resulting copy does not require transformation matrices or the camera's frustum to be computed, these may be disabled to gain speed.
|
virtual |
Virtual destructor.
double SilverLining::Camera::GetAltitude | ( | void | ) | const |
Retrieve the camera's altitude in world space.
bool SilverLining::Camera::GetDepthRange | ( | float & | zmin, |
float & | zmax | ||
) | const |
Retrieves the depth range for rendering.
zmin | The depth buffer range min value, float [0.0 .. 1.0]. |
zmax | The depth buffer range max value, float [0.0 .. 1.0]. |
const Frustum & SilverLining::Camera::GetFrustumWorldSpace | ( | void | ) | const |
Retrieve the camera's frustum, in world space.
const Matrix4 & SilverLining::Camera::GetModelViewMatrix | ( | ) | const |
Retrieve the camera's view matrix.
const Matrix4 & SilverLining::Camera::GetModelViewProjectionMatrix | ( | ) | const |
Retrieve the camera's combined view X projection matrix.
const char *SILVERLINING_API SilverLining::Camera::GetName | ( | void | ) | const |
Get the name of the camera.
const Vector3 & SilverLining::Camera::GetPosition | ( | void | ) | const |
Retrieve the camera's position in world space.
const Matrix4 & SilverLining::Camera::GetProjectionMatrix | ( | ) | const |
Retrieve the camera's projection matrix.
|
inline |
Get the renderer specific render target.
This is the frame buffer object for OpenGL/OpenGL32 renderers.
const Vector3 & SilverLining::Camera::GetRightVector | ( | void | ) | const |
Retrieve the "right" direction for this camera.
const Vector3 & SilverLining::Camera::GetUpVector | ( | void | ) | const |
Retrieve the "up" direction for this camera.
bool SilverLining::Camera::GetViewport | ( | int & | x, |
int & | y, | ||
int & | w, | ||
int & | h | ||
) | const |
Retrieve the viewport origin and size.
bool SilverLining::Camera::GetViewport | ( | int | viewport[4] | ) | const |
Retrieve the viewport in a format useful for OpenGL.
(x, y, w, h)
bool SilverLining::Camera::HasCameraMatrix | ( | void | ) | const |
Returns if this Camera has a view matrix associated with it yet.
bool SilverLining::Camera::HasProjectionMatrix | ( | void | ) | const |
Returns if this Camera has a projection matrix associated with it yet.
bool SilverLining::Camera::HasViewPort | ( | void | ) | const |
Returns if this Camera has a viewport associated with it yet.
bool SilverLining::Camera::SetDepthRange | ( | float | zmin, |
float | zmax | ||
) |
Sets the depth range for rendering.
zmin | The depth buffer range min value, float [0.0 .. 1.0]. |
zmax | The depth buffer range max value, float [0.0 .. 1.0]. |
void SilverLining::Camera::SetModelViewMatrix | ( | const Matrix4 & | modelViewMatrix | ) |
Associate a 4x4 view matrix with this camera.
This should be updated as often as necessary.
void SILVERLINING_API SilverLining::Camera::SetName | ( | const char * | name | ) |
Set the name of the camera.
void SilverLining::Camera::SetProjectionMatrix | ( | const Matrix4 & | projectionMatrix | ) |
Associate a 4x4 projection matrix with this camera.
|
inline |
Set the renderer specific render target.
This is the frame buffer object for OpenGL/OpenGL32 renderers.
void SilverLining::Camera::SetRightVector | ( | const Vector3 & | rightVector | ) |
Sets the assumption of what direction is "right".
If the vector (x, y, z) is not a unit vector, it is normalized before being stored. Cannot be called prior to Atmosphere::Initialize(). Must be called in conjunction with SetUpVector().
Be sure to call this prior to positioning any clouds. The incoming vector is used as is (without normalization).
void SilverLining::Camera::SetRightVector | ( | double | x, |
double | y, | ||
double | z | ||
) |
This is same as the SetRightVector() above, but normalizes the incoming values.
That is, if the incoming vector (x, y, z) is not a unit vector, it is normalized before being stored.
void SilverLining::Camera::SetUpVector | ( | const Vector3 & | upVector | ) |
Sets the assumption of what direction is "up".
Cannot be called prior to Atmosphere::Initialize(). Must be called in conjunction with SetRightVector().
Be sure to call this prior to positioning any clouds.
In a geocentric / ECEF coordinate system, this should be the normalized camera position vector pointing from the center of the Earth, not the local normal vector of the Earth's ellipsoid. There is a subtle difference between the two that can lead to cloud positions being a bit off. The incoming vector is used as is (without normalization).
void SilverLining::Camera::SetUpVector | ( | double | x, |
double | y, | ||
double | z | ||
) |
This is same as the SetUpVector() above, but normalizes the incoming values.
That is, if the incoming vector (x, y, z) is not a unit vector, it is normalized before being stored.
void SilverLining::Camera::SetViewport | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Set the viewport origin and size for this camera.