improve vr controllers handling

This commit is contained in:
2019-05-22 14:14:34 +02:00
parent ed170e555d
commit 37491d9fe1
3 changed files with 46 additions and 41 deletions

View File

@@ -42,14 +42,14 @@ struct Vive
vr::IVRSystem* m_hmd = nullptr;
vr::IVRCompositor* m_comp = nullptr;
vr::IVRSettings* m_settings = nullptr;
ViveController m_controllers[2];
std::array<ViveController, 2> m_controllers;
glm::mat4 m_view[2];
glm::mat4 m_proj[2];
glm::mat4 m_pose;
bool m_active = false;
std::function<void(const glm::mat4& m_proj, const glm::mat4& m_view, const glm::mat4& m_pose)> on_draw = nullptr;
std::function<void(const ViveController&, ViveController::kButton, ViveController::kAction)> on_button = nullptr;
std::function<void(const ViveController&, ViveController::kButton, ViveController::kAction)> on_analog_button = nullptr;
std::function<void(const ViveController&, ViveController::kButton, ViveController::kAction, glm::vec2 axis)> on_button = nullptr;
std::function<void(const ViveController&, ViveController::kButton, ViveController::kAction, glm::vec2 force)> on_analog_button = nullptr;
bool Initialize();
void Terminate();