Wizard Engine
2D cross-platform game engine built around SDL2
 
Loading...
Searching...
No Matches
camera.hpp
Go to the documentation of this file.
1/*
2 Wizard Engine
3 Copyright (C) 2023-2024 Zana Domán
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22#ifndef WIZARD_ENGINE_CAMERA_HPP
23#define WIZARD_ENGINE_CAMERA_HPP
24
27
28namespace wze {
34class camera final {
35 private:
36 static float _x;
37 static float _y;
38 static float _z;
39 static float _angle;
40 static std::array<float, 4> _transformation_matrix;
41 static float _focus;
42
48 camera() = default;
49
50 public:
57 [[nodiscard]] static float x();
58
65 static void set_x(float x);
66
73 [[nodiscard]] static float y();
74
81 static void set_y(float y);
82
89 [[nodiscard]] static float z();
90
97 static void set_z(float z);
98
105 [[nodiscard]] static float angle();
106
113 static void set_angle(float angle);
114
121 [[nodiscard]] static std::array<float, 4> const& transformation_matrix();
122
129 [[nodiscard]] static float focus();
130
137 static void set_focus(float focus);
138
139#ifdef __WIZARD_ENGINE_INTERNAL__
145 static void initialize();
146#endif /* __WIZARD_ENGINE_INTERNAL__ */
147
148#ifdef __WIZARD_ENGINE_INTERNAL__
155 static void project(renderable& instance);
156#endif /* __WIZARD_ENGINE_INTERNAL__ */
157
167 [[nodiscard]] static std::pair<float, float> project(float x, float y,
168 float z);
169
179 [[nodiscard]] static std::pair<float, float> unproject(float x, float y,
180 float z);
181};
182} /* namespace wze */
183
184#endif /* WIZARD_ENGINE_CAMERA_HPP */
Export header of the Wizard Engine.
Wizard Engine.
Interface to make an object renderable.