CORGI
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
corgi::CameraInterface Class Referenceabstract

An interface for 3D cameras, allowing them to have position, facing field of view, etc. Libraries can use this to pass around generic cameras that the game itself can implement the logic for. More...

#include <camera_interface.h>

Detailed Description

An interface for 3D cameras, allowing them to have position, facing field of view, etc. Libraries can use this to pass around generic cameras that the game itself can implement the logic for.

Public Member Functions

virtual ~CameraInterface ()
 The destructor for the CameraInterface.
 
virtual mathfu::mat4 GetTransformMatrix () const =0
 Get the view/projection matrix. More...
 
virtual mathfu::mat4 GetViewMatrix () const =0
 Get the view matrix. More...
 
virtual mathfu::mat4 GetTransformMatrix (int32_t index) const =0
 Get the view/projection matrix at a given index. More...
 
virtual mathfu::mat4 GetViewMatrix (int32_t index) const =0
 Get the view matrix at a given index. More...
 
virtual mathfu::vec3 position () const =0
 Get the camera's world position,. More...
 
virtual mathfu::vec3 position (int32_t index) const =0
 Get the camera's world position at a given index. More...
 
virtual void set_position (const mathfu::vec3 &position)=0
 Set the camera's world position. More...
 
virtual void set_position (int32_t index, const mathfu::vec3 &position)=0
 Set the camera's world position. More...
 
virtual const mathfu::vec3 & facing () const =0
 Get the camera's forward direction. More...
 
virtual void set_facing (const mathfu::vec3 &facing)=0
 Set the camera's forward direction. More...
 
virtual const mathfu::vec3 & up () const =0
 Get the camera's up direction. More...
 
virtual void set_up (const mathfu::vec3 &up)=0
 Set the camera's up direction. More...
 
virtual void set_viewport_angle (float viewport_angle)=0
 Set the viewport angle. More...
 
virtual float viewport_angle () const =0
 Get the viewport angle. More...
 
virtual void set_viewport_resolution (mathfu::vec2 viewport_resolution)=0
 Set the camera's viewport resolution. More...
 
virtual mathfu::vec2 viewport_resolution () const =0
 Get the viewport resolution. More...
 
virtual void set_viewport_near_plane (float viewport_near_plane)=0
 Set the distance to the near clipping plane. More...
 
virtual float viewport_near_plane () const =0
 Get the distance to the near clipping plane. More...
 
virtual void set_viewport_far_plane (float viewport_far_plane)=0
 Set the distance to the far clipping plane. More...
 
virtual float viewport_far_plane () const =0
 Get the distance to the far clipping plane. More...
 
virtual void set_viewport (const mathfu::vec4i &viewport)=0
 Sets the camera's viewport. More...
 
virtual void set_viewport (int32_t index, const mathfu::vec4i &viewport)=0
 Sets the camera's viewport at a given index. More...
 
virtual const mathfu::vec4i & viewport (int32_t index) const =0
 Get the camera's viewport at a given index. More...
 
virtual bool IsStereo () const =0
 Check if the camera is stereoscopic. More...
 
virtual void set_stereo (bool b)=0
 Set a camera as stereoscopic. More...
 

Member Function Documentation

virtual const mathfu::vec3& corgi::CameraInterface::facing ( ) const
pure virtual

Get the camera's forward direction.

Returns
Returns the camera's forward direction as a const mathfu::vec3 reference.
virtual mathfu::mat4 corgi::CameraInterface::GetTransformMatrix ( ) const
pure virtual

Get the view/projection matrix.

Returns
Returns the view/projection matrix as a mathfu::mat4.
virtual mathfu::mat4 corgi::CameraInterface::GetTransformMatrix ( int32_t  index) const
pure virtual

Get the view/projection matrix at a given index.

Parameters
[in]indexThe index of the desired matrix.
Returns
Returns the view/projection matrix as a mathfu::mat4.
virtual mathfu::mat4 corgi::CameraInterface::GetViewMatrix ( ) const
pure virtual

Get the view matrix.

Returns
Returns the view matrix as a mathfu::mat4.
virtual mathfu::mat4 corgi::CameraInterface::GetViewMatrix ( int32_t  index) const
pure virtual

Get the view matrix at a given index.

Parameters
[in]indexThe index of the desired matrix.
Returns
Returns the view matrix as a mathfu::mat4.
virtual bool corgi::CameraInterface::IsStereo ( ) const
pure virtual

Check if the camera is stereoscopic.

Returns
Returns true if this camera is stereoscopic. Otherwise it returns false.
virtual mathfu::vec3 corgi::CameraInterface::position ( ) const
pure virtual

Get the camera's world position,.

Returns
Returns the camera's position as a mathfu::vec3.
virtual mathfu::vec3 corgi::CameraInterface::position ( int32_t  index) const
pure virtual

Get the camera's world position at a given index.

Parameters
[in]indexThe index of the camera whose position should be returned.
Returns
Returns the camera's position as a mathfu::vec3.
virtual void corgi::CameraInterface::set_facing ( const mathfu::vec3 &  facing)
pure virtual

Set the camera's forward direction.

Parameters
[in]facingA const mathfu::vec3 reference to the direction the camera should face.
virtual void corgi::CameraInterface::set_position ( const mathfu::vec3 &  position)
pure virtual

Set the camera's world position.

Parameters
[in]positionA const mathfu::vec3 reference to the world position to set.
virtual void corgi::CameraInterface::set_position ( int32_t  index,
const mathfu::vec3 &  position 
)
pure virtual

Set the camera's world position.

Parameters
[in]indexThe index of the camera whose position should be set.
[in]positionA const mathfu::vec3 reference to the world position to set.
virtual void corgi::CameraInterface::set_stereo ( bool  b)
pure virtual

Set a camera as stereoscopic.

Parameters
[in]bA bool determining if the camera is stereoscopic or not.
virtual void corgi::CameraInterface::set_up ( const mathfu::vec3 &  up)
pure virtual

Set the camera's up direction.

Parameters
[in]upA const mathfu::vec3 reference to the up direction to set for the camera.
virtual void corgi::CameraInterface::set_viewport ( const mathfu::vec4i &  viewport)
pure virtual

Sets the camera's viewport.

Parameters
[in]viewportA const mathfu::vec4i reference to the viewport that should be set.
virtual void corgi::CameraInterface::set_viewport ( int32_t  index,
const mathfu::vec4i &  viewport 
)
pure virtual

Sets the camera's viewport at a given index.

Parameters
[in]indexThe index of the viewport to set.
[in]viewportA const mathfu::vec4i reference to the viewport that should be set.
virtual void corgi::CameraInterface::set_viewport_angle ( float  viewport_angle)
pure virtual

Set the viewport angle.

Parameters
[in]viewport_angleA float representing the viewport angle, in radians.
virtual void corgi::CameraInterface::set_viewport_far_plane ( float  viewport_far_plane)
pure virtual

Set the distance to the far clipping plane.

Parameters
[in]viewport_far_planeA float distance to the far clipping plane.
virtual void corgi::CameraInterface::set_viewport_near_plane ( float  viewport_near_plane)
pure virtual

Set the distance to the near clipping plane.

Parameters
[in]viewport_near_planeA float distance to the near clipping plane.
virtual void corgi::CameraInterface::set_viewport_resolution ( mathfu::vec2  viewport_resolution)
pure virtual

Set the camera's viewport resolution.

Parameters
[in]viewport_resolutionA mathfu::vec2 representing the viewport resolution.
virtual const mathfu::vec3& corgi::CameraInterface::up ( ) const
pure virtual

Get the camera's up direction.

Returns
Returns the camera's up direction as a const mathfu::vec3 reference.
virtual const mathfu::vec4i& corgi::CameraInterface::viewport ( int32_t  index) const
pure virtual

Get the camera's viewport at a given index.

Parameters
[in]indexThe index of the desired viewport.
Returns
Returns the camera viewport as a const mathfu::vec4i reference.
virtual float corgi::CameraInterface::viewport_angle ( ) const
pure virtual

Get the viewport angle.

Returns
Returns the viewport angle, in radians.
virtual float corgi::CameraInterface::viewport_far_plane ( ) const
pure virtual

Get the distance to the far clipping plane.

Returns
Returns the float distance to the far clipping plane.
virtual float corgi::CameraInterface::viewport_near_plane ( ) const
pure virtual

Get the distance to the near clipping plane.

Returns
Returns the float distance to the near clipping plane.
virtual mathfu::vec2 corgi::CameraInterface::viewport_resolution ( ) const
pure virtual

Get the viewport resolution.

Returns
Returns the viewport resolution as a mathfu::vec2.

The documentation for this class was generated from the following file: