vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
Light.hpp
Go to the documentation of this file.
1///
2/// @file Light.hpp
3/// @brief This file contains the Light class
4/// @namespace ven
5///
6
7#pragma once
8
9#include <string>
10#include <unordered_map>
11
13
14namespace ven {
15
16 static constexpr float DEFAULT_LIGHT_INTENSITY = .2F;
17 static constexpr float DEFAULT_LIGHT_RADIUS = 0.1F;
18 static constexpr float DEFAULT_SHININESS = 32.F;
19 static constexpr glm::vec4 DEFAULT_LIGHT_COLOR = {glm::vec3(1.F), DEFAULT_LIGHT_INTENSITY};
20
21 static constexpr uint8_t MAX_LIGHTS = 10;
22
23 ///
24 /// @class Light
25 /// @brief Class for light
26 /// @namespace ven
27 ///
28 class Light {
29
30 public:
31
32 using Map = std::unordered_map<unsigned int, Light>;
33
34 explicit Light(const unsigned int objId) : m_lightId{objId} {}
35
36 ~Light() = default;
37
38 Light(const Light&) = delete;
39 Light& operator=(const Light&) = delete;
40 Light(Light&&) = default;
41 Light& operator=(Light&&) = default;
42
43 [[nodiscard]] unsigned int getId() const { return m_lightId; }
44 [[nodiscard]] std::string getName() const { return m_name; }
45 [[nodiscard]] float getShininess() const { return m_shininess; }
46
47 void setName(const std::string &name) { m_name = name; }
48 void setShininess(const float shininess) { m_shininess = shininess; }
49
52
53 private:
54
55 unsigned int m_lightId;
56 std::string m_name{"point light"};
58
59 }; // class Light
60
61} // namespace ven
This file contains the Transform3D class.
Class for light.
Definition Light.hpp:28
std::string getName() const
Definition Light.hpp:44
std::unordered_map< unsigned int, Light > Map
Definition Light.hpp:32
Light(Light &&)=default
glm::vec4 color
Definition Light.hpp:50
Light(const Light &)=delete
unsigned int getId() const
Definition Light.hpp:43
Light(const unsigned int objId)
Definition Light.hpp:34
void setName(const std::string &name)
Definition Light.hpp:47
Light & operator=(const Light &)=delete
Light & operator=(Light &&)=default
float getShininess() const
Definition Light.hpp:45
~Light()=default
float m_shininess
Definition Light.hpp:57
unsigned int m_lightId
Definition Light.hpp:55
void setShininess(const float shininess)
Definition Light.hpp:48
Transform3D transform
Definition Light.hpp:51
std::string m_name
Definition Light.hpp:56
Class for 3D transformation.
static constexpr uint8_t MAX_LIGHTS
Definition Light.hpp:21
static constexpr float DEFAULT_SHININESS
Definition Light.hpp:18
static constexpr float DEFAULT_LIGHT_INTENSITY
Definition Light.hpp:16
static constexpr glm::vec4 DEFAULT_LIGHT_COLOR
Definition Light.hpp:19
static constexpr float DEFAULT_LIGHT_RADIUS
Definition Light.hpp:17