Skip to main content
Version: 🚧 Nightly

Class f3d::camera

Definition: camera.h (line 35)

Abstract class to control a camera in a window.

A class to control a camera in a window. When modifying the Position/FocalPoint/ViewUp API or the camera movements API, the view up is automatically orthogonalized. All angles are in degrees.

Members

Parameters

Set/Get the camera parameters.

Function setPosition

virtual camera & f3d::camera::setPosition(const point3_t &pos)=0

Set the position of the camera to the provided arg

Parameters:

Return type: camera &

Function getPosition

virtual point3_t f3d::camera::getPosition()=0

Return the position of the camera

Return type: point3_t

Function getPosition

virtual void f3d::camera::getPosition(point3_t &pos)=0

Get the position of the camera into the provided arg

Parameters:

Return type: void

Function setFocalPoint

virtual camera & f3d::camera::setFocalPoint(const point3_t &foc)=0

Set the focal point of the camera to the provided arg

Parameters:

Return type: camera &

Function getFocalPoint

virtual point3_t f3d::camera::getFocalPoint()=0

Return the focal point of the camera

Return type: point3_t

Function getFocalPoint

virtual void f3d::camera::getFocalPoint(point3_t &foc)=0

Get the focal point of the camera into the provided arg

Parameters:

Return type: void

Function setViewUp

virtual camera & f3d::camera::setViewUp(const vector3_t &up)=0

Set the view up of the camera to the provided arg

Parameters:

Return type: camera &

Function getViewUp

virtual vector3_t f3d::camera::getViewUp()=0

Return the view up of the camera

Return type: vector3_t

Function getViewUp

virtual void f3d::camera::getViewUp(vector3_t &up)=0

Get the view up of the camera into the provided arg

Parameters:

Return type: void

Function setViewAngle

virtual camera & f3d::camera::setViewAngle(const angle_deg_t &angle)=0

Set the view angle in degrees of the camera to the provided arg

Parameters:

  • const angle_deg_t & angle

Return type: camera &

Function getViewAngle

virtual angle_deg_t f3d::camera::getViewAngle()=0

Return the view angle in degrees of the camera

Return type: angle_deg_t

Function getViewAngle

virtual void f3d::camera::getViewAngle(angle_deg_t &angle)=0

Get the view angle in degrees of the camera into the provided arg

Parameters:

  • angle_deg_t & angle

Return type: void

Function setState

virtual camera & f3d::camera::setState(const camera_state_t &state)=0

Set the complete state of the provided arg

Parameters:

Return type: camera &

Function getState

virtual camera_state_t f3d::camera::getState()=0

Return the complete state of the camera

Return type: camera_state_t

Function getState

virtual void f3d::camera::getState(camera_state_t &state)=0

Get the complete state of the camera into the provided arg

Parameters:

Return type: void

Manipulation

Standard camera manipulation methods. Angles are in degrees.

Function dolly

virtual camera & f3d::camera::dolly(double val)=0

Divide the camera's distance from the focal point by the given value.

Parameters:

  • double val

Return type: camera &

Function pan

virtual camera & f3d::camera::pan(double right, double up, double forward=0)=0

Move the camera along its horizontal, vertical, and forward axes

Parameters:

  • double right
  • double up
  • double forward = 0

Return type: camera &

Function zoom

virtual camera & f3d::camera::zoom(double factor)=0

Decrease the view angle (or the parallel scale in parallel mode) by the specified factor.

Parameters:

  • double factor

Return type: camera &

Function roll

virtual camera & f3d::camera::roll(angle_deg_t angle)=0

Rotate the camera about its forward axis.

Parameters:

  • angle_deg_t angle

Return type: camera &

Function azimuth

virtual camera & f3d::camera::azimuth(angle_deg_t angle)=0

Rotate the camera about its vertical axis, centered at the focal point.

Parameters:

  • angle_deg_t angle

Return type: camera &

Function yaw

virtual camera & f3d::camera::yaw(angle_deg_t angle)=0

Rotate the camera about its vertical axis, centered the camera's position.

Parameters:

  • angle_deg_t angle

Return type: camera &

Function elevation

virtual camera & f3d::camera::elevation(angle_deg_t angle)=0

Rotate the camera about its horizontal axis, centered at the focal point.

Parameters:

  • angle_deg_t angle

Return type: camera &

Function pitch

virtual camera & f3d::camera::pitch(angle_deg_t angle)=0

Rotate the camera about its horizontal axis, centered the camera's position.

Parameters:

  • angle_deg_t angle

Return type: camera &

Public functions

Function setCurrentAsDefault

virtual camera & f3d::camera::setCurrentAsDefault()=0

Store the current camera configuration as default.

Return type: camera &

Function resetToDefault

virtual camera & f3d::camera::resetToDefault()=0

Reset the camera to the stored default camera configuration.

Return type: camera &

Function resetToBounds

virtual camera & f3d::camera::resetToBounds(double zoomFactor=0.9)=0

Reset the camera using the bounds of actors in the scene. Provided zoomFactor will be used to position the camera. A value of 1 correspond to the bounds roughly aligned to the edges of the window.

Parameters:

  • double zoomFactor = 0.9

Return type: camera &