graphics
Class CCamera
in Camera.h
in Camera.cpp
- class CCamera
Constructor Summary |
CCamera()
=========================================================================
File : Camera. |
~CCamera()
|
Method Summary |
void |
BuildCameraRay( CVector3D& origin, CVector3D& dir )
|
void |
BuildCameraRay( int px, int py, CVector3D& origin, CVector3D& dir )
|
void |
GetCameraPlanePoints( float dist, CVector3D pts[ 4] ) const
BuildCameraRay: calculate origin and ray direction of a ray through
the pixel (px,py) on the screen |
float |
GetFarPlane() const
|
CVector3D |
GetFocus()
|
float |
GetFOV() const
|
CFrustum |
GetFrustum()
|
void |
GetFrustumPoints( CVector3D pts[ 8] ) const
|
float |
GetNearPlane() const
|
const CMatrix3D& |
GetProjection() const
|
void |
GetScreenCoordinates( const CVector3D& world, float& x, float& y ) const
|
const SViewPort& |
GetViewPort() const
|
CVector3D |
GetWorldCoordinates( bool aboveWater = false )
|
CVector3D |
GetWorldCoordinates( int px, int py, float h )
|
CVector3D |
GetWorldCoordinates( int px, int py, bool aboveWater = false )
|
void |
LookAlong( CVector3D camera, CVector3D orientation, CVector3D up )
Render the camera's frustum |
void |
LookAt( const CVector3D& camera, const CVector3D& orientation, const CVector3D& up )
|
void |
Render( uint intermediates = 0 ) const
Render: Renders the camera's frustum in world space. |
void |
SetProjection( float nearp, float farp, float fov )
|
void |
SetProjection( CMatrix3D* proj )
|
void |
SetProjectionTile( int tiles, int tile_x, int tile_y )
|
void |
SetViewPort( SViewPort* viewport )
GetCameraPlanePoints: return four points in camera space at given distance from camera |
void |
UpdateFrustum()
|
m_FarPlane
private float m_FarPlane;
m_FOV
private float m_FOV;
m_NearPlane
private float m_NearPlane;
m_Orientation
public CMatrix3D m_Orientation;
m_ProjMat
public CMatrix3D m_ProjMat;
m_ViewFrustum
private CFrustum m_ViewFrustum;
m_ViewPort
private SViewPort m_ViewPort;
CCamera
public CCamera();
- =========================================================================
File : Camera.cpp
Project : 0 A.D.
Description : CCamera holds a view and a projection matrix. It also has
a frustum which can be used to cull objects for rendering.
=========================================================================
~CCamera
public ~CCamera();
BuildCameraRay
public void BuildCameraRay( CVector3D& origin, CVector3D& dir );
BuildCameraRay
public void BuildCameraRay( int px, int py, CVector3D& origin, CVector3D& dir );
GetCameraPlanePoints
public void GetCameraPlanePoints( float dist, CVector3D pts[ 4] ) const;
- BuildCameraRay: calculate origin and ray direction of a ray through
the pixel (px,py) on the screen
GetFarPlane
public float GetFarPlane() const;
GetFocus
public CVector3D GetFocus();
GetFOV
public float GetFOV() const;
GetFrustum
public CFrustum GetFrustum();
GetFrustumPoints
public void GetFrustumPoints( CVector3D pts[ 8] ) const;
GetNearPlane
public float GetNearPlane() const;
GetProjection
public const CMatrix3D& GetProjection() const;
GetScreenCoordinates
public void GetScreenCoordinates( const CVector3D& world, float& x, float& y ) const;
GetViewPort
public const SViewPort& GetViewPort() const;
GetWorldCoordinates
public CVector3D GetWorldCoordinates( bool aboveWater = false );
GetWorldCoordinates
public CVector3D GetWorldCoordinates( int px, int py, float h );
GetWorldCoordinates
public CVector3D GetWorldCoordinates( int px, int py, bool aboveWater = false );
LookAlong
public void LookAlong( CVector3D camera, CVector3D orientation, CVector3D up );
- Render the camera's frustum
LookAt
public void LookAt( const CVector3D& camera, const CVector3D& orientation, const CVector3D& up );
Render
public void Render( uint intermediates = 0 ) const;
- Render: Renders the camera's frustum in world space.
The caller should set the color using glColorXy before calling Render.
- Parameters:
intermediates
- determines how many intermediate distance planes should
be hinted at between the near and far planes
SetProjection
public void SetProjection( float nearp, float farp, float fov );
SetProjection
public void SetProjection( CMatrix3D* proj );
SetProjectionTile
public void SetProjectionTile( int tiles, int tile_x, int tile_y );
SetViewPort
public void SetViewPort( SViewPort* viewport );
- GetCameraPlanePoints: return four points in camera space at given distance from camera
UpdateFrustum
public void UpdateFrustum();