SleakEngine
1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Light.cpp
Go to the documentation of this file.
1
#include <
Lighting/Light.hpp
>
2
3
namespace
Sleak
{
4
5
Light::Light
(
const
std::string& name) :
GameObject
(name) {}
6
7
void
Light::SetColor
(
float
r,
float
g,
float
b) {
8
m_color
=
Math::Vector3D
(r, g, b);
9
}
10
11
void
Light::SetColor
(
const
Math::Color
& color) {
12
Math::Vector4D
norm = color.
normalize
();
13
m_color
=
Math::Vector3D
(norm.
GetX
(), norm.
GetY
(), norm.
GetZ
());
14
}
15
16
}
// namespace Sleak
Light.hpp
Sleak::GameObject::GameObject
GameObject(const std::string &name="GameObject")
Definition
GameObject.hpp:59
Sleak::Light::m_color
Math::Vector3D m_color
Definition
Light.hpp:57
Sleak::Light::Light
Light(const std::string &name="Light")
Definition
Light.cpp:5
Sleak::Light::SetColor
void SetColor(float r, float g, float b)
Definition
Light.cpp:7
Sleak::Math::Color
Definition
Color.hpp:16
Sleak::Math::Color::normalize
Vector4D normalize() const noexcept
Converts to a Vector4D with each channel in [0,1].
Definition
Color.hpp:93
Sleak::Math::Vector3D
Definition
Vector.hpp:353
Sleak::Math::Vector4D
Definition
Vector.hpp:529
Sleak::Math::Vector4D::GetX
float GetX() const
Definition
Vector.hpp:536
Sleak::Math::Vector4D::GetZ
float GetZ() const
Definition
Vector.hpp:538
Sleak::Math::Vector4D::GetY
float GetY() const
Definition
Vector.hpp:537
Sleak
Root namespace for everything the engine exposes.
Definition
Camera.hpp:10
src
Lighting
Light.cpp
Generated on
for SleakEngine by
1.16.1