Castor3D  ..
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Castor3D::Light Class Reference

Light source implementation. More...

+ Inheritance diagram for Castor3D::Light:
+ Collaboration diagram for Castor3D::Light:

Public Member Functions

C3D_API Light (Castor::String const &p_name, Scene &p_scene, SceneNodeSPtr p_node, LightFactory &p_factory, eLIGHT_TYPE p_lightType)
 Constructor. More...
 
C3D_API ~Light ()
 Destructor. More...
 
C3D_API void Bind (Castor::PxBufferBase &p_texture, uint32_t p_index)
 Puts the light into the given texture. More...
 
virtual C3D_API void AttachTo (SceneNodeSPtr p_node)
 Attaches this light to a Material. More...
 
C3D_API DirectionalLightSPtr GetDirectionalLight () const
 Retrieves the DirectionalLight category. More...
 
C3D_API PointLightSPtr GetPointLight () const
 Retrieves the PointLight category. More...
 
C3D_API SpotLightSPtr GetSpotLight () const
 Retrieves the SpotLight category. More...
 
eLIGHT_TYPE GetLightType () const
 Retrieves the light type. More...
 
bool IsEnabled () const
 Retrieves the light enabled status. More...
 
Castor::Point3f const & GetColour () const
 
Castor::Point3f const & GetIntensity () const
 
float GetAmbientIntensity () const
 
float GetDiffuseIntensity () const
 
float GetSpecularIntensity () const
 
Castor::Point4f const & GetPositionType () const
 Retrieves the light position and type. More...
 
int GetIndex () const
 Retrieves the light index. More...
 
void SetIndex (int p_value)
 Sets the light index. More...
 
void SetColour (float *p_values)
 Sets the colour. More...
 
void SetColour (float r, float g, float b)
 Sets the colour. More...
 
void SetColour (Castor::Point3f const &p_colour)
 Sets the colour. More...
 
void SetColour (Castor::Colour const &p_colour)
 Sets the colour. More...
 
void SetIntensity (float *p_values)
 Sets the light's intensity values. More...
 
void SetIntensity (float a, float d, float s)
 Sets the light's intensity values. More...
 
void SetIntensity (Castor::Point3f const &p_intensity)
 Sets the light's intensity values. More...
 
void SetAmbientIntensity (float p_intensity)
 Sets the ambient intensity. More...
 
void SetDiffuseIntensity (float p_intensity)
 Sets the diffuse intensity. More...
 
void SetSpecularIntensity (float p_intensity)
 Sets the specular intensity. More...
 
void SetEnabled (bool p_enabled)
 Sets the light enabled status. More...
 
void Enable ()
 Enables the light. More...
 
void Disable ()
 Disables the light. More...
 
- Public Member Functions inherited from Castor3D::MovableObject
C3D_API MovableObject (Castor::String const &p_name, Scene &p_scene, eMOVABLE_TYPE p_type, SceneNodeSPtr p_sn)
 Constructor. More...
 
virtual C3D_API ~MovableObject ()
 Destructor. More...
 
C3D_API void Detach ()
 Detaches the movable object from it's parent. More...
 
Castor::String const & GetName () const
 Retrieves the object name. More...
 
SceneNodeSPtr GetParent () const
 Retrieves the parent node. More...
 
eMOVABLE_TYPE GetType () const
 Retrieves the object type. More...
 
void SetName (Castor::String const &p_name)
 Sets the object name. More...
 
- Public Member Functions inherited from Castor3D::Animable
C3D_API AnimationSPtr CreateAnimation (Castor::String const &p_name)
 Creates an animation. More...
 
C3D_API void CleanupAnimations ()
 Empties the animations map. More...
 
C3D_API AnimationSPtr GetAnimation (Castor::String const &p_name)
 Retrieves an animation. More...
 
AnimationPtrStrMap const & GetAnimations () const
 

Protected Member Functions

void OnNodeChanged ()
 
- Protected Member Functions inherited from Castor3D::Animable
 Animable ()
 Constructor. More...
 
 ~Animable ()
 Destructor. More...
 

Protected Attributes

bool m_enabled
 Tells the light is enabled. More...
 
LightCategorySPtr m_pCategory
 The Light category that effectively holds light data. More...
 
int m_iIndex
 The light index. More...
 
- Protected Attributes inherited from Castor3D::MovableObject
eMOVABLE_TYPE m_type
 Movable object type. More...
 
Castor::String m_name
 The object name. More...
 
Castor::String m_strNodeName
 The parent node name. More...
 
SceneNodeWPtr m_pSceneNode
 The parent scene node. More...
 
uint32_t m_notifyIndex = 0
 The node change notification index. More...
 
- Protected Attributes inherited from Castor3D::Animable
AnimationPtrStrMap m_animations
 All animations. More...
 

Detailed Description

Light source implementation.

Author
Sylvain DOREMUS
Version
0.1
Date
09/02/2010

Constructor & Destructor Documentation

◆ Light()

C3D_API Castor3D::Light::Light ( Castor::String const &  p_name,
Scene p_scene,
SceneNodeSPtr  p_node,
LightFactory p_factory,
eLIGHT_TYPE  p_lightType 
)

Constructor.

Parameters
[in]p_nameThe light name
[in]p_sceneParent scene
[in]p_factoryFactory used to create the LightCategory
[in]p_lightTypeThe light type
[in]p_nodeThe parent scene node

◆ ~Light()

C3D_API Castor3D::Light::~Light ( )

Destructor.

Member Function Documentation

◆ AttachTo()

virtual C3D_API void Castor3D::Light::AttachTo ( SceneNodeSPtr  p_node)
virtual

Attaches this light to a Material.

Parameters
[in]p_nodeThe new light's parent node

Reimplemented from Castor3D::MovableObject.

◆ Bind()

C3D_API void Castor3D::Light::Bind ( Castor::PxBufferBase &  p_texture,
uint32_t  p_index 
)

Puts the light into the given texture.

Parameters
[out]p_textureThe texture that receives the light's data.
[in]p_indexThe light index.

◆ Disable()

void Castor3D::Light::Disable ( )
inline

Disables the light.

References SetEnabled().

+ Here is the call graph for this function:

◆ Enable()

void Castor3D::Light::Enable ( )
inline

Enables the light.

References SetEnabled().

+ Here is the call graph for this function:

◆ GetAmbientIntensity()

float Castor3D::Light::GetAmbientIntensity ( ) const
inline
Returns
The ambient intensity.

References m_pCategory.

◆ GetColour()

Castor::Point3f const& Castor3D::Light::GetColour ( ) const
inline
Returns
The light colour.

References m_pCategory.

◆ GetDiffuseIntensity()

float Castor3D::Light::GetDiffuseIntensity ( ) const
inline
Returns
The diffuse intensity.

References m_pCategory.

◆ GetDirectionalLight()

C3D_API DirectionalLightSPtr Castor3D::Light::GetDirectionalLight ( ) const

Retrieves the DirectionalLight category.

Returns
The value

◆ GetIndex()

int Castor3D::Light::GetIndex ( ) const
inline

Retrieves the light index.

Returns
The value

References m_iIndex.

◆ GetIntensity()

Castor::Point3f const& Castor3D::Light::GetIntensity ( ) const
inline
Returns
The intensity values.

References m_pCategory.

◆ GetLightType()

eLIGHT_TYPE Castor3D::Light::GetLightType ( ) const
inline

Retrieves the light type.

Returns
The value

References m_pCategory.

◆ GetPointLight()

C3D_API PointLightSPtr Castor3D::Light::GetPointLight ( ) const

Retrieves the PointLight category.

Returns
The value

◆ GetPositionType()

Castor::Point4f const& Castor3D::Light::GetPositionType ( ) const
inline

Retrieves the light position and type.

Returns
The value

References m_pCategory.

◆ GetSpecularIntensity()

float Castor3D::Light::GetSpecularIntensity ( ) const
inline
Returns
The specular intensity.

References m_pCategory.

◆ GetSpotLight()

C3D_API SpotLightSPtr Castor3D::Light::GetSpotLight ( ) const

Retrieves the SpotLight category.

Returns
The value

◆ IsEnabled()

bool Castor3D::Light::IsEnabled ( ) const
inline

Retrieves the light enabled status.

Returns
The value

References m_enabled.

◆ OnNodeChanged()

void Castor3D::Light::OnNodeChanged ( )
protected

◆ SetAmbientIntensity()

void Castor3D::Light::SetAmbientIntensity ( float  p_intensity)
inline

Sets the ambient intensity.

Parameters
[in]p_intensityThe new value.

References m_pCategory.

◆ SetColour() [1/4]

void Castor3D::Light::SetColour ( float *  p_values)
inline

Sets the colour.

Parameters
[in]p_valuesThe new value.

References m_pCategory.

◆ SetColour() [2/4]

void Castor3D::Light::SetColour ( float  r,
float  g,
float  b 
)
inline

Sets the colour.

Parameters
[in]r,g,bThe RGB components.

References m_pCategory.

◆ SetColour() [3/4]

void Castor3D::Light::SetColour ( Castor::Point3f const &  p_colour)
inline

Sets the colour.

Parameters
[in]p_colourThe new value.

References m_pCategory.

◆ SetColour() [4/4]

void Castor3D::Light::SetColour ( Castor::Colour const &  p_colour)
inline

Sets the colour.

Parameters
[in]p_colourThe new value

References m_pCategory.

◆ SetDiffuseIntensity()

void Castor3D::Light::SetDiffuseIntensity ( float  p_intensity)
inline

Sets the diffuse intensity.

Parameters
[in]p_intensityThe new value.

References m_pCategory.

◆ SetEnabled()

void Castor3D::Light::SetEnabled ( bool  p_enabled)
inline

Sets the light enabled status.

Parameters
[in]p_enabledThe new value

References m_enabled.

Referenced by Disable(), and Enable().

+ Here is the caller graph for this function:

◆ SetIndex()

void Castor3D::Light::SetIndex ( int  p_value)
inline

Sets the light index.

Parameters
[in]p_valueThe new value

References m_iIndex.

◆ SetIntensity() [1/3]

void Castor3D::Light::SetIntensity ( float *  p_values)
inline

Sets the light's intensity values.

Parameters
[in]p_valuesThe new values.

References m_pCategory.

◆ SetIntensity() [2/3]

void Castor3D::Light::SetIntensity ( float  a,
float  d,
float  s 
)
inline

Sets the light's intensity values.

Parameters
[in]a,d,sThe new values.

References m_pCategory.

◆ SetIntensity() [3/3]

void Castor3D::Light::SetIntensity ( Castor::Point3f const &  p_intensity)
inline

Sets the light's intensity values.

Parameters
[in]p_intensityThe new values.

References m_pCategory.

◆ SetSpecularIntensity()

void Castor3D::Light::SetSpecularIntensity ( float  p_intensity)
inline

Sets the specular intensity.

Parameters
[in]p_intensityThe new value.

References m_pCategory.

Member Data Documentation

◆ m_enabled

bool Castor3D::Light::m_enabled
protected

Tells the light is enabled.

Referenced by IsEnabled(), and SetEnabled().

◆ m_iIndex

int Castor3D::Light::m_iIndex
protected

The light index.

Referenced by GetIndex(), and SetIndex().

◆ m_pCategory

LightCategorySPtr Castor3D::Light::m_pCategory
protected

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