3#include <Core/Math/Math.hpp>
4#include <Engine/RaEngine.hpp>
5#include <Engine/Scene/Light.hpp>
22 void setPosition(
const Eigen::Matrix<Scalar, 3, 1>& position )
override;
23 inline const Eigen::Matrix<Scalar, 3, 1>& getPosition()
const;
25 void setDirection(
const Eigen::Matrix<Scalar, 3, 1>& direction )
override;
26 inline const Eigen::Matrix<Scalar, 3, 1>& getDirection()
const;
28 inline void setInnerAngleInRadians( Scalar angle );
29 inline void setOuterAngleInRadians( Scalar angle );
30 inline void setInnerAngleInDegrees( Scalar angle );
31 inline void setOuterAngleInDegrees( Scalar angle );
33 inline Scalar getInnerAngle()
const;
34 inline Scalar getOuterAngle()
const;
36 inline void setAttenuation(
const Attenuation& attenuation );
37 inline void setAttenuation( Scalar constant, Scalar linear, Scalar quadratic );
43 Eigen::Matrix<Scalar, 3, 1> m_position { 0, 0, 0 };
44 Eigen::Matrix<Scalar, 3, 1> m_direction { 0, -1, 0 };
46 Scalar m_innerAngle { Core::Math::PiDiv4 };
47 Scalar m_outerAngle { Core::Math::PiDiv2 };
56 m_position = position;
60inline const Eigen::Matrix<Scalar, 3, 1>& Scene::SpotLight::getPosition()
const {
65 m_direction = direction.normalized();
69inline const Eigen::Matrix<Scalar, 3, 1>& SpotLight::getDirection()
const {
73inline void SpotLight::setInnerAngleInRadians( Scalar angle ) {
78inline void SpotLight::setOuterAngleInRadians( Scalar angle ) {
83inline void SpotLight::setInnerAngleInDegrees( Scalar angle ) {
84 m_innerAngle = angle * Core::Math::toRad;
87inline void SpotLight::setOuterAngleInDegrees( Scalar angle ) {
88 m_outerAngle = Core::Math::toRad *
angle;
91inline Scalar SpotLight::getInnerAngle()
const {
95inline Scalar SpotLight::getOuterAngle()
const {
99inline void SpotLight::setAttenuation(
const Attenuation& attenuation ) {
100 m_attenuation = attenuation;
104 m_attenuation.quadratic );
107inline void SpotLight::setAttenuation( Scalar constant, Scalar linear, Scalar quadratic ) {
108 setAttenuation( { constant, linear, quadratic } );
111inline const SpotLight::Attenuation& SpotLight::getAttenuation()
const {
112 return m_attenuation;
void setVariable(const std::string &name, RenderParameters &rp)
overload create ref wrapper for RenderParameters variable
An entity is an scene element. It ties together components with a transform.
const Data::RenderParameters & getRenderParameters() const
Gives read-only access to the renderParameters of the light.
void setDirection(const Eigen::Matrix< Scalar, 3, 1 > &direction) override
void setPosition(const Eigen::Matrix< Scalar, 3, 1 > &position) override
Scalar angle(const Vector_ &v1, const Vector_ &v2)
hepler function to manage enum as underlying types in VariableSet