#include <camera.h>
Inheritance diagram for oxygen::Camera:
Public Member Functions | |
Camera () | |
virtual | ~Camera () |
void | SetViewport (int x, int y, int width, int height) |
sets viewpoint properties | |
int | GetViewportX () |
int | GetViewportY () |
int | GetViewportWidth () |
int | GetViewportHeight () |
void | SetFOV (const float fov) |
sets the field of view (FOV) | |
void | SetZNear (const float zNear) |
sets the distance of the Z near plane | |
void | SetZFar (const float zFar) |
sets the distance of the Z far plane | |
void | AdjustFOV (const float fov) |
adjusts the current FOV, i.e. | |
void | AdjustZNear (const float zNear) |
adjusts the distance of the Z near plane, i.e adds a delta increment | |
void | AdjustZFar (const float zFar) |
adjusts the distance of the Z far plane, i.e adds a delta increment | |
float | GetFOV () const |
returns the field of View | |
float | GetZNear () const |
returns the distance of the Z near plane | |
float | GetZFar () const |
returns the distance of the Z far plane | |
const salt::Matrix & | GetViewTransform () const |
returns the view transformation matrix | |
const salt::Matrix & | GetProjectionTransform () const |
returns the projection matrix | |
void | DescribeFrustum (salt::Frustum &frustum) const |
fills in a frustum object with the correct parameters for this camera | |
void | Bind () |
sets the view transform to be the inverted WorldTransform and sets up the projection transform matrix | |
Protected Member Functions | |
virtual void | OnLink () |
gets the right viewport resolution | |
Protected Attributes | |
float | mFOV |
horizontal field of view, default is 60 degrees | |
float | mZNear |
near clipping plane, default is 1 | |
float | mZFar |
far clipping plane, default is 2000 | |
int | mX |
x-position of upper left viewport corner, default is 0 | |
int | mY |
y-position of upper left viewport corner, default is 0 | |
int | mWidth |
width of viewport, default is the engine window width | |
int | mHeight |
height of viewport, default is the egine window height | |
float | mHalfWorldWidth |
float | mHalfWorldHeight |
salt::Matrix | mViewTransform |
the view transformation matrix | |
salt::Matrix | mProjectionTransform |
the projection matrix | |
Private Member Functions | |
virtual void | UpdateHierarchyInternal () |
calculates the view matrix (world->view space transformation) |
The active camera is responsible to construct a frustum needed to render the scene.
Definition at line 35 of file camera.h.
|
Definition at line 29 of file camera.cpp. References salt::Matrix::Identity(), mFOV, mHeight, mViewTransform, mWidth, mX, mY, mZFar, mZNear, and zeitgeist::Leaf::SetName(). Here is the call graph for this function: ![]() |
|
Definition at line 43 of file camera.cpp. |
|
adjusts the current FOV, i.e. adds a delta increment Definition at line 175 of file camera.cpp. References mFOV. |
|
adjusts the distance of the Z far plane, i.e adds a delta increment
Definition at line 185 of file camera.cpp. References mZFar. |
|
adjusts the distance of the Z near plane, i.e adds a delta increment
Definition at line 180 of file camera.cpp. References mZNear. |
|
sets the view transform to be the inverted WorldTransform and sets up the projection transform matrix
Definition at line 93 of file camera.cpp. References salt::Matrix::CalcInfiniteFrustum(), oxygen::BaseNode::GetWorldTransform(), salt::Matrix::InvertRotationMatrix(), mHalfWorldHeight, mHalfWorldWidth, mProjectionTransform, mViewTransform, mZNear, and salt::Matrix::RotateX(). Here is the call graph for this function: ![]() |
|
fills in a frustum object with the correct parameters for this camera The code extracts a frustum given the projection and view transforms. It is really fast and very generic because of that. Definition at line 51 of file camera.cpp. References salt::Plane::d, oxygen::BaseNode::GetWorldTransform(), salt::Matrix::m, salt::Frustum::mBasePos, salt::Frustum::mPlanes, mProjectionTransform, mViewTransform, salt::Plane::normal, salt::Plane::Normalize(), salt::Frustum::PI_BOTTOM, salt::Frustum::PI_FAR, salt::Frustum::PI_LEFT, salt::Frustum::PI_NEAR, salt::Frustum::PI_RIGHT, salt::Frustum::PI_TOP, salt::Matrix::Pos(), and salt::TVector3< DATATYPE, TYPE >::Set(). Here is the call graph for this function: ![]() |
|
returns the field of View
Definition at line 190 of file camera.cpp. References mFOV. |
|
returns the projection matrix
Definition at line 210 of file camera.cpp. References mProjectionTransform. |
|
Definition at line 155 of file camera.cpp. References mHeight. |
|
Definition at line 150 of file camera.cpp. References mWidth. |
|
Definition at line 140 of file camera.cpp. References mX. |
|
Definition at line 145 of file camera.cpp. References mY. |
|
returns the view transformation matrix
Definition at line 205 of file camera.cpp. References mViewTransform. |
|
returns the distance of the Z far plane
Definition at line 200 of file camera.cpp. References mZFar. |
|
returns the distance of the Z near plane
Definition at line 195 of file camera.cpp. References mZNear. |
|
gets the right viewport resolution
Reimplemented from zeitgeist::Leaf. Definition at line 108 of file camera.cpp. References zeitgeist::Object::GetLog(), zeitgeist::Object::GetScript(), mHeight, and mWidth. Here is the call graph for this function: ![]() |
|
sets the field of view (FOV)
Definition at line 160 of file camera.cpp. References mFOV. |
|
sets viewpoint properties
Definition at line 132 of file camera.cpp. |
|
sets the distance of the Z far plane
Definition at line 170 of file camera.cpp. References mZFar. |
|
sets the distance of the Z near plane
Definition at line 165 of file camera.cpp. References mZNear. |
|
calculates the view matrix (world->view space transformation)
Reimplemented from oxygen::BaseNode. Definition at line 123 of file camera.cpp. References salt::gClamp(), salt::gDegToRad(), mFOV, mHalfWorldHeight, mHalfWorldWidth, mHeight, mWidth, and mZNear. Here is the call graph for this function: ![]() |
|
horizontal field of view, default is 60 degrees
Definition at line 111 of file camera.h. Referenced by AdjustFOV(), Camera(), GetFOV(), SetFOV(), and UpdateHierarchyInternal(). |
|
Definition at line 131 of file camera.h. Referenced by Bind(), and UpdateHierarchyInternal(). |
|
Definition at line 130 of file camera.h. Referenced by Bind(), and UpdateHierarchyInternal(). |
|
height of viewport, default is the egine window height
Definition at line 129 of file camera.h. Referenced by Camera(), GetViewportHeight(), OnLink(), SetViewport(), and UpdateHierarchyInternal(). |
|
the projection matrix
Definition at line 137 of file camera.h. Referenced by Bind(), DescribeFrustum(), and GetProjectionTransform(). |
|
the view transformation matrix
Definition at line 134 of file camera.h. Referenced by Bind(), Camera(), DescribeFrustum(), and GetViewTransform(). |
|
width of viewport, default is the engine window width
Definition at line 126 of file camera.h. Referenced by Camera(), GetViewportWidth(), OnLink(), SetViewport(), and UpdateHierarchyInternal(). |
|
x-position of upper left viewport corner, default is 0
Definition at line 120 of file camera.h. Referenced by Camera(), GetViewportX(), and SetViewport(). |
|
y-position of upper left viewport corner, default is 0
Definition at line 123 of file camera.h. Referenced by Camera(), GetViewportY(), and SetViewport(). |
|
far clipping plane, default is 2000
Definition at line 117 of file camera.h. Referenced by AdjustZFar(), Camera(), GetZFar(), and SetZFar(). |
|
near clipping plane, default is 1
Definition at line 114 of file camera.h. Referenced by AdjustZNear(), Bind(), Camera(), GetZNear(), SetZNear(), and UpdateHierarchyInternal(). |