sinpin-vr/src/controller.h

43 lines
629 B
C
Raw Normal View History

#pragma once
#include "overlay.h"
#include "util.h"
2023-04-16 18:23:00 +02:00
#include <vector>
class App;
enum class ControllerSide
{
Left,
Right
};
class Controller
{
public:
Controller(App *app, ControllerSide hand);
TrackerID DeviceIndex();
vr::VRInputValueHandle_t InputHandle();
ControllerSide Side();
bool IsConnected();
2023-04-16 18:23:00 +02:00
void SetHidden(bool state);
void ReleaseOverlay();
2023-04-16 18:23:00 +02:00
void Update();
private:
void UpdateStatus();
void UpdateLaser();
App *_app;
Overlay _laser;
ControllerSide _side;
TrackerID _device_index;
vr::VRInputValueHandle_t _input_handle;
bool _is_connected;
2023-04-16 18:23:00 +02:00
bool _hidden;
Overlay *_grabbed_overlay;
};