iridescence
Loading...
Searching...
No Matches
topdown_camera_control.hpp
Go to the documentation of this file.
1#ifndef GUIK_TOPDOWN_CAMERA_CONTROL_HPP
2#define GUIK_TOPDOWN_CAMERA_CONTROL_HPP
3
5
6namespace guik {
7
9public:
10 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
11
14 virtual ~TopDownCameraControl() override;
15
16 virtual void reset_center() override;
17 virtual void lookat(const Eigen::Vector3f& pt) override;
18 virtual void mouse(const Eigen::Vector2f& p, int button, bool down) override;
19 virtual void drag(const Eigen::Vector2f& p, int button) override;
20 virtual void scroll(const Eigen::Vector2f& rel) override;
21 virtual Eigen::Vector2f depth_range() const override;
22
23 virtual Eigen::Matrix4f view_matrix() const override;
24
25 virtual std::string name() const override { return "TopDownCameraControl"; }
26 virtual void load(std::istream& ist) override;
27 virtual void save(std::ostream& ost) const override;
28
29protected:
30 Eigen::Vector3f center_offset;
31 Eigen::Vector3f center;
32 double distance;
33
34 Eigen::Vector2f drag_last_pos;
35
38 double theta;
39};
40
41} // namespace guik
42
43#endif
Base class for camera control. This class defines the interface for controlling the camera in the vie...
Definition camera_control.hpp:19
bool left_button_down
Definition topdown_camera_control.hpp:36
virtual void scroll(const Eigen::Vector2f &rel) override
Scroll event callback. This method is called when the mouse wheel is scrolled.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW TopDownCameraControl()
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 void save(std::ostream &ost) const 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...
virtual void load(std::istream &ist) override
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.
Eigen::Vector3f center
Definition topdown_camera_control.hpp:31
Eigen::Vector3f center_offset
Definition topdown_camera_control.hpp:30
double distance
Definition topdown_camera_control.hpp:32
double theta
Definition topdown_camera_control.hpp:38
virtual ~TopDownCameraControl() override
Eigen::Vector2f drag_last_pos
Definition topdown_camera_control.hpp:34
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.
bool middle_button_down
Definition topdown_camera_control.hpp:37
TopDownCameraControl(double distance, double theta)
virtual std::string name() const override
Definition topdown_camera_control.hpp:25
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 reset_center() override
Reset the shift of the camera.
Definition drawable_container.hpp:9