Skip to content

Commit dddb352

Browse files
committed
Added icons and icon paths
1 parent 8baffda commit dddb352

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed
Loading
Loading

driver_tutorial_hmd/src/Driver/HMDDevice.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ void TutorialDriver::HMDDevice::update(std::vector<vr::VREvent_t> events)
4040
pose.qRotation.y = pose_rot.y;
4141
pose.qRotation.z = pose_rot.z;
4242

43+
// Update position based on rotation
4344
linalg::vec<float, 3> forward_vec{-1.0f * (GetAsyncKeyState(0x44) == 0) + 1.0f * (GetAsyncKeyState(0x41) == 0), 0, 0};
44-
4545
linalg::vec<float, 3> right_vec{0, 0, 1.0f * (GetAsyncKeyState(0x57) == 0) - 1.0f * (GetAsyncKeyState(0x53) == 0) };
46-
4746
linalg::vec<float, 3> final_dir = forward_vec + right_vec;
4847
if (linalg::length(final_dir) > 0.01) {
4948
final_dir = linalg::normalize(final_dir) * (float)deltaTimeSeconds;
@@ -86,7 +85,18 @@ vr::EVRInitError TutorialDriver::HMDDevice::Activate(uint32_t unObjectId)
8685
vr::VRProperties()->SetStringProperty(props, vr::Prop_ModelNumber_String, "Tutorial HMD Device");
8786

8887
// Set up a rendermodel name
89-
vr::VRProperties()->SetStringProperty(props, vr::Prop_RenderModelName_String, "tutorial_hmd_model");
88+
vr::VRProperties()->SetStringProperty(props, vr::Prop_RenderModelName_String, "{tutorial_hmd}tutorial_hmd_model");
89+
90+
// Set up icon paths
91+
vr::VRProperties()->SetStringProperty(props, vr::Prop_NamedIconPathDeviceReady_String, "{tutorial_hmd}/icons/hmd_ready.png");
92+
93+
vr::VRProperties()->SetStringProperty(props, vr::Prop_NamedIconPathDeviceOff_String, "{tutorial_hmd}/icons/hmd_not_ready.png");
94+
vr::VRProperties()->SetStringProperty(props, vr::Prop_NamedIconPathDeviceSearching_String, "{tutorial_hmd}/icons/hmd_not_ready.png");
95+
vr::VRProperties()->SetStringProperty(props, vr::Prop_NamedIconPathDeviceSearchingAlert_String, "{tutorial_hmd}/icons/hmd_not_ready.png");
96+
vr::VRProperties()->SetStringProperty(props, vr::Prop_NamedIconPathDeviceReadyAlert_String, "{tutorial_hmd}/icons/hmd_not_ready.png");
97+
vr::VRProperties()->SetStringProperty(props, vr::Prop_NamedIconPathDeviceNotReady_String, "{tutorial_hmd}/icons/hmd_not_ready.png");
98+
vr::VRProperties()->SetStringProperty(props, vr::Prop_NamedIconPathDeviceStandby_String, "{tutorial_hmd}/icons/hmd_not_ready.png");
99+
vr::VRProperties()->SetStringProperty(props, vr::Prop_NamedIconPathDeviceAlertLow_String, "{tutorial_hmd}/icons/hmd_not_ready.png");
90100

91101
this->m_lastFrameTime = std::chrono::system_clock::now();
92102

0 commit comments

Comments
 (0)