Nameless Engine
|
#include <CameraProperties.h>
Classes | |
struct | Data |
Public Member Functions | |
void | setFov (unsigned int iVerticalFov) |
void | setNearClipPlaneDistance (float nearClipPlaneDistance) |
void | setFarClipPlaneDistance (float farClipPlaneDistance) |
unsigned int | getVerticalFov () |
float | getNearClipPlaneDistance () |
float | getFarClipPlaneDistance () |
CameraMode | getCurrentCameraMode () |
Data::OrbitalModeData | getOrbitalModeProperties () |
glm::vec3 | getWorldLocation () |
glm::mat4x4 | getViewMatrix () |
glm::mat4x4 | getProjectionMatrix () |
Frustum * | getCameraFrustum () |
Private Member Functions | |
void | setRenderTargetSize (unsigned int iRenderTargetWidth, unsigned int iRenderTargetHeight) |
void | makeSureViewMatrixIsUpToDate () |
void | makeSureProjectionMatrixAndClipPlanesAreUpToDate () |
void | recalculateFrustum () |
Private Attributes | |
std::pair< std::recursive_mutex, Data > | mtxData {} |
Static Private Attributes | |
static constexpr float | floatDelta = 0.00001F |
Friends | |
class | CameraNode |
class | Renderer |
Defines camera settings, base axis, location, modes, etc.
|
inline |
Returns camera's frustum for fast read-only access.
CameraMode ne::CameraProperties::getCurrentCameraMode | ( | ) |
Returns the current camera mode.
float ne::CameraProperties::getFarClipPlaneDistance | ( | ) |
Returns distance from camera (view) space origin to camera's far clip plane.
float ne::CameraProperties::getNearClipPlaneDistance | ( | ) |
Returns distance from camera (view) space origin to camera's near clip plane.
CameraProperties::Data::OrbitalModeData ne::CameraProperties::getOrbitalModeProperties | ( | ) |
Returns orbital camera properties.
glm::mat4x4 ne::CameraProperties::getProjectionMatrix | ( | ) |
Returns a matrix that transforms positions from view (camera) space to 2D projection window (homogeneous clip space).
unsigned int ne::CameraProperties::getVerticalFov | ( | ) |
Returns vertical field of view of the camera.
glm::mat4x4 ne::CameraProperties::getViewMatrix | ( | ) |
Returns a matrix that transforms positions to view (camera) space.
glm::vec3 ne::CameraProperties::getWorldLocation | ( | ) |
Returns camera's world location.
|
private |
Recalculates camera's projection matrix and clip plane heights if they need to be updated.
|
private |
Recalculates camera's view matrix if it needs to be updated.
|
private |
Recalculates camera's frustum.
void ne::CameraProperties::setFarClipPlaneDistance | ( | float | farClipPlaneDistance | ) |
Sets distance from camera (view) space origin to camera's far clip plane.
farClipPlaneDistance | Far Z distance. Should be a positive value. |
void ne::CameraProperties::setFov | ( | unsigned int | iVerticalFov | ) |
Sets camera's vertical field of view.
iVerticalFov | Vertical field of view. |
void ne::CameraProperties::setNearClipPlaneDistance | ( | float | nearClipPlaneDistance | ) |
Sets distance from camera (view) space origin to camera's near clip plane.
nearClipPlaneDistance | Near Z distance. Should be a positive value. |
|
private |
Sets size of the render target for projection matrix calculations.
iRenderTargetWidth | Width of the buffer we are rendering the image to. |
iRenderTargetHeight | Height of the buffer we are rendering the image to. |
|
inlinestaticconstexprprivate |
Delta to compare input to zero.
|
private |
Internal properties.