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);
65 using Camera::SetClipDist;
85 public:
virtual void Render(
const bool _force =
false);
95 public:
virtual void SetWorldPose(
const ignition::math::Pose3d &_pose);
126 const ignition::math::Vector3d &_pos);
135 public:
void Resize(
unsigned int _w,
unsigned int _h);
164 ignition::math::Vector3d &_origin,
165 ignition::math::Vector3d &_dir)
const;
186 std::string &_mod)
const;
192 const ignition::math::Vector2i &_mousePos)
const;
241 public:
virtual ignition::math::Vector2i
Project(
242 const ignition::math::Vector3d &_pt)
const;
256 const bool _inheritOrientation,
const double _minDist = 0,
257 const double _maxDist = 0);
258 using Camera::AttachToVisualImpl;
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;
common
Definition FuelModelDatabase.hh:37
rendering
Definition RenderEngine.hh:31
Generic description of a mouse event.
Definition MouseEvent.hh:36
Basic camera sensor.
Definition Camera.hh:86
virtual void SetClipDist()
Set the clip distance based on stored SDF values.
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.
virtual void Render(const bool _force=false)
Render the camera.
A camera used for user visualization of a scene.
Definition UserCamera.hh:47
bool IsCameraSetInWorldFile()
brief Show if the user camera pose has changed in the world file.
std::string GetViewControllerTypeString()
Get current view controller type.
void SetInitialPose(const ignition::math::Pose3d &_pose)
Set the initial pose in the world coordinate frame and set that as the current camera world pose.
void HandleKeyPressEvent(const std::string &_key)
Handle a key press.
virtual void UpdateFOV()
Update the camera's field of view.
bool StereoEnabled() const
Get whether stereo is enabled.
void EnableStereo(bool _enable)
Turn on/off stereo rendering.
virtual bool TrackVisualImpl(VisualPtr _visual)
Set the camera to track a scene node.
void SetJoyTwistControl(bool _value)
brief Enable or disable camera control through ~/user_camera/joy_twist gz topic.
void SetJoyPoseControl(bool _value)
brief Enable or disable camera control through ~/user_camera/joy_pose gz topic.
virtual void SetClipDist(const float _near, const float _far)
Set the clip distances.
VisualPtr Visual(const ignition::math::Vector2i &_mousePos) const
Get a visual at a mouse position.
virtual void SetWorldPose(const ignition::math::Pose3d &_pose)
Set the global pose of the camera.
void SetUseSDFPose(bool _value)
brief Set if the user camera pose has changed in the world file.
virtual void AnimationComplete()
Internal function used to indicate that an animation has completed.
void HandleMouseEvent(const common::MouseEvent &_evt)
Handle a mouse event.
void SetDevicePixelRatio(const double _ratio)
Set the screen point to device pixel ratio.
void SetViewController(const std::string &_type, const ignition::math::Vector3d &_pos)
Set view controller.
ignition::math::Pose3d InitialPose() const
Get the initial pose in the world coordinate frame.
virtual void SetRenderTarget(Ogre::RenderTarget *_target)
Set to true to enable rendering.
virtual ~UserCamera()
Destructor.
void SetFocalPoint(const ignition::math::Vector3d &_pt)
Set the point the camera should orbit around.
void SetViewportDimensions(float _x, float _y, float _w, float _h)
Set the dimensions of the viewport.
VisualPtr Visual(const ignition::math::Vector2i &_mousePos, std::string &_mod) const
Get an entity at a pixel location using a camera.
virtual void CameraToViewportRay(const int _screenx, const int _screeny, ignition::math::Vector3d &_origin, ignition::math::Vector3d &_dir) const
Get a world space ray as cast from the camera through the viewport.
void MoveToVisual(VisualPtr _visual)
Move the camera to focus on a visual.
void SetViewController(const std::string &_type)
Set view controller.
UserCamera(const std::string &_name, ScenePtr _scene, bool _stereoEnabled=false)
Constructor.
double DevicePixelRatio() const
Get the screen point to device pixel ratio.
virtual bool SetProjectionType(const std::string &_type)
Set the type of projection used by the camera.
void MoveToVisual(const std::string &_visualName)
Move the camera to focus on a visual.
void EnableViewController(bool _value) const
Set whether the view controller is enabled.
void Load(sdf::ElementPtr _sdf)
Load the user camera.
void Load()
Generic load function.
virtual ignition::math::Vector2i Project(const ignition::math::Vector3d &_pt) const
Project 3D world coordinates to 2D screen coordinates.
virtual void PostRender()
Post render.
virtual void Render(const bool _force=false)
Render the camera.
void Resize(unsigned int _w, unsigned int _h)
Resize the camera.
virtual void Update()
Render the camera.
void HandleKeyReleaseEvent(const std::string &_key)
Handle a key release.
virtual unsigned int GetImageHeight() const
virtual unsigned int GetImageWidth() const
virtual bool AttachToVisualImpl(VisualPtr _visual, const bool _inheritOrientation, const double _minDist=0, const double _maxDist=0)
Set the camera to be attached to a visual.
std::shared_ptr< Visual > VisualPtr
Definition RenderTypes.hh:114
boost::shared_ptr< Scene > ScenePtr
Definition RenderTypes.hh:82
Forward declarations for the common classes.
Definition Animation.hh:27