wren
Vulkan-based game engine
Loading...
Searching...
No Matches
camera.hpp
Go to the documentation of this file.
1#pragma once
2
7
8namespace editor {
9class Camera {
10 public:
11 Camera() = default;
12 Camera(float fov, float aspect_ratio, float z_near, float z_far)
13 : fov_(fov), aspect_ratio_(aspect_ratio), z_near_(z_near), z_far_(z_far) {
16 }
17
18 static auto create();
19
24 [[nodiscard]] auto aspect() const { return aspect_ratio_; }
25
26 [[nodiscard]] auto projection() const { return projection_; }
27
28 [[nodiscard]] auto transform() const { return transform_; }
29
30 private:
35
37
38 float fov_{};
40 float z_near_{};
41 float z_far_{};
42
44};
45
46} // namespace editor
Definition camera.hpp:9
static auto create()
auto aspect() const
Definition camera.hpp:24
float fov_
Definition camera.hpp:38
auto projection() const
Definition camera.hpp:26
float z_far_
Definition camera.hpp:41
float aspect_ratio_
Definition camera.hpp:39
float z_near_
Definition camera.hpp:40
auto aspect(float aspect)
Definition camera.hpp:20
void update_projection_matrix()
Definition camera.hpp:31
Camera(float fov, float aspect_ratio, float z_near, float z_far)
Definition camera.hpp:12
auto transform() const
Definition camera.hpp:28
wren::math::Mat4f projection_
Definition camera.hpp:43
wren::scene::components::Transform transform_
Definition camera.hpp:36
Camera()=default
Definition camera.hpp:8
auto perspective(T fov_y, T aspect, T z_near, T z_far)
Definition geometry.hpp:57
auto radians(float degrees) -> float
Definition geometry.hpp:14
Definition matrix.hpp:86
auto z() const
Definition vector.hpp:144
Definition transform.hpp:10
math::Vec3f position
Definition transform.hpp:11