23 #include <boost/enable_shared_from_this.hpp>
24 #include <boost/shared_ptr.hpp>
30 #include "gazebo/gazebo_config.h"
70 public boost::enable_shared_from_this<Scene>
73 GZ_SKYX_ALL = 0x0FFFFFFF,
74 GZ_SKYX_CLOUDS = 0x0000001,
75 GZ_SKYX_MOON = 0x0000002,
87 public: Scene(
const std::string &_name,
88 bool _enableVisualizations =
false,
89 bool _isServer =
false);
92 public:
virtual ~Scene();
96 public:
void Load(sdf::ElementPtr _scene);
105 public:
void PreRender();
109 public: Ogre::SceneManager *GetManager()
const;
113 public: std::string GetName()
const;
125 public:
void SetBackgroundColor(
const common::Color &_color);
136 public:
void CreateGrid(uint32_t _cellCount,
float _cellLength,
142 public: Grid *GetGrid(uint32_t _index)
const;
146 public: uint32_t GetGridCount()
const;
153 public:
CameraPtr CreateCamera(
const std::string &_name,
154 bool _autoRender =
true);
157 public: OculusCameraPtr CreateOculusCamera(
const std::string &_name);
164 public: uint32_t GetOculusCameraCount()
const;
172 public:
DepthCameraPtr CreateDepthCamera(
const std::string &_name,
173 bool _autoRender =
true);
180 public:
GpuLaserPtr CreateGpuLaser(
const std::string &_name,
181 bool _autoRender =
true);
185 public: uint32_t GetCameraCount()
const;
191 public:
CameraPtr GetCamera(uint32_t _index)
const;
196 public:
CameraPtr GetCamera(
const std::string &_name)
const;
205 public:
UserCameraPtr CreateUserCamera(
const std::string &_name,
206 bool _stereoEnabled =
false);
210 public: uint32_t GetUserCameraCount()
const;
221 public:
void RemoveCamera(
const std::string &_name);
226 public:
LightPtr GetLight(
const std::string &_name)
const;
230 public: uint32_t GetLightCount()
const;
236 public:
LightPtr GetLight(uint32_t _index)
const;
241 public:
VisualPtr GetVisual(
const std::string &_name)
const;
246 public:
VisualPtr GetVisual(uint32_t _id)
const;
251 public:
void SelectVisual(
const std::string &_name,
252 const std::string &_mode);
266 public:
void SnapVisualToNearestBelow(
const std::string &_visualName);
288 public:
VisualPtr GetVisualBelow(
const std::string &_visualName);
295 std::vector<VisualPtr> &_visuals);
302 public:
double GetHeightBelowPoint(
const math::Vector3 &_pt);
309 public:
bool GetFirstContact(
CameraPtr _camera,
314 public:
void PrintSceneGraph();
320 public:
void SetVisible(
const std::string &_name,
bool _visible);
328 const std::string &_name);
337 public:
void SetFog(
const std::string &_type,
339 double _density,
double _start,
double _end);
343 public: uint32_t GetId()
const;
347 public: std::string GetIdString()
const;
351 public:
void SetShadowsEnabled(
bool _value);
355 public:
bool GetShadowsEnabled()
const;
363 public:
void RemoveVisual(
VisualPtr _vis);
367 public:
void RemoveVisual(uint32_t _id);
374 public:
void SetVisualId(
VisualPtr _vis, uint32_t _id);
378 public:
void AddLight(
LightPtr _light);
382 public:
void RemoveLight(
LightPtr _light);
386 public:
void SetGrid(
bool _enabled);
390 public:
void ShowOrigin(
bool _show);
394 public:
VisualPtr GetWorldVisual()
const;
399 public: std::string StripSceneName(
const std::string &_name)
const;
403 public: Heightmap *GetHeightmap()
const;
406 public:
void Clear();
411 public:
VisualPtr GetSelectedVisual()
const;
415 public:
void SetWireframe(
bool _show);
419 public:
void SetTransparent(
bool _show);
423 public:
void ShowCOMs(
bool _show);
427 public:
void ShowInertias(
bool _show);
431 public:
void ShowLinkFrames(
bool _show);
435 public:
void ShowJoints(
bool _show);
439 public:
void ShowCollisions(
bool _show);
443 public:
void ShowContacts(
bool _show);
447 public:
void ShowClouds(
bool _show);
451 public:
bool GetShowClouds()
const;
458 public:
void SetSkyXMode(
unsigned int _mode);
462 public: SkyX::SkyX *GetSkyX()
const;
465 public:
bool GetInitialized()
const;
476 public: uint32_t GetVisualCount()
const;
479 public:
void RemoveProjectors();
485 public:
void ToggleLayer(
const int32_t _layer);
488 private:
void SetSky();
491 private:
void InitDeferredShading();
499 private: Ogre::Entity *GetOgreEntityAt(
CameraPtr _camera,
501 bool _ignorSelectionObj);
513 private:
void GetMeshInformation(
const Ogre::Mesh *_mesh,
514 size_t &_vertexCount,
515 Ogre::Vector3* &_vertices,
518 const Ogre::Vector3 &_position,
519 const Ogre::Quaternion &_orient,
520 const Ogre::Vector3 &_scale);
525 private:
void PrintSceneGraphHelper(
const std::string &_prefix,
531 private:
void OnScene(ConstScenePtr &_msg);
535 private:
void OnResponse(ConstResponsePtr &_msg);
539 private:
void OnRequest(ConstRequestPtr &_msg);
543 private:
void OnJointMsg(ConstJointPtr &_msg);
547 private:
bool ProcessSensorMsg(ConstSensorPtr &_msg);
551 private:
bool ProcessJointMsg(ConstJointPtr &_msg);
555 private:
bool ProcessLinkMsg(ConstLinkPtr &_msg);
559 private:
bool ProcessSceneMsg(ConstScenePtr &_msg);
563 private:
bool ProcessModelMsg(
const msgs::Model &_msg);
567 private:
void OnSensorMsg(ConstSensorPtr &_msg);
571 private:
void OnVisualMsg(ConstVisualPtr &_msg);
577 private:
bool ProcessVisualMsg(ConstVisualPtr &_msg,
582 private:
void OnLightMsg(ConstLightPtr &_msg);
586 private:
bool ProcessLightMsg(ConstLightPtr &_msg);
590 private:
void ProcessRequestMsg(ConstRequestPtr &_msg);
594 private:
void OnSkyMsg(ConstSkyPtr &_msg);
598 private:
void OnModelMsg(ConstModelPtr &_msg);
602 private:
void OnPoseMsg(ConstPosesStampedPtr &_msg);
606 private:
void OnSkeletonPoseMsg(ConstPoseAnimationPtr &_msg);
611 private:
void CreateCOMVisual(ConstLinkPtr &_msg,
VisualPtr _linkVisual);
616 private:
void CreateCOMVisual(sdf::ElementPtr _elem,
622 private:
void CreateInertiaVisual(ConstLinkPtr &_msg,
628 private:
void CreateInertiaVisual(sdf::ElementPtr _elem,
634 private:
void CreateLinkFrameVisual(ConstLinkPtr &_msg,
640 private:
void RemoveVisualizations(
VisualPtr _vis);
644 private: ScenePrivate *dataPtr;
boost::shared_ptr< DepthCamera > DepthCameraPtr
Definition: RenderTypes.hh:95
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
boost::shared_ptr< Light > LightPtr
Definition: RenderTypes.hh:83
Generic integer x, y vector.
Definition: Vector2i.hh:36
Forward declarations for transport.
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:87
VisualType
Type of visual.
Definition: Visual.hh:62
SkyXMode
Definition: Scene.hh:72
#define GZ_RENDERING_VISIBLE
Definition: system.hh:241
boost::shared_ptr< GpuLaser > GpuLaserPtr
Definition: RenderTypes.hh:99
Entity visual.
Definition: Visual.hh:65
Representation of an entire scene graph.
Definition: Scene.hh:69
Defines a color.
Definition: Color.hh:36
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:107
boost::shared_ptr< UserCamera > UserCameraPtr
Definition: RenderTypes.hh:91
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:39