Scene manager class for loading and managing objects in the scene. More...
#include <SceneManager.hh>
Public Member Functions | |
| SceneManager () | |
| Constructor. More... | |
| ~SceneManager () | |
| Destructor. More... | |
| std::map< std::string, math::Matrix4d > | ActorMeshAnimationAt (Entity _id, std::chrono::steady_clock::duration _time) const |
| Get the animation of actor mesh given an id. More... | |
| rendering::MeshPtr | ActorMeshById (Entity _id) const |
| Get a rendering mesh given an id. More... | |
| bool | AddSensor (Entity _gazeboId, const std::string &_sensorName, Entity _parentGazeboId=0) |
| Ignition sensors is the one responsible for adding sensors to the scene. Here we just keep track of it and make sure it has the correct parent. More... | |
| rendering::VisualPtr | CreateActor (Entity _id, const sdf::Actor &_actor, Entity _parentId=0) |
| Create an actor. More... | |
| rendering::VisualPtr | CreateCollision (Entity _id, const sdf::Collision &_collision, Entity _parentId=0) |
| Create a collision visual. More... | |
| rendering::LightPtr | CreateLight (Entity _id, const sdf::Light &_light, Entity _parentId) |
| Create a light. More... | |
| rendering::VisualPtr | CreateLink (Entity _id, const sdf::Link &_link, Entity _parentId=0) |
| Create a link. More... | |
| rendering::VisualPtr | CreateModel (Entity _id, const sdf::Model &_model, Entity _parentId=0) |
| Create a model. More... | |
| rendering::VisualPtr | CreateVisual (Entity _id, const sdf::Visual &_visual, Entity _parentId=0) |
| Create a visual. More... | |
| Entity | EntityFromNode (const rendering::NodePtr &_node) const |
| Get the entity for a given node. More... | |
| bool | HasEntity (Entity _id) const |
| Check if entity exists. More... | |
| rendering::NodePtr | NodeById (Entity _id) const |
| Get a rendering node given an entity id. More... | |
| void | RemoveEntity (Entity _id) |
| Remove an entity by id. More... | |
| rendering::ScenePtr | Scene () const |
| Get the scene. More... | |
| void | SetScene (rendering::ScenePtr _scene) |
| Set the scene to manage. More... | |
| void | SetWorldId (Entity _id) |
| Set the world's ID. More... | |
| rendering::NodePtr | TopLevelNode (const rendering::NodePtr &_node) const |
| Get the top level node for the given node, which is the ancestor which is a direct child to the root visual. Usually, this will be a model or a light. More... | |
| rendering::VisualPtr | TopLevelVisual (rendering::VisualPtr _visual) const |
| Get the top level visual for the given visual, which is the ancestor which is a direct child to the root visual. Usually, this will be a model or a light. More... | |
| rendering::VisualPtr | VisualById (Entity _id) |
| Retrieve visual. More... | |
| Entity | WorldId () const |
| Get the world's ID. More... | |
Detailed Description
Scene manager class for loading and managing objects in the scene.
Constructor & Destructor Documentation
◆ SceneManager()
| SceneManager | ( | ) |
Constructor.
◆ ~SceneManager()
| ~SceneManager | ( | ) |
Destructor.
Member Function Documentation
◆ ActorMeshAnimationAt()
| std::map<std::string, math::Matrix4d> ActorMeshAnimationAt | ( | Entity | _id, |
| std::chrono::steady_clock::duration | _time | ||
| ) | const |
Get the animation of actor mesh given an id.
- Parameters
-
[in] _id Entity's unique id [in] _time Timepoint for the animation
- Returns
- Map from the skeleton node name to transforms
◆ ActorMeshById()
| rendering::MeshPtr ActorMeshById | ( | Entity | _id | ) | const |
Get a rendering mesh given an id.
- Parameters
-
[in] _id Actor entity's unique id
- Returns
- Pointer to requested entity's mesh
◆ AddSensor()
| bool AddSensor | ( | Entity | _gazeboId, |
| const std::string & | _sensorName, | ||
| Entity | _parentGazeboId = 0 |
||
| ) |
Ignition sensors is the one responsible for adding sensors to the scene. Here we just keep track of it and make sure it has the correct parent.
- Parameters
-
[in] _gazeboId Entity in Gazebo [in] _sensorName Name of sensor node in Ignition Rendering. [in] _parentGazeboId Parent Id on Gazebo.
- Returns
- True if sensor is successfully handled
◆ CreateActor()
Create an actor.
- Parameters
-
[in] _id Unique actor id [in] _actor Actor sdf dom [in] _parentId Parent id
- Returns
- Actor object created from the sdf dom
◆ CreateCollision()
| rendering::VisualPtr CreateCollision | ( | Entity | _id, |
| const sdf::Collision & | _collision, | ||
| Entity | _parentId = 0 |
||
| ) |
Create a collision visual.
- Parameters
-
[in] _id Unique visual id [in] _collision Collision sdf dom [in] _parentId Parent id
- Returns
- Visual (collision) object created from the sdf dom
◆ CreateLight()
Create a light.
- Parameters
-
[in] _id Unique light id [in] _light Light sdf dom [in] _parentId Parent id
- Returns
- Light object created from the sdf dom
◆ CreateLink()
◆ CreateModel()
◆ CreateVisual()
Create a visual.
- Parameters
-
[in] _id Unique visual id [in] _visual Visual sdf dom [in] _parentId Parent id
- Returns
- Visual object created from the sdf dom
◆ EntityFromNode()
| Entity EntityFromNode | ( | const rendering::NodePtr & | _node | ) | const |
Get the entity for a given node.
- Parameters
-
[in] _node Node to get the entity for.
- Returns
- The entity for that node, or
kNullEntityfor no entity.
- Todo:
- (anyone) Deprecate in favour of
gz::rendering::Node::UserDataonce that's available.
◆ HasEntity()
| bool HasEntity | ( | Entity | _id | ) | const |
Check if entity exists.
- Parameters
-
[in] _id Unique entity id
- Returns
- true if exists, false otherwise
◆ NodeById()
| rendering::NodePtr NodeById | ( | Entity | _id | ) | const |
Get a rendering node given an entity id.
- Parameters
-
[in] _id Entity's unique id
- Returns
- Pointer to requested entity's node
◆ RemoveEntity()
| void RemoveEntity | ( | Entity | _id | ) |
Remove an entity by id.
- Parameters
-
[in] _id Entity's unique id
◆ Scene()
| rendering::ScenePtr Scene | ( | ) | const |
Get the scene.
- Returns
- Pointer to scene
◆ SetScene()
| void SetScene | ( | rendering::ScenePtr | _scene | ) |
Set the scene to manage.
- Parameters
-
[in] _scene Scene pointer.
◆ SetWorldId()
◆ TopLevelNode()
| rendering::NodePtr TopLevelNode | ( | const rendering::NodePtr & | _node | ) | const |
Get the top level node for the given node, which is the ancestor which is a direct child to the root visual. Usually, this will be a model or a light.
- Parameters
-
[in] _node Child node
- Returns
- Top level node containining this node
◆ TopLevelVisual()
| rendering::VisualPtr TopLevelVisual | ( | rendering::VisualPtr | _visual | ) | const |
Get the top level visual for the given visual, which is the ancestor which is a direct child to the root visual. Usually, this will be a model or a light.
- Parameters
-
[in] _visual Child visual
- Returns
- Top level visual containining this visual TODO(anyone) Make it const ref when merging forward
◆ VisualById()
| rendering::VisualPtr VisualById | ( | Entity | _id | ) |
Retrieve visual.
- Parameters
-
[in] _id Unique visual (entity) id
- Returns
- Pointer to requested visual
◆ WorldId()
The documentation for this class was generated from the following file: