From e17adf12f96ab5b45ae10061f9290314615ead25 Mon Sep 17 00:00:00 2001 From: Apollo Zhu <zhuzhiyu@cs.washington.edu> Date: Thu, 1 Jun 2023 11:24:29 -0700 Subject: [PATCH] Increase distance allowance --- VAST/NearbyInteraction/TagPlayerView2D.swift | 25 ++++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/VAST/NearbyInteraction/TagPlayerView2D.swift b/VAST/NearbyInteraction/TagPlayerView2D.swift index 465327e..09c5149 100644 --- a/VAST/NearbyInteraction/TagPlayerView2D.swift +++ b/VAST/NearbyInteraction/TagPlayerView2D.swift @@ -195,10 +195,10 @@ struct TagPlayer2D: View { case .device: if realWorld <= normalizationMode.threshold { return sqrt(normalized) * (2 / 3) - } else if realWorld <= 10 { + } else if realWorld <= 32 { return log10(normalized) / 4 + 2 / 3 } else { - return CGFloat(realWorld) / 5 - 1 + return CGFloat(realWorld) / 10 - 2 } } } @@ -235,14 +235,19 @@ struct TagPlayerView2D_Previews: PreviewProvider { NavigationStack { TagPlayer2D(players: [ "0.0": (distance: 0.0, direction: .init(x: -1, y: 0, z: 0)), - "0.3": (distance: 0.3, direction: .init(x: -1/3, y: 0, z: 0)), - "0.5": (distance: 0.5, direction: .init(x: 0, y: 0, z: 0)), - "1.0": (distance: 1.0, direction: .init(x: 1/4, y: 0, z: 0)), - "1.5": (distance: 1.5, direction: .init(x: 1/3, y: 0, z: 0)), - "5.0": (distance: 5.0, direction: .init(x: 1/2, y: 0, z: 0)), - "10.": (distance: 10, direction: .init(x: 7/12, y: 0, z: 0)), - "15.": (distance: 15, direction: .init(x: 2/3, y: 0, z: 0)), - "20.": (distance: 20, direction: .init(x: 5/6, y: 0, z: 0)), + "0.3": (distance: 0.3, direction: .init(x: -5/6, y: 0, z: 0)), + "0.5": (distance: 0.5, direction: .init(x: -2/3, y: 0, z: 0)), + "1.0": (distance: 1.0, direction: .init(x: -7/12, y: 0, z: 0)), + "1.5": (distance: 1.5, direction: .init(x: -1/2, y: 0, z: 0)), + "5.0": (distance: 5.0, direction: .init(x: -1/3, y: 0, z: 0)), + "10.": (distance: 10, direction: .init(x: -1/4, y: 0, z: 0)), + "15.": (distance: 15, direction: .init(x: 0, y: 0, z: 0)), + "20.": (distance: 20, direction: .init(x: 1/4, y: 0, z: 0)), + "30.": (distance: 30, direction: .init(x: 1/3, y: 0, z: 0)), + "40.": (distance: 40, direction: .init(x: 1/2, y: 0, z: 0)), + "50.": (distance: 50, direction: .init(x: 7/12, y: 0, z: 0)), + "60.": (distance: 60, direction: .init(x: 2/3, y: 0, z: 0)), + "75.": (distance: 75, direction: .init(x: 5/6, y: 0, z: 0)), ], normalizationMode: .device) } } -- GitLab