A renderable object. More...
#include <rendering/rendering.hh>
Inherits enable_shared_from_this< Visual >.
Inherited by ApplyWrenchVisual, ArrowVisual, AxisVisual, CameraVisual, COMVisual, ContactVisual, InertiaVisual, JointVisual, LaserVisual, LogicalCameraVisual, OriginVisual, RFIDTagVisual, RFIDVisual, Road2d, SelectionObj, SonarVisual, TransmitterVisual, VideoVisual, and WrenchVisual.
Public Types | |
enum | VisualType { VT_ENTITY, VT_MODEL, VT_LINK, VT_VISUAL, VT_COLLISION, VT_SENSOR, VT_GUI, VT_PHYSICS } |
Type of visual. More... | |
Public Member Functions | |
Visual (const std::string &_name, VisualPtr _parent, bool _useRTShader=true) | |
Constructor. More... | |
Visual (const std::string &_name, ScenePtr _scene, bool _useRTShader=true) | |
Constructor. More... | |
virtual | ~Visual () |
Destructor. More... | |
void | AddPendingChild (std::pair< VisualType, const google::protobuf::Message *> _pair) |
Push a message for a child of this visual which hasn't been loaded yet. More... | |
ignition::math::Color | Ambient () const |
Get the ambient color of the visual. More... | |
void | AttachLineVertex (DynamicLines *_line, unsigned int _index) |
Attach a vertex of a line to the position of the visual. More... | |
Ogre::MovableObject * | AttachMesh (const std::string &_meshName, const std::string &_subMesh="", bool _centerSubmesh=false, const std::string &_objName="") |
Attach a mesh to this visual by name. More... | |
void | AttachObject (Ogre::MovableObject *_obj) |
Attach a renerable object to the visual. More... | |
void | AttachVisual (VisualPtr _vis) |
Attach a visual to this visual. More... | |
ignition::math::AxisAlignedBox | BoundingBox () const |
Get the bounding box for the visual. More... | |
void | ClearParent () |
Clear parents. More... | |
VisualPtr | Clone (const std::string &_name, VisualPtr _newParent) |
Clone the visual with a new name. More... | |
DynamicLines * | CreateDynamicLine (RenderOpType _type=RENDERING_LINE_STRIP) |
Add a line to the visual. More... | |
void | DeleteDynamicLine (DynamicLines *_line) |
Delete a dynamic line. More... | |
ignition::math::Vector3d | DerivedScale () const |
Get the scale of the visual as inherited from all parents. More... | |
float | DerivedTransparency () const |
Get the transparency of the visual as inherited from all parents. More... | |
void | DetachObjects () |
Detach all objects. More... | |
void | DetachVisual (VisualPtr _vis) |
Detach a visual. More... | |
void | DetachVisual (const std::string &_name) |
Detach a visual. More... | |
ignition::math::Color | Diffuse () const |
Get the diffuse color of the visual. More... | |
void | DisableTrackVisual () |
Disable tracking of a visual. More... | |
ignition::math::Color | Emissive () const |
Get the emissive color of the visual. More... | |
void | EnableTrackVisual (VisualPtr _vis) |
Set one visual to track/follow another. More... | |
void | FillMaterialMsg (ignition::msgs::Material &_msg) const |
Fill an ignition::msgs::Material message based on this visual's material properties. More... | |
virtual void | Fini () |
Helper for the destructor. More... | |
unsigned int | GetAttachedObjectCount () const |
Return the number of attached movable objects. More... | |
bool | GetCastShadows () const |
Get whether the visual casts shadows. More... | |
VisualPtr | GetChild (unsigned int _index) |
Get an attached visual based on an index. More... | |
unsigned int | GetChildCount () |
Get the number of attached visuals. More... | |
unsigned int | GetDepth () const |
Get the depth of this visual, where 0 is the depth of the world visual. More... | |
ignition::math::Vector3d | GetGeometrySize () const |
Get the geometry size. More... | |
std::string | GetGeometryType () const |
Get the geometry type. More... | |
bool | GetHighlighted () const |
Get whether or not the visual is visually highlighted. More... | |
uint32_t | GetId () const |
Get the id associated with this visual. More... | |
bool | GetLighting () const |
Get whether or not lighting is enabled. More... | |
std::string | GetMaterialName () const |
Get the name of the material. More... | |
std::string | GetMeshName () const |
The name of the mesh set in the visual's SDF. More... | |
std::string | GetNormalMap () const |
Get the normal map. More... | |
VisualPtr | GetNthAncestor (unsigned int _n) |
Get the nth ancestor counting from the world visual. More... | |
VisualPtr | GetParent () const |
Get the parent visual, if one exists. More... | |
VisualPtr | GetRootVisual () |
Get the root visual. More... | |
ScenePtr | GetScene () const |
Get current. More... | |
Ogre::SceneNode * | GetSceneNode () const |
Return the scene Node of this visual entity. More... | |
sdf::ElementPtr | GetSDF () const |
Get the visual SDF. More... | |
std::string | GetShaderType () const |
Get the shader type. More... | |
std::string | GetSubMeshName () const |
Get the name of the sub mesh set in the visual's SDF. More... | |
float | GetTransparency () |
Get the transparency. More... | |
Visual::VisualType | GetType () const |
Get type of visual. More... | |
uint32_t | GetVisibilityFlags () |
Get visibility flags for this visual and all children. More... | |
bool | GetVisible () const |
Get whether the visual is visible. More... | |
bool | HasAttachedObject (const std::string &_name) |
Returns true if an object with _name is attached. More... | |
bool | InheritTransparency () const |
Get whether this visual inherits transparency from parent. More... | |
void | Init () |
Helper for the contructor. More... | |
ignition::math::Pose3d | InitialRelativePose () const |
Get the initial relative pose of the visual. More... | |
void | InsertMesh (const std::string &_meshName, const std::string &_subMesh="", bool _centerSubmesh=false) |
Insert a mesh into Ogre. More... | |
bool | IsAncestorOf (const rendering::VisualPtr _visual) const |
Check if this visual is an ancestor of another visual. More... | |
bool | IsDescendantOf (const rendering::VisualPtr _visual) const |
Check if this visual is a descendant of another visual. More... | |
bool | IsPlane () const |
Return true if the visual is a plane. More... | |
bool | IsStatic () const |
Return true if the visual is a static geometry. More... | |
void | Load (sdf::ElementPtr _sdf) |
Load the visual with a set of parameters. More... | |
virtual void | Load () |
Load the visual with default parameters. More... | |
void | LoadFromMsg (ConstVisualPtr &_msg) |
Load from a message. More... | |
void | LoadPlugin (const std::string &_filename, const std::string &_name, sdf::ElementPtr _sdf) |
Load a plugin. More... | |
void | MakeStatic () |
Make the visual objects static renderables. More... | |
void | MoveToPosition (const ignition::math::Pose3d &_pose, const double _time) |
Move to a pose and over a given time. More... | |
void | MoveToPositions (const std::vector< ignition::math::Pose3d > &_pts, const double _time, std::function< void()> _onComplete=nullptr) |
Move to a series of pose and over a given time. More... | |
std::string | Name () const |
Get the name of the visual. More... | |
ignition::math::Pose3d | Pose () const |
Get the pose of the visual. More... | |
ignition::math::Vector3d | Position () const |
Get the position of the visual. More... | |
void | RemovePlugin (const std::string &_name) |
Remove a running plugin. More... | |
ignition::math::Quaterniond | Rotation () const |
Get the rotation of the visual. More... | |
ignition::math::Vector3d | Scale () const |
Get the scale. More... | |
void | SetAmbient (const ignition::math::Color &_color, const bool _cascade=true) |
Set the ambient color of the visual. More... | |
void | SetCastShadows (bool _shadows) |
Set whether the visual should cast shadows. More... | |
void | SetDiffuse (const ignition::math::Color &_color, const bool _cascade=true) |
Set the diffuse color of the visual. More... | |
virtual void | SetEmissive (const ignition::math::Color &_color, const bool _cascade=true) |
Set the emissive value. More... | |
virtual void | SetHighlighted (bool _highlighted) |
Set the visual to be visually highlighted. More... | |
void | SetId (uint32_t _id) |
Set the id associated with this visual. More... | |
void | SetInheritTransparency (const bool _inherit) |
Set whether to inherit transparency from parent. More... | |
void | SetLayer (const int32_t _layer) |
Set the layer this visual belongs to. More... | |
void | SetLighting (bool _lighting) |
Set whether or not to enable or disable lighting. More... | |
void | SetMaterial (const std::string &_materialName, bool _unique=true, const bool _cascade=true) |
Set the material. More... | |
void | SetMaterialShaderParam (const std::string &_paramName, const std::string &_shaderType, const std::string &_value) |
Set a shader program parameter associated to this visual's material. More... | |
void | SetName (const std::string &_name) |
Set the name of the visual. More... | |
void | SetNormalMap (const std::string &_nmap) |
Set the normal map. More... | |
void | SetPose (const ignition::math::Pose3d &_pose) |
Set the pose of the visual. More... | |
void | SetPosition (const ignition::math::Vector3d &_pos) |
Set the position of the visual. More... | |
void | SetRibbonTrail (bool _value, const ignition::math::Color &_initialColor, const ignition::math::Color &_changeColor) |
True on or off a ribbon trail. More... | |
void | SetRotation (const ignition::math::Quaterniond &_rot) |
Set the rotation of the visual. More... | |
void | SetScale (const ignition::math::Vector3d &_scale) |
Set the scale. More... | |
void | SetScene (ScenePtr _scene) |
Set current scene. More... | |
void | SetShaderType (const std::string &_type) |
Set the shader type for the visual's material. More... | |
void | SetSkeletonPose (const msgs::PoseAnimation &_pose) |
Set animation skeleton pose. More... | |
void | SetSpecular (const ignition::math::Color &_color, const bool _cascade=true) |
Set the specular color of the visual. More... | |
void | SetTransparency (float _trans) |
Set the transparency. More... | |
void | SetType (const Visual::VisualType _type) |
Set type of visual. More... | |
void | SetTypeMsg (const google::protobuf::Message *_msg) |
Set a message specific for this visual type. More... | |
void | SetVisibilityFlags (uint32_t _flags) |
Set visibility flags for this visual and all children. More... | |
virtual void | SetVisible (bool _visible, bool _cascade=true) |
Set whether the visual is visible. More... | |
void | SetWireframe (bool _show) |
Enable or disable wireframe for this visual. More... | |
void | SetWorldPose (const ignition::math::Pose3d &_pose) |
Set the world pose of the visual. More... | |
void | SetWorldPosition (const ignition::math::Vector3d &_pos) |
Set the world linear position of the visual. More... | |
void | SetWorldRotation (const ignition::math::Quaterniond &_rot) |
Set the world orientation of the visual. More... | |
void | ShowBoundingBox () |
Display the bounding box visual. More... | |
void | ShowCollision (bool _show) |
Display the collision visuals. More... | |
void | ShowCOM (bool _show) |
Display Center of Mass visuals. More... | |
void | ShowInertia (bool _show) |
Display inertia visuals. More... | |
void | ShowJoints (bool _show) |
Display joint visuals. More... | |
void | ShowLinkFrame (bool _show) |
Display link frame visuals. More... | |
void | ShowSkeleton (bool _show) |
Display the skeleton visuals. More... | |
ignition::math::Color | Specular () const |
Get the specular color of the visual. More... | |
void | ToggleLayer (const int32_t _layer) |
Toggle layer visibility. More... | |
void | ToggleVisible () |
Toggle whether this visual is visible. More... | |
void | Update () |
Update the visual. More... | |
void | UpdateFromMsg (ConstVisualPtr &_msg) |
Update a visual based on a message. More... | |
bool | UseRTShader () const |
Get whether this visual uses RT shader system. More... | |
bool | Wireframe () const |
Get whether wireframe is enabled for this visual. More... | |
ignition::math::Pose3d | WorldPose () const |
Get the global pose of the visual. More... | |
Static Public Member Functions | |
static Visual::VisualType | ConvertVisualType (const msgs::Visual::Type &_type) |
Convert from msgs::Visual::Type to VisualType. More... | |
static msgs::Visual::Type | ConvertVisualType (const Visual::VisualType &_type) |
Convert from msgs::Visual::Type to VisualType. More... | |
static void | InsertMesh (const common::Mesh *_mesh, const std::string &_subMesh="", bool _centerSubmesh=false) |
Insert a mesh into Ogre. More... | |
Protected Member Functions | |
Visual (VisualPrivate &_dataPtr, const std::string &_name, VisualPtr _parent, bool _useRTShader=true) | |
Visual (VisualPrivate &_dataPtr, const std::string &_name, ScenePtr _scene, bool _useRTShader=true) | |
void | ProcessMaterialMsg (const msgs::Material &_msg) |
Process a gazebo material message, which uses proto2 syntax that allows unset fields to be ignored, which is the legacy behavior for gazebo10 and earlier. More... | |
void | ProcessMaterialMsg (const ignition::msgs::Material &_msg) |
Process a material message. More... | |
Protected Attributes | |
VisualPrivate * | dataPtr |
A renderable object.
enum VisualType |
Constructor.
[in] | _name | Name of the visual. |
[in] | _parent | Parent of the visual. |
[in] | _useRTShader | True if the visual should use the real-time shader system (RTShader). |
Constructor.
[in] | _name | Name of the visual. |
[in] | _scene | Scene containing the visual. |
[in] | _useRTShader | True if the visual should use the real-time shader system (RTShader). |
|
virtual |
Destructor.
|
protected |
|
protected |
void AddPendingChild | ( | std::pair< VisualType, const google::protobuf::Message *> | _pair | ) |
Push a message for a child of this visual which hasn't been loaded yet.
[in] | _pair | Pair with the child visual type and the message for the child. |
ignition::math::Color Ambient | ( | ) | const |
Get the ambient color of the visual.
void AttachLineVertex | ( | DynamicLines * | _line, |
unsigned int | _index | ||
) |
Attach a vertex of a line to the position of the visual.
[in] | _line | Line to attach to this visual. |
[in] | _index | Index of the line vertex to attach. |
Ogre::MovableObject* AttachMesh | ( | const std::string & | _meshName, |
const std::string & | _subMesh = "" , |
||
bool | _centerSubmesh = false , |
||
const std::string & | _objName = "" |
||
) |
Attach a mesh to this visual by name.
[in] | _meshName | Name of the mesh. |
[in] | _subMesh | Name of the submesh. Empty string to use all submeshes. |
[in] | _centerSubmesh | True to center a submesh. |
[in] | _objName | Name of the attached Object to put the mesh onto. |
void AttachObject | ( | Ogre::MovableObject * | _obj | ) |
Attach a renerable object to the visual.
[in] | _obj | A movable object to attach to the visual. |
void AttachVisual | ( | VisualPtr | _vis | ) |
Attach a visual to this visual.
[in] | _vis | Visual to attach. |
ignition::math::AxisAlignedBox BoundingBox | ( | ) | const |
Get the bounding box for the visual.
void ClearParent | ( | ) |
Clear parents.
|
static |
Convert from msgs::Visual::Type to VisualType.
[in] | _type | A msgs::Visual::Type enum. |
|
static |
Convert from msgs::Visual::Type to VisualType.
[in] | _type | VisualType enum. |
DynamicLines* CreateDynamicLine | ( | RenderOpType | _type = RENDERING_LINE_STRIP | ) |
Add a line to the visual.
[in] | _type | The type of line to make. |
void DeleteDynamicLine | ( | DynamicLines * | _line | ) |
Delete a dynamic line.
[in] | _line | Pointer to the line to delete. |
ignition::math::Vector3d DerivedScale | ( | ) | const |
Get the scale of the visual as inherited from all parents.
float DerivedTransparency | ( | ) | const |
Get the transparency of the visual as inherited from all parents.
void DetachObjects | ( | ) |
Detach all objects.
void DetachVisual | ( | const std::string & | _name | ) |
Detach a visual.
[in] | _name | Name of the visual to detach. |
ignition::math::Color Diffuse | ( | ) | const |
Get the diffuse color of the visual.
void DisableTrackVisual | ( | ) |
Disable tracking of a visual.
ignition::math::Color Emissive | ( | ) | const |
Get the emissive color of the visual.
void EnableTrackVisual | ( | VisualPtr | _vis | ) |
Set one visual to track/follow another.
[in] | _vis | Visual to track. |
void FillMaterialMsg | ( | ignition::msgs::Material & | _msg | ) | const |
Fill an ignition::msgs::Material message based on this visual's material properties.
[out] | _msg | Ignition message to fill. |
|
virtual |
Helper for the destructor.
Reimplemented in ApplyWrenchVisual, CameraVisual, WrenchVisual, JointVisual, and LogicalCameraVisual.
unsigned int GetAttachedObjectCount | ( | ) | const |
Return the number of attached movable objects.
bool GetCastShadows | ( | ) | const |
Get whether the visual casts shadows.
VisualPtr GetChild | ( | unsigned int | _index | ) |
Get an attached visual based on an index.
Index should be between 0 and Visual::GetChildCount.
[in] | _index | Index of the child to retreive. |
unsigned int GetChildCount | ( | ) |
Get the number of attached visuals.
unsigned int GetDepth | ( | ) | const |
Get the depth of this visual, where 0 is the depth of the world visual.
ignition::math::Vector3d GetGeometrySize | ( | ) | const |
Get the geometry size.
std::string GetGeometryType | ( | ) | const |
Get the geometry type.
bool GetHighlighted | ( | ) | const |
Get whether or not the visual is visually highlighted.
This is most often means that an object is selected by a user via the GUI.
uint32_t GetId | ( | ) | const |
Get the id associated with this visual.
bool GetLighting | ( | ) | const |
Get whether or not lighting is enabled.
std::string GetMaterialName | ( | ) | const |
Get the name of the material.
std::string GetMeshName | ( | ) | const |
The name of the mesh set in the visual's SDF.
std::string GetNormalMap | ( | ) | const |
Get the normal map.
VisualPtr GetNthAncestor | ( | unsigned int | _n | ) |
Get the nth ancestor counting from the world visual.
GetNthAncestor(0) returns the world visual. GetNthAncestor(1) returns the RootVisual. GetNthAncestor(2) returns the ancestor which is a child of the root visual and so on.
[in] | _n | Depth of the ancestor. |
VisualPtr GetParent | ( | ) | const |
Get the parent visual, if one exists.
VisualPtr GetRootVisual | ( | ) |
Get the root visual.
ScenePtr GetScene | ( | ) | const |
Get current.
Ogre::SceneNode* GetSceneNode | ( | ) | const |
Return the scene Node of this visual entity.
sdf::ElementPtr GetSDF | ( | ) | const |
Get the visual SDF.
Note that visuals are abstract. This SDF could be associated with a visual that represents a model, a link, a visual (inside a link), or a visualization object (e.g. LaserVisual). Therefore this SDF may store more fields than actually used.
std::string GetShaderType | ( | ) | const |
Get the shader type.
std::string GetSubMeshName | ( | ) | const |
Get the name of the sub mesh set in the visual's SDF.
float GetTransparency | ( | ) |
Get the transparency.
Visual::VisualType GetType | ( | ) | const |
Get type of visual.
uint32_t GetVisibilityFlags | ( | ) |
Get visibility flags for this visual and all children.
bool GetVisible | ( | ) | const |
Get whether the visual is visible.
bool HasAttachedObject | ( | const std::string & | _name | ) |
Returns true if an object with _name is attached.
[in] | _name | Name of an object to find. |
bool InheritTransparency | ( | ) | const |
Get whether this visual inherits transparency from parent.
void Init | ( | ) |
Helper for the contructor.
ignition::math::Pose3d InitialRelativePose | ( | ) | const |
Get the initial relative pose of the visual.
void InsertMesh | ( | const std::string & | _meshName, |
const std::string & | _subMesh = "" , |
||
bool | _centerSubmesh = false |
||
) |
Insert a mesh into Ogre.
[in] | _meshName | Name of the mesh to insert. |
[in] | _subMesh | Name of the mesh within _meshName to insert. |
[in] | _centerSubmesh | True to center the submesh. |
|
static |
Insert a mesh into Ogre.
[in] | _mesh | Pointer to the mesh to insert. |
[in] | _subMesh | Name of the mesh within _meshName to insert. |
[in] | _centerSubmesh | True to center the submesh. |
bool IsAncestorOf | ( | const rendering::VisualPtr | _visual | ) | const |
Check if this visual is an ancestor of another visual.
[in] | _visual | The other visual. |
bool IsDescendantOf | ( | const rendering::VisualPtr | _visual | ) | const |
Check if this visual is a descendant of another visual.
[in] | _visual | The other visual. |
bool IsPlane | ( | ) | const |
Return true if the visual is a plane.
bool IsStatic | ( | ) | const |
Return true if the visual is a static geometry.
void Load | ( | sdf::ElementPtr | _sdf | ) |
Load the visual with a set of parameters.
[in] | _sdf | Load from an SDF element. |
|
virtual |
Load the visual with default parameters.
Reimplemented in SelectionObj, ApplyWrenchVisual, SonarVisual, TransmitterVisual, AxisVisual, LinkFrameVisual, OriginVisual, and ArrowVisual.
void LoadFromMsg | ( | ConstVisualPtr & | _msg | ) |
Load from a message.
[in] | _msg | A visual message. |
void LoadPlugin | ( | const std::string & | _filename, |
const std::string & | _name, | ||
sdf::ElementPtr | _sdf | ||
) |
Load a plugin.
_filename | The filename of the plugin |
_name | A unique name for the plugin |
_sdf | The SDF to pass into the plugin. |
void MakeStatic | ( | ) |
Make the visual objects static renderables.
void MoveToPosition | ( | const ignition::math::Pose3d & | _pose, |
const double | _time | ||
) |
Move to a pose and over a given time.
[in] | _pose | Pose the visual will end at. |
[in] | _time | Time it takes the visual to move to the pose. |
void MoveToPositions | ( | const std::vector< ignition::math::Pose3d > & | _pts, |
const double | _time, | ||
std::function< void()> | _onComplete = nullptr |
||
) |
Move to a series of pose and over a given time.
[in] | _poses | Series of poses the visual will move to. |
[in] | _time | Time it takes the visual to move to the pose. |
[in] | _onComplete | Callback used when the move is complete. |
std::string Name | ( | ) | const |
Get the name of the visual.
ignition::math::Pose3d Pose | ( | ) | const |
Get the pose of the visual.
ignition::math::Vector3d Position | ( | ) | const |
Get the position of the visual.
|
protected |
Process a gazebo material message, which uses proto2 syntax that allows unset fields to be ignored, which is the legacy behavior for gazebo10 and earlier.
[in] | _msg | The ignition material message. |
|
protected |
Process a material message.
Note that ignition msgs5+ uses proto3 syntax, which does not distinguish between unset fields and fields with a default value, default values will be used for any fields not explicitly set when using this function.
[in] | _msg | The ignition material message. |
void RemovePlugin | ( | const std::string & | _name | ) |
Remove a running plugin.
_name | The unique name of the plugin to remove |
ignition::math::Quaterniond Rotation | ( | ) | const |
Get the rotation of the visual.
ignition::math::Vector3d Scale | ( | ) | const |
Get the scale.
void SetAmbient | ( | const ignition::math::Color & | _color, |
const bool | _cascade = true |
||
) |
Set the ambient color of the visual.
[in] | _color | The ambient color. |
[in] | _cascade | Whether to set this parameter in children too. |
void SetCastShadows | ( | bool | _shadows | ) |
Set whether the visual should cast shadows.
[in] | _shadows | True to enable shadows. |
void SetDiffuse | ( | const ignition::math::Color & | _color, |
const bool | _cascade = true |
||
) |
Set the diffuse color of the visual.
[in] | _color | Set the diffuse color. |
[in] | _cascade | Whether to set this parameter in children too. |
|
virtual |
Set the emissive value.
[in] | _color | The emissive color. |
[in] | _cascade | Whether to set this parameter in children too. |
Reimplemented in LaserVisual.
|
virtual |
Set the visual to be visually highlighted.
This is most often used when an object is selected by a user via the GUI.
[in] | _highlighted | True to enable the highlighting. |
Reimplemented in LinkFrameVisual.
void SetId | ( | uint32_t | _id | ) |
Set the id associated with this visual.
void SetInheritTransparency | ( | const bool | _inherit | ) |
Set whether to inherit transparency from parent.
[in] | _inherit | True to inherit transparency. |
void SetLayer | ( | const int32_t | _layer | ) |
Set the layer this visual belongs to.
[in] | _layer | Index of the layer. |
void SetLighting | ( | bool | _lighting | ) |
Set whether or not to enable or disable lighting.
[in] | _lighting | True to enable lighting. |
void SetMaterial | ( | const std::string & | _materialName, |
bool | _unique = true , |
||
const bool | _cascade = true |
||
) |
Set the material.
[in] | _materialName | The name of the material. |
[in] | _unique | True to make the material unique, which allows the material to change without changing materials that originally had the same name. |
[in] | _cascade | Whether to set this parameter in children too. |
void SetMaterialShaderParam | ( | const std::string & | _paramName, |
const std::string & | _shaderType, | ||
const std::string & | _value | ||
) |
Set a shader program parameter associated to this visual's material.
[in] | _paramName | Name of shader parameter |
[in] | _shaderType | Type of shader. Supported types: vertex, fragment |
[in] | _value | Value to set the parameter to. The value string can be a number (int, float) or a space delimited array of numbers (floats). The value type must match the type defined in the shaders. Note: Setting vec2/float2 params is only supported in ogre1.9+ |
void SetName | ( | const std::string & | _name | ) |
Set the name of the visual.
[in] | _name | Name of the visual |
void SetNormalMap | ( | const std::string & | _nmap | ) |
Set the normal map.
[in] | _nmap | Name of the normal map material. |
void SetPose | ( | const ignition::math::Pose3d & | _pose | ) |
Set the pose of the visual.
[in] | _pose | The new pose of the visual. |
void SetPosition | ( | const ignition::math::Vector3d & | _pos | ) |
Set the position of the visual.
[in] | _pos | The position to set the visual to. |
void SetRibbonTrail | ( | bool | _value, |
const ignition::math::Color & | _initialColor, | ||
const ignition::math::Color & | _changeColor | ||
) |
True on or off a ribbon trail.
[in] | _value | True to enable ribbon trail. |
[in] | _initialColor | The initial color of the ribbon trail. |
[in] | _changeColor | Color to change too as the trail grows. |
void SetRotation | ( | const ignition::math::Quaterniond & | _rot | ) |
Set the rotation of the visual.
[in] | _rot | The rotation of the visual. |
void SetScale | ( | const ignition::math::Vector3d & | _scale | ) |
Set the scale.
[in] | _scale | The scaling factor for the visual. |
void SetScene | ( | ScenePtr | _scene | ) |
Set current scene.
[in] | _scene | Pointer to the scene. |
void SetShaderType | ( | const std::string & | _type | ) |
Set the shader type for the visual's material.
[in] | _type | Shader type string: "vertex", "pixel", "normal_map_object_space", "normal_map_tangent_space". |
void SetSkeletonPose | ( | const msgs::PoseAnimation & | _pose | ) |
Set animation skeleton pose.
[in] | _pose | Skelton message |
void SetSpecular | ( | const ignition::math::Color & | _color, |
const bool | _cascade = true |
||
) |
Set the specular color of the visual.
[in] | _color | Specular color. |
[in] | _cascade | Whether to set this parameter in children too. |
void SetTransparency | ( | float | _trans | ) |
Set the transparency.
[in] | _trans | The transparency, between 0 and 1 where 0 is no transparency. |
void SetType | ( | const Visual::VisualType | _type | ) |
Set type of visual.
[in] | _type | Visual type. |
void SetTypeMsg | ( | const google::protobuf::Message * | _msg | ) |
Set a message specific for this visual type.
For example, a link visual will have a link message.
[in] | _msg | Message for this visual. |
void SetVisibilityFlags | ( | uint32_t | _flags | ) |
Set visibility flags for this visual and all children.
[in] | _flags | The visiblity flags. |
|
virtual |
Set whether the visual is visible.
[in] | _visible | set this visual visible. |
[in] | _cascade | setting this parameter in children too. |
Reimplemented in JointVisual, and ArrowVisual.
void SetWireframe | ( | bool | _show | ) |
Enable or disable wireframe for this visual.
[in] | _show | True to enable wireframe for this visual. |
void SetWorldPose | ( | const ignition::math::Pose3d & | _pose | ) |
Set the world pose of the visual.
[in] | _pose | Pose of the visual in the world coordinate frame. |
void SetWorldPosition | ( | const ignition::math::Vector3d & | _pos | ) |
Set the world linear position of the visual.
[in] | _pose | Position in the world coordinate frame. |
void SetWorldRotation | ( | const ignition::math::Quaterniond & | _rot | ) |
Set the world orientation of the visual.
[in] | _rot | Rotation in the world coordinate frame. |
void ShowBoundingBox | ( | ) |
Display the bounding box visual.
void ShowCollision | ( | bool | _show | ) |
Display the collision visuals.
[in] | _show | True to show visuals labeled as collision objects. |
void ShowCOM | ( | bool | _show | ) |
Display Center of Mass visuals.
[in] | _show | True to show center of mass visualizations. |
void ShowInertia | ( | bool | _show | ) |
Display inertia visuals.
[in] | _show | True to show inertia visualizations. |
void ShowJoints | ( | bool | _show | ) |
Display joint visuals.
[in] | _show | True to show joint visualizations. |
void ShowLinkFrame | ( | bool | _show | ) |
Display link frame visuals.
[in] | _show | True to show link frame visualizations. |
void ShowSkeleton | ( | bool | _show | ) |
Display the skeleton visuals.
[in] | _show | True to show skeleton visuals. |
ignition::math::Color Specular | ( | ) | const |
Get the specular color of the visual.
void ToggleLayer | ( | const int32_t | _layer | ) |
Toggle layer visibility.
If the visual is on the specified layer its visibility will be toggled.
[in] | _layer | Index of the layer to toggle. |
void ToggleVisible | ( | ) |
Toggle whether this visual is visible.
void Update | ( | ) |
Update the visual.
void UpdateFromMsg | ( | ConstVisualPtr & | _msg | ) |
Update a visual based on a message.
[in] | _msg | The visual message. |
bool UseRTShader | ( | ) | const |
Get whether this visual uses RT shader system.
bool Wireframe | ( | ) | const |
Get whether wireframe is enabled for this visual.
ignition::math::Pose3d WorldPose | ( | ) | const |
Get the global pose of the visual.
|
protected |