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

Camera control that orbits around a tracked sensor pose. The camera always looks at the sensor position, with user-controlled azimuth/elevation and distance scaling. More...

#include <sensor_view_camera_control.hpp>

Inheritance diagram for guik::SensorViewCameraControl:
Collaboration diagram for guik::SensorViewCameraControl:

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW SensorViewCameraControl (const Eigen::Isometry3f &T_sensor_camera=Eigen::Translation3f(-5.0f, 0.0f, 0.1f) *Eigen::Isometry3f::Identity(), double smoothing_factor_trans=0.75, double smoothing_factor_rot=0.9)
virtual ~SensorViewCameraControl () override
void set_smoothing_factor (double trans, double rot)
 Set both smoothing factors. 0 = no smoothing (instant snap), 1 = maximum smoothing (very slow follow).
void set_smoothing_factor_trans (double factor)
 Set the translation smoothing factor.
void set_smoothing_factor_rot (double factor)
 Set the rotation smoothing factor.
void set_z_axis_alignment (bool enabled)
 Enable or disable z-axis alignment. When enabled (default), the camera up direction is locked to the world z-axis.
void set_sensor_pose (const Eigen::Isometry3f &T_world_sensor)
 Set the raw sensor pose (T_world_sensor).
template<typename Transform>
void set_sensor_pose (const Transform &T_world_sensor)
 Set the raw sensor pose using a generic transform.
virtual void lookat (const Eigen::Isometry3f &T_world_sensor) override
 Same as set_sensor_pose.
void set_sensor_camera_transform (const Eigen::Isometry3f &T_sensor_camera)
 Set the transform from sensor frame to camera frame (T_sensor_camera).
template<typename Transform>
void set_sensor_camera_transform (const Transform &T_sensor_camera)
 Set the transform from sensor frame to camera frame using a generic transform.
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 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::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
Public Member Functions inherited from guik::CameraControl
virtual ~CameraControl ()
virtual void reset_center ()
 Reset the shift of the camera.
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.
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.
virtual void updown (double p)
 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)
 Keyboard arrow key event callback. This method is called while the user is pressing the arrow keys.
virtual void load (std::istream &ist)
virtual void save (std::ostream &ost) const

Detailed Description

Camera control that orbits around a tracked sensor pose. The camera always looks at the sensor position, with user-controlled azimuth/elevation and distance scaling.

Constructor & Destructor Documentation

◆ SensorViewCameraControl()

EIGEN_MAKE_ALIGNED_OPERATOR_NEW guik::SensorViewCameraControl::SensorViewCameraControl ( const Eigen::Isometry3f & T_sensor_camera = Eigen::Translation3f(-5.0f, 0.0f, 0.1f) *Eigen::Isometry3f::Identity(),
double smoothing_factor_trans = 0.75,
double smoothing_factor_rot = 0.9 )
Parameters
T_sensor_cameraTransform from sensor frame to camera frame.
smoothing_factor_transSmoothing factor for translation in [0, 1]. 0 = no smoothing (instant snap), 1 = maximum smoothing (very slow follow).
smoothing_factor_rotSmoothing factor for rotation in [0, 1]. 0 = no smoothing (instant snap), 1 = maximum smoothing (very slow follow).

◆ ~SensorViewCameraControl()

virtual guik::SensorViewCameraControl::~SensorViewCameraControl ( )
overridevirtual

Member Function Documentation

◆ depth_range()

virtual Eigen::Vector2f guik::SensorViewCameraControl::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::SensorViewCameraControl::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.

◆ lookat()

virtual void guik::SensorViewCameraControl::lookat ( const Eigen::Isometry3f & T_world_sensor)
inlineoverridevirtual

Same as set_sensor_pose.

Parameters
T_world_sensor

Reimplemented from guik::CameraControl.

◆ mouse()

virtual void guik::SensorViewCameraControl::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::SensorViewCameraControl::name ( ) const
inlineoverridevirtual

Reimplemented from guik::CameraControl.

◆ scroll()

virtual void guik::SensorViewCameraControl::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_sensor_camera_transform() [1/2]

void guik::SensorViewCameraControl::set_sensor_camera_transform ( const Eigen::Isometry3f & T_sensor_camera)

Set the transform from sensor frame to camera frame (T_sensor_camera).

◆ set_sensor_camera_transform() [2/2]

template<typename Transform>
void guik::SensorViewCameraControl::set_sensor_camera_transform ( const Transform & T_sensor_camera)
inline

Set the transform from sensor frame to camera frame using a generic transform.

◆ set_sensor_pose() [1/2]

void guik::SensorViewCameraControl::set_sensor_pose ( const Eigen::Isometry3f & T_world_sensor)

Set the raw sensor pose (T_world_sensor).

◆ set_sensor_pose() [2/2]

template<typename Transform>
void guik::SensorViewCameraControl::set_sensor_pose ( const Transform & T_world_sensor)
inline

Set the raw sensor pose using a generic transform.

◆ set_smoothing_factor()

void guik::SensorViewCameraControl::set_smoothing_factor ( double trans,
double rot )

Set both smoothing factors. 0 = no smoothing (instant snap), 1 = maximum smoothing (very slow follow).

◆ set_smoothing_factor_rot()

void guik::SensorViewCameraControl::set_smoothing_factor_rot ( double factor)

Set the rotation smoothing factor.

◆ set_smoothing_factor_trans()

void guik::SensorViewCameraControl::set_smoothing_factor_trans ( double factor)

Set the translation smoothing factor.

◆ set_z_axis_alignment()

void guik::SensorViewCameraControl::set_z_axis_alignment ( bool enabled)

Enable or disable z-axis alignment. When enabled (default), the camera up direction is locked to the world z-axis.

◆ view_matrix()

virtual Eigen::Matrix4f guik::SensorViewCameraControl::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: