vr controlled ui

This commit is contained in:
2019-06-01 00:54:56 +02:00
parent 20582dafa8
commit c7a2a92b52
5 changed files with 50 additions and 29 deletions

View File

@@ -42,6 +42,7 @@ struct VRController
Trigger,
Menu,
Grip,
A,
COUNT,
};
enum class kAction
@@ -53,7 +54,9 @@ struct VRController
std::array<bool, (int)kButton::COUNT> m_analog_buttons;
glm::mat4 m_mat;
bool m_valid = false;
virtual float get_trigger_value() { return 1.f; }
glm::vec3 get_pos() const { return m_mat[3]; }
glm::vec3 get_pos_n() const { return glm::normalize(xyz(m_mat[3])); }
virtual float get_trigger_value() const { return 1.f; }
};
@@ -114,8 +117,7 @@ public:
bool ui_rtl = false;
bool vr_active = false;
bool vr_only = false;
glm::mat4 vr_controller;
glm::vec3 vr_controller_pos;
VRController vr_controllers[2];
float vr_pressure = 1.f;
glm::mat4 vr_rot{ 0 };
glm::mat4 vr_uirot{ 0 };