Unravel Engine C++ Reference
Loading...
Searching...
No Matches
camera_component.h
Go to the documentation of this file.
1#pragma once
2#include <base/basetypes.hpp>
10
13#include <math/math.h>
14
15namespace unravel
16{
21class camera_component : public component_crtp<camera_component>
22{
23public:
28
33 void set_fov(float fov_degrees);
34
39 void set_near_clip(float distance);
40
45 void set_far_clip(float distance);
46
52
57 auto get_fov() const -> float;
58
63 auto get_near_clip() const -> float;
64
69 auto get_far_clip() const -> float;
70
76
81 auto get_camera() -> camera&;
82
87 auto get_camera() const -> const camera&;
88
93 void update(const math::transform& t);
94
98 void release_resources();
99
104 void set_viewport_size(const usize32_t& size);
105
110 auto get_viewport_size() const -> const usize32_t&;
111
116 auto get_ortho_size() const -> float;
117
122 void set_ortho_size(float size);
123
128 auto get_ppu() const -> float;
129
135 auto get_render_view() const -> const gfx::render_view&;
136
141 auto get_storage() -> camera_storage&;
142
144 auto get_pipeline_data() const -> const pipeline_camera&;
145
150 auto get_render_include_mask() const -> layer_mask;
151
157
162 auto get_render_exclude_mask() const -> layer_mask;
163
169
174 auto get_render_mask() const -> layer_mask;
175
176private:
178 pipeline_camera pipeline_camera_;
179
181 gfx::render_view rview_;
182
184 camera_storage storage_;
185
187 layer_mask render_include_mask_{layer_reserved::everything_layer};
188
190 layer_mask render_exclude_mask_{layer_reserved::nothing_layer};
191};
192
193} // namespace unravel
int layer_mask
General purpose transformation class designed to maintain each component of the transformation separa...
Definition transform.hpp:27
Class that contains core camera data, used for rendering and other purposes.
auto get_far_clip() const -> float
Gets the far clipping distance.
auto get_projection_mode() const -> projection_mode
Gets the projection mode.
auto get_pipeline_data() -> pipeline_camera &
auto get_render_exclude_mask() const -> layer_mask
Gets the render exclude mask.
void set_near_clip(float distance)
Sets the near clipping distance.
auto get_render_mask() const -> layer_mask
Gets the effective render mask (include - exclude).
auto get_storage() -> camera_storage &
Gets the camera storage.
void set_viewport_size(const usize32_t &size)
Sets the viewport size.
auto get_render_view() -> gfx::render_view &
Gets the render view.
auto get_viewport_size() const -> const usize32_t &
Gets the viewport size.
auto get_camera() -> camera &
Gets the camera object.
void set_fov(float fov_degrees)
Sets the field of view (FOV).
void set_render_exclude_mask(layer_mask mask)
Sets the render exclude mask.
void set_render_include_mask(layer_mask mask)
Sets the render include mask.
auto get_ortho_size() const -> float
Gets the orthographic size.
void set_projection_mode(projection_mode mode)
Sets the projection mode.
void set_ortho_size(float size)
Sets the orthographic size.
auto get_fov() const -> float
Gets the field of view (FOV).
void release_resources()
Releases the pipeline resources.
auto get_near_clip() const -> float
Gets the near clipping distance.
auto get_render_include_mask() const -> layer_mask
Gets the render include mask.
void set_far_clip(float distance)
Sets the far clipping distance.
void update(const math::transform &t)
Updates the camera with the given transform.
camera_component()
Default constructor for camera_component.
auto get_ppu() const -> float
Gets the pixels per unit (PPU).
Class representing a camera. Contains functionality for manipulating and updating a camera....
Definition camera.h:62
@ everything_layer
Definition layer_mask.h:16
@ nothing_layer
Definition layer_mask.h:13
projection_mode
Enum representing the projection mode of a camera.
Definition camera.h:16
@ mask
Hard alpha cutoff; casts cutout shadows.
Structure for storing camera related context.
Definition camera.h:52
CRTP (Curiously Recurring Template Pattern) base structure for components.