18 #ifndef GZ_SIM_SCENEMANAGER_HH_
19 #define GZ_SIM_SCENEMANAGER_HH_
24 #include <unordered_map>
28 #include <sdf/Geometry.hh>
29 #include <sdf/Actor.hh>
30 #include <sdf/Joint.hh>
31 #include <sdf/Light.hh>
32 #include <sdf/Link.hh>
33 #include <sdf/Material.hh>
34 #include <sdf/Model.hh>
35 #include <sdf/Visual.hh>
37 #include <gz/common/KeyFrame.hh>
38 #include <gz/common/Animation.hh>
39 #include <gz/common/graphics/Types.hh>
41 #include <gz/math/Inertial.hh>
42 #include <gz/math/Matrix4.hh>
43 #include <gz/math/Pose3.hh>
44 #include <gz/math/SphericalCoordinates.hh>
45 #include <gz/math/Vector3.hh>
47 #include <gz/msgs/particle_emitter.pb.h>
49 #include <gz/rendering/RenderTypes.hh>
51 #include <gz/sim/config.hh>
53 #include <gz/sim/rendering/Export.hh>
60 inline namespace GZ_SIM_VERSION_NAMESPACE {
62 class SceneManagerPrivate;
72 public: std::chrono::steady_clock::duration
time;
75 public:
bool loop =
false;
78 public:
bool followTrajectory =
false;
95 public:
bool valid =
false;
109 public:
void SetScene(rendering::ScenePtr _scene);
113 public: rendering::ScenePtr
Scene()
const;
117 public:
void SetWorldId(
Entity _id);
121 public:
Entity WorldId()
const;
126 public:
void SetSphericalCoordinates(
134 public: rendering::VisualPtr CreateModel(
Entity _id,
142 public: rendering::VisualPtr CreateLink(
Entity _id,
155 const rendering::NodePtr _nodeToFilter)> _filter)
const;
174 public: rendering::VisualPtr CreateVisual(
Entity _id,
182 public: rendering::VisualPtr CreateCOMVisual(
Entity _id,
190 public: rendering::VisualPtr CreateInertiaVisual(
Entity _id,
199 public: rendering::VisualPtr CreateJointVisual(
Entity _id,
208 public: rendering::VisualPtr CreateCollision(
Entity _id,
214 public: rendering::VisualPtr VisualById(
Entity _id);
225 public:
void SequenceTrajectories(
227 std::chrono::steady_clock::time_point _time);
235 public: rendering::VisualPtr CreateActor(
Entity _id,
245 public: rendering::LightPtr CreateLight(
Entity _id,
254 public: rendering::VisualPtr CreateLightVisual(
Entity _id,
262 public: rendering::ParticleEmitterPtr CreateParticleEmitter(
269 public: rendering::ParticleEmitterPtr UpdateParticleEmitter(
Entity _id,
277 public: rendering::ProjectorPtr CreateProjector(
288 Entity _parentGazeboId = 0);
293 public:
bool HasEntity(
Entity _id)
const;
298 public: rendering::NodePtr NodeById(
Entity _id)
const;
303 public: rendering::MeshPtr ActorMeshById(
Entity _id)
const;
317 Entity _id, std::chrono::steady_clock::duration _time)
const;
327 Entity _id, std::chrono::steady_clock::duration _time)
const;
331 public:
void RemoveEntity(
Entity _id);
339 private: rendering::GeometryPtr LoadGeometry(
const sdf::Geometry &_geom,
345 private: rendering::MaterialPtr LoadMaterial(
353 public: rendering::VisualPtr TopLevelVisual(
354 const rendering::VisualPtr &_visual)
const;
361 public: rendering::NodePtr TopLevelNode(
362 const rendering::NodePtr &_node)
const;
371 public:
void UpdateTransparency(
const rendering::NodePtr &_node,
372 bool _makeTransparent);
377 public:
void UpdateJointParentPose(
Entity _jointId);
382 public:
Entity UniqueId()
const;
387 public:
void Clear();