mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 06:00:09 +02:00
Keep a screen's controls with it when the layout moves it
ft-screens read a screen's pose back from SteamVR right after setting it to place its controls. SteamVR could still return the old pose, so after Arrange now (or a layout reset) the bar and buttons stayed where the screen had been. ft-screens now keeps each screen's pose itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f70073b140
commit
951fe139b1
1 file changed
+6
-2
+6
-2
@@ -205,6 +205,7 @@ struct Screen {
|
||||
float alpha = 1;
|
||||
vr::TrackedDeviceIndex_t pinned = kNone; // riding on this controller
|
||||
Mat pinRel = Identity(); // controller -> screen
|
||||
Mat pose = Identity(); // where it is in the room, when not pinned
|
||||
Drag drag = Drag::None;
|
||||
vr::TrackedDeviceIndex_t dragDevice = kNone;
|
||||
Mat dragRel = Identity(); // device -> screen, while moving
|
||||
@@ -444,8 +445,10 @@ bool ScreenPose(const Screen &s, Mat *out) {
|
||||
*out = Mul(d, s.pinRel);
|
||||
return true;
|
||||
}
|
||||
vr::ETrackingUniverseOrigin origin;
|
||||
return vr::VROverlay()->GetOverlayTransformAbsolute(s.overlay, &origin, out) == vr::VROverlayError_None;
|
||||
// Our own copy: reading it back from SteamVR right after setting it could return the
|
||||
// old pose, which left a moved screen's controls behind.
|
||||
*out = s.pose;
|
||||
return true;
|
||||
}
|
||||
|
||||
// The controls' size from both the screen's width and its distance from the head (the
|
||||
@@ -533,6 +536,7 @@ void RefreshChrome() {
|
||||
|
||||
void SetAbsolute(Screen &s, const Mat &pose) {
|
||||
s.pinned = kNone;
|
||||
s.pose = pose;
|
||||
vr::VROverlay()->SetOverlayTransformAbsolute(s.overlay, vr::TrackingUniverseStanding, &pose);
|
||||
PlaceChrome(s);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user