Emergency 2017 Dokumentation  v3.0.1
qsf::LightComponent Class Reference

Light component class. More...

#include <LightComponent.h>

Public Types

enum  LightType { POINT_LIGHT = 0, DIRECTIONAL_LIGHT = 1, SPOT_LIGHT = 2 }
 Light type. More...
 
- Public Types inherited from qsf::Component
enum  TransformChangeFlag {
  TRANSFORM_CHANGE_POSITION = 0x01, TRANSFORM_CHANGE_ROTATION = 0x02, TRANSFORM_CHANGE_SCALE = 0x04, TRANSFORM_CHANGE_TRANSFORM = 0x07,
  TRANSFORM_CHANGE_FOR_SIMULATION = 0x08, TRANSFORM_CHANGE_FOR_ANIMATION = 0x10
}
 
typedef BitFlagSet< uint8, TransformChangeFlagTransformChangeFlags
 
- Public Types inherited from qsf::Object
enum  PropertyOverrideState { PROPERTY_INVALID, PROPERTY_DEFAULT, PROPERTY_OVERRIDE, PROPERTY_REMOVED }
 
enum  SerializationMethod { SERIALIZE_FLAT, SERIALIZE_COMPLETE, SERIALIZE_DIFFERENTIAL, SERIALIZE_IGNORE_UNKNOWN }
 
enum  SerializationMode { MODE_MINIMAL, MODE_COMPATIBLE }
 

Public Member Functions

 LightComponent (Prototype *prototype)
 Constructor. More...
 
virtual ~LightComponent ()
 Destructor. More...
 
LightType getLightType () const
 Return the light type. More...
 
void setLightType (LightType lightType)
 Set the light type. More...
 
const Color3getDiffuseColor () const
 Return the color of the light. More...
 
void setDiffuseColor (const Color3 &lightColor)
 Set the of the light. More...
 
float getDiffuseIntensity () const
 Return the diffuse intensity of the light. More...
 
void setDiffuseIntensity (float diffuseIntensity)
 Set the diffuse intensity of the light. More...
 
float getDiffuseTemperature () const
 Return the diffuse temperature of the light. More...
 
void setDiffuseTemperature (float diffuseTemperature)
 Set the diffuse temperature of the light. More...
 
const AssetProxygetTexture () const
 Return the texture asset to use. More...
 
void setTexture (const AssetProxy &texture)
 Set the texture asset to use. More...
 
float getRange () const
 Return the absolute upper range of the light in world units. More...
 
void setRange (float falloutSmooth)
 Set the absolute upper range of the light in world units. More...
 
float getFalloffSmooth () const
 Get the smoothness of the falloff inside the range. More...
 
void setFalloffSmooth (float falloffSmooth)
 Set the smoothness of the falloff inside the range. More...
 
float getSpotlightOuterAngle () const
 Return the angle in degree covered by the outer cone of the light. More...
 
void setSpotlightOuterAngle (float spotlightOuterAngle)
 Set the angle in degree covered by the outer cone of the light. More...
 
float getSpotlightInnerAngle () const
 Return the angle in degree covered by the bright inner cone of the light. More...
 
void setSpotlightInnerAngle (float spotlightInnerAngle)
 Set the angle in degree covered by the bright inner cone of the light. More...
 
float getSpotlightFalloff () const
 Return the rate of falloff between the inner and outer cones of the light. More...
 
void setSpotlightFalloff (float spotlightFalloff)
 Set the rate of falloff between the inner and outer cones of the light. More...
 
float getSpotlightNearClipDistance () const
 Return the near distance of the light. More...
 
void setSpotlightNearClipDistance (float spotlightNearClipDistance)
 Set the near distance of the light. More...
 
float getMaxSpotlightAngle () const
 How large canspotlight angles become? More...
 
void setMaxSpotlightAngle (float maxAngle)
 Prevent spotlight angles becoming too large. More...
 
float getShadowFarDistance () const
 Return the maximum distance away from the camera that shadows by this light will be visible. More...
 
void setShadowFarDistance (float shadowFarDistance)
 Set the maximum distance away from the camera that shadows by this light will be visible. More...
 
float getShadowNearClipDistance () const
 Return the near clip plane distance to be used by the shadow camera, if this light casts texture shadows. More...
 
void setShadowNearClipDistance (float shadowNearClipDistance)
 Set the near clip plane distance to be used by the shadow camera, if this light casts texture shadows. More...
 
float getShadowFarClipDistance () const
 Return the far clip plane distance to be used by the shadow camera, if this light casts texture shadows. More...
 
void setShadowFarClipDistance (float shadowFarClipDistance)
 Set the far clip plane distance to be used by the shadow camera, if this light casts texture shadows. More...
 
const glm::vec3 & getWorldSpacePosition () const
 Return the world space position. More...
 
const glm::quat & getWorldSpaceRotation () const
 Return the world space rotation. More...
 
void setWorldSpaceRotation (const glm::quat &worldSpaceRotation)
 Set the world space rotation. More...
 
float getIntensity () const
 Get the intensity. More...
 
void setIntensity (float intensity)
 Set the intensity. More...
 
- Public Member Functions inherited from qsf::RendererComponent
 RendererComponent (Prototype *prototype)
 Constructor. More...
 
virtual ~RendererComponent ()
 Destructor. More...
 
bool getCastShadows () const
 Return whether or not the render component casts shadows. More...
 
void setCastShadows (bool castShadows)
 Set whether or not the render component casts shadows. More...
 
uint32 getRenderQueueId () const
 Return the render queue ID. More...
 
void setRenderQueueId (uint32 renderQueueId)
 Set the render queue ID. More...
 
float getWorldRadius () const
 Get the world radius of the renderer component. More...
 
bool getWorldAxisAlignedBoundingBox (glm::vec3 &minimumPoint, glm::vec3 &maximumPoint) const
 Get the axis aligned bounding box in world space. More...
 
bool getLocalAxisAlignedBoundingBox (glm::vec3 &minimumPoint, glm::vec3 &maximumPoint) const
 Get the axis aligned bounding box in local space. More...
 
Ogre::SceneManager * getOgreSceneManager () const
 Get the OGRE scene manager instance. More...
 
void updateOgreSceneNodeVisibility ()
 Update the visibility state of the internal OGRE scene node. More...
 
virtual Ogre::SceneNode * getOgreSceneNode () const
 Return the OGRE scene node instance. More...
 
virtual Ogre::v1::Entity * getOgreEntity () const
 Return the OGRE entity instance, if there are multiple the first one will be returned. More...
 
- Public Member Functions inherited from qsf::Component
virtual ~Component ()
 Destructor. More...
 
PrototypegetPrototype () const
 Return the prototype this component is in. More...
 
EntitygetEntity () const
 Return a reference to the entity this component is in. More...
 
uint32 getId () const
 Return the unique component identifier. More...
 
ComponentManagergetComponentManager () const
 Return the component manager that's responsible for this component instance. More...
 
ComponentCollectiongetComponentCollection () const
 Return the component collection that's responsible for this component instance. More...
 
bool isSimulating () const
 Return whether or not the component is in simulating mode. More...
 
bool isActive () const
 Return whether or not the component is considered to be active. More...
 
void setActive (bool active)
 Set whether or not the component is considered to be active. More...
 
bool isDebug () const
 Return whether or not the component is considered to be in debug mode. More...
 
bool isHidden () const
 Return whether or not the component is hidden. More...
 
void setHidden (bool hidden)
 Set whether or not the component is hidden. More...
 
bool isGloballyHidden () const
 Return whether or not the component is globally hidden. More...
 
void setGloballyHidden (bool globallyHidden)
 Set whether or not the component is globally hidden. More...
 
bool isReallyHidden () const
 Return whether or not the component is really hidden. More...
 
bool startup ()
 Startup the component. More...
 
bool isRunning () const
 Return whether or not the component is up-and-running. More...
 
void shutdown ()
 Shutdown the component. More...
 
uint64 getPrototypeId () const
 Return the ID of the prototype this component is in. More...
 
uint64 getEntityId () const
 Return the ID of the entity this component is in. More...
 
virtual void onInvalidation ()
 Invalidate the component. More...
 
virtual void setDebug (bool debugMode)
 Set whether or not the component is considered to be in debug mode. More...
 
virtual void serialize (BinarySerializer &serializer)
 Serialize or deserialize the component using a binary serializer. More...
 
- Public Member Functions inherited from qsf::InheritedObject
void copyPropertyOverrideStateFrom (const InheritedObject &object, bool add=false)
 
void setAllPropertyOverrideFlags (bool value)
 
void autoCreatePropertyOverrideState ()
 
virtual camp::Value getPropertyDefaultValue (const StringHash &propertyId) const override
 
virtual PropertyOverrideState getPropertyOverrideState (const StringHash &propertyId) const override
 
virtual bool setPropertyOverrideState (const StringHash &propertyId, PropertyOverrideState overrideState) override
 
- Public Member Functions inherited from qsf::Object
virtual ~Object ()
 Destructor. More...
 
const camp::Class & getCampClass () const
 Return the CAMP class. More...
 
int getPropertyIndexById (const StringHash &propertyId) const
 Return the CAMP property index by using the unique class property ID. More...
 
uint32 getPropertyIdByIndex (int index) const
 Return the unique class property ID with the given index. More...
 
std::string getPropertyNameById (const StringHash &propertyId) const
 Return the CAMP property name by using the unique class property ID. More...
 
const camp::Property * getCampPropertyById (const StringHash &propertyId) const
 Return the CAMP property by using the unique class property ID. More...
 
void setPropertyValuesByString (const std::string &values)
 Set CAMP reflection property values by using a given string. More...
 
void setPropertiesToDefaultValues ()
 Set all CAMP reflection system properties to their default values. More...
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
void serializeToBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void deserializeFromBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL, bool setOverrideState=true)
 
virtual void onPreDeserialize ()
 Called right before the object is deserialized using any of the above methods. Default implementation is empty. More...
 
virtual void onPostDeserialize ()
 Called right after the object was deserialized using any of the above methods. Default implementation is empty. More...
 
virtual ScriptgetAssociatedScript () const
 Return the script instance associated with this object instance. More...
 

Static Public Attributes

static const uint32 COMPONENT_ID
 "qsf::LightComponent" unique component ID More...
 
static const uint32 LIGHT_TYPE
 "LightType" unique class property ID inside the class More...
 
static const uint32 DIFFUSE_COLOR
 "DiffuseColor" unique class property ID inside the class More...
 
static const uint32 DIFFUSE_INTENSITY
 "DiffuseIntensity" unique class property ID inside the class More...
 
static const uint32 DIFFUSE_TEMPERATURE
 "DiffuseTemperature" unique class property ID inside the class More...
 
static const uint32 TEXTURE
 "Texture" unique class property ID inside the class More...
 
static const uint32 RANGE
 "Range" unique class property ID inside the class More...
 
static const uint32 FALLOFF_SMOOTH
 "FalloffSmooth" unique class property ID inside the class More...
 
static const uint32 SPOTLIGHT_OUTER_ANGLE
 "SpotlightOuterAngle" unique class property ID inside the class More...
 
static const uint32 SPOTLIGHT_INNER_ANGLE
 "SpotlightInnerAngle" unique class property ID inside the class More...
 
static const uint32 SPOTLIGHT_FALLOFF
 "SpotlightFalloff" unique class property ID inside the class More...
 
static const uint32 SPOTLIGHT_NEAR_CLIP_DISTANCE
 "SpotlightNearClipDistance" unique class property ID inside the class More...
 
static const uint32 SHADOW_FAR_DISTANCE
 "ShadowFarDistance" unique class property ID inside the class More...
 
static const uint32 SHADOW_NEAR_CLIP_DISTANCE
 "ShadowNearClipDistance" unique class property ID inside the class More...
 
static const uint32 SHADOW_FAR_CLIP_DISTANCE
 "ShadowFarClipDistance" unique class property ID inside the class More...
 
- Static Public Attributes inherited from qsf::RendererComponent
static const uint32 COMPONENT_ID
 "qsf::RendererComponent" unique component ID More...
 
static const uint32 ACTIVE
 "Active" unique class property ID inside the class More...
 
static const uint32 CAST_SHADOWS
 "CastShadows" unique class property ID inside the class More...
 
static const uint32 RENDER_QUEUE_ID
 "RenderQueueId" unique class property ID inside the class More...
 
- Static Public Attributes inherited from qsf::Component
static const uint32 COMPONENT_ID
 "qsf::Component" unique component ID More...
 

Protected Member Functions

virtual void setOgreSceneNodeVisibility (bool visible) override
 Set the visibility state of the internal OGRE scene node. More...
 
virtual void onComponentTransformChange (const Transform &transform, TransformChangeFlags flags) override
 Called in case a component transformation value was changed. More...
 
virtual void onSetSimulating (bool simulating) override
 Set whether or not the component is in simulating mode. More...
 
virtual void onSetDebug (bool debug) override
 Set whether or not the component is considered to be in debug mode. More...
 
virtual bool onStartup () override
 Startup the component. More...
 
virtual void onShutdown () override
 Shutdown the component. More...
 
- Protected Member Functions inherited from qsf::RendererComponent
virtual bool implementsOnComponentPropertyChange () const override
 Signal whether this component needs the "onComponentPropertyChange" callback at all. More...
 
virtual void onSetActive (bool active) override
 Set whether or not the component is considered to be active. More...
 
virtual void onSetHidden (bool hidden) override
 Set whether or not the component is considered to be hidden. More...
 
virtual void updateOgreObjectRenderingDistance () const
 Update the rendering distance state of the internal OGRE movable object. More...
 
virtual void updateOgreObjectCastShadows () const
 Update the cast shadows state of the internal OGRE movable object. More...
 
virtual uint32 getDefaultRenderQueueId () const
 Return the ID of the default render queue to use. More...
 
virtual void updateOgreObjectRenderQueue (uint32 renderQueueId)
 Update the render queue ID state of the internal OGRE movable object. More...
 
virtual void updateOgreObjectFlipCulling ()
 Update the flip culling state of the internal OGRE movable object. More...
 
virtual bool isGridManaged () const
 Return whether or not the renderer component is grid managed. More...
 
Ogre::SceneNode * createCellChildSceneNode ()
 Create cell child scene node. More...
 
void updateOgreObject ()
 Update the states controlled by this renderer component of the internal OGRE object. More...
 
bool shouldBeVisible () const
 Check component flags to determine if this renderer component should be visible right now. More...
 
- Protected Member Functions inherited from qsf::Component
 Component (Prototype *prototype)
 Constructor. More...
 
void promotePropertyChange (uint32 propertyId)
 A component property value was changed. More...
 
template<typename T , typename S >
bool assignAndPromoteChange (T &variable, const S &newValue, uint32 propertyId)
 Comfort function for updating an exported member variable and promoting any change that happened. More...
 
void setRegisterForSimulationTransformChanges (bool enable)
 Register or unregister this component as simulation transform listener. More...
 
void setRegisterForAnimationTransformChanges (bool enable)
 Register or unregister this component as animation transform listener. More...
 
virtual const ObjectgetPropertyDefaultsProvider () const override
 
virtual void onComponentPropertyChange (const Component &component, uint32 propertyId)
 Called in case a component property value was changed. More...
 
- Protected Member Functions inherited from qsf::InheritedObject
 InheritedObject ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::WeakPtrTarget
 WeakPtrTarget ()
 Default constructor. More...
 
 WeakPtrTarget (const WeakPtrTarget &other)
 Copy constructor. More...
 
 WeakPtrTarget (WeakPtrTarget &&)=delete
 Delete the move constructor, as WeakPtrTarget would need a proper move constructor-implementation that ensures that its pointer gets updated in the WeakPtrBase as well. More...
 
 ~WeakPtrTarget ()
 Destructor. More...
 
void invalidateAllWeakPtr ()
 Invalidate all weak pointers to this object. More...
 
void operator= (const WeakPtrTarget &other)
 Copy operator. More...
 

Protected Attributes

glm::vec3 mWorldSpacePosition
 Cached world space position. More...
 
glm::quat mWorldSpaceRotation
 Cached world space rotation. More...
 
DebugDrawProxy mDebugDrawProxy
 Debug draw proxy. More...
 
- Protected Attributes inherited from qsf::InheritedObject
std::bitset< 128 > mPropertyOverrideFlags
 One bit for each property; if set, the property is overridden. More...
 

Friends

class OgreCompositorPassDeferredLight
 

Additional Inherited Members

- Static Public Member Functions inherited from qsf::RendererComponent
static ComponentgetComponentByOgreMovableObject (const Ogre::MovableObject &ogreMovableObject)
 Get the component associated with an OGRE movable object. More...
 

Detailed Description

Light component class.

Todo:
  • TODO(co) Remove "qsf::RendererComponent" inheritance?

Definition at line 48 of file LightComponent.h.

Member Enumeration Documentation

Light type.

Enumerator
POINT_LIGHT 

Point light sources give off light equally in all directions, so require only position not direction.

DIRECTIONAL_LIGHT 

Directional lights simulate parallel light beams from a distant source, hence have direction but no position.

SPOT_LIGHT 

Spot lights simulate a cone of light from a source so require position and direction, plus extra values for falloff.

Definition at line 93 of file LightComponent.h.

Constructor & Destructor Documentation

qsf::LightComponent::LightComponent ( Prototype prototype)
explicit

Constructor.

Parameters
[in]prototypeThe prototype this component is in, no null pointer allowed
virtual qsf::LightComponent::~LightComponent ( )
virtual

Destructor.

Member Function Documentation

const Color3 & qsf::LightComponent::getDiffuseColor ( ) const
inline

Return the color of the light.

Returns
The color of the light, do no destroy the returned instance
Note
  • Connected to the CAMP reflection system

Definition at line 19 of file LightComponent-inl.h.

float qsf::LightComponent::getDiffuseIntensity ( ) const
inline

Return the diffuse intensity of the light.

Returns
The diffuse intensity of the light
Note
  • Connected to the CAMP reflection system

Definition at line 32 of file LightComponent-inl.h.

float qsf::LightComponent::getDiffuseTemperature ( ) const
inline

Return the diffuse temperature of the light.

Returns
The diffuse temperature (in Kelvin) of the light
Note
  • Connected to the CAMP reflection system

Definition at line 45 of file LightComponent-inl.h.

float qsf::LightComponent::getFalloffSmooth ( ) const
inline

Get the smoothness of the falloff inside the range.

Note
  • Connected to the CAMP reflection system

Definition at line 70 of file LightComponent-inl.h.

float qsf::LightComponent::getIntensity ( ) const
inline

Get the intensity.

Returns
Intensity value between 0 and 1, which can be set and changed freely
Note
  • Don't access this method if you don't have to

Definition at line 160 of file LightComponent-inl.h.

LightComponent::LightType qsf::LightComponent::getLightType ( ) const
inline

Return the light type.

Returns
The light type
Note
  • Connected to the CAMP reflection system

Definition at line 14 of file LightComponent-inl.h.

float qsf::LightComponent::getMaxSpotlightAngle ( ) const
inline

How large canspotlight angles become?

Parameters
[in]maxAngleMaximum angle allowed for inner and outer angle. 120 by default.

Definition at line 105 of file LightComponent-inl.h.

float qsf::LightComponent::getRange ( ) const
inline

Return the absolute upper range of the light in world units.

Returns
The absolute upper range of the light in world units
Note
  • Connected to the CAMP reflection system

Definition at line 65 of file LightComponent-inl.h.

float qsf::LightComponent::getShadowFarClipDistance ( ) const
inline

Return the far clip plane distance to be used by the shadow camera, if this light casts texture shadows.

Returns
The far clip plane distance to be used by the shadow camera, if this light casts texture shadows; <0 to use the global setting
Remarks
This is different from the "shadow far distance", which is always measured from the main camera. This distance is the far clip plane of the light camera.
Note
  • Connected to the CAMP reflection system

Definition at line 135 of file LightComponent-inl.h.

float qsf::LightComponent::getShadowFarDistance ( ) const
inline

Return the maximum distance away from the camera that shadows by this light will be visible.

Returns
The maximum distance away from the camera that shadows by this light will be visible; <0 to use the global setting
Remarks
Shadow techniques can be expensive, therefore it is a good idea to limit them to being rendered close to the camera if possible, and to skip the expense of rendering shadows for distance objects. This method allows you to set the distance at which shadows will no longer be rendered.

Each shadow technique can interpret this subtely differently. For example, one technique may use this to eliminate casters, another might use it to attenuate the shadows themselves. You should tweak this value to suit your chosen shadow technique and scene setup.

Note
  • Connected to the CAMP reflection system

Definition at line 115 of file LightComponent-inl.h.

float qsf::LightComponent::getShadowNearClipDistance ( ) const
inline

Return the near clip plane distance to be used by the shadow camera, if this light casts texture shadows.

Returns
The near clip plane distance to be used by the shadow camera, if this light casts texture shadows; <=0 to use the global setting
Note
  • Connected to the CAMP reflection system

Definition at line 125 of file LightComponent-inl.h.

float qsf::LightComponent::getSpotlightFalloff ( ) const
inline

Return the rate of falloff between the inner and outer cones of the light.

Returns
The rate of falloff between the inner and outer cones of the light. 1.0 means a linear falloff, less means slower falloff, higher means faster falloff.
Note
  • Connected to the CAMP reflection system

Definition at line 90 of file LightComponent-inl.h.

float qsf::LightComponent::getSpotlightInnerAngle ( ) const
inline

Return the angle in degree covered by the bright inner cone of the light.

Returns
The angle in degree covered by the bright inner cone of the light
Note
  • Connected to the CAMP reflection system

Definition at line 85 of file LightComponent-inl.h.

float qsf::LightComponent::getSpotlightNearClipDistance ( ) const
inline

Return the near distance of the light.

Returns
The near distance of the light
Note
  • Connected to the CAMP reflection system
  • Set the near clip plane distance to be used by spotlights that use light clipping, allowing you to render spots as if they start from further down their frustum

Definition at line 100 of file LightComponent-inl.h.

float qsf::LightComponent::getSpotlightOuterAngle ( ) const
inline

Return the angle in degree covered by the outer cone of the light.

Returns
The angle in degree covered by the outer cone of the light
Note
  • Connected to the CAMP reflection system

Definition at line 80 of file LightComponent-inl.h.

const AssetProxy & qsf::LightComponent::getTexture ( ) const
inline

Return the texture asset to use.

Returns
The texture asset to use (e.g. "sample/texture/spot/bat"), do no destroy the returned instance
Note
  • Connected to the CAMP reflection system

Definition at line 55 of file LightComponent-inl.h.

const glm::vec3 & qsf::LightComponent::getWorldSpacePosition ( ) const
inline

Return the world space position.

Returns
The world space position, do no destroy the returned instance
Note
  • Don't access this method if you don't have to

Definition at line 145 of file LightComponent-inl.h.

const glm::quat & qsf::LightComponent::getWorldSpaceRotation ( ) const
inline

Return the world space rotation.

Returns
The world space rotation, do no destroy the returned instance
Note
  • Don't access this method if you don't have to

Definition at line 150 of file LightComponent-inl.h.

virtual void qsf::LightComponent::onComponentTransformChange ( const Transform transform,
TransformChangeFlags  flags 
)
overrideprotectedvirtual

Called in case a component transformation value was changed.

Parameters
[in]transformThe changed transformation
[in]flagsFlags describing the change
Note
  • The default implementation is empty
  • In order for this to get called at all in simulating mode, an entity has to register itself as listener for simulation and/or animation transform changes, see e.g. "qsf::Component::setRegisterForSimulationTransformChanges".

Reimplemented from qsf::RendererComponent.

Reimplemented in qsf::SunComponent.

virtual void qsf::LightComponent::onSetDebug ( bool  debug)
overrideprotectedvirtual

Set whether or not the component is considered to be in debug mode.

Parameters
[in]debug"true" if the component is considered to be in debug mode, else "false"
Note
  • The default implementation is empty
  • This method is only called in case there's a real state change
See also
  • "qsf::Component::setDebug()"

Reimplemented from qsf::RendererComponent.

virtual void qsf::LightComponent::onSetSimulating ( bool  simulating)
overrideprotectedvirtual

Set whether or not the component is in simulating mode.

Parameters
[in]active"true" if the component is in simulating mode, else "false"
Note
  • The default implementation is empty
  • This method is only called in case there's a real state change
  • In contrast to internal flags (e.g. Active, Debug), the simulating mode state can only be changed globally for a whole map
  • On component shutdown and simulating enabled, "onSetSimulating()" is automatically called with "false" before calling "onShutdown()"

Reimplemented from qsf::RendererComponent.

virtual void qsf::LightComponent::onShutdown ( )
overrideprotectedvirtual

Shutdown the component.

Note
  • Only called in case "onStartup()" returned successfully
  • The default implementation is empty

Reimplemented from qsf::Component.

Reimplemented in qsf::SunComponent.

virtual bool qsf::LightComponent::onStartup ( )
overrideprotectedvirtual

Startup the component.

Returns
"true" if all went fine, else "false"
Note
  • The default implementation is empty
  • Only components which are part of entities (concrete prototype instances) get started
  • When this method gets called, the properties might still be on default values but it's also possible that properties already have customized values. Take this into account when implementing your method.

Reimplemented from qsf::Component.

Reimplemented in qsf::SunComponent.

void qsf::LightComponent::setDiffuseColor ( const Color3 lightColor)
inline

Set the of the light.

Parameters
[in]lightColorThe color of the light
Note
  • Connected to the CAMP reflection system

Definition at line 24 of file LightComponent-inl.h.

void qsf::LightComponent::setDiffuseIntensity ( float  diffuseIntensity)
inline

Set the diffuse intensity of the light.

Parameters
[in]diffuseIntensityThe diffuse intensity of the light
Note
  • Connected to the CAMP reflection system

Definition at line 37 of file LightComponent-inl.h.

void qsf::LightComponent::setDiffuseTemperature ( float  diffuseTemperature)
inline

Set the diffuse temperature of the light.

Parameters
[in]diffuseTemperatureThe diffuse temperature (in Kelvin) of the light
Note
  • Connected to the CAMP reflection system

Definition at line 50 of file LightComponent-inl.h.

void qsf::LightComponent::setFalloffSmooth ( float  falloffSmooth)
inline

Set the smoothness of the falloff inside the range.

Parameters
[in]rangeFalloff between 0 and 1
Note
  • Connected to the CAMP reflection system

Definition at line 75 of file LightComponent-inl.h.

void qsf::LightComponent::setIntensity ( float  intensity)
inline

Set the intensity.

Parameters
[in]intensityIntensity value between 0 and 1, which can be set and changed freely
Note
  • Don't access this method if you don't have to

Definition at line 165 of file LightComponent-inl.h.

void qsf::LightComponent::setLightType ( LightType  lightType)

Set the light type.

Parameters
[in]lightTypeThe light type
Note
  • Connected to the CAMP reflection system
void qsf::LightComponent::setMaxSpotlightAngle ( float  maxAngle)
inline

Prevent spotlight angles becoming too large.

Parameters
[in]maxAngleMaximum angle allowed for inner and outer angle. 120 by default.

Definition at line 110 of file LightComponent-inl.h.

virtual void qsf::LightComponent::setOgreSceneNodeVisibility ( bool  visible)
overrideprotectedvirtual

Set the visibility state of the internal OGRE scene node.

Parameters
[in]visible"true" if the OGRE scene node should be visible, else "false"

Reimplemented from qsf::RendererComponent.

Reimplemented in qsf::SunComponent.

void qsf::LightComponent::setRange ( float  falloutSmooth)

Set the absolute upper range of the light in world units.

Parameters
[in]rangeThe absolute upper range of the light in world units
Note
  • Connected to the CAMP reflection system
void qsf::LightComponent::setShadowFarClipDistance ( float  shadowFarClipDistance)
inline

Set the far clip plane distance to be used by the shadow camera, if this light casts texture shadows.

Parameters
[in]shadowFarClipDistanceThe far clip plane distance to be used by the shadow camera, if this light casts texture shadows; <0 to use the global setting
Note
  • Connected to the CAMP reflection system
See also
  • "qsf::LightComponent::getShadowFarClipDistance()"

Definition at line 140 of file LightComponent-inl.h.

void qsf::LightComponent::setShadowFarDistance ( float  shadowFarDistance)
inline

Set the maximum distance away from the camera that shadows by this light will be visible.

Parameters
[in]shadowFarDistanceThe maximum distance away from the camera that shadows by this light will be visible; <0 to use the global setting
Note
  • Connected to the CAMP reflection system
See also
  • "qsf::LightComponent::getShadowFarDistance()"

Definition at line 120 of file LightComponent-inl.h.

void qsf::LightComponent::setShadowNearClipDistance ( float  shadowNearClipDistance)
inline

Set the near clip plane distance to be used by the shadow camera, if this light casts texture shadows.

Parameters
[in]shadowNearClipDistanceThe near clip plane distance to be used by the shadow camera, if this light casts texture shadows; <=0 to use the global setting
Note
  • Connected to the CAMP reflection system

Definition at line 130 of file LightComponent-inl.h.

void qsf::LightComponent::setSpotlightFalloff ( float  spotlightFalloff)
inline

Set the rate of falloff between the inner and outer cones of the light.

Parameters
[in]spotlightFalloffThe rate of falloff between the inner and outer cones of the light 1.0 means a linear falloff, less means slower falloff, higher means faster falloff.
Note
  • Connected to the CAMP reflection system

Definition at line 95 of file LightComponent-inl.h.

void qsf::LightComponent::setSpotlightInnerAngle ( float  spotlightInnerAngle)

Set the angle in degree covered by the bright inner cone of the light.

Parameters
[in]spotlightInnerAngleThe angle in degree covered by the bright inner cone of the light. NOTE: It will be clamped to MaxSpotlightAngle to prevent insane angles.
Note
  • Connected to the CAMP reflection system
void qsf::LightComponent::setSpotlightNearClipDistance ( float  spotlightNearClipDistance)

Set the near distance of the light.

Parameters
[in]rangeThe near distance of the light
Note
  • Connected to the CAMP reflection system
  • Set the near clip plane distance to be used by spotlights that use light clipping, allowing you to render spots as if they start from further down their frustum
void qsf::LightComponent::setSpotlightOuterAngle ( float  spotlightOuterAngle)

Set the angle in degree covered by the outer cone of the light.

Parameters
[in]spotlightOuterAngleThe angle in degree covered by the outer cone of the light NOTE: It will be clamped to MaxSpotlightAngle to prevent insane angles.
Note
  • Connected to the CAMP reflection system
void qsf::LightComponent::setTexture ( const AssetProxy texture)
inline

Set the texture asset to use.

Parameters
[in]textureThe texture asset to use (e.g. "sample/texture/spot/bat")
Note
  • Connected to the CAMP reflection system

Definition at line 60 of file LightComponent-inl.h.

void qsf::LightComponent::setWorldSpaceRotation ( const glm::quat &  worldSpaceRotation)
inline

Set the world space rotation.

Parameters
[in]worldSpaceRotationThe world space rotation to set

Definition at line 155 of file LightComponent-inl.h.

Friends And Related Function Documentation

friend class OgreCompositorPassDeferredLight
friend

Definition at line 56 of file LightComponent.h.

Member Data Documentation

const uint32 qsf::LightComponent::COMPONENT_ID
static

"qsf::LightComponent" unique component ID

Definition at line 63 of file LightComponent.h.

const uint32 qsf::LightComponent::DIFFUSE_COLOR
static

"DiffuseColor" unique class property ID inside the class

Definition at line 67 of file LightComponent.h.

const uint32 qsf::LightComponent::DIFFUSE_INTENSITY
static

"DiffuseIntensity" unique class property ID inside the class

Definition at line 68 of file LightComponent.h.

const uint32 qsf::LightComponent::DIFFUSE_TEMPERATURE
static

"DiffuseTemperature" unique class property ID inside the class

Definition at line 69 of file LightComponent.h.

const uint32 qsf::LightComponent::FALLOFF_SMOOTH
static

"FalloffSmooth" unique class property ID inside the class

Definition at line 73 of file LightComponent.h.

const uint32 qsf::LightComponent::LIGHT_TYPE
static

"LightType" unique class property ID inside the class

Definition at line 65 of file LightComponent.h.

DebugDrawProxy qsf::LightComponent::mDebugDrawProxy
protected

Debug draw proxy.

Definition at line 596 of file LightComponent.h.

glm::vec3 qsf::LightComponent::mWorldSpacePosition
protected

Cached world space position.

Definition at line 594 of file LightComponent.h.

glm::quat qsf::LightComponent::mWorldSpaceRotation
protected

Cached world space rotation.

Definition at line 595 of file LightComponent.h.

const uint32 qsf::LightComponent::RANGE
static

"Range" unique class property ID inside the class

Definition at line 72 of file LightComponent.h.

const uint32 qsf::LightComponent::SHADOW_FAR_CLIP_DISTANCE
static

"ShadowFarClipDistance" unique class property ID inside the class

Definition at line 82 of file LightComponent.h.

const uint32 qsf::LightComponent::SHADOW_FAR_DISTANCE
static

"ShadowFarDistance" unique class property ID inside the class

Definition at line 80 of file LightComponent.h.

const uint32 qsf::LightComponent::SHADOW_NEAR_CLIP_DISTANCE
static

"ShadowNearClipDistance" unique class property ID inside the class

Definition at line 81 of file LightComponent.h.

const uint32 qsf::LightComponent::SPOTLIGHT_FALLOFF
static

"SpotlightFalloff" unique class property ID inside the class

Definition at line 77 of file LightComponent.h.

const uint32 qsf::LightComponent::SPOTLIGHT_INNER_ANGLE
static

"SpotlightInnerAngle" unique class property ID inside the class

Definition at line 76 of file LightComponent.h.

const uint32 qsf::LightComponent::SPOTLIGHT_NEAR_CLIP_DISTANCE
static

"SpotlightNearClipDistance" unique class property ID inside the class

Definition at line 78 of file LightComponent.h.

const uint32 qsf::LightComponent::SPOTLIGHT_OUTER_ANGLE
static

"SpotlightOuterAngle" unique class property ID inside the class

Definition at line 75 of file LightComponent.h.

const uint32 qsf::LightComponent::TEXTURE
static

"Texture" unique class property ID inside the class

Definition at line 70 of file LightComponent.h.


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