![]() |
The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
|
The base camera. More...
#include <BaseCamera.h>
Public Member Functions | |
| LBaseCamera () | |
| Constructor. More... | |
| void | SetPerspective (float, float, float, float) |
| Set perspective camera. More... | |
| void | SetOrthographic (float, float, float, float) |
| Set orthographic camera. More... | |
| virtual void | Move (float) |
| Move along velocity vector. More... | |
| void | MoveTo (const Vector3 &) |
| Move to new position. More... | |
| void | AddToPos (const Vector3 &) |
| Add to position. More... | |
| void | SetVel (const Vector3 &) |
| Set velocity. More... | |
| void | AddToYaw (float) |
| Add to yaw. More... | |
| void | AddToPitch (float) |
| Add to pitch. More... | |
| void | AddToRoll (float) |
| Add to roll. More... | |
| void | SetYaw (float) |
| Set yaw. More... | |
| void | SetPitch (float) |
| Set pitch. More... | |
| void | SetRoll (float) |
| Set roll. More... | |
| const float | GetYaw () const |
| Get yaw. More... | |
| const float | GetPitch () const |
| Get pitch. More... | |
| const float | GetRoll () const |
| Get roll. More... | |
| void | RotateToFaceCamera (LSpriteDesc3D &) |
| Rotate to face camera. More... | |
| bool | BoxInFrustum (const BoundingBox &) |
| Does the box overlap the view frustum? More... | |
| const Vector3 & | GetViewVector () const |
| Get the view vector. More... | |
| const Vector3 & | GetUpVector () const |
| Get the up vector. More... | |
| const BoundingFrustum & | GetFrustum () const |
| Get the view frustum. More... | |
| const Vector3 & | GetPos () const |
| Get position. More... | |
Protected Member Functions | |
| void | BuildViewFrustum () |
| Build the view frustum. More... | |
| virtual void | Update () |
| Update matrices and frustum. More... | |
Additional Inherited Members | |
Static Protected Attributes inherited from LCameraCommon | |
| static XMFLOAT4X4 | m_orient |
| Orientation matrix. | |
| static XMFLOAT4X4 | m_view |
| View matrix. | |
| static XMFLOAT4X4 | m_projection |
| Projection matrix. | |
Basic camera functionality including position, orientation, velocity, and frustum culling.
| LBaseCamera::LBaseCamera | ( | ) |
Set the orientation, view, and projection matrices to the identity matrix.
| void LBaseCamera::AddToPitch | ( | float | angle | ) |
Add angle to pitch.
| angle | Angle to be added to pitch, in radians. |
| void LBaseCamera::AddToPos | ( | const Vector3 & | delta | ) |
Add to the camera position.
| delta | Change in position. |
| void LBaseCamera::AddToRoll | ( | float | angle | ) |
Add angle to roll.
| angle | Angle to be added to roll, in radians. |
| void LBaseCamera::AddToYaw | ( | float | angle | ) |
Add angle to yaw.
| angle | Angle to be added to yaw, in radians. |
| bool LBaseCamera::BoxInFrustum | ( | const BoundingBox & | box | ) |
Box in frustum test.
| box | An AABB. |
|
protected |
Compute the view frustum from the camera's projection and view matrices.
| const BoundingFrustum & LBaseCamera::GetFrustum | ( | ) | const |
Reader function for the view frustum.
| const float LBaseCamera::GetPitch | ( | ) | const |
Reader function for the pitch.
| const Vector3 & LBaseCamera::GetPos | ( | ) | const |
Reader function for the camera position.
| const float LBaseCamera::GetRoll | ( | ) | const |
Reader function for the roll.
| const Vector3 & LBaseCamera::GetUpVector | ( | ) | const |
Reader function for the up vector.
| const Vector3 & LBaseCamera::GetViewVector | ( | ) | const |
Reader function for the view vector.
| const float LBaseCamera::GetYaw | ( | ) | const |
Reader function for the yaw.
|
virtual |
Move the camera along its velocity vector for a given amount of time.
| t | Frame time in seconds. |
| void LBaseCamera::MoveTo | ( | const Vector3 & | p | ) |
Move camera to a new position.
| p | New position. |
| void LBaseCamera::RotateToFaceCamera | ( | LSpriteDesc3D & | sd | ) |
Rotate a sprite descriptor to face the camera.
| sd | [in, out] 3D sprite descriptor |
| void LBaseCamera::SetOrthographic | ( | float | width, |
| float | ht, | ||
| float | nearz, | ||
| float | farz | ||
| ) |
Set renderer to orthographic projection.
| width | Window width in pixels. |
| ht | Window height in pixels. |
| nearz | Z coordinate of the near clipping plane. |
| farz | Z coordinate of the far clipping plane. |
| void LBaseCamera::SetPerspective | ( | float | aspectratio, |
| float | hfov, | ||
| float | nearz, | ||
| float | farz | ||
| ) |
Set renderer to perspective projection.
| aspectratio | Window aspect ratio. |
| hfov | Horizontal field of view angle |
| nearz | Z coordinate of the near clipping plane. |
| farz | Z coordinate of the far clipping plane. |
| void LBaseCamera::SetPitch | ( | float | angle | ) |
Set pitch angle.
| angle | New pitch angle, in radians. |
| void LBaseCamera::SetRoll | ( | float | angle | ) |
Set roll angle.
| angle | New roll angle, in radians. |
| void LBaseCamera::SetVel | ( | const Vector3 & | p | ) |
Set camera velocity.
| p | The new velocity vector. |
| void LBaseCamera::SetYaw | ( | float | angle | ) |
Set yaw angle.
| angle | New yaw angle, in radians. |
|
protectedvirtual |
Update the camera's orientation matrix, view vector, up vector, view matrix, and view frustum from its current yaw, pitch, roll, and position.