Defines camera world, view and projection transforms.
More...
#include <RenderCamera.h>
|
static const float | NominalAspectRatio = 4.f/3.f |
|
static const float | MinAspectRatioForPortraitMode = 1.f |
|
Defines camera world, view and projection transforms.
float RenderCamera::CalculateEffectiveFOV |
( |
| ) |
const |
- Returns
- the effective FOV after aspect tweaks have been applied
float Eegeo::Camera::RenderCamera::GetAltitude |
( |
| ) |
const |
|
inline |
- Returns
- the altitude above sea level in metres of the camera origin
float Eegeo::Camera::RenderCamera::GetAspect |
( |
| ) |
const |
|
inline |
- Returns
- horizontal-to-vertical aspect ratio (width / height)
const Eegeo::dv3& Eegeo::Camera::RenderCamera::GetEcefLocation |
( |
| ) |
const |
|
inline |
- Returns
- camera origin point in ECEF coordinates
float Eegeo::Camera::RenderCamera::GetFarClip |
( |
| ) |
const |
|
inline |
- Returns
- distance to far clip plane
float Eegeo::Camera::RenderCamera::GetFOV |
( |
| ) |
const |
|
inline |
- Returns
- vertical field of view angle, in radians
const Eegeo::m44 & RenderCamera::GetInverseViewProjectionMatrix |
( |
| ) |
const |
- Returns
- inverse of view-projection transform
const Eegeo::m44& Eegeo::Camera::RenderCamera::GetModelMatrix |
( |
| ) |
const |
|
inline |
- Returns
- model-to-world orientation transform of camera, with translation component set to zero
float Eegeo::Camera::RenderCamera::GetNearClip |
( |
| ) |
const |
|
inline |
- Returns
- distance to near clip plane
float RenderCamera::GetNearClipRatio |
( |
| ) |
const |
- Returns
- 2 * distance to near clip plane / height of near plane.
const Eegeo::m44 & RenderCamera::GetProjectionMatrix |
( |
| ) |
const |
- Returns
- projection transform
const Eegeo::m44 & RenderCamera::GetViewMatrix |
( |
| ) |
const |
- Returns
- world-to-view transform
float Eegeo::Camera::RenderCamera::GetViewportHeight |
( |
| ) |
const |
|
inline |
- Returns
- viewport height in pixels
v2 Eegeo::Camera::RenderCamera::GetViewportOrigin |
( |
| ) |
const |
|
inline |
- Returns
- viewport origin in screen coords (screen origin top left)
float Eegeo::Camera::RenderCamera::GetViewportWidth |
( |
| ) |
const |
|
inline |
- Returns
- viewport width in pixels
const Eegeo::m44 & RenderCamera::GetViewProjectionMatrix |
( |
| ) |
const |
- Returns
- view-projection transform (view transform multiplied by projection transform)
void RenderCamera::Project |
( |
const Eegeo::v3 & |
cameraRelativeWorldPosition, |
|
|
Eegeo::v3 & |
screenPosition |
|
) |
| const |
Project a camera-relative Ecef point to screenspace
- Parameters
-
cameraRelativeWorldPosition | point in ECEF coordinate frame, with translation relative to camera origin |
screenPosition | [out] projected position in screenspace |
void RenderCamera::Project360 |
( |
const Eegeo::v3 & |
cameraRelativeWorldPosition, |
|
|
Eegeo::v3 & |
screenPosition |
|
) |
| const |
Project a camera-relative Ecef point to screenspace, where screen plane points behind the camera are projected onto a plane just in front before the perspective is applied.
- Parameters
-
cameraRelativeWorldPosition | point in ECEF coordinate frame, with translation relative to camera origin |
screenPosition | [out] projected position in screenspace |
void RenderCamera::SetEcefLocation |
( |
const Eegeo::dv3 & |
ecefLocation | ) |
|
Set the camera origin point in ECEF coordinates
- Parameters
-
ecefLocation | camera origin point |
void RenderCamera::SetOrientationMatrix |
( |
const Eegeo::m33 & |
m | ) |
|
- Parameters
-
m | a rotation matrix orienting the camera in the ECEF coordinate frame |
void RenderCamera::SetProjection |
( |
float |
nominalVerticalFovRadians, |
|
|
float |
nearZ, |
|
|
float |
farZ |
|
) |
| |
Set the camera projection transform
- Parameters
-
nominalVerticalFovRadians | field of view angle, in radians, of the vertical view extents |
nearZ | distance to near clip plane, in metres |
farZ | distance to far clip plane, in metres |
void RenderCamera::SetProjectionMatrix |
( |
Eegeo::m44 & |
projectionMatrix | ) |
|
Set an explicit projection transform
- Parameters
-
projectionMatrix | projection matrix |
void RenderCamera::SetViewport |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height |
|
) |
| |
Set the viewport of the camera in absolute screen pixel coords, with screen origin being top left Calling this method will recompute a projection matrix using the values passed to SetProjection()
- Parameters
-
x | horizontal pixel coordinate defining the left of viewport rectangle |
y | vertical pixel coordinate defining the top of viewport rectangle |
width | width in pixels |
height | height in pixels |
void RenderCamera::UnProject |
( |
const Eegeo::v3 & |
screenPosition, |
|
|
Eegeo::v3 & |
cameraRelativeWorldPosition |
|
) |
| const |
Transform a screen-space position to a camera-relative Ecef point
- Parameters
-
screenPosition | screen-space point |
cameraRelativeWorldPosition | [out] point in ECEF coordinate frame, with translation relative ot camera origin |
The documentation for this class was generated from the following files: