Skip to content

Commit a4799ba

Browse files
committed
Emulated HMD tracking fixes
1 parent 5514b5f commit a4799ba

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

driver_00Amethyst/BodyTracker.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,7 @@ void BodyTracker::update()
114114
_pose.poseIsValid = _valid;
115115
_pose.deviceIsConnected = _active;
116116

117-
auto pose = _pose; // Copy the pose
118-
119-
// Adjust for kinect-based HMD pose emulation
120-
if (m_is_head_override_active)
121-
{
122-
pose.vecPosition[0] += 1.0;
123-
pose.vecPosition[1] += 1.0;
124-
pose.vecPosition[2] += 1.0;
125-
}
126-
127-
vr::VRServerDriverHost()->TrackedDevicePoseUpdated(_index, pose, sizeof pose);
117+
vr::VRServerDriverHost()->TrackedDevicePoseUpdated(_index, _pose, sizeof _pose);
128118
}
129119
}
130120

driver_00Amethyst/ServerProvider.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,13 @@ bool ServerProvider::HandleDevicePoseUpdated(uint32_t openVRID, vr::DriverPose_t
215215
// Apply pose overrides for selected IDs
216216
if (pose_overrides_.contains(openVRID))
217217
{
218-
pose.qRotation.w = pose_overrides_[openVRID].Orientation.W;
219-
pose.qRotation.x = pose_overrides_[openVRID].Orientation.X;
220-
pose.qRotation.y = pose_overrides_[openVRID].Orientation.Y;
221-
pose.qRotation.z = pose_overrides_[openVRID].Orientation.Z;
218+
if (openVRID != 0)
219+
{
220+
pose.qRotation.w = pose_overrides_[openVRID].Orientation.W;
221+
pose.qRotation.x = pose_overrides_[openVRID].Orientation.X;
222+
pose.qRotation.y = pose_overrides_[openVRID].Orientation.Y;
223+
pose.qRotation.z = pose_overrides_[openVRID].Orientation.Z;
224+
}
222225

223226
pose.vecPosition[0] = pose_overrides_[openVRID].Position.X;
224227
pose.vecPosition[1] = pose_overrides_[openVRID].Position.Y;

0 commit comments

Comments
 (0)