Gainput
v1.0.0
lib
include
gainput
gestures
GainputRotateGesture.h
1
2
#ifndef GAINPUTROTATEGESTURE_H_
3
#define GAINPUTROTATEGESTURE_H_
4
5
#ifdef GAINPUT_ENABLE_ROTATE_GESTURE
6
7
namespace
gainput
8
{
9
11
enum
RotateAction
12
{
13
RotateTriggered
,
14
RotateAngle
15
};
16
18
32
class
GAINPUT_LIBEXPORT
RotateGesture
:
public
InputGesture
33
{
34
public
:
36
RotateGesture
(
InputManager
& manager,
DeviceId
device,
unsigned
index,
DeviceVariant
variant);
38
~
RotateGesture
();
39
41
55
void
Initialize(
DeviceId
downDevice,
DeviceButtonId
downButton,
56
DeviceId
xAxisDevice,
DeviceButtonId
xAxis,
57
DeviceId
yAxisDevice,
DeviceButtonId
yAxis,
58
DeviceId
down2Device,
DeviceButtonId
downButton2,
59
DeviceId
xAxis2Device,
DeviceButtonId
xAxis2,
60
DeviceId
yAxis2Device,
DeviceButtonId
yAxis2);
61
62
bool
IsValidButtonId
(
DeviceButtonId
deviceButton)
const
{
return
deviceButton ==
RotateTriggered
|| deviceButton ==
RotateAngle
; }
63
64
ButtonType
GetButtonType
(
DeviceButtonId
deviceButton)
const
{ GAINPUT_ASSERT(IsValidButtonId(deviceButton));
return
deviceButton ==
RotateTriggered
?
BT_BOOL
:
BT_FLOAT
; }
65
66
protected
:
67
void
InternalUpdate(
InputDeltaState
* delta);
68
69
private
:
70
DeviceButtonSpec
downButton_;
71
DeviceButtonSpec
xAxis_;
72
DeviceButtonSpec
yAxis_;
73
DeviceButtonSpec
downButton2_;
74
DeviceButtonSpec
xAxis2_;
75
DeviceButtonSpec
yAxis2_;
76
77
bool
rotating_;
78
float
initialAngle_;
79
80
};
81
82
}
83
84
#endif
85
86
#endif
87
gainput::RotateGesture::GetButtonType
ButtonType GetButtonType(DeviceButtonId deviceButton) const
Returns the type of the given button.
Definition:
GainputRotateGesture.h:64
gainput::RotateAction
RotateAction
Buttons provided by the RotateGesture.
Definition:
GainputRotateGesture.h:11
gainput::InputManager
Manages all input devices and some other helpful stuff.
Definition:
GainputInputManager.h:24
gainput::BT_BOOL
A boolean value button, either down (true) or up (false).
Definition:
GainputInputDevice.h:12
gainput::ButtonType
ButtonType
Type of an input device button.
Definition:
GainputInputDevice.h:10
gainput::RotateGesture::IsValidButtonId
bool IsValidButtonId(DeviceButtonId deviceButton) const
Returns if the given button is valid for this device.
Definition:
GainputRotateGesture.h:62
gainput::InputDeltaState
Stores a list of input state changes.
Definition:
GainputInputDeltaState.h:9
gainput::DeviceButtonSpec
Describes a device button on a specific device.
Definition:
gainput.h:112
gainput::DeviceId
unsigned int DeviceId
ID of an input device.
Definition:
gainput.h:107
gainput::InputDevice::DeviceVariant
DeviceVariant
Variant of an input device type.
Definition:
GainputInputDevice.h:51
gainput::InputGesture
Base class for all input gestures.
Definition:
GainputGestures.h:41
gainput::BT_FLOAT
A floating-point value button, between -1.0f and 1.0f or 0.0f and 1.0f.
Definition:
GainputInputDevice.h:13
gainput::RotateTriggered
The button that triggers when both rotate buttons are down.
Definition:
GainputRotateGesture.h:13
gainput::DeviceButtonId
unsigned int DeviceButtonId
ID of a specific button unique to an input device.
Definition:
gainput.h:109
gainput::RotateGesture
A multi-touch rotate gesture.
Definition:
GainputRotateGesture.h:32
gainput::RotateAngle
The current rotation angle in radians if rotation is triggered (RotateTriggered). ...
Definition:
GainputRotateGesture.h:14
gainput
Contains all Gainput related classes, types, and functions.
Definition:
gainput.h:103
Generated on Wed Sep 6 2017 20:47:59 for Gainput by
1.8.13