All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
gazebo::rendering::Light Class Reference

A light source. More...

#include <rendering/rendering.hh>

Public Member Functions

 Light (Scene *_scene)
 Constructor.
 
virtual ~Light ()
 Destructor.
 
void FillMsg (msgs::Light &_msg) const
 Fill the contents of a light message.
 
common::Color GetDiffuseColor () const
 Get the diffuse color.
 
math::Vector3 GetDirection () const
 Get the direction.
 
std::string GetName () const
 Get the name of the visual.
 
math::Vector3 GetPosition () const
 Get the position of the light.
 
common::Color GetSpecularColor () const
 Get the specular color.
 
std::string GetType () const
 Get the type of the light.
 
void Load (sdf::ElementPtr _sdf)
 Load the light using a set of SDF parameters.
 
void Load ()
 Load the light using default parameters.
 
void LoadFromMsg (ConstLightPtr &_msg)
 Load from a light message.
 
void SetAttenuation (double _constant, double _linear, double _quadratic)
 Set the attenuation.
 
void SetCastShadows (const bool &_cast)
 Set cast shadows.
 
void SetDiffuseColor (const common::Color &_color)
 Set the diffuse color.
 
void SetDirection (const math::Vector3 &_dir)
 Set the direction.
 
void SetLightType (const std::string &_type)
 Set the light type.
 
void SetName (const std::string &_name)
 Set the name of the visual.
 
void SetPosition (const math::Vector3 &_p)
 Set the position of the light.
 
void SetRange (const double &_range)
 Set the range.
 
virtual bool SetSelected (bool _s)
 Set whether this entity has been selected by the user through the gui.
 
void SetSpecularColor (const common::Color &_color)
 Set the specular color.
 
void SetSpotFalloff (const double &_value)
 Set the spot light falloff.
 
void SetSpotInnerAngle (const double &_angle)
 Set the spot light inner angle.
 
void SetSpotOuterAngle (const double &_angle)
 Set the spot light outer angle.
 
void ShowVisual (bool _s)
 Set whether to show the visual.
 
void ToggleShowVisual ()
 
void UpdateFromMsg (ConstLightPtr &_msg)
 Update a light source from a message.
 

Protected Member Functions

virtual void OnPoseChange ()
 On pose change callback.
 

Detailed Description

A light source.

There are three types of lights: Point, Spot, and Directional. This class encapsulates all three. Point lights are light light bulbs, spot lights project a cone of light, and directional lights are light sun light.

Constructor & Destructor Documentation

gazebo::rendering::Light::Light ( Scene _scene)

Constructor.

Parameters
[in]_scenePointer to the scene that contains the Light.
virtual gazebo::rendering::Light::~Light ( )
virtual

Destructor.

Member Function Documentation

void gazebo::rendering::Light::FillMsg ( msgs::Light &  _msg) const

Fill the contents of a light message.

Parameters
[out]_msgMessage to fill.
common::Color gazebo::rendering::Light::GetDiffuseColor ( ) const

Get the diffuse color.

Returns
The light's diffuse color.
math::Vector3 gazebo::rendering::Light::GetDirection ( ) const

Get the direction.

Returns
The light's direction.
std::string gazebo::rendering::Light::GetName ( ) const

Get the name of the visual.

Returns
The light's name.
math::Vector3 gazebo::rendering::Light::GetPosition ( ) const

Get the position of the light.

Returns
The position of the light
common::Color gazebo::rendering::Light::GetSpecularColor ( ) const

Get the specular color.

Returns
The specular color
std::string gazebo::rendering::Light::GetType ( ) const

Get the type of the light.

Returns
The light type: "point", "spot", "directional".
void gazebo::rendering::Light::Load ( sdf::ElementPtr  _sdf)

Load the light using a set of SDF parameters.

Parameters
[in]_sdfPointer to the SDF containing the Light description.
void gazebo::rendering::Light::Load ( )

Load the light using default parameters.

void gazebo::rendering::Light::LoadFromMsg ( ConstLightPtr &  _msg)

Load from a light message.

Parameters
[in]_msgContaining the light information.
virtual void gazebo::rendering::Light::OnPoseChange ( )
inlineprotectedvirtual

On pose change callback.

void gazebo::rendering::Light::SetAttenuation ( double  _constant,
double  _linear,
double  _quadratic 
)

Set the attenuation.

Parameters
[in]_contantConstant attenuation
[in]_linearLinear attenuation
[in]_quadraticQuadratic attenuation
void gazebo::rendering::Light::SetCastShadows ( const bool &  _cast)

Set cast shadows.

Parameters
[in]_castSet to true to cast shadows.
void gazebo::rendering::Light::SetDiffuseColor ( const common::Color _color)

Set the diffuse color.

Parameters
[in]_colorLight diffuse color.
void gazebo::rendering::Light::SetDirection ( const math::Vector3 _dir)

Set the direction.

Parameters
[in]_dirSet the light's direction. Only applicable to spot and directional lights.
void gazebo::rendering::Light::SetLightType ( const std::string &  _type)

Set the light type.

Parameters
[in]_typeThe light type: "point", "spot", "directional"
void gazebo::rendering::Light::SetName ( const std::string &  _name)

Set the name of the visual.

Parameters
[in]_nameName of the light source.
void gazebo::rendering::Light::SetPosition ( const math::Vector3 _p)

Set the position of the light.

Parameters
[in]_pNew position for the light
void gazebo::rendering::Light::SetRange ( const double &  _range)

Set the range.

Parameters
[in]_rangeRage of the light in meters.
virtual bool gazebo::rendering::Light::SetSelected ( bool  _s)
virtual

Set whether this entity has been selected by the user through the gui.

Parameters
[in]_sSet to True when the light is selected by the user.
void gazebo::rendering::Light::SetSpecularColor ( const common::Color _color)

Set the specular color.

Parameters
[in]_colorThe specular color
void gazebo::rendering::Light::SetSpotFalloff ( const double &  _value)

Set the spot light falloff.

Parameters
[in]_valueFalloff value
void gazebo::rendering::Light::SetSpotInnerAngle ( const double &  _angle)

Set the spot light inner angle.

Parameters
[in]_angleInner angle in radians
void gazebo::rendering::Light::SetSpotOuterAngle ( const double &  _angle)

Set the spot light outer angle.

Parameters
[in]_angleOuter angle in radians
void gazebo::rendering::Light::ShowVisual ( bool  _s)

Set whether to show the visual.

Parameters
[in]_sSet to true to draw a representation of the light.
void gazebo::rendering::Light::ToggleShowVisual ( )
void gazebo::rendering::Light::UpdateFromMsg ( ConstLightPtr &  _msg)

Update a light source from a message.

Parameters
[in]_msgLight message to update from

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