|
Hymn to Beauty
C++ 3D Engine
|
Component handling a camera through which the world can be rendered. More...
#include <Camera.hpp>
Classes | |
| struct | FilterSettings |
| Filter settings. More... | |
Public Member Functions | |
| Camera () | |
| Create new camera. More... | |
| void | Serialize (Json::Value &node, bool load) override |
| Save or load component values to/from JSON. More... | |
| glm::mat4 | GetProjection (const glm::vec2 &screenSize) const |
| Get the projection matrix. More... | |
Public Member Functions inherited from Component::SuperComponent | |
| SuperComponent () | |
| Create new SuperComponent. More... | |
| virtual | ~SuperComponent () |
| Destructor. More... | |
| void | Kill () |
| Kill the component, will be removed at the end of the frame. More... | |
| bool | IsKilled () const |
| Get whether component has been killed. More... | |
Public Attributes | |
| bool | orthographic = false |
| Whether the camera should use an orthographic projection, otherwise perspective projection. More... | |
| float | fieldOfView = 45.f |
| Field of view, in degrees. More... | |
| float | size = 10.0f |
| The size of the view volume. More... | |
| float | zNear = 0.1f |
| Near plane. More... | |
| float | zFar = 100.f |
| Far plane. More... | |
| int32_t | order = 0 |
| The order in the camera stack. More... | |
| bool | overlay = false |
| Whether the camera should be rendered with a transparent background. More... | |
| glm::vec4 | viewport = glm::vec4(0.0f, 0.0f, 1.0f, 1.0f) |
| Viewport. More... | |
| uint32_t | layerMask = 1u |
| Bitmask of which layers the camera should show. More... | |
| FilterSettings | filterSettings |
| Filter settings. More... | |
Public Attributes inherited from Component::SuperComponent | |
| Entity * | entity = nullptr |
| Pointer to which entity this component corresponds. More... | |
Component handling a camera through which the world can be rendered.
| Camera::Camera | ( | ) |
Create new camera.
| glm::mat4 Camera::GetProjection | ( | const glm::vec2 & | screenSize | ) | const |
Get the projection matrix.
| screenSize | Screen size in pixels. |
|
overridevirtual |
Save or load component values to/from JSON.
| node | The JSON node to save to or load from. |
| load | Whether to load (otherwise saves). |
Implements Component::SuperComponent.
| float Component::Camera::fieldOfView = 45.f |
Field of view, in degrees.
Default: 45.0 Only used for perspective projection.
| FilterSettings Component::Camera::filterSettings |
Filter settings.
| uint32_t Component::Camera::layerMask = 1u |
Bitmask of which layers the camera should show.
| int32_t Component::Camera::order = 0 |
The order in the camera stack.
| bool Component::Camera::orthographic = false |
Whether the camera should use an orthographic projection, otherwise perspective projection.
| bool Component::Camera::overlay = false |
Whether the camera should be rendered with a transparent background.
| float Component::Camera::size = 10.0f |
The size of the view volume.
Default: 10.0 Only used for orthographic projection.
| glm::vec4 Component::Camera::viewport = glm::vec4(0.0f, 0.0f, 1.0f, 1.0f) |
Viewport.
| float Component::Camera::zFar = 100.f |
Far plane.
Default: 100.0
| float Component::Camera::zNear = 0.1f |
Near plane.
Default: 0.1