-
Notifications
You must be signed in to change notification settings - Fork 60
/
TrackingReferenceDevice.hpp
40 lines (29 loc) · 1.27 KB
/
TrackingReferenceDevice.hpp
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
#pragma once
#include <chrono>
#include <cmath>
#include <linalg.h>
#include <Driver/IVRDevice.hpp>
#include <Native/DriverFactory.hpp>
namespace ExampleDriver {
class TrackingReferenceDevice : public IVRDevice {
public:
TrackingReferenceDevice(std::string serial);
~TrackingReferenceDevice() = default;
// Inherited via IVRDevice
virtual std::string GetSerial() override;
virtual void Update() override;
virtual vr::TrackedDeviceIndex_t GetDeviceIndex() override;
virtual DeviceType GetDeviceType() override;
virtual vr::EVRInitError Activate(uint32_t unObjectId) override;
virtual void Deactivate() override;
virtual void EnterStandby() override;
virtual void* GetComponent(const char* pchComponentNameAndVersion) override;
virtual void DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize) override;
virtual vr::DriverPose_t GetPose() override;
private:
vr::TrackedDeviceIndex_t device_index_ = vr::k_unTrackedDeviceIndexInvalid;
std::string serial_;
vr::DriverPose_t last_pose_ = IVRDevice::MakeDefaultPose();
float random_angle_rad_;
};
};