Skip to main content

Camera Class

Represents a camera for perspective or orthographic projection, deriving from SceneNode to allow for spatial positioning and transformation within the scene graph. More...

Declaration

class helios::scene::Camera { ... }

Base class

classSceneNode

Represents a SceneNode within a SceneGraph. More...

Public Constructors Index

Camera ()

Constructor for this class. Initializes projectionMatrix and viewMatrix with the identity matrix. More...

Public Member Functions Index

SceneNode *addChild (std::unique_ptr< SceneNode > sceneNode) override

This method will do nothing but returning a `nullptr`, indicating that a `Camera` must not have child modes. More...

const helios::math::mat4f &projectionMatrix () const noexcept

Returns a constant ref to this camera's current projection matrix. Typically set to the perspective / orthographic projection. More...

const helios::math::mat4f &viewMatrix () const noexcept

Returns a constant ref to this camera' view matrix. Automatically computed as inverse from the camera's world transform (i.e. [v]_c = P_{C <- W } [v]_w) = P_{W <- C}^{-1} [v]_w. More...

Protected Member Attributes Index

helios::math::mat4fprojectionMatrix_

The projection matrix of this Camera. More...

helios::math::mat4fviewMatrix_

The view matrix of this Camera. More...

Description

Represents a camera for perspective or orthographic projection, deriving from SceneNode to allow for spatial positioning and transformation within the scene graph.

The camera provides the view and projection matrix, whereas the view matrix is computed as the inverse of the camera's world transform.

A Camera behaves just like a (non-renderable) SceneNode, except for the fact that it does not accept child nodes.

An instance of `Camera` is added as a direct descendant of the scene's root node for free transform. It can be a child of a model hierarchy to inherit the corresponding positioning in the world.

Todo

implement class. Make sure localTransforms mark this class as dirty, for proper recalculating projection-/viewMatrix if needed.

check whether nodes should further be divided into Parent- and LeafNodes. Cameras would be LeafNodes then, not allowing to have child nodes.

Definition at line 31 of file Camera.ixx.

Public Constructors

Camera()

helios::scene::Camera::Camera ()

Constructor for this class. Initializes projectionMatrix and viewMatrix with the identity matrix.

Definition at line 49 of file Camera.ixx.

Public Member Functions

addChild()

SceneNode * helios::scene::Camera::addChild (std::unique_ptr< SceneNode > sceneNode)
nodiscard virtual

This method will do nothing but returning a `nullptr`, indicating that a `Camera` must not have child modes.

Parameters
sceneNode
Returns

This implementation returns a `nullptr.`

See Also

https://stackoverflow.com/questions/24609872/delete-virtual-function-from-a-derived-class

Definition at line 61 of file Camera.ixx.

Reference helios::scene::SceneNode::SceneNode.

projectionMatrix()

const helios::math::mat4f & helios::scene::Camera::projectionMatrix ()
nodiscard noexcept

Returns a constant ref to this camera's current projection matrix. Typically set to the perspective / orthographic projection.

Returns

A const ref to this `Camera`'s projection matrix.

Definition at line 69 of file Camera.ixx.

viewMatrix()

const helios::math::mat4f & helios::scene::Camera::viewMatrix ()
nodiscard noexcept

Returns a constant ref to this camera' view matrix. Automatically computed as inverse from the camera's world transform (i.e. [v]_c = P_{C <- W } [v]_w) = P_{W <- C}^{-1} [v]_w.

Returns

A const ref to this `Camera`s view matrix.

Definition at line 78 of file Camera.ixx.

Reference viewMatrix.

Referenced by viewMatrix.

Protected Member Attributes

projectionMatrix_

helios::math::mat4f helios::scene::Camera::projectionMatrix_
protected mutable

The projection matrix of this Camera.

Definition at line 37 of file Camera.ixx.

viewMatrix_

helios::math::mat4f helios::scene::Camera::viewMatrix_
protected mutable

The view matrix of this Camera.

Definition at line 42 of file Camera.ixx.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.