3 #include <easylogging++.h>
26 float linear_attenuation;
27 float quadratic_attenuation;
30 glm::vec3 cone_direction;
32 virtual void onStart()
override;
33 virtual bool onUpdate(
const double delta)
override;
53 void setColor(
const glm::vec3 color) noexcept;
156 virtual std::
string className() const noexcept override;
161 virtual
void log(el::base::type::ostream_t& os) const override;
164 if(str ==
"Spot" || str ==
"spot" || str ==
"SPOT")
165 return Light::Type::SPOT;
166 else if(str ==
"Point" || str ==
"point" || str ==
"POINT")
167 return Light::Type::POINT;
169 return Light::Type::POINT;
173 if(type == Light::Type::SPOT)
174 return std::string(
"Spot");
175 else if(type == Light::Type::POINT)
176 return std::string(
"Point");
178 return std::string(
"N/A");
void setNumberOfQuantizedBands(const int bands) noexcept
Sets the number of quantized bands.
Definition: light.cpp:65
bool castsQuantizedBands() const noexcept
Function to see if lights cast quantized bands or are smooth.
Definition: light.cpp:61
float getIntensity() const noexcept
Gets the intensity.
Definition: light.cpp:41
void setColor(const glm::vec3 color) noexcept
Sets the color.
Definition: light.cpp:29
~Light()
Destroys the object.
Definition: light.cpp:13
void setIntensity(const float intensity) noexcept
Sets the intensity.
Definition: light.cpp:37
void setLinearAttenuation(const float linear) noexcept
Sets the linear attenuation.
Definition: light.cpp:45
float getConeAngle() const noexcept
Gets the cone angle.
Definition: light.cpp:77
Base Class for all components.
Definition: component.h:20
virtual void onStart() override
Called when the engine starts and when a new scene is loaded.
Definition: light.cpp:17
virtual std::string className() const noexceptoverride
Returns a string representing the class name.
Definition: light.cpp:104
virtual unsigned long long getValueForSorting() const noexceptoverride
Gets the value for sorting.
Definition: light.cpp:100
Light::Type getType() const noexcept
Gets the type.
Definition: light.cpp:89
glm::vec3 getConeDirection() const noexcept
Gets the cone direction.
Definition: light.cpp:85
void setConeDirection(const glm::vec3 direction) noexcept
Sets the cone direction.
Definition: light.cpp:81
float getLinearAttenuation() const noexcept
Gets the linear attenuation.
Definition: light.cpp:49
void setQuadraticAttenuation(const float quadratic) noexcept
Sets the quadratic attenuation.
Definition: light.cpp:53
float getQuadraticAttenuation() const noexcept
Gets the quadratic attenuation.
Definition: light.cpp:57
void setConeAngle(const float angle) noexcept
Sets the cone angle.
Definition: light.cpp:73
glm::vec3 getColor() const noexcept
Gets the color.
Definition: light.cpp:33
virtual bool onUpdate(const double delta) override
Called every engine loop.
Definition: light.cpp:21
Light(const Light::Type &type=Type::POINT)
Light constructor.
Definition: light.cpp:7
float influenceOnComponent(const Component &component) const
Calculates a light's influence on a given component.
Definition: light.cpp:93
virtual void onDestroy() override
Called when the engine is shutting down.
Definition: light.cpp:25
int getNumberOfQuantizedBands() const noexcept
Gets the number of quantized bands.
Definition: light.cpp:69
Class for light.
Definition: light.h:15
virtual void log(el::base::type::ostream_t &os) const override
Definition: light.cpp:108
static const std::string typeToString(const Light::Type &type)
Definition: light.h:172
Type
Light type enum.
Definition: light.h:21
static const Light::Type stringToType(const std::string &str)
Definition: light.h:163