iridescence
Loading...
Searching...
No Matches
guik::OrbitCameraControlXY Class Reference

Orbit camera control (Up vector is locked to Z axis) Left button: rotate (pan/tilt) Middle or Right button: XY translate Middle & Right button: Z translate Scroll wheel: zoom in/out. More...

#include <orbit_camera_control_xy.hpp>

Inheritance diagram for guik::OrbitCameraControlXY:
Collaboration diagram for guik::OrbitCameraControlXY:

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW OrbitCameraControlXY ()
 OrbitCameraControlXY (double theta, double phi, double distance)
virtual ~OrbitCameraControlXY () override
virtual void reset_center () override
 Reset the shift of the camera.
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.
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 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.
virtual void scroll (const Eigen::Vector2f &rel) override
 Scroll event callback. This method is called when the mouse wheel is scrolled.
virtual void updown (double p) override
 Keyboard page up/down event callback. This method is called while the user is pressing the page up/down keys.
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.
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 custom depth range for rendering.
virtual Eigen::Quaternionf rotation () const
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 current view transformation matrix.
virtual std::string name () const override
virtual void load (std::istream &ist) override
virtual void save (std::ostream &ost) const override
Public Member Functions inherited from guik::CameraControl
virtual ~CameraControl ()
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 transform, and optionally align its orientation with the rotation part.
virtual void lookat (const Eigen::Isometry3d &T_world_sensor)
virtual void update ()
 Update the camera state. This method can be called every frame to update the camera based on user input or animations.

Protected Attributes

Eigen::Vector3f center_offset
Eigen::Vector3f center
double distance
Eigen::Vector2f drag_last_pos
bool left_button_down
bool right_button_down
double theta
double phi
bool middle_button_down

Detailed Description

Orbit camera control (Up vector is locked to Z axis) Left button: rotate (pan/tilt) Middle or Right button: XY translate Middle & Right button: Z translate Scroll wheel: zoom in/out.

Constructor & Destructor Documentation

◆ OrbitCameraControlXY() [1/2]

EIGEN_MAKE_ALIGNED_OPERATOR_NEW guik::OrbitCameraControlXY::OrbitCameraControlXY ( )

◆ OrbitCameraControlXY() [2/2]

guik::OrbitCameraControlXY::OrbitCameraControlXY ( double theta,
double phi,
double distance )

◆ ~OrbitCameraControlXY()

virtual guik::OrbitCameraControlXY::~OrbitCameraControlXY ( )
overridevirtual

Member Function Documentation

◆ arrow()

virtual void guik::OrbitCameraControlXY::arrow ( const Eigen::Vector2f & p)
overridevirtual

Keyboard arrow key event callback. This method is called while the user is pressing the arrow keys.

Parameters
pThe amount of movement in the x and y directions.

Reimplemented from guik::CameraControl.

◆ depth_range()

virtual Eigen::Vector2f guik::OrbitCameraControlXY::depth_range ( ) const
overridevirtual

Get the depth range of the camera. This method can be overridden by derived classes to specify a custom depth range for rendering.

Returns
The near and far depth values as a 2D vector (x: near, y: far).

Reimplemented from guik::CameraControl.

◆ drag()

virtual void guik::OrbitCameraControlXY::drag ( const Eigen::Vector2f & p,
int button )
overridevirtual

Mouse drag event callback. This method is called when the mouse is moved while a button is pressed.

Parameters
pThe current mouse position in screen coordinates (pixels).
buttonThe mouse button index (0: left, 1: right, 2: middle).

Reimplemented from guik::CameraControl.

Reimplemented in guik::OrbitCameraControlXZ.

◆ load()

virtual void guik::OrbitCameraControlXY::load ( std::istream & ist)
overridevirtual

Reimplemented from guik::CameraControl.

Reimplemented in guik::OrbitCameraControlXZ.

◆ lookat()

virtual void guik::OrbitCameraControlXY::lookat ( const Eigen::Vector3f & pt)
overridevirtual

Move the camera to look at the given point. The point is expected to be in world coordinates.

Parameters
ptThe point to look at, in world coordinates.

Reimplemented from guik::CameraControl.

◆ mouse()

virtual void guik::OrbitCameraControlXY::mouse ( const Eigen::Vector2f & p,
int button,
bool down )
overridevirtual

Mouse event callback. This method is called when a mouse button is pressed or released.

Parameters
pThe current mouse position in screen coordinates (pixels).
buttonThe mouse button index (0: left, 1: right, 2: middle).
downTrue if the button is pressed, false if released.

Reimplemented from guik::CameraControl.

◆ name()

virtual std::string guik::OrbitCameraControlXY::name ( ) const
inlineoverridevirtual

Reimplemented from guik::CameraControl.

Reimplemented in guik::OrbitCameraControlXZ.

◆ reset_center()

virtual void guik::OrbitCameraControlXY::reset_center ( )
overridevirtual

Reset the shift of the camera.

Reimplemented from guik::CameraControl.

◆ rotation()

virtual Eigen::Quaternionf guik::OrbitCameraControlXY::rotation ( ) const
virtual

Reimplemented in guik::OrbitCameraControlXZ.

◆ save()

virtual void guik::OrbitCameraControlXY::save ( std::ostream & ost) const
overridevirtual

Reimplemented from guik::CameraControl.

Reimplemented in guik::OrbitCameraControlXZ.

◆ scroll()

virtual void guik::OrbitCameraControlXY::scroll ( const Eigen::Vector2f & rel)
overridevirtual

Scroll event callback. This method is called when the mouse wheel is scrolled.

Parameters
relThe relative scroll amount.

Reimplemented from guik::CameraControl.

◆ updown()

virtual void guik::OrbitCameraControlXY::updown ( double p)
overridevirtual

Keyboard page up/down event callback. This method is called while the user is pressing the page up/down keys.

Parameters
pThe amount of movement. Positive for page up, negative for page down.

Reimplemented from guik::CameraControl.

◆ view_matrix()

virtual Eigen::Matrix4f guik::OrbitCameraControlXY::view_matrix ( ) const
overridevirtual

Get the view matrix of the camera. This method must be implemented by derived classes to return the current view transformation matrix.

Returns
The 4x4 view matrix as an Eigen::Matrix4f.

Implements guik::CameraControl.

Reimplemented in guik::OrbitCameraControlXZ.

Member Data Documentation

◆ center

Eigen::Vector3f guik::OrbitCameraControlXY::center
protected

◆ center_offset

Eigen::Vector3f guik::OrbitCameraControlXY::center_offset
protected

◆ distance

double guik::OrbitCameraControlXY::distance
protected

◆ drag_last_pos

Eigen::Vector2f guik::OrbitCameraControlXY::drag_last_pos
protected

◆ left_button_down

bool guik::OrbitCameraControlXY::left_button_down
protected

◆ middle_button_down

bool guik::OrbitCameraControlXY::middle_button_down
protected

◆ phi

double guik::OrbitCameraControlXY::phi
protected

◆ right_button_down

bool guik::OrbitCameraControlXY::right_button_down
protected

◆ theta

double guik::OrbitCameraControlXY::theta
protected

The documentation for this class was generated from the following file: