A light source. More...
#include <rendering/rendering.hh>
Public Member Functions | |
Light (ScenePtr _scene) | |
Constructor. More... | |
virtual | ~Light () |
Destructor. More... | |
LightPtr | Clone (const std::string &_name, ScenePtr _scene) |
Clone the light with a new name. More... | |
common::Color | DiffuseColor () const |
Get the diffuse color. More... | |
ignition::math::Vector3d | Direction () const |
Get the direction. More... | |
void | FillMsg (msgs::Light &_msg) const |
Fill the contents of a light message. More... | |
common::Color | GetDiffuseColor () const GAZEBO_DEPRECATED(7.0) |
Get the diffuse color. More... | |
math::Vector3 | GetDirection () const GAZEBO_DEPRECATED(7.0) |
Get the direction. More... | |
std::string | GetName () const GAZEBO_DEPRECATED(7.0) |
Get the name of the visual. More... | |
math::Vector3 | GetPosition () const GAZEBO_DEPRECATED(7.0) |
Get the position of the light. More... | |
math::Quaternion | GetRotation () const GAZEBO_DEPRECATED(7.0) |
Get the rotation of the light. More... | |
common::Color | GetSpecularColor () const GAZEBO_DEPRECATED(7.0) |
Get the specular color. More... | |
std::string | GetType () const GAZEBO_DEPRECATED(7.0) |
Get the type of the light. More... | |
bool | GetVisible () const GAZEBO_DEPRECATED(7.0) |
Get whether the light is visible. More... | |
void | Load (sdf::ElementPtr _sdf) |
Load the light using a set of SDF parameters. More... | |
void | Load () |
Load the light using default parameters. More... | |
void | LoadFromMsg (ConstLightPtr &_msg) |
Load from a light message. More... | |
void | LoadFromMsg (const msgs::Light &_msg) |
Load from a light message. More... | |
std::string | Name () const |
Get the name of the visual. More... | |
ignition::math::Vector3d | Position () const |
Get the position of the light. More... | |
ignition::math::Quaterniond | Rotation () const |
Get the rotation of the light. More... | |
void | SetAttenuation (double _constant, double _linear, double _quadratic) |
Set the attenuation. More... | |
void | SetCastShadows (const bool _cast) |
Set cast shadows. More... | |
void | SetDiffuseColor (const common::Color &_color) |
Set the diffuse color. More... | |
void | SetDirection (const math::Vector3 &_dir) GAZEBO_DEPRECATED(7.0) |
Set the direction. More... | |
void | SetDirection (const ignition::math::Vector3d &_dir) |
Set the direction. More... | |
void | SetLightType (const std::string &_type) |
Set the light type. More... | |
void | SetName (const std::string &_name) |
Set the name of the visual. More... | |
void | SetPosition (const math::Vector3 &_p) GAZEBO_DEPRECATED(7.0) |
Set the position of the light. More... | |
void | SetPosition (const ignition::math::Vector3d &_p) |
Set the position of the light. More... | |
void | SetRange (const double _range) |
Set the range. More... | |
void | SetRotation (const math::Quaternion &_q) GAZEBO_DEPRECATED(7.0) |
Set the rotation of the light. More... | |
void | SetRotation (const ignition::math::Quaterniond &_q) |
Set the rotation of the light. More... | |
virtual bool | SetSelected (const bool _s) |
Set whether this entity has been selected by the user through the gui. More... | |
void | SetSpecularColor (const common::Color &_color) |
Set the specular color. More... | |
void | SetSpotFalloff (const double _value) |
Set the spot light falloff. More... | |
void | SetSpotInnerAngle (const double _angle) |
Set the spot light inner angle. More... | |
void | SetSpotOuterAngle (const double _angle) |
Set the spot light outer angle. More... | |
void | ShowVisual (const bool _s) |
Set whether to show the visual. More... | |
common::Color | SpecularColor () const |
Get the specular color. More... | |
void | ToggleShowVisual () |
std::string | Type () const |
Get the type of the light. More... | |
void | UpdateFromMsg (ConstLightPtr &_msg) |
Update a light source from a message. More... | |
bool | Visible () const |
Get whether the light is visible. More... | |
Protected Member Functions | |
virtual void | OnPoseChange () |
On pose change callback. More... | |
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.
Clone the light with a new name.
[in] | _name | Name of the cloned light. |
[in] | _scene | Scene to contain the light. |
common::Color gazebo::rendering::Light::DiffuseColor | ( | ) | const |
Get the diffuse color.
ignition::math::Vector3d gazebo::rendering::Light::Direction | ( | ) | const |
Get the direction.
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 |
math::Vector3 gazebo::rendering::Light::GetDirection | ( | ) | const |
std::string gazebo::rendering::Light::GetName | ( | ) | const |
math::Vector3 gazebo::rendering::Light::GetPosition | ( | ) | const |
math::Quaternion gazebo::rendering::Light::GetRotation | ( | ) | const |
common::Color gazebo::rendering::Light::GetSpecularColor | ( | ) | const |
std::string gazebo::rendering::Light::GetType | ( | ) | const |
Get the type of the light.
bool gazebo::rendering::Light::GetVisible | ( | ) | const |
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. |
void gazebo::rendering::Light::LoadFromMsg | ( | const msgs::Light & | _msg | ) |
Load from a light message.
[in] | _msg | Message containing the light information. |
std::string gazebo::rendering::Light::Name | ( | ) | const |
Get the name of the visual.
|
inlineprotectedvirtual |
On pose change callback.
ignition::math::Vector3d gazebo::rendering::Light::Position | ( | ) | const |
Get the position of the light.
ignition::math::Quaterniond gazebo::rendering::Light::Rotation | ( | ) | const |
Get the rotation of the light.
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::SetDirection | ( | const ignition::math::Vector3d & | _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::SetPosition | ( | const ignition::math::Vector3d & | _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. |
void gazebo::rendering::Light::SetRotation | ( | const math::Quaternion & | _q | ) |
Set the rotation of the light.
[in] | _q | New rotation for the light |
void gazebo::rendering::Light::SetRotation | ( | const ignition::math::Quaterniond & | _q | ) |
Set the rotation of the light.
[in] | _q | New rotation for the light |
|
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 | ( | const bool | _s | ) |
Set whether to show the visual.
[in] | _s | Set to true to draw a representation of the light. |
common::Color gazebo::rendering::Light::SpecularColor | ( | ) | const |
Get the specular color.
void gazebo::rendering::Light::ToggleShowVisual | ( | ) |
std::string gazebo::rendering::Light::Type | ( | ) | const |
Get the type of the light.
void gazebo::rendering::Light::UpdateFromMsg | ( | ConstLightPtr & | _msg | ) |
Update a light source from a message.
[in] | _msg | Light message to update from |
bool gazebo::rendering::Light::Visible | ( | ) | const |
Get whether the light is visible.