Provides a description of a light source. More...
#include <Light.hh>
Public Member Functions | |
Light () | |
Default constructor. More... | |
double | AttenuationRange () const |
Get the range of the light source in meters. More... | |
bool | CastShadows () const |
Get whether the light casts shadows. More... | |
double | ConstantAttenuationFactor () const |
Get the constant attenuation factor. More... | |
gz::math::Color | Diffuse () const |
Get the diffuse color. More... | |
gz::math::Vector3d | Direction () const |
Get the direction of the light source. More... | |
sdf::ElementPtr | Element () const |
Get a pointer to the SDF element that was used during load. More... | |
double | Intensity () const |
Get the light intensity. More... | |
bool | LightOn () const |
Get if the light is on. More... | |
double | LinearAttenuationFactor () const |
Get the linear attenuation factor. More... | |
Errors | Load (ElementPtr _sdf) |
Load the light based on a element pointer. More... | |
std::string | Name () const |
Get the name of the light. More... | |
const std::string & | PoseRelativeTo () const |
Get the name of the coordinate frame relative to which this object's pose is expressed. More... | |
double | QuadraticAttenuationFactor () const |
Get the quadratic attenuation factor which adds a curvature to the attenuation. More... | |
const gz::math::Pose3d & | RawPose () const |
Get the pose of the light. More... | |
sdf::SemanticPose | SemanticPose () const |
Get SemanticPose object of this object to aid in resolving poses. More... | |
void | SetAttenuationRange (const double _range) |
Set the range of the light source in meters. More... | |
void | SetCastShadows (const bool _cast) |
Set whether the light casts shadows. More... | |
void | SetConstantAttenuationFactor (const double _factor) |
Set the constant attenuation factor. More... | |
void | SetDiffuse (const gz::math::Color &_color) |
Set the diffuse color. More... | |
void | SetDirection (const gz::math::Vector3d &_dir) |
Set the direction of the light source. More... | |
void | SetIntensity (const double _intensity) |
Set the light intensity. More... | |
void | SetLightOn (const bool _isLightOn) |
Set if the light is ON/OFF. More... | |
void | SetLinearAttenuationFactor (const double _factor) |
Set the linear attenuation factor. More... | |
void | SetName (const std::string &_name) |
Set the name of the light. More... | |
void | SetPoseRelativeTo (const std::string &_frame) |
Set the name of the coordinate frame relative to which this object's pose is expressed. More... | |
void | SetQuadraticAttenuationFactor (const double _factor) |
Set the quadratic attenuation factor which adds a curvature to the attenuation. More... | |
void | SetRawPose (const gz::math::Pose3d &_pose) |
Set the pose of the light. More... | |
void | SetSpecular (const gz::math::Color &_color) |
Set the specular color. More... | |
void | SetSpotFalloff (const double _falloff) |
Set the rate of falloff between the inner and outer cones. More... | |
void | SetSpotInnerAngle (const gz::math::Angle &_angle) |
Set the angle covered by the bright inner cone. More... | |
void | SetSpotOuterAngle (const gz::math::Angle &_angle) |
Set the angle covered by the outer cone. More... | |
void | SetType (const LightType _type) |
Set the light type. More... | |
void | SetVisualize (const bool _visualize) |
Set whether light visualization in the GUI is enabled. More... | |
gz::math::Color | Specular () const |
Get the specular color. More... | |
double | SpotFalloff () const |
Get the rate of falloff between the inner and outer cones. More... | |
gz::math::Angle | SpotInnerAngle () const |
Get the angle covered by the bright inner cone. More... | |
gz::math::Angle | SpotOuterAngle () const |
Get the angle covered by the outer cone. More... | |
sdf::ElementPtr | ToElement () const |
Create and return an SDF element filled with data from this light object. More... | |
sdf::ElementPtr | ToElement (sdf::Errors &_errors) const |
Create and return an SDF element filled with data from this light object. More... | |
LightType | Type () const |
Get the light type. More... | |
bool | Visualize () const |
Whether light visualization in the GUI is enabled. More... | |
Provides a description of a light source.
A light source can be point, spot, or directional light.
sdf::SDF_VERSION_NAMESPACE::Light::Light | ( | ) |
Default constructor.
double sdf::SDF_VERSION_NAMESPACE::Light::AttenuationRange | ( | ) | const |
Get the range of the light source in meters.
bool sdf::SDF_VERSION_NAMESPACE::Light::CastShadows | ( | ) | const |
Get whether the light casts shadows.
double sdf::SDF_VERSION_NAMESPACE::Light::ConstantAttenuationFactor | ( | ) | const |
Get the constant attenuation factor.
This value is clamped to a value between 0 and 1, where 1.0 means never attenuate and 0.0 is complete attenutation.
gz::math::Color sdf::SDF_VERSION_NAMESPACE::Light::Diffuse | ( | ) | const |
Get the diffuse color.
The diffuse color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
gz::math::Vector3d sdf::SDF_VERSION_NAMESPACE::Light::Direction | ( | ) | const |
Get the direction of the light source.
This only has meaning for spot and directional light types. The default value is [0, 0, -1].
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Light::Element | ( | ) | const |
double sdf::SDF_VERSION_NAMESPACE::Light::Intensity | ( | ) | const |
Get the light intensity.
bool sdf::SDF_VERSION_NAMESPACE::Light::LightOn | ( | ) | const |
Get if the light is on.
double sdf::SDF_VERSION_NAMESPACE::Light::LinearAttenuationFactor | ( | ) | const |
Get the linear attenuation factor.
This value is clamped to a value between 0 and 1, where 1 means attenuate evenly over the distance.
Errors sdf::SDF_VERSION_NAMESPACE::Light::Load | ( | ElementPtr | _sdf | ) |
std::string sdf::SDF_VERSION_NAMESPACE::Light::Name | ( | ) | const |
Get the name of the light.
const std::string& sdf::SDF_VERSION_NAMESPACE::Light::PoseRelativeTo | ( | ) | const |
Get the name of the coordinate frame relative to which this object's pose is expressed.
An empty value indicates that the frame is relative to the parent link/world coordinate frame.
double sdf::SDF_VERSION_NAMESPACE::Light::QuadraticAttenuationFactor | ( | ) | const |
Get the quadratic attenuation factor which adds a curvature to the attenuation.
const gz::math::Pose3d& sdf::SDF_VERSION_NAMESPACE::Light::RawPose | ( | ) | const |
Get the pose of the light.
This is the pose of the light as specified in SDF (<light> <pose> ... </pose></light>), and is typically used to express the position and rotation of a light in a global coordinate frame.
sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::Light::SemanticPose | ( | ) | const |
Get SemanticPose object of this object to aid in resolving poses.
void sdf::SDF_VERSION_NAMESPACE::Light::SetAttenuationRange | ( | const double | _range | ) |
Set the range of the light source in meters.
[in] | _factor | Range of the light source in meters. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetCastShadows | ( | const bool | _cast | ) |
Set whether the light casts shadows.
[in] | _cast | True to indicate that the light casts shadows. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetConstantAttenuationFactor | ( | const double | _factor | ) |
Set the constant attenuation factor.
This value is clamped to a value between 0 and 1, where 1.0 means never attenuate and 0.0 is complete attenutation.
[in] | _factor | Constant attenuation factor. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetDiffuse | ( | const gz::math::Color & | _color | ) |
Set the diffuse color.
The diffuse color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
[in] | _color | Diffuse color. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetDirection | ( | const gz::math::Vector3d & | _dir | ) |
Set the direction of the light source.
This only has meaning for spot and directional light types.
[in] | _dir | Light source direction. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetIntensity | ( | const double | _intensity | ) |
Set the light intensity.
[in] | _intensity | New light intensity |
void sdf::SDF_VERSION_NAMESPACE::Light::SetLightOn | ( | const bool | _isLightOn | ) |
Set if the light is ON/OFF.
[in] | _cast | True to indicate that the light is on, False otherwise. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetLinearAttenuationFactor | ( | const double | _factor | ) |
Set the linear attenuation factor.
This value is clamped to a value between 0 and 1, where 1 means attenuate evenly over the distance.
[in] | _factor | Linear attentuation factor. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetName | ( | const std::string & | _name | ) |
Set the name of the light.
[in] | _name | Name of the light. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetPoseRelativeTo | ( | const std::string & | _frame | ) |
Set the name of the coordinate frame relative to which this object's pose is expressed.
An empty value indicates that the frame is relative to the parent model/world coordinate frame.
[in] | _frame | The name of the pose relative-to frame. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetQuadraticAttenuationFactor | ( | const double | _factor | ) |
Set the quadratic attenuation factor which adds a curvature to the attenuation.
[in] | _factor | The quadratic attenuation factor. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetRawPose | ( | const gz::math::Pose3d & | _pose | ) |
Set the pose of the light.
[in] | _pose | The new light pose. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetSpecular | ( | const gz::math::Color & | _color | ) |
Set the specular color.
The specular color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
[in] | _color | Specular color. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetSpotFalloff | ( | const double | _falloff | ) |
Set the rate of falloff between the inner and outer cones.
A value of 1.0 is a linear falloff, less than 1.0 is a slower falloff, and a higher value indicates a faster falloff.
[in] | _falloff | The spot falloff. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetSpotInnerAngle | ( | const gz::math::Angle & | _angle | ) |
Set the angle covered by the bright inner cone.
[in] | _angle | The angle covered by the bright inner cone. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetSpotOuterAngle | ( | const gz::math::Angle & | _angle | ) |
Set the angle covered by the outer cone.
[in] | _angle | The angle covered by the outer cone. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetType | ( | const LightType | _type | ) |
Set the light type.
[in] | _type | The light type. |
void sdf::SDF_VERSION_NAMESPACE::Light::SetVisualize | ( | const bool | _visualize | ) |
Set whether light visualization in the GUI is enabled.
[in] | _visualize | True to view the light on the GUI. |
gz::math::Color sdf::SDF_VERSION_NAMESPACE::Light::Specular | ( | ) | const |
Get the specular color.
The specular color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
double sdf::SDF_VERSION_NAMESPACE::Light::SpotFalloff | ( | ) | const |
Get the rate of falloff between the inner and outer cones.
A value of 1.0 is a linear falloff, less than 1.0 is a slower falloff, and a higher value indicates a faster falloff.
gz::math::Angle sdf::SDF_VERSION_NAMESPACE::Light::SpotInnerAngle | ( | ) | const |
Get the angle covered by the bright inner cone.
gz::math::Angle sdf::SDF_VERSION_NAMESPACE::Light::SpotOuterAngle | ( | ) | const |
Get the angle covered by the outer cone.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Light::ToElement | ( | ) | const |
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Light::ToElement | ( | sdf::Errors & | _errors | ) | const |
LightType sdf::SDF_VERSION_NAMESPACE::Light::Type | ( | ) | const |
Get the light type.
bool sdf::SDF_VERSION_NAMESPACE::Light::Visualize | ( | ) | const |
Whether light visualization in the GUI is enabled.