SpatiumLib
Public Member Functions | Protected Attributes | Friends | List of all members
spatium::gfx3d::Camera Class Reference

Camera object in a 3D scene. More...

#include <Camera.h>

Inheritance diagram for spatium::gfx3d::Camera:
Inheritance graph
[legend]
Collaboration diagram for spatium::gfx3d::Camera:
Collaboration graph
[legend]

Public Member Functions

 Camera (double near, double far)
 Constructor. More...
 
virtual ~Camera ()=default
 
double near () const
 Get the distance to the near clipping plane in world space. More...
 
double far () const
 Get the distance to the far clipping plane in world space. More...
 
void lookAt (const geom3d::Point3 &target, const geom3d::Vector3 &up)
 Set view direction towards target position. The resulting transformation matrix maps the reference point to the negative z axis and the eye point to the origin. More...
 
void lookAt (const geom3d::Point3 &eye, const geom3d::Point3 &target, const geom3d::Vector3 &up)
 Set camera position and set view direction towards target position. The resulting transformation matrix maps the reference point to the negative z axis and the eye point to the origin. More...
 
- Public Member Functions inherited from spatium::gfx3d::SceneObject
 SceneObject ()
 
Transformtransform ()
 Get the transformation. More...
 

Protected Attributes

double m_near
 
double m_far
 
- Protected Attributes inherited from spatium::gfx3d::SceneObject
Transform m_transform
 

Friends

std::ostream & operator<< (std::ostream &os, const Camera &camera)
 Output to ostream. More...
 

Detailed Description

Camera object in a 3D scene.

Camera with perspective projection.

Vantage point from where an image can be rendered. In its default position centred at the origin and aligned along the negative z-axis.

Constructor & Destructor Documentation

◆ Camera()

spatium::gfx3d::Camera::Camera ( double  near,
double  far 
)
inline

Constructor.

◆ ~Camera()

virtual spatium::gfx3d::Camera::~Camera ( )
virtualdefault

Member Function Documentation

◆ far()

double spatium::gfx3d::Camera::far ( ) const
inline

Get the distance to the far clipping plane in world space.

Returns
Far clipping plane distance.

◆ lookAt() [1/2]

void spatium::gfx3d::Camera::lookAt ( const geom3d::Point3 target,
const geom3d::Vector3 up 
)
inline

Set view direction towards target position. The resulting transformation matrix maps the reference point to the negative z axis and the eye point to the origin.

Parameters
[in]targetTarget position
[in]upUp vector May not be parallel with view direction vector

◆ lookAt() [2/2]

void spatium::gfx3d::Camera::lookAt ( const geom3d::Point3 eye,
const geom3d::Point3 target,
const geom3d::Vector3 up 
)
inline

Set camera position and set view direction towards target position. The resulting transformation matrix maps the reference point to the negative z axis and the eye point to the origin.

Parameters
[in]eyeCamera/eye position
[in]targetTarget position
[in]upUp vector May not be parallel with vector from eye to target

◆ near()

double spatium::gfx3d::Camera::near ( ) const
inline

Get the distance to the near clipping plane in world space.

Returns
Near clipping plane distance.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Camera camera 
)
friend

Output to ostream.

Member Data Documentation

◆ m_far

double spatium::gfx3d::Camera::m_far
protected

◆ m_near

double spatium::gfx3d::Camera::m_near
protected

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