Trackball camera control class.
More...
#include <CameraControl.h>
Trackball camera control class.
This class implements the control of the Trackball camera by capturing GLFW mouse events from the target window
- Author
- Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de
Definition at line 16 of file CameraControl.h.
◆ mouseEvent
Enumerator |
---|
none | |
start_turn | |
turn | |
start_pan | |
pan | |
Definition at line 42 of file CameraControl.h.
◆ CCameraControl()
DirectGraphicalModels::vis::CCameraControl::CCameraControl |
( |
GLFWwindow * |
window, |
|
|
float |
theta = 0.0f , |
|
|
float |
phi = -glm::pi<float>() / 2 , |
|
|
float |
radius = 2.4f , |
|
|
float |
turnSpeed = 0.004f , |
|
|
float |
scrollSpeed = 0.33f , |
|
|
float |
panSpeed = 0.01f |
|
) |
| |
Constructor.
The camera is defined in polar coordinate system with the parameters theta, phi and radius in point \(P\) and looks at the origin \(O\), which is initially situated at the zero point.
- Parameters
-
window | The window that received the mouse evenents |
theta | The azimuth (or azimuthal angle) measured from the azimuth reference direction to the orthogonal projection of the line segment \(OP\) on the reference plane |
phi | The inclination (or polar angle) between the zenith direction and the line segment \(OP\) |
radius | The radial distance of the camera to origin, i.e. the Euclidian distance between \(O\) and \(P\) |
turnSpeed | The rotation speed |
scrollSpeed | The zoom speed |
panSpeed | The panning speed |
Definition at line 6 of file CameraControl.cpp.
◆ ~CCameraControl()
virtual DirectGraphicalModels::vis::CCameraControl::~CCameraControl |
( |
void |
| ) |
|
|
inlinevirtual |
◆ cursorPosCallback()
void DirectGraphicalModels::vis::CCameraControl::cursorPosCallback |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
|
private |
◆ mouseButtonCallback()
void DirectGraphicalModels::vis::CCameraControl::mouseButtonCallback |
( |
int |
button, |
|
|
int |
action, |
|
|
int |
mods |
|
) |
| |
|
private |
◆ scrollCallback()
void DirectGraphicalModels::vis::CCameraControl::scrollCallback |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
|
private |
◆ m_mouseEvent
mouseEvent DirectGraphicalModels::vis::CCameraControl::m_mouseEvent |
|
private |
◆ m_mouseLastPos
glm::vec2 DirectGraphicalModels::vis::CCameraControl::m_mouseLastPos |
|
private |
◆ m_panSpeed
float DirectGraphicalModels::vis::CCameraControl::m_panSpeed |
|
private |
◆ m_scrollSpeed
float DirectGraphicalModels::vis::CCameraControl::m_scrollSpeed |
|
private |
◆ m_turnSpeed
float DirectGraphicalModels::vis::CCameraControl::m_turnSpeed |
|
private |
The documentation for this class was generated from the following files: