Direct Graphical Models
v.1.7.0
CameraControl.h
1
// Trackball camera control class
2
// Written by Sergey Kosov in 2016 for Project X
3
#pragma once
4
5
#include "TrackballCamera.h"
6
#include "GLFW/glfw3.h"
7
8
namespace
DirectGraphicalModels
{
namespace
vis
9
{
10
// ================================ Camera Control Class ===============================
16
class
CCameraControl
:
public
CTrackballCamera
17
{
18
public
:
31
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);
32
virtual
~CCameraControl
(
void
) {}
33
34
35
private
:
36
void
mouseButtonCallback
(
int
button,
int
action,
int
mods);
37
void
cursorPosCallback
(
double
x,
double
y);
38
void
scrollCallback
(
double
x,
double
y);
39
40
41
private
:
42
enum class
mouseEvent
{
none
,
start_turn
,
turn
,
start_pan
,
pan
};
43
44
mouseEvent
m_mouseEvent
;
45
glm::vec2
m_mouseLastPos
;
46
47
float
m_turnSpeed
;
48
float
m_scrollSpeed
;
49
float
m_panSpeed
;
50
};
51
} }
DirectGraphicalModels::vis::CCameraControl::scrollCallback
void scrollCallback(double x, double y)
Definition:
CameraControl.cpp:56
DirectGraphicalModels::vis::CCameraControl::mouseEvent::start_pan
DirectGraphicalModels::vis::CCameraControl::cursorPosCallback
void cursorPosCallback(double x, double y)
Definition:
CameraControl.cpp:38
DirectGraphicalModels::vis::CCameraControl::m_panSpeed
float m_panSpeed
Definition:
CameraControl.h:49
DirectGraphicalModels::vis::CCameraControl
Trackball camera control class.
Definition:
CameraControl.h:16
DirectGraphicalModels::vis::CCameraControl::m_turnSpeed
float m_turnSpeed
Definition:
CameraControl.h:47
DirectGraphicalModels
Definition:
AveragePrecision.cpp:4
DirectGraphicalModels::vis::CCameraControl::m_mouseEvent
mouseEvent m_mouseEvent
Definition:
CameraControl.h:44
DirectGraphicalModels::vis::CCameraControl::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.
Definition:
CameraControl.cpp:6
DirectGraphicalModels::vis::CCameraControl::mouseEvent::none
DirectGraphicalModels::vis::CCameraControl::mouseEvent::pan
DirectGraphicalModels::vis::CTrackballCamera
Trackball camera class.
Definition:
TrackballCamera.h:16
DirectGraphicalModels::vis::CCameraControl::~CCameraControl
virtual ~CCameraControl(void)
Definition:
CameraControl.h:32
DirectGraphicalModels::vis::CCameraControl::mouseEvent
mouseEvent
Definition:
CameraControl.h:42
DirectGraphicalModels::vis::CCameraControl::m_scrollSpeed
float m_scrollSpeed
Definition:
CameraControl.h:48
DirectGraphicalModels::vis::CCameraControl::mouseEvent::turn
DirectGraphicalModels::vis::CCameraControl::mouseEvent::start_turn
DirectGraphicalModels::vis::CCameraControl::mouseButtonCallback
void mouseButtonCallback(int button, int action, int mods)
Definition:
CameraControl.cpp:26
DirectGraphicalModels::vis::CCameraControl::m_mouseLastPos
glm::vec2 m_mouseLastPos
Definition:
CameraControl.h:45
modules
VIS
Trackball Camera
CameraControl.h
Generated on Thu Feb 21 2019 13:31:15 for Direct Graphical Models by
1.8.14