-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCVirtualBodyTracker.h
45 lines (34 loc) · 1.39 KB
/
CVirtualBodyTracker.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
#pragma once
#include "CVirtualDevice.h"
enum class TRACKER_ROLE;
// A virtual body tracker device
// Allows different joints in the system to be available as tracking devices
class CVirtualBodyTracker : public CVirtualDevice
{
// The index for the tracker
size_t m_index;
CVirtualBodyTracker(const CVirtualBodyTracker &that) = delete;
CVirtualBodyTracker &operator=(const CVirtualBodyTracker &that) = delete;
// The last set of transforms that was set (used for interpolation)
std::deque<glm::mat4x4> m_transformCache;
bool cacheImmediate;
// The current transform set (used for interpolation)
glm::mat4x4 m_curTransform;
bool m_wasSet;
// The frame number recorded by the tracker (used for interpolation)
float frame;
double m_lCall;
double m_diff;
// Compute the transform based on the currently set values, and interpolate between them using the frame number
const glm::mat4x4 InterpolatedTransform() const;
void SetupProperties() override;
friend CServerDriver;
public:
// The role of this body tracker
TRACKER_ROLE role;
void RunFrame() override;
// Update the tracker with data from the body tracking service
void UpdateTransform(const glm::mat4x4 &newTransform);
explicit CVirtualBodyTracker(size_t p_index, TRACKER_ROLE rle, size_t frameSize, bool cachefast = false);
~CVirtualBodyTracker();
};