Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::camera_component Class Reference

Class that contains core camera data, used for rendering and other purposes. More...

#include <camera_component.h>

Inheritance diagram for unravel::camera_component:
unravel::component_crtp< camera_component > unravel::basic_component

Public Member Functions

 camera_component ()
 Default constructor for camera_component.
 
void set_fov (float fov_degrees)
 Sets the field of view (FOV).
 
void set_near_clip (float distance)
 Sets the near clipping distance.
 
void set_far_clip (float distance)
 Sets the far clipping distance.
 
void set_projection_mode (projection_mode mode)
 Sets the projection mode.
 
auto get_fov () const -> float
 Gets the field of view (FOV).
 
auto get_near_clip () const -> float
 Gets the near clipping distance.
 
auto get_far_clip () const -> float
 Gets the far clipping distance.
 
auto get_projection_mode () const -> projection_mode
 Gets the projection mode.
 
auto get_camera () -> camera &
 Gets the camera object.
 
auto get_camera () const -> const camera &
 Gets the camera object (const version).
 
void update (const math::transform &t)
 Updates the camera with the given transform.
 
void set_viewport_size (const usize32_t &size)
 Sets the viewport size.
 
auto get_viewport_size () const -> const usize32_t &
 Gets the viewport size.
 
auto get_ortho_size () const -> float
 Gets the orthographic size.
 
void set_ortho_size (float size)
 Sets the orthographic size.
 
auto get_ppu () const -> float
 Gets the pixels per unit (PPU).
 
auto get_render_view () -> gfx::render_view &
 Gets the render view.
 
auto get_render_view () const -> const gfx::render_view &
 
auto get_storage () -> camera_storage &
 Gets the camera storage.
 
auto get_pipeline_data () -> pipeline_camera &
 
auto get_pipeline_data () const -> const pipeline_camera &
 
auto get_render_include_mask () const -> layer_mask
 Gets the render include mask.
 
void set_render_include_mask (layer_mask mask)
 Sets the render include mask.
 
auto get_render_exclude_mask () const -> layer_mask
 Gets the render exclude mask.
 
void set_render_exclude_mask (layer_mask mask)
 Sets the render exclude mask.
 
auto get_render_mask () const -> layer_mask
 Gets the effective render mask (include - exclude).
 
- Public Member Functions inherited from unravel::basic_component
void touch ()
 Marks the component as 'touched'.
 

Additional Inherited Members

- Public Types inherited from unravel::component_crtp< camera_component >
using base
 
- Public Attributes inherited from unravel::basic_component
bool eto {}
 Disable empty type optimizations.
 
- Static Public Attributes inherited from unravel::component_crtp< camera_component >
static constexpr bool in_place_delete
 Indicates if the component can be deleted in place.
 

Detailed Description

Class that contains core camera data, used for rendering and other purposes.

Definition at line 21 of file camera_component.h.

Constructor & Destructor Documentation

◆ camera_component()

unravel::camera_component::camera_component ( )

Default constructor for camera_component.

Definition at line 5 of file camera_component.cpp.

Member Function Documentation

◆ get_camera() [1/2]

auto unravel::camera_component::get_camera ( ) -> camera&

Gets the camera object.

Returns
A reference to the camera object.

Definition at line 107 of file camera_component.cpp.

◆ get_camera() [2/2]

auto unravel::camera_component::get_camera ( ) const -> const camera&

Gets the camera object (const version).

Returns
A constant reference to the camera object.

Definition at line 112 of file camera_component.cpp.

◆ get_far_clip()

auto unravel::camera_component::get_far_clip ( ) const -> float

Gets the far clipping distance.

Returns
The far clipping distance.

Definition at line 97 of file camera_component.cpp.

◆ get_fov()

auto unravel::camera_component::get_fov ( ) const -> float

Gets the field of view (FOV).

Returns
The FOV in degrees.

Definition at line 89 of file camera_component.cpp.

◆ get_near_clip()

auto unravel::camera_component::get_near_clip ( ) const -> float

Gets the near clipping distance.

Returns
The near clipping distance.

Definition at line 93 of file camera_component.cpp.

◆ get_ortho_size()

auto unravel::camera_component::get_ortho_size ( ) const -> float

Gets the orthographic size.

Returns
The orthographic size.

Definition at line 29 of file camera_component.cpp.

◆ get_pipeline_data() [1/2]

auto unravel::camera_component::get_pipeline_data ( ) -> pipeline_camera&

Definition at line 59 of file camera_component.cpp.

◆ get_pipeline_data() [2/2]

auto unravel::camera_component::get_pipeline_data ( ) const -> const pipeline_camera&

Definition at line 64 of file camera_component.cpp.

◆ get_ppu()

auto unravel::camera_component::get_ppu ( ) const -> float

Gets the pixels per unit (PPU).

Returns
The pixels per unit.

Definition at line 39 of file camera_component.cpp.

◆ get_projection_mode()

auto unravel::camera_component::get_projection_mode ( ) const -> projection_mode

Gets the projection mode.

Returns
The current projection mode.

Definition at line 102 of file camera_component.cpp.

◆ get_render_exclude_mask()

auto unravel::camera_component::get_render_exclude_mask ( ) const -> layer_mask

Gets the render exclude mask.

Returns
The render exclude mask.

Definition at line 127 of file camera_component.cpp.

◆ get_render_include_mask()

auto unravel::camera_component::get_render_include_mask ( ) const -> layer_mask

Gets the render include mask.

Returns
The render include mask.

Definition at line 117 of file camera_component.cpp.

◆ get_render_mask()

auto unravel::camera_component::get_render_mask ( ) const -> layer_mask

Gets the effective render mask (include - exclude).

Returns
The effective render mask.

Definition at line 137 of file camera_component.cpp.

◆ get_render_view() [1/2]

auto unravel::camera_component::get_render_view ( ) -> gfx::render_view&

Gets the render view.

Returns
A reference to the render view.

Definition at line 44 of file camera_component.cpp.

◆ get_render_view() [2/2]

auto unravel::camera_component::get_render_view ( ) const -> const gfx::render_view&

Definition at line 49 of file camera_component.cpp.

◆ get_storage()

auto unravel::camera_component::get_storage ( ) -> camera_storage&

Gets the camera storage.

Returns
A reference to the camera storage.

Definition at line 54 of file camera_component.cpp.

◆ get_viewport_size()

auto unravel::camera_component::get_viewport_size ( ) const -> const usize32_t&

Gets the viewport size.

Returns
A constant reference to the size of the viewport.

Definition at line 24 of file camera_component.cpp.

◆ set_far_clip()

void unravel::camera_component::set_far_clip ( float distance)

Sets the far clipping distance.

Parameters
[in]distanceThe far clipping distance.

Definition at line 79 of file camera_component.cpp.

◆ set_fov()

void unravel::camera_component::set_fov ( float fov_degrees)

Sets the field of view (FOV).

Parameters
[in]fov_degreesThe FOV in degrees.

Definition at line 69 of file camera_component.cpp.

◆ set_near_clip()

void unravel::camera_component::set_near_clip ( float distance)

Sets the near clipping distance.

Parameters
[in]distanceThe near clipping distance.

Definition at line 74 of file camera_component.cpp.

◆ set_ortho_size()

void unravel::camera_component::set_ortho_size ( float size)

Sets the orthographic size.

Parameters
[in]sizeThe orthographic size to set.

Definition at line 34 of file camera_component.cpp.

◆ set_projection_mode()

void unravel::camera_component::set_projection_mode ( projection_mode mode)

Sets the projection mode.

Parameters
[in]modeThe projection mode to set.

Definition at line 84 of file camera_component.cpp.

◆ set_render_exclude_mask()

void unravel::camera_component::set_render_exclude_mask ( layer_mask mask)

Sets the render exclude mask.

Parameters
maskThe render exclude mask to set.

Definition at line 132 of file camera_component.cpp.

◆ set_render_include_mask()

void unravel::camera_component::set_render_include_mask ( layer_mask mask)

Sets the render include mask.

Parameters
maskThe render include mask to set.

Definition at line 122 of file camera_component.cpp.

◆ set_viewport_size()

void unravel::camera_component::set_viewport_size ( const usize32_t & size)

Sets the viewport size.

Parameters
[in]sizeThe size of the viewport.

Definition at line 19 of file camera_component.cpp.

◆ update()

void unravel::camera_component::update ( const math::transform & t)

Updates the camera with the given transform.

Parameters
[in]tThe transform to update the camera with.

Definition at line 10 of file camera_component.cpp.


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