17 #ifndef GAZEBO_RENDERING_USERCAMERA_HH_
18 #define GAZEBO_RENDERING_USERCAMERA_HH_
22 #include <ignition/math/Pose3.hh>
23 #include <ignition/math/Vector2.hh>
39 class UserCameraPrivate;
56 bool _stereoEnabled =
false);
63 public:
void Load(sdf::ElementPtr _sdf);
66 public:
virtual void SetClipDist(
const float _near,
const float _far);
76 public:
virtual void Update();
87 public:
virtual void Render(
const bool _force =
false);
91 public:
virtual void PostRender();
99 public:
virtual void SetWorldPose(
const math::Pose &_pose)
103 public:
virtual void SetWorldPose(
const ignition::math::Pose3d &_pose);
109 public:
void SetDefaultPose(
const math::Pose &_pose)
115 public:
void SetInitialPose(
const ignition::math::Pose3d &_pose);
124 public: ignition::math::Pose3d InitialPose()
const;
132 public:
void HandleKeyPressEvent(
const std::string &_key);
136 public:
void HandleKeyReleaseEvent(
const std::string &_key);
140 public:
void SetViewController(
const std::string &_type);
145 public:
void SetViewController(
const std::string &_type,
146 const ignition::math::Vector3d &_pos);
153 public:
void SetViewController(
const std::string &_type,
158 public: std::string GetViewControllerTypeString();
163 public:
void Resize(
unsigned int _w,
unsigned int _h);
170 public:
void SetViewportDimensions(
float _x,
float _y,
175 public:
void MoveToVisual(
VisualPtr _visual);
179 public:
void MoveToVisual(
const std::string &_visualName);
183 public:
void SetDevicePixelRatio(
const double _ratio);
187 public:
double DevicePixelRatio()
const;
190 public:
virtual void CameraToViewportRay(
const int _screenx,
192 ignition::math::Vector3d &_origin,
193 ignition::math::Vector3d &_dir)
const;
199 public:
virtual void SetRenderTarget(Ogre::RenderTarget *_target);
206 public:
void EnableViewController(
bool _value)
const;
238 std::string &_mod)
const;
244 const ignition::math::Vector2i &_mousePos)
const;
248 public:
void SetFocalPoint(
const ignition::math::Vector3d &_pt);
251 public:
virtual unsigned int GetImageWidth()
const;
254 public:
virtual unsigned int GetImageHeight()
const;
258 public:
bool IsCameraSetInWorldFile();
262 public:
void SetUseSDFPose(
bool _value);
268 public:
void SetJoyTwistControl(
bool _value);
274 public:
void SetJoyPoseControl(
bool _value);
278 public:
bool StereoEnabled()
const;
287 public:
void EnableStereo(
bool _enable);
290 public:
virtual bool SetProjectionType(
const std::string &_type);
293 public:
virtual ignition::math::Vector2i Project(
294 const ignition::math::Vector3d &_pt)
const;
307 protected:
virtual bool AttachToVisualImpl(
VisualPtr _visual,
308 const bool _inheritOrientation,
const double _minDist = 0,
309 const double _maxDist = 0);
313 protected:
virtual void AnimationComplete();
320 protected:
virtual bool TrackVisualImpl(
VisualPtr _visual);
323 protected:
virtual void UpdateFOV();
326 private:
void ToggleShowVisual();
331 private:
void ShowVisual(
bool _show);
335 private:
void OnMoveToVisualComplete();
341 private:
void OnJoyTwist(ConstJoystickPtr &_msg);
347 private:
void OnJoyPose(ConstPosePtr &_msg);
351 private: UserCameraPrivate *dataPtr;
Basic camera sensor.
Definition: Camera.hh:85
Generic description of a mouse event.
Definition: MouseEvent.hh:35
Encapsulates a position and rotation in three space.
Definition: Pose.hh:42
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
Generic integer x, y vector.
Definition: Vector2i.hh:36
A camera used for user visualization of a scene.
Definition: UserCamera.hh:48
A renderable object.
Definition: Visual.hh:63
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:81
virtual void Render(const bool _force=false)
Render the camera.
virtual void SetClipDist()
Set the clip distance based on stored SDF values.
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:113
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.