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
Base class
| class | SceneNode |
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 return `nullptr`, indicating that a `Camera` must not have child nodes. 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's view matrix. Automatically computed as the inverse of the camera's world transform. More... | |
Protected Member Attributes Index
| helios::math::mat4f | projectionMatrix_ |
| helios::math::mat4f | viewMatrix_ |
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 35 of file Camera.ixx.
Public Constructors
Camera()
|
Constructor for this class. Initializes projectionMatrix and viewMatrix with the identity matrix.
Definition at line 53 of file Camera.ixx.
Public Member Functions
addChild()
| nodiscard virtual |
This method will do nothing but return `nullptr`, indicating that a `Camera` must not have child nodes.
- Parameters
-
sceneNode The attempted child node to add (ignored).
- Returns
This implementation returns `nullptr`.
Definition at line 64 of file Camera.ixx.
Reference helios::scene::SceneNode::SceneNode.
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 72 of file Camera.ixx.
viewMatrix()
| nodiscard noexcept |
Returns a constant ref to this camera's view matrix. Automatically computed as the inverse of the camera's world transform.
- Returns
A const ref to this `Camera`'s view matrix.
Definition at line 81 of file Camera.ixx.
Reference viewMatrix.
Referenced by viewMatrix.
Protected Member Attributes
projectionMatrix_
| protected mutable |
The projection matrix of this Camera.
Definition at line 41 of file Camera.ixx.
viewMatrix_
| protected mutable |
The view matrix of this Camera.
Definition at line 46 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.