3 #include <Engine/RaEngine.hpp>
4 #include <Engine/Scene/Light.hpp>
17 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
19 explicit PointLight(
Entity* entity,
const std::string& name =
"pointlight" );
22 void setPosition(
const Eigen::Matrix<Scalar, 3, 1>& pos )
override;
23 inline const Eigen::Matrix<Scalar, 3, 1>& getPosition()
const;
25 inline void setAttenuation(
const Attenuation& attenuation );
26 inline void setAttenuation( Scalar constant, Scalar linear, Scalar quadratic );
29 std::string getShaderInclude()
const override;
32 Eigen::Matrix<Scalar, 3, 1> m_position { 0, 0, 0 };
45 inline const Eigen::Matrix<Scalar, 3, 1>& PointLight::getPosition()
const {
49 inline void PointLight::setAttenuation(
const PointLight::Attenuation& attenuation ) {
50 m_attenuation = attenuation;
52 m_attenuation.constant );
55 m_attenuation.quadratic );
58 inline void PointLight::setAttenuation( Scalar constant, Scalar linear, Scalar quadratic ) {
59 setAttenuation( { constant, linear, quadratic } );
62 inline const PointLight::Attenuation& PointLight::getAttenuation()
const {
void addParameter(const std::string &name, T value, typename std::enable_if<!std::is_class< T > {}, bool >::type=true)
Add a parameter by value.
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 setPosition(const Eigen::Matrix< Scalar, 3, 1 > &pos) override