Lugdunum  0.1.0
Camera.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
7 #include <lug/System/Debug.hpp>
8 
9 namespace lug {
10 namespace Graphics {
11 
12 class Renderer;
13 
14 namespace Builder {
15 
17 public:
18  enum class Type : uint8_t {
19  Perspective,
20  Orthographic
21  };
22 
23 public:
24  explicit Camera(Renderer& renderer);
25 
26  Camera(const Camera&) = delete;
27  Camera(Camera&&) = delete;
28 
29  Camera& operator=(const Camera&) = delete;
30  Camera& operator=(Camera&&) = delete;
31 
32  ~Camera() = default;
33 
38  void setName(const std::string& name);
39  void setType(Type type);
40 
41  // Perspective
42  void setFovY(float fovy);
43  void setAspectRatio(float aspectRatio);
44 
45  // Orthographic
46  void setXMag(float xmag);
47  void setYMag(float ymag);
48 
49  // Both
50  void setZNear(float znear);
51  void setZFar(float zfar);
52 
54 
55 protected:
57 
58  std::string _name;
59  Type _type{Type::Perspective};
60 
61  // Perspective
62  float _fovy{0.0f};
63  float _aspectRatio{0.0f};
64 
65  // Orthographic
66  float _xmag{0.0f};
67  float _ymag{0.0f};
68 
69  // Both
70  float _znear{0.0f};
71  float _zfar{0.0f};
72 };
73 
75 
76 } // Builder
77 } // Graphics
78 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11
Dummy class for a shared pointer.
Definition: Resource.hpp:66
Resource::SharedPtr< lug::Graphics::Render::Material > build(const ::lug::Graphics::Builder::Material &builder)
Definition: Material.cpp:14
Class for graphics.
Definition: Graphics.hpp:25