Hymn to Beauty
C++ 3D Engine
Component::Camera Class Reference

Component handling a camera through which the world can be rendered. More...

#include <Camera.hpp>

Inheritance diagram for Component::Camera:
Component::SuperComponent

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
Entityentity = nullptr
 Pointer to which entity this component corresponds. More...
 

Detailed Description

Component handling a camera through which the world can be rendered.

Constructor & Destructor Documentation

◆ Camera()

Camera::Camera ( )

Create new camera.

Member Function Documentation

◆ GetProjection()

glm::mat4 Camera::GetProjection ( const glm::vec2 &  screenSize) const

Get the projection matrix.

Parameters
screenSizeScreen size in pixels.
Returns
The projection matrix.

◆ Serialize()

void Camera::Serialize ( Json::Value &  node,
bool  load 
)
overridevirtual

Save or load component values to/from JSON.

Parameters
nodeThe JSON node to save to or load from.
loadWhether to load (otherwise saves).

Implements Component::SuperComponent.

Member Data Documentation

◆ fieldOfView

float Component::Camera::fieldOfView = 45.f

Field of view, in degrees.

Default: 45.0 Only used for perspective projection.

◆ filterSettings

FilterSettings Component::Camera::filterSettings

Filter settings.

◆ layerMask

uint32_t Component::Camera::layerMask = 1u

Bitmask of which layers the camera should show.

◆ order

int32_t Component::Camera::order = 0

The order in the camera stack.

◆ orthographic

bool Component::Camera::orthographic = false

Whether the camera should use an orthographic projection, otherwise perspective projection.

◆ overlay

bool Component::Camera::overlay = false

Whether the camera should be rendered with a transparent background.

◆ size

float Component::Camera::size = 10.0f

The size of the view volume.

Default: 10.0 Only used for orthographic projection.

◆ viewport

glm::vec4 Component::Camera::viewport = glm::vec4(0.0f, 0.0f, 1.0f, 1.0f)

Viewport.

◆ zFar

float Component::Camera::zFar = 100.f

Far plane.

Default: 100.0

◆ zNear

float Component::Camera::zNear = 0.1f

Near plane.

Default: 0.1


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