17 #ifndef GAZEBO_RENDERING_USERCAMERA_HH_
18 #define GAZEBO_RENDERING_USERCAMERA_HH_
22 #include <ignition/math/Pose3.hh>
23 #include <ignition/math/Vector2.hh>
37 class UserCameraPrivate;
54 bool _stereoEnabled =
false);
61 public:
void Load(sdf::ElementPtr _sdf);
64 public:
virtual void SetClipDist(
const float _near,
const float _far);
74 public:
virtual void Update();
85 public:
virtual void Render(
const bool _force =
false);
89 public:
virtual void PostRender();
95 public:
virtual void SetWorldPose(
const ignition::math::Pose3d &_pose);
100 public:
void SetInitialPose(
const ignition::math::Pose3d &_pose);
104 public: ignition::math::Pose3d InitialPose()
const;
112 public:
void HandleKeyPressEvent(
const std::string &_key);
116 public:
void HandleKeyReleaseEvent(
const std::string &_key);
120 public:
void SetViewController(
const std::string &_type);
125 public:
void SetViewController(
const std::string &_type,
126 const ignition::math::Vector3d &_pos);
130 public: std::string GetViewControllerTypeString();
135 public:
void Resize(
unsigned int _w,
unsigned int _h);
142 public:
void SetViewportDimensions(
float _x,
float _y,
147 public:
void MoveToVisual(
VisualPtr _visual);
151 public:
void MoveToVisual(
const std::string &_visualName);
155 public:
void SetDevicePixelRatio(
const double _ratio);
159 public:
double DevicePixelRatio()
const;
162 public:
virtual void CameraToViewportRay(
const int _screenx,
164 ignition::math::Vector3d &_origin,
165 ignition::math::Vector3d &_dir)
const;
171 public:
virtual void SetRenderTarget(Ogre::RenderTarget *_target);
178 public:
void EnableViewController(
bool _value)
const;
186 std::string &_mod)
const;
192 const ignition::math::Vector2i &_mousePos)
const;
196 public:
void SetFocalPoint(
const ignition::math::Vector3d &_pt);
199 public:
virtual unsigned int GetImageWidth()
const;
202 public:
virtual unsigned int GetImageHeight()
const;
206 public:
bool IsCameraSetInWorldFile();
210 public:
void SetUseSDFPose(
bool _value);
216 public:
void SetJoyTwistControl(
bool _value);
222 public:
void SetJoyPoseControl(
bool _value);
226 public:
bool StereoEnabled()
const;
235 public:
void EnableStereo(
bool _enable);
238 public:
virtual bool SetProjectionType(
const std::string &_type);
241 public:
virtual ignition::math::Vector2i Project(
242 const ignition::math::Vector3d &_pt)
const;
255 protected:
virtual bool AttachToVisualImpl(
VisualPtr _visual,
256 const bool _inheritOrientation,
const double _minDist = 0,
257 const double _maxDist = 0);
261 protected:
virtual void AnimationComplete();
268 protected:
virtual bool TrackVisualImpl(
VisualPtr _visual);
271 protected:
virtual void UpdateFOV();
274 private:
void ToggleShowVisual();
279 private:
void ShowVisual(
bool _show);
283 private:
void OnMoveToVisualComplete();
289 private:
void OnJoyTwist(ConstJoystickPtr &_msg);
295 private:
void OnJoyPose(ConstPosePtr &_msg);
299 private: UserCameraPrivate *dataPtr;
Basic camera sensor.
Definition: Camera.hh:81
Generic description of a mouse event.
Definition: MouseEvent.hh:35
A camera used for user visualization of a scene.
Definition: UserCamera.hh:46
A renderable object.
Definition: Visual.hh:60
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
virtual void Render(const bool _force=false)
Render the camera.
virtual void SetClipDist()
Set the clip distance based on stored SDF values.
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
virtual bool AttachToVisualImpl(const std::string &_name, const bool _inheritOrientation, const double _minDist=0, const double _maxDist=0)
Attach the camera to a scene node.