iridescence
Loading...
Searching...
No Matches
orbit_camera_control_xy.hpp
Go to the documentation of this file.
1#ifndef GUIK_ORBIT_CAMERA_CONTROL_XY_HPP
2#define GUIK_ORBIT_CAMERA_CONTROL_XY_HPP
3
5
6namespace guik {
7
14public:
15 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
16
18 OrbitCameraControlXY(double theta, double phi, double distance);
19 virtual ~OrbitCameraControlXY() override;
20
21 virtual void reset_center() override;
22 virtual void lookat(const Eigen::Vector3f& pt) override;
23
24 virtual void mouse(const Eigen::Vector2f& p, int button, bool down) override;
25 virtual void drag(const Eigen::Vector2f& p, int button) override;
26 virtual void scroll(const Eigen::Vector2f& rel) override;
27
28 virtual void updown(double p) override;
29 virtual void arrow(const Eigen::Vector2f& p) override;
30
31 virtual Eigen::Vector2f depth_range() const override;
32
33 virtual Eigen::Quaternionf rotation() const;
34 virtual Eigen::Matrix4f view_matrix() const override;
35
36 virtual std::string name() const override { return "OrbitCameraControlXY"; }
37 virtual void load(std::istream& ist) override;
38 virtual void save(std::ostream& ost) const override;
39
40protected:
41 Eigen::Vector3f center_offset;
42 Eigen::Vector3f center;
43 double distance;
44
45 Eigen::Vector2f drag_last_pos;
46
49 double theta;
50 double phi;
51
53};
54
55} // namespace guik
56
57#endif
Base class for camera control. This class defines the interface for controlling the camera in the vie...
Definition camera_control.hpp:19
Eigen::Vector3f center_offset
Definition orbit_camera_control_xy.hpp:41
virtual void load(std::istream &ist) override
virtual Eigen::Vector2f depth_range() const override
Get the depth range of the camera. This method can be overridden by derived classes to specify a cust...
OrbitCameraControlXY(double theta, double phi, double distance)
virtual void lookat(const Eigen::Vector3f &pt) override
Move the camera to look at the given point. The point is expected to be in world coordinates.
double phi
Definition orbit_camera_control_xy.hpp:50
virtual void scroll(const Eigen::Vector2f &rel) override
Scroll event callback. This method is called when the mouse wheel is scrolled.
double theta
Definition orbit_camera_control_xy.hpp:49
Eigen::Vector2f drag_last_pos
Definition orbit_camera_control_xy.hpp:45
virtual void drag(const Eigen::Vector2f &p, int button) override
Mouse drag event callback. This method is called when the mouse is moved while a button is pressed.
double distance
Definition orbit_camera_control_xy.hpp:43
virtual void arrow(const Eigen::Vector2f &p) override
Keyboard arrow key event callback. This method is called while the user is pressing the arrow keys.
bool left_button_down
Definition orbit_camera_control_xy.hpp:47
EIGEN_MAKE_ALIGNED_OPERATOR_NEW OrbitCameraControlXY()
bool right_button_down
Definition orbit_camera_control_xy.hpp:48
bool middle_button_down
Definition orbit_camera_control_xy.hpp:52
Eigen::Vector3f center
Definition orbit_camera_control_xy.hpp:42
virtual void updown(double p) override
Keyboard page up/down event callback. This method is called while the user is pressing the page up/do...
virtual Eigen::Quaternionf rotation() const
virtual void reset_center() override
Reset the shift of the camera.
virtual Eigen::Matrix4f view_matrix() const override
Get the view matrix of the camera. This method must be implemented by derived classes to return the c...
virtual ~OrbitCameraControlXY() override
virtual void mouse(const Eigen::Vector2f &p, int button, bool down) override
Mouse event callback. This method is called when a mouse button is pressed or released.
virtual void save(std::ostream &ost) const override
virtual std::string name() const override
Definition orbit_camera_control_xy.hpp:36
Definition drawable_container.hpp:9