i6engine  1.0
i6e::api::LuminousAppearanceComponent Class Reference

Tells the engine that this GameObject is emitting light. For creating a LuminousAppearanceComponent, these keys are possible:

Name Required Type Description Public
lightType yes int one of the LightTypes yes
diffuseColor yes Vec3 diffuse colour of the light yes
specularColor yes Vec3 specular colour of the light yes
attenuation yes Vec4 attenuation of the light, W = range (range in world units), X = constant (1.0 never attenuate, 0.0 complete attenuation), Y = linear (linear attenuation depending on distance), Z = quadratic factor yes
pos no Vec3 relative position to SceneNode yes
direction *) Vec3 direction of the light shaft, *) required if lightType is DIRECTIONAL or SPOT yes
spotLightRangeInner *) double range of the inner cone of a spot light in degree, *) required if lightType is SPOT yes
spotLightRangeOuter *) double range of the outer cone of a spot light in degree, *) required if lightType is SPOT yes
More...

#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/api/components/LuminousAppearanceComponent.h>

Public Types

enum  LightType { LightType::POINT, LightType::DIRECTIONAL, LightType::SPOT }
 type of the light emitted More...
 

Public Member Functions

 LuminousAppearanceComponent (const int64_t id, const attributeMap &params)
 Constructor sets ID and component. More...
 
virtual ~LuminousAppearanceComponent ()
 
void setLightType (const LightType lightType)
 Sets light type. More...
 
LightType getLightType () const
 Gets component's light type. More...
 
void setDiffuseColor (const Vec3 &diffuseColor)
 Sets diffuse colour. More...
 
Vec3 getDiffuseColor () const
 Gets diffuse colour. More...
 
void setSpecularColor (const Vec3 &specular)
 Sets specular colour. More...
 
Vec3 getSpecularColor () const
 Gets specular colour. More...
 
void setAttenuation (const Vec4 &attenuation)
 Sets attenuation. More...
 
Vec4 getAttenuation () const
 Gets attenuation. More...
 
void setDirection (const Vec3 &direction)
 Sets direction. More...
 
Vec3 getDirection () const
 Gets direction. More...
 
void setSpotLightInnerRange (double angle)
 sets inner spot light angle More...
 
void setSpotLightOuterRange (double angle)
 sets outer spot light angle More...
 
virtual attributeMap synchronize () const override
 synchronizes the Components state More...
 
virtual std::string getTemplateName () const override
 returns the name this template was registered with More...
 
virtual std::vector< componentOptionsgetComponentOptions () override
 returns a vector containing all options of the Component being readable and writeable in the editor More...
 
- Public Member Functions inherited from i6e::api::Component
 Component ()
 Constructor for Component. More...
 
 Component (const int64_t id, const attributeMap &params)
 Constructor for Component. More...
 
virtual ~Component ()
 Destructor of Component. Must be implemented in derived class. More...
 
void setOwnerGO (const WeakGOPtr &objGo)
 Sets the GameObject that owns this Component. More...
 
GOPtr getOwnerGO ()
 Get the GameObject that owns this Component. More...
 
uint32_t getComponentID () const
 Returns the component identification string. More...
 
uint32_t getFamilyID () const
 Returns the family identification string. More...
 
std::string getIdentifier () const
 Returns the family identification string. More...
 
virtual void Tick ()
 Components can have Tick method like normal Subsystems this method is called by the ObjectController during every Tick if the component registered itself at the ObjectFacade. More...
 
void setDie () const
 component will be deleted soon More...
 
int64_t getID () const
 returns the id of the component More...
 
virtual void News (const GameMessage::Ptr &msg)
 Receives messages for this component override this function, if you expect messages. More...
 
void setSync (bool b)
 sets whether this object has to be synchronized or not More...
 
bool getSync () const
 
void enableTicking (bool allowTicking) const
 triggers doEnableTicking threadsafe More...
 
void setSelf (const WeakComPtr &self)
 sets weak_ptr on self for registration of ticker More...
 
std::vector< ComPtrgetSubComponents () const
 returns all SubComponents attached to this Component More...
 

Protected Member Functions

virtual void Init () override
 initializes the Component More...
 
virtual void Finalize () override
 finalizes the component More...
 
- Protected Member Functions inherited from i6e::api::Component
void addTicker ()
 adds this component to ticklist More...
 
void removeTicker ()
 removes this component from ticklist More...
 
void doEnableTicking (bool allowTicking)
 sets ticking status for this Component per default all Components are allowed to tick and calling addTicker will start ticking, but in some cases, e.g. for level editor, ticking has to be disabled and just a few components are allowed to tick More...
 

Protected Attributes

LightType _lightType
 
Vec3 _diffuseColor
 
Vec3 _specularColor
 
Vec4 _attenuation
 
Vec3 _direction
 
Vec3 _position
 
double _spotlightRangeInner
 
double _spotlightRangeOuter
 
- Protected Attributes inherited from i6e::api::Component
int64_t _objOwnerID
 ID of the GameObject that owns this Component. More...
 
WeakGOPtr _objOwnerGO
 Owning GameObject. More...
 
uint32_t _objComponentID
 Component ID of the Component. More...
 
uint32_t _objFamilyID
 Family ID of the Component. More...
 
std::vector< ComPtr_subComps
 vector containing the other componetns of the same type if this is the dispatcher component More...
 
std::string _identifier
 identifies the subcomponent More...
 
int64_t _id
 id of this component More...
 
bool _sync
 
WeakComPtr _self
 a weak_ptr on the own shared_ptr More...
 
bool _tickingAllowed
 status if this object is allowed to tick or not More...
 
bool _wantsToTick
 stores if a Component which isn't allowed to tick want to tick, so it can start ticking when ticking will be allowed More...
 
bool _isTicking
 stores whether this Component is actually ticking More...
 

Additional Inherited Members

- Static Public Member Functions inherited from i6e::api::Component
template<typename T >
static ComPtr createC (const int64_t id, const attributeMap &params)
 

Detailed Description

Tells the engine that this GameObject is emitting light. For creating a LuminousAppearanceComponent, these keys are possible:

Name Required Type Description Public
lightType yes int one of the LightTypes yes
diffuseColor yes Vec3 diffuse colour of the light yes
specularColor yes Vec3 specular colour of the light yes
attenuation yes Vec4 attenuation of the light, W = range (range in world units), X = constant (1.0 never attenuate, 0.0 complete attenuation), Y = linear (linear attenuation depending on distance), Z = quadratic factor yes
pos no Vec3 relative position to SceneNode yes
direction *) Vec3 direction of the light shaft, *) required if lightType is DIRECTIONAL or SPOT yes
spotLightRangeInner *) double range of the inner cone of a spot light in degree, *) required if lightType is SPOT yes
spotLightRangeOuter *) double range of the outer cone of a spot light in degree, *) required if lightType is SPOT yes

Definition at line 51 of file LuminousAppearanceComponent.h.

Constructor & Destructor Documentation

i6e::api::LuminousAppearanceComponent::LuminousAppearanceComponent ( const int64_t  id,
const attributeMap params 
)

Constructor sets ID and component.

virtual i6e::api::LuminousAppearanceComponent::~LuminousAppearanceComponent ( )
virtual

Member Function Documentation

virtual void i6e::api::LuminousAppearanceComponent::Finalize ( )
overrideprotectedvirtual

finalizes the component

Reimplemented from i6e::api::Component.

Vec4 i6e::api::LuminousAppearanceComponent::getAttenuation ( ) const
inline

Gets attenuation.

Gets attenuation

Returns
Attenuation of the component

Definition at line 139 of file LuminousAppearanceComponent.h.

virtual std::vector<componentOptions> i6e::api::LuminousAppearanceComponent::getComponentOptions ( )
overridevirtual

returns a vector containing all options of the Component being readable and writeable in the editor

Implements i6e::api::Component.

Reimplemented in i6e::api::AnimatedLuminousAppearanceComponent, and i6e::api::AnimatedSpotLightComponent.

Vec3 i6e::api::LuminousAppearanceComponent::getDiffuseColor ( ) const
inline

Gets diffuse colour.

Gets diffuse colour

Returns
Diffuse colour of the component

Definition at line 103 of file LuminousAppearanceComponent.h.

Vec3 i6e::api::LuminousAppearanceComponent::getDirection ( ) const
inline

Gets direction.

Gets direction

Returns
Direction of the component

Definition at line 157 of file LuminousAppearanceComponent.h.

LightType i6e::api::LuminousAppearanceComponent::getLightType ( ) const
inline

Gets component's light type.

Gets component's light type

Returns
Light type of the component

Definition at line 85 of file LuminousAppearanceComponent.h.

Vec3 i6e::api::LuminousAppearanceComponent::getSpecularColor ( ) const
inline

Gets specular colour.

Gets specular colour

Returns
Specular colour of the component

Definition at line 121 of file LuminousAppearanceComponent.h.

virtual std::string i6e::api::LuminousAppearanceComponent::getTemplateName ( ) const
inlineoverridevirtual

returns the name this template was registered with

Implements i6e::api::Component.

Reimplemented in i6e::api::AnimatedLuminousAppearanceComponent, i6e::api::AnimatedSpotLightComponent, and i6e::api::AnimatedDirectionalLightComponent.

Definition at line 174 of file LuminousAppearanceComponent.h.

virtual void i6e::api::LuminousAppearanceComponent::Init ( )
overrideprotectedvirtual

initializes the Component

Implements i6e::api::Component.

void i6e::api::LuminousAppearanceComponent::setAttenuation ( const Vec4 attenuation)

Sets attenuation.

Sets attenuation and sends update message

Parameters
[in]attenuationNew attenuation of the component
void i6e::api::LuminousAppearanceComponent::setDiffuseColor ( const Vec3 diffuseColor)

Sets diffuse colour.

Sets diffuse colour and sends update message

Parameters
[in]diffuseColorNew diffuse colour of the light
void i6e::api::LuminousAppearanceComponent::setDirection ( const Vec3 direction)

Sets direction.

Sets direction and sends update message

Parameters
[in]directionNew direction of the component
void i6e::api::LuminousAppearanceComponent::setLightType ( const LightType  lightType)

Sets light type.

Sets the light type of the component and sends update message

Parameters
[in]lightTypeNew light type
void i6e::api::LuminousAppearanceComponent::setSpecularColor ( const Vec3 specular)

Sets specular colour.

Sets specular colour and sends update message

Parameters
[in]specularNew specular colour of the component
void i6e::api::LuminousAppearanceComponent::setSpotLightInnerRange ( double  angle)

sets inner spot light angle

void i6e::api::LuminousAppearanceComponent::setSpotLightOuterRange ( double  angle)

sets outer spot light angle

virtual attributeMap i6e::api::LuminousAppearanceComponent::synchronize ( ) const
overridevirtual

Member Data Documentation

Vec4 i6e::api::LuminousAppearanceComponent::_attenuation
protected

Attenuation of the component W = range (range in world units) X = constant (1.0 never attenuate, 0.0 complete attenuation) Y = linear (linear attenuation depending on distance) Z = quadratic

Definition at line 203 of file LuminousAppearanceComponent.h.

Vec3 i6e::api::LuminousAppearanceComponent::_diffuseColor
protected

Diffuse colour of the component

Definition at line 189 of file LuminousAppearanceComponent.h.

Vec3 i6e::api::LuminousAppearanceComponent::_direction
protected

Direction of the component

Definition at line 208 of file LuminousAppearanceComponent.h.

LightType i6e::api::LuminousAppearanceComponent::_lightType
protected

Light type of the component

Definition at line 184 of file LuminousAppearanceComponent.h.

Vec3 i6e::api::LuminousAppearanceComponent::_position
protected

Relative position of this component

Definition at line 213 of file LuminousAppearanceComponent.h.

Vec3 i6e::api::LuminousAppearanceComponent::_specularColor
protected

Specular colour of the component

Definition at line 194 of file LuminousAppearanceComponent.h.

double i6e::api::LuminousAppearanceComponent::_spotlightRangeInner
protected

Range of the inner cone of a spotlight in degree, whole angle

Definition at line 219 of file LuminousAppearanceComponent.h.

double i6e::api::LuminousAppearanceComponent::_spotlightRangeOuter
protected

Range of the outer cone of a spotlight in degree, whole angle

Definition at line 225 of file LuminousAppearanceComponent.h.


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