-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tracker.h
67 lines (50 loc) · 1.67 KB
/
Tracker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <osvr/PluginKit/PluginKit.h>
#include <osvr/PluginKit/TrackerInterfaceC.h>
#include <osvr/PluginKit/SkeletonInterfaceC.h>
#include <osvr/Util/Pose3C.h>
#include "VirtualMotionData.h"
#include "Analog.h"
namespace OSVRVirtualMotion {
/** @brief Handles tracker and skeleton interfaces */
class Tracker {
public:
Tracker(const osvr::pluginkit::DeviceToken& pDeviceToken,
Analog& analog, OSVR_DeviceInitOptions pOptions, const VirtualMotionData& pVirtualMotionData);
void update();
private:
enum Channel {
Elbow,
Wrist,
Palm,
ThumbMeta,
ThumbProx,
ThumbInter,
ThumbDist,
IndexMeta,
IndexProx,
IndexInter,
IndexDist,
MiddleMeta,
MiddleProx,
MiddleInter,
MiddleDist,
RingMeta,
RingProx,
RingInter,
RingDist,
PinkyMeta,
PinkyProx,
PinkyInter,
PinkyDist,
ChannelsPerHand //must be the last element
};
const VirtualMotionData& mVirtualMotionData;
const osvr::pluginkit::DeviceToken& mDeviceToken;
OSVR_TrackerDeviceInterface mTrackerInterface;
OSVR_SkeletonDeviceInterface mSkeletonInterface;
Analog& mAnalog;
bool sendGlove(uint32 pGloveIndex, OSVR_ChannelCount pSkeletonChannel, OSVR_TimeValue pTimestamp);
void sendPose(Channel pChannel, bool pIsLeft, const double pVirtualMotionQuat[4]);
OSVR_Quaternion getOsvrQuaternion(const double pVirtualMotionQuat[4], bool pIsLeft);
};
}