23 #include <boost/enable_shared_from_this.hpp>
24 #include <boost/shared_ptr.hpp>
30 #include "gazebo/gazebo_config.h"
71 GZ_SKYX_ALL = 0x0FFFFFFF,
72 GZ_SKYX_CLOUDS = 0x0000001,
73 GZ_SKYX_MOON = 0x0000002,
85 public: Scene(
const std::string &_name,
86 bool _enableVisualizations =
false,
87 bool _isServer =
false);
90 public:
virtual ~Scene();
94 public:
void Load(sdf::ElementPtr _scene);
103 public:
void PreRender();
107 public: Ogre::SceneManager *GetManager()
const;
111 public: std::string GetName()
const;
123 public:
void SetBackgroundColor(
const common::Color &_color);
134 public:
void CreateGrid(uint32_t _cellCount,
float _cellLength,
140 public: Grid *GetGrid(uint32_t _index)
const;
144 public: uint32_t GetGridCount()
const;
151 public:
CameraPtr CreateCamera(
const std::string &_name,
152 bool _autoRender =
true);
162 public: uint32_t GetOculusCameraCount()
const;
170 public:
DepthCameraPtr CreateDepthCamera(
const std::string &_name,
171 bool _autoRender =
true);
178 public:
GpuLaserPtr CreateGpuLaser(
const std::string &_name,
179 bool _autoRender =
true);
183 public: uint32_t GetCameraCount()
const;
189 public:
CameraPtr GetCamera(uint32_t _index)
const;
194 public:
CameraPtr GetCamera(
const std::string &_name)
const;
201 public:
UserCameraPtr CreateUserCamera(
const std::string &_name);
205 public: uint32_t GetUserCameraCount()
const;
216 public:
void RemoveCamera(
const std::string &_name);
221 public:
LightPtr GetLight(
const std::string &_name)
const;
225 public: uint32_t GetLightCount()
const;
231 public:
LightPtr GetLight(uint32_t _index)
const;
236 public:
VisualPtr GetVisual(
const std::string &_name)
const;
241 public:
VisualPtr GetVisual(uint32_t _id)
const;
246 public:
void SelectVisual(
const std::string &_name,
247 const std::string &_mode);
261 public:
void SnapVisualToNearestBelow(
const std::string &_visualName);
283 public:
VisualPtr GetVisualBelow(
const std::string &_visualName);
290 std::vector<VisualPtr> &_visuals);
297 public:
double GetHeightBelowPoint(
const math::Vector3 &_pt);
304 public:
bool GetFirstContact(
CameraPtr _camera,
309 public:
void PrintSceneGraph();
315 public:
void SetVisible(
const std::string &_name,
bool _visible);
323 const std::string &_name);
332 public:
void SetFog(
const std::string &_type,
334 double _density,
double _start,
double _end);
338 public: uint32_t GetId()
const;
342 public: std::string GetIdString()
const;
346 public:
void SetShadowsEnabled(
bool _value);
350 public:
bool GetShadowsEnabled()
const;
358 public:
void RemoveVisual(
VisualPtr _vis);
362 public:
void AddLight(
LightPtr _light);
366 public:
void RemoveLight(
LightPtr _light);
370 public:
void SetGrid(
bool _enabled);
374 public:
VisualPtr GetWorldVisual()
const;
379 public: std::string StripSceneName(
const std::string &_name)
const;
383 public: Heightmap *GetHeightmap()
const;
386 public:
void Clear();
391 public:
VisualPtr GetSelectedVisual()
const;
395 public:
void SetWireframe(
bool _show);
399 public:
void SetTransparent(
bool _show);
403 public:
void ShowCOMs(
bool _show);
407 public:
void ShowJoints(
bool _show);
411 public:
void ShowCollisions(
bool _show);
415 public:
void ShowContacts(
bool _show);
419 public:
void ShowClouds(
bool _show);
423 public:
bool GetShowClouds()
const;
430 public:
void SetSkyXMode(
unsigned int _mode);
437 public:
bool GetInitialized()
const;
448 public: uint32_t GetVisualCount()
const;
451 public:
void RemoveProjectors();
454 private:
void SetSky();
457 private:
void InitDeferredShading();
465 private: Ogre::Entity *GetOgreEntityAt(
CameraPtr _camera,
467 bool _ignorSelectionObj);
479 private:
void GetMeshInformation(
const Ogre::Mesh *_mesh,
480 size_t &_vertexCount,
481 Ogre::Vector3* &_vertices,
484 const Ogre::Vector3 &_position,
485 const Ogre::Quaternion &_orient,
486 const Ogre::Vector3 &_scale);
491 private:
void PrintSceneGraphHelper(
const std::string &_prefix,
497 private:
void OnScene(ConstScenePtr &_msg);
501 private:
void OnResponse(ConstResponsePtr &_msg);
505 private:
void OnRequest(ConstRequestPtr &_msg);
509 private:
void OnJointMsg(ConstJointPtr &_msg);
513 private:
bool ProcessSensorMsg(ConstSensorPtr &_msg);
517 private:
bool ProcessJointMsg(ConstJointPtr &_msg);
521 private:
bool ProcessLinkMsg(ConstLinkPtr &_msg);
525 private:
bool ProcessSceneMsg(ConstScenePtr &_msg);
529 private:
bool ProcessModelMsg(
const msgs::Model &_msg);
533 private:
void OnSensorMsg(ConstSensorPtr &_msg);
537 private:
void OnVisualMsg(ConstVisualPtr &_msg);
541 private:
bool ProcessVisualMsg(ConstVisualPtr &_msg);
545 private:
void OnLightMsg(ConstLightPtr &_msg);
549 private:
bool ProcessLightMsg(ConstLightPtr &_msg);
553 private:
void ProcessRequestMsg(ConstRequestPtr &_msg);
557 private:
void OnSelectionMsg(ConstSelectionPtr &_msg);
561 private:
void OnSkyMsg(ConstSkyPtr &_msg);
565 private:
void OnModelMsg(ConstModelPtr &_msg);
569 private:
void OnPoseMsg(ConstPosesStampedPtr &_msg);
573 private:
void OnSkeletonPoseMsg(ConstPoseAnimationPtr &_msg);
578 private:
void CreateCOMVisual(ConstLinkPtr &_msg,
VisualPtr _linkVisual);
583 private:
void CreateCOMVisual(sdf::ElementPtr _elem,
588 private: ScenePrivate *dataPtr;
boost::shared_ptr< DepthCamera > DepthCameraPtr
Definition: RenderTypes.hh:90
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
boost::shared_ptr< Light > LightPtr
Definition: RenderTypes.hh:78
Generic integer x, y vector.
Definition: Vector2i.hh:39
Forward declarations for transport.
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:82
SkyXMode
Definition: Scene.hh:70
boost::shared_ptr< GpuLaser > GpuLaserPtr
Definition: RenderTypes.hh:94
Representation of an entire scene graph.
Definition: Scene.hh:68
SkyX(Ogre::SceneManager *sm, Controller *c)
Contructor.
Defines a color.
Definition: Color.hh:39
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:102
boost::shared_ptr< UserCamera > UserCameraPtr
Definition: RenderTypes.hh:86
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:43
boost::shared_ptr< OculusCamera > OculusCameraPtr
Definition: RenderTypes.hh:167