Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Scene::SpotLight Class Referencefinal

#include <Engine/Scene/SpotLight.hpp>

+ Inheritance diagram for Ra::Engine::Scene::SpotLight:
+ Collaboration diagram for Ra::Engine::Scene::SpotLight:

Public Member Functions

 SpotLight (Entity *entity, const std::string &name="spotlight")
 
void setPosition (const Eigen::Matrix< Scalar, 3, 1 > &position) override
 
const Eigen::Matrix< Scalar, 3, 1 > & getPosition () const
 
void setDirection (const Eigen::Matrix< Scalar, 3, 1 > &direction) override
 
const Eigen::Matrix< Scalar, 3, 1 > & getDirection () const
 
void setInnerAngleInRadians (Scalar angle)
 
void setOuterAngleInRadians (Scalar angle)
 
void setInnerAngleInDegrees (Scalar angle)
 
void setOuterAngleInDegrees (Scalar angle)
 
Scalar getInnerAngle () const
 
Scalar getOuterAngle () const
 
void setAttenuation (const Attenuation &attenuation)
 
void setAttenuation (Scalar constant, Scalar linear, Scalar quadratic)
 
const AttenuationgetAttenuation () const
 
std::string getShaderInclude () const override
 
- Public Member Functions inherited from Ra::Engine::Scene::Light
 Light (Entity *entity, const LightType &type, const std::string &name="light")
 
const Core::Utils::ColorgetColor () const
 
void setColor (const Core::Utils::Color &color)
 
const LightTypegetType () const
 
void getRenderParameters (Data::RenderParameters &params) const
 Extract the set of parameters that must be given to a shader for rendering and lighting with this light.
 
const Data::RenderParametersgetRenderParameters () const
 Gives read-only access to the renderParameters of the light.
 
Data::RenderParametersgetRenderParameters ()
 Gives read-write access to the renderParameters of the light.
 
void initialize () override
 
- Public Member Functions inherited from Ra::Engine::Scene::Component
 Component (const std::string &name, Entity *entity)
 CONSTRUCTOR.
 
virtual ~Component ()
 DESTRUCTOR.
 
virtual void setEntity (Entity *entity)
 Set entity the component is part of. This method is called by the entity.
 
virtual EntitygetEntity () const
 Return the entity the component belongs to.
 
virtual const std::stringgetName () const
 Return the component's name.
 
virtual void setSystem (System *system)
 Set the system to which the component belongs.
 
virtual SystemgetSystem () const
 Returns the system to which the component belongs.
 
Core::Utils::Index addRenderObject (Rendering::RenderObject *renderObject)
 Add a new render object to the component. This adds the RO to the manager for drawing.
 
void removeRenderObject (const Core::Utils::Index &roIdx)
 Remove the render object from the component.
 
virtual bool canEdit (const Core::Utils::Index &) const
 Returns true if a transform can be edited with the render object index given as a key.
 
virtual Core::Transform getTransform (const Core::Utils::Index &) const
 Get the transform associated with the given RO index key.
 
virtual void setTransform (const Core::Utils::Index &, const Core::Transform &)
 Set the new transform associated with the RO index key.
 
void notifyRenderObjectExpired (const Core::Utils::Index &idx)
 
virtual Core::Aabb computeAabb ()
 
void invalidateAabb ()
 
const std::vector< Core::Utils::Index > & getRenderObjects ()
 

Additional Inherited Members

- Public Types inherited from Ra::Engine::Scene::Light
enum  LightType : int { DIRECTIONAL = 0 , POINT , SPOT , POLYGONAL }
 
- Public Attributes inherited from Ra::Engine::Scene::Component
std::vector< Core::Utils::Index > m_renderObjects
 
- Static Protected Member Functions inherited from Ra::Engine::Scene::Component
static Rendering::RenderObjectManager * getRoMgr ()
 Shortcut to access the render object manager.
 
- Protected Attributes inherited from Ra::Engine::Scene::Component
std::string m_name {}
 
Entitym_entity { nullptr }
 
Systemm_system { nullptr }
 

Detailed Description

Spot light for rendering.

Definition at line 15 of file SpotLight.hpp.

Constructor & Destructor Documentation

◆ SpotLight()

Ra::Engine::Scene::SpotLight::SpotLight ( Entity * entity,
const std::string & name = "spotlight" )
explicit

Definition at line 7 of file SpotLight.cpp.

Member Function Documentation

◆ getAttenuation()

const SpotLight::Attenuation & Ra::Engine::Scene::SpotLight::getAttenuation ( ) const
inline

Definition at line 111 of file SpotLight.hpp.

◆ getDirection()

const Eigen::Matrix< Scalar, 3, 1 > & Ra::Engine::Scene::SpotLight::getDirection ( ) const
inline

Definition at line 69 of file SpotLight.hpp.

◆ getInnerAngle()

Scalar Ra::Engine::Scene::SpotLight::getInnerAngle ( ) const
inline

Definition at line 91 of file SpotLight.hpp.

◆ getOuterAngle()

Scalar Ra::Engine::Scene::SpotLight::getOuterAngle ( ) const
inline

Definition at line 95 of file SpotLight.hpp.

◆ getPosition()

const Eigen::Matrix< Scalar, 3, 1 > & Ra::Engine::Scene::Scene::SpotLight::getPosition ( ) const
inline

Definition at line 60 of file SpotLight.hpp.

◆ getShaderInclude()

std::string Ra::Engine::Scene::SpotLight::getShaderInclude ( ) const
overridevirtual

Abstract method that define the glsl code that manage this light type For the moment, this is not use (except by experimental plugins) but will be part of the shader composition process of radium v2

Returns

Reimplemented from Ra::Engine::Scene::Light.

Definition at line 19 of file SpotLight.cpp.

◆ setAttenuation() [1/2]

void Ra::Engine::Scene::SpotLight::setAttenuation ( const Attenuation & attenuation)
inline

Definition at line 99 of file SpotLight.hpp.

◆ setAttenuation() [2/2]

void Ra::Engine::Scene::SpotLight::setAttenuation ( Scalar constant,
Scalar linear,
Scalar quadratic )
inline

Definition at line 107 of file SpotLight.hpp.

◆ setDirection()

void Ra::Engine::Scene::SpotLight::setDirection ( const Eigen::Matrix< Scalar, 3, 1 > & )
inlineoverridevirtual

set the direction of lighting

Todo
put this only on directional and spot light sources
Parameters
dir

Reimplemented from Ra::Engine::Scene::Light.

Definition at line 64 of file SpotLight.hpp.

+ Here is the call graph for this function:

◆ setInnerAngleInDegrees()

void Ra::Engine::Scene::SpotLight::setInnerAngleInDegrees ( Scalar angle)
inline

Definition at line 83 of file SpotLight.hpp.

◆ setInnerAngleInRadians()

void Ra::Engine::Scene::SpotLight::setInnerAngleInRadians ( Scalar angle)
inline

Definition at line 73 of file SpotLight.hpp.

◆ setOuterAngleInDegrees()

void Ra::Engine::Scene::SpotLight::setOuterAngleInDegrees ( Scalar angle)
inline

Definition at line 87 of file SpotLight.hpp.

◆ setOuterAngleInRadians()

void Ra::Engine::Scene::SpotLight::setOuterAngleInRadians ( Scalar angle)
inline

Definition at line 78 of file SpotLight.hpp.

◆ setPosition()

void Ra::Engine::Scene::SpotLight::setPosition ( const Eigen::Matrix< Scalar, 3, 1 > & )
inlineoverridevirtual

Set the position of the light source

Todo
put this only on point and spot light sources
Parameters
pos

Reimplemented from Ra::Engine::Scene::Light.

Definition at line 55 of file SpotLight.hpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: