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

#include <fps_camera_control.hpp>

Inheritance diagram for guik::FPSCameraControl:
Collaboration diagram for guik::FPSCameraControl:

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW FPSCameraControl (const Eigen::Vector2i &canvas_size)
 ~FPSCameraControl () override
void set_mouse_senstivity (double mouse_sensitivity_pitch=0.01, double mouse_sensitivity_yaw=0.01)
void set_translation_speed (double speed=0.05)
void set_size (const Eigen::Vector2i &size) override
void set_fovy_range (double min_fovy_deg, double max_fovy_deg, double default_fovy_deg=60.0)
void reset_fovy ()
void lock_fovy ()
void unlock_fovy ()
void set_fovy (double fovy_deg)
void set_depth_range (const Eigen::Vector2f &range) override
Eigen::Matrix4f projection_matrix () const override
void set_pose (const Eigen::Vector3f &pos, double yaw_deg, double pitch_deg)
void reset_center () override
 Reset the shift of the camera.
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.
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.
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.
void scroll (const Eigen::Vector2f &rel) override
 Scroll event callback. This method is called when the mouse wheel is scrolled.
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.
void arrow (const Eigen::Vector2f &p) override
 Keyboard arrow key event callback. This method is called while the user is pressing the arrow keys.
void update () override
 Update the camera state. This method can be called every frame to update the camera based on user input or animations.
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.
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.
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 std::string name () const
virtual void load (std::istream &ist)
virtual void save (std::ostream &ost) const
Public Member Functions inherited from guik::ProjectionControl
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ProjectionControl ()
virtual ~ProjectionControl ()
virtual void draw_ui ()
virtual std::string name () const
virtual void load (std::istream &ist)
virtual void save (std::ostream &ost) const

Constructor & Destructor Documentation

◆ FPSCameraControl()

EIGEN_MAKE_ALIGNED_OPERATOR_NEW guik::FPSCameraControl::FPSCameraControl ( const Eigen::Vector2i & canvas_size)

◆ ~FPSCameraControl()

guik::FPSCameraControl::~FPSCameraControl ( )
override

Member Function Documentation

◆ arrow()

void guik::FPSCameraControl::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()

Eigen::Vector2f guik::FPSCameraControl::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()

void guik::FPSCameraControl::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.

◆ lock_fovy()

void guik::FPSCameraControl::lock_fovy ( )

◆ lookat()

void guik::FPSCameraControl::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()

void guik::FPSCameraControl::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.

◆ projection_matrix()

Eigen::Matrix4f guik::FPSCameraControl::projection_matrix ( ) const
overridevirtual

◆ reset_center()

void guik::FPSCameraControl::reset_center ( )
overridevirtual

Reset the shift of the camera.

Reimplemented from guik::CameraControl.

◆ reset_fovy()

void guik::FPSCameraControl::reset_fovy ( )

◆ scroll()

void guik::FPSCameraControl::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.

◆ set_depth_range()

void guik::FPSCameraControl::set_depth_range ( const Eigen::Vector2f & range)
overridevirtual

◆ set_fovy()

void guik::FPSCameraControl::set_fovy ( double fovy_deg)

◆ set_fovy_range()

void guik::FPSCameraControl::set_fovy_range ( double min_fovy_deg,
double max_fovy_deg,
double default_fovy_deg = 60.0 )

◆ set_mouse_senstivity()

void guik::FPSCameraControl::set_mouse_senstivity ( double mouse_sensitivity_pitch = 0.01,
double mouse_sensitivity_yaw = 0.01 )

◆ set_pose()

void guik::FPSCameraControl::set_pose ( const Eigen::Vector3f & pos,
double yaw_deg,
double pitch_deg )

◆ set_size()

void guik::FPSCameraControl::set_size ( const Eigen::Vector2i & size)
overridevirtual

◆ set_translation_speed()

void guik::FPSCameraControl::set_translation_speed ( double speed = 0.05)

◆ unlock_fovy()

void guik::FPSCameraControl::unlock_fovy ( )

◆ update()

void guik::FPSCameraControl::update ( )
overridevirtual

Update the camera state. This method can be called every frame to update the camera based on user input or animations.

Reimplemented from guik::CameraControl.

◆ updown()

void guik::FPSCameraControl::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()

Eigen::Matrix4f guik::FPSCameraControl::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.


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