Skip to content

Commit bd4524e

Browse files
committed
Remove universe calculation.
1 parent 24481a7 commit bd4524e

2 files changed

Lines changed: 1 addition & 22 deletions

File tree

src/TrackerDevice.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void SlimeVRDriver::TrackerDevice::Update() {
151151
system_click_value, 0);
152152
}
153153

154-
// Target pose: controllers always use SlimeVR + active correction (position + rotation); trackers use last SlimeVR pose.
154+
// Target pose: controllers use SlimeVR + offset; trackers use last SlimeVR pose.
155155
vr::DriverPose_t target = last_pose_atomic_.load();
156156
if (is_controller_) {
157157
auto offset = GetDriver()->GetHandPositionOffsetInDriverSpace(is_left_hand_);
@@ -161,10 +161,8 @@ void SlimeVRDriver::TrackerDevice::Update() {
161161
}
162162
vr::HmdQuaternion_t corr =
163163
GetDriver()->GetHandRotationCorrectionInDriverSpace(is_left_hand_);
164-
// target.qRotation = SlimeVR_rot * correction (apply correction after SlimeVR)
165164
target.qRotation = QuatMultiply(target.qRotation, corr);
166165
}
167-
// Lerp from current toward target to reduce jitter and smooth transitions.
168166
if (!smoothed_pose_.has_value())
169167
smoothed_pose_ = target;
170168
else
@@ -192,21 +190,6 @@ void SlimeVRDriver::TrackerDevice::PositionMessage(
192190
pose.qRotation.y = position.qy();
193191
pose.qRotation.z = position.qz();
194192

195-
auto current_universe = GetDriver()->GetCurrentUniverse();
196-
if (current_universe.has_value()) {
197-
auto trans = current_universe.value();
198-
199-
// TODO: set this once, somewhere?
200-
pose.vecWorldFromDriverTranslation[0] = -trans.translation.v[0];
201-
pose.vecWorldFromDriverTranslation[1] = -trans.translation.v[1];
202-
pose.vecWorldFromDriverTranslation[2] = -trans.translation.v[2];
203-
204-
pose.qWorldFromDriverRotation.w = cos(trans.yaw / 2);
205-
pose.qWorldFromDriverRotation.x = 0;
206-
pose.qWorldFromDriverRotation.y = sin(trans.yaw / 2);
207-
pose.qWorldFromDriverRotation.z = 0;
208-
}
209-
210193
bool double_tap = false;
211194
bool triple_tap = false;
212195

src/VRDriver.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,6 @@ SlimeVRDriver::VRDriver::GetHandPositionOffsetInDriverSpace(bool left_hand) {
612612
tracking = &hand_offset_right_tracking_;
613613
if (!tracking)
614614
return std::nullopt;
615-
// Return offset in the same space as the pose we add it to. The controller
616-
// pose is in tracking space when universe is set (device uses worldFromDriver),
617-
// else driver space; we store offset in that same space, so return as-is.
618615
return std::array<float, 3>{{(*tracking)[0], (*tracking)[1], (*tracking)[2]}};
619616
}
620617

@@ -873,7 +870,6 @@ bool SlimeVRDriver::VRDriver::ExternalHandNearEdgeOfFov(
873870
void SlimeVRDriver::VRDriver::UpdateHandCorrectionFromPoses(
874871
bool left_hand, const vr::DriverPose_t &vd_pose,
875872
const vr::DriverPose_t &slimevr_pose) {
876-
// No conversion: offset = VD - SlimeVR (same space as raw pose swap used).
877873
float alpha = config_hand_offset_ema_alpha_;
878874
if (left_hand) {
879875
if (!hand_offset_left_valid_) {

0 commit comments

Comments
 (0)