#include <rendering/rendering.hh>
Public Member Functions | |
| Light (ScenePtr _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. | |
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.
| gazebo::rendering::Light::Light | ( | ScenePtr | _scene | ) |
Constructor.
| [in] | _scene | Pointer to the scene that contains the Light. |
|
virtual |
Destructor.
| void gazebo::rendering::Light::FillMsg | ( | msgs::Light & | _msg | ) | const |
Fill the contents of a light message.
| [out] | _msg | Message to fill. |
| common::Color gazebo::rendering::Light::GetDiffuseColor | ( | ) | const |
Get the diffuse color.
| math::Vector3 gazebo::rendering::Light::GetDirection | ( | ) | const |
Get the direction.
| std::string gazebo::rendering::Light::GetName | ( | ) | const |
Get the name of the visual.
| math::Vector3 gazebo::rendering::Light::GetPosition | ( | ) | const |
Get the position of the light.
| common::Color gazebo::rendering::Light::GetSpecularColor | ( | ) | const |
Get the specular color.
| std::string gazebo::rendering::Light::GetType | ( | ) | const |
Get the type of the light.
| void gazebo::rendering::Light::Load | ( | sdf::ElementPtr | _sdf | ) |
Load the light using a set of SDF parameters.
| [in] | _sdf | Pointer 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.
| [in] | _msg | Containing the light information. |
|
inlineprotectedvirtual |
On pose change callback.
| void gazebo::rendering::Light::SetAttenuation | ( | double | _constant, |
| double | _linear, | ||
| double | _quadratic | ||
| ) |
Set the attenuation.
| [in] | _contant | Constant attenuation |
| [in] | _linear | Linear attenuation |
| [in] | _quadratic | Quadratic attenuation |
| void gazebo::rendering::Light::SetCastShadows | ( | const bool & | _cast | ) |
Set cast shadows.
| [in] | _cast | Set to true to cast shadows. |
| void gazebo::rendering::Light::SetDiffuseColor | ( | const common::Color & | _color | ) |
Set the diffuse color.
| [in] | _color | Light diffuse color. |
| void gazebo::rendering::Light::SetDirection | ( | const math::Vector3 & | _dir | ) |
Set the direction.
| [in] | _dir | Set the light's direction. Only applicable to spot and directional lights. |
| void gazebo::rendering::Light::SetLightType | ( | const std::string & | _type | ) |
Set the light type.
| [in] | _type | The light type: "point", "spot", "directional" |
| void gazebo::rendering::Light::SetName | ( | const std::string & | _name | ) |
Set the name of the visual.
| [in] | _name | Name of the light source. |
| void gazebo::rendering::Light::SetPosition | ( | const math::Vector3 & | _p | ) |
Set the position of the light.
| [in] | _p | New position for the light |
| void gazebo::rendering::Light::SetRange | ( | const double & | _range | ) |
Set the range.
| [in] | _range | Rage of the light in meters. |
|
virtual |
Set whether this entity has been selected by the user through the gui.
| [in] | _s | Set to True when the light is selected by the user. |
| void gazebo::rendering::Light::SetSpecularColor | ( | const common::Color & | _color | ) |
Set the specular color.
| [in] | _color | The specular color |
| void gazebo::rendering::Light::SetSpotFalloff | ( | const double & | _value | ) |
Set the spot light falloff.
| [in] | _value | Falloff value |
| void gazebo::rendering::Light::SetSpotInnerAngle | ( | const double & | _angle | ) |
Set the spot light inner angle.
| [in] | _angle | Inner angle in radians |
| void gazebo::rendering::Light::SetSpotOuterAngle | ( | const double & | _angle | ) |
Set the spot light outer angle.
| [in] | _angle | Outer angle in radians |
| void gazebo::rendering::Light::ShowVisual | ( | bool | _s | ) |
Set whether to show the visual.
| [in] | _s | Set 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.
| [in] | _msg | Light message to update from |