All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Public Member Functions | Static Public Attributes | List of all members
Eegeo::Camera::RenderCamera Class Reference

Defines camera world, view and projection transforms. More...

#include <RenderCamera.h>

Public Member Functions

void SetEcefLocation (const Eegeo::dv3 &ecefLocation)
 
const Eegeo::dv3GetEcefLocation () const
 
float GetAltitude () const
 
void SetOrientationMatrix (const Eegeo::m33 &m)
 
void SetViewport (float x, float y, float width, float height)
 
void SetProjection (float nominalVerticalFovRadians, float nearZ, float farZ)
 
void SetProjectionMatrix (m44 &projectionMatrix)
 
void Project (const Eegeo::v3 &cameraRelativeWorldPosition, Eegeo::v3 &screenPosition) const
 
void Project360 (const Eegeo::v3 &cameraRelativeWorldPosition, Eegeo::v3 &screenPosition) const
 
void UnProject (const Eegeo::v3 &screenPosition, Eegeo::v3 &cameraRelativeWorldPosition) const
 
const Eegeo::m44GetModelMatrix () const
 
const Eegeo::m44GetViewMatrix () const
 
const Eegeo::m44GetProjectionMatrix () const
 
const Eegeo::m44GetViewProjectionMatrix () const
 
const Eegeo::m44GetInverseViewProjectionMatrix () const
 
float GetNearClip () const
 
float GetFarClip () const
 
float GetNearClipRatio () const
 
float GetFOV () const
 
float GetAspect () const
 
float GetViewportWidth () const
 
float GetViewportHeight () const
 
v2 GetViewportOrigin () const
 
const Eegeo::Geometry::FrustumGetFrustum () const
 
float CalculateEffectiveFOV () const
 

Static Public Attributes

static const float NominalAspectRatio = 4.f/3.f
 
static const float MinAspectRatioForPortraitMode = 1.f
 

Detailed Description

Defines camera world, view and projection transforms.

Member Function Documentation

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::Geometry::Frustum & RenderCamera::GetFrustum ( ) const
Returns
camera frustum
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
cameraRelativeWorldPositionpoint 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
cameraRelativeWorldPositionpoint 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
ecefLocationcamera origin point
void RenderCamera::SetOrientationMatrix ( const Eegeo::m33 m)
Parameters
ma 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
nominalVerticalFovRadiansfield of view angle, in radians, of the vertical view extents
nearZdistance to near clip plane, in metres
farZdistance to far clip plane, in metres
void RenderCamera::SetProjectionMatrix ( Eegeo::m44 projectionMatrix)

Set an explicit projection transform

Parameters
projectionMatrixprojection 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
xhorizontal pixel coordinate defining the left of viewport rectangle
yvertical pixel coordinate defining the top of viewport rectangle
widthwidth in pixels
heightheight 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
screenPositionscreen-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: