1#ifndef GLK_CAMERA_CONTROL_HPP
2#define GLK_CAMERA_CONTROL_HPP
8#include <Eigen/Geometry>
28 virtual void lookat(
const Eigen::Vector3f& pt) {}
33 virtual void lookat(
const Eigen::Isometry3f& T_world_sensor) {
lookat(T_world_sensor.translation()); }
35 virtual void lookat(
const Eigen::Isometry3d& T_world_sensor) {
lookat(T_world_sensor.cast<
float>()); }
41 virtual void mouse(
const Eigen::Vector2f& p,
int button,
bool down) {}
46 virtual void drag(
const Eigen::Vector2f& p,
int button) {}
50 virtual void scroll(
const Eigen::Vector2f& rel) {}
61 virtual void arrow(
const Eigen::Vector2f& p) {}
65 virtual Eigen::Vector2f
depth_range()
const {
return Eigen::Vector2f(0.0f, 1.0f); }
72 virtual std::string
name()
const {
return "CameraControl"; }
73 virtual void load(std::istream& ist) {}
74 virtual void save(std::ostream& ost)
const {}
Base class for camera control. This class defines the interface for controlling the camera in the vie...
Definition camera_control.hpp:19
virtual Eigen::Vector2f depth_range() const
Get the depth range of the camera. This method can be overridden by derived classes to specify a cust...
Definition camera_control.hpp:65
virtual void arrow(const Eigen::Vector2f &p)
Keyboard arrow key event callback. This method is called while the user is pressing the arrow keys.
Definition camera_control.hpp:61
virtual std::string name() const
Definition camera_control.hpp:72
virtual void lookat(const Eigen::Isometry3d &T_world_sensor)
Definition camera_control.hpp:35
virtual void update()
Update the camera state. This method can be called every frame to update the camera based on user inp...
Definition camera_control.hpp:53
virtual void drag(const Eigen::Vector2f &p, int button)
Mouse drag event callback. This method is called when the mouse is moved while a button is pressed.
Definition camera_control.hpp:46
virtual Eigen::Matrix4f view_matrix() const =0
Get the view matrix of the camera. This method must be implemented by derived classes to return the c...
virtual void load(std::istream &ist)
Definition camera_control.hpp:73
virtual void lookat(const Eigen::Isometry3f &T_world_sensor)
Move the camera to look at the given transform. The camera will look at the translation part of the t...
Definition camera_control.hpp:33
virtual void save(std::ostream &ost) const
Definition camera_control.hpp:74
virtual void reset_center()
Reset the shift of the camera.
Definition camera_control.hpp:24
virtual void lookat(const Eigen::Vector3f &pt)
Move the camera to look at the given point. The point is expected to be in world coordinates.
Definition camera_control.hpp:28
virtual void scroll(const Eigen::Vector2f &rel)
Scroll event callback. This method is called when the mouse wheel is scrolled.
Definition camera_control.hpp:50
virtual ~CameraControl()
Definition camera_control.hpp:21
virtual void updown(double p)
Keyboard page up/down event callback. This method is called while the user is pressing the page up/do...
Definition camera_control.hpp:57
virtual void mouse(const Eigen::Vector2f &p, int button, bool down)
Mouse event callback. This method is called when a mouse button is pressed or released.
Definition camera_control.hpp:41
Definition drawable_container.hpp:9
std::ostream & operator<<(std::ostream &ost, const CameraControl &cam)
std::istream & operator>>(std::istream &ist, CameraControl &cam)