ソースを参照

WIP: consider IPD for virtual noses

Marcel Zickler 3 年 前
コミット
8bb6f8826b

+ 1 - 0
.idea/.idea.VRCyling/.idea/contentModel.xml

@@ -851,6 +851,7 @@
               <e p="DoF" t="Include">
                 <e p="DynamicDoF.cs" t="Include" />
               </e>
+              <e p="IpdInfo.cs" t="Include" />
               <e p="Rendering" t="Include">
                 <e p="BokehFeature.cs" t="Include" />
                 <e p="BokehRenderPass.cs" t="Include" />

+ 24 - 22
.idea/.idea.VRCyling/.idea/workspace.xml

@@ -22,20 +22,14 @@
     <select />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="ae9d46da-fd77-45ea-9287-d8d155f44bcf" name="Default Changelist" comment="WIP: Vive Tracker initialization">
-      <change afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/IViveTracker.cs" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/IViveTracker.cs.meta" afterDir="false" />
+    <list default="true" id="ae9d46da-fd77-45ea-9287-d8d155f44bcf" name="Default Changelist" comment="Automatic tracker indeces">
+      <change afterPath="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Visual/IpdInfo.cs" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Visual/IpdInfo.cs.meta" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/contentModel.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/indexLayout.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/indexLayout.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.VRCyling/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Assembly-CSharp.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/Assembly-CSharp.csproj" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Materials/ViveTrackerMaterial.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Materials/ViveTrackerMaterial.mat" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scenes/MainScene.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/MainScene.unity" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/Tracking/FrontWheelTracker.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/FrontWheelTracker.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/Tracking/IdentifyTrackers.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/TrackerIndexManager.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/Tracking/IdentifyTrackers.cs.meta" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/TrackerIndexManager.cs.meta" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/Tracking/KineticLegTracker.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/KineticLegTracker.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache" beforeDir="false" afterPath="$PROJECT_DIR$/obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Visual/VirtualNose.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Visual/VirtualNose.cs" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/Assets/Scripts/Tracking/TrackerIndexManager.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Tracking/TrackerIndexManager.cs" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -65,7 +59,6 @@
   <component name="IdeDocumentHistory">
     <option name="CHANGED_PATHS">
       <list>
-        <option value="$PROJECT_DIR$/Assets/Scripts/Logging/RouteEventLogger.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Logging/Data/BikeGameObjectDataLogger.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Logging/Data/BikeSensorDataLogger.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Logging/Data/PolarAccDataLogger.cs" />
@@ -99,7 +92,6 @@
         <option value="$PROJECT_DIR$/Assets/Scripts/Wheels/SwitchColliderOnStanding.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Wheels/SlopeCollider.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Visual/DoF/DynamicDoF.cs" />
-        <option value="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Visual/VirtualNose.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Controller/Lean/LeanControllerBehaviour.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Controller/Lean/PolarLeanController.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Controller/SensorBikeController.cs" />
@@ -116,6 +108,8 @@
         <option value="$PROJECT_DIR$/Assets/Scripts/Tracking/FrontWheelTracker.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Tracking/KineticLegTracker.cs" />
         <option value="$PROJECT_DIR$/Assets/Scripts/Tracking/TrackerIndexManager.cs" />
+        <option value="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Visual/IpdInfo.cs" />
+        <option value="$PROJECT_DIR$/Assets/Scripts/SicknessReduction/Visual/VirtualNose.cs" />
       </list>
     </option>
   </component>
@@ -191,7 +185,7 @@
       <workItem from="1615970052613" duration="12089000" />
       <workItem from="1615987932942" duration="2186000" />
       <workItem from="1616403254170" duration="2841000" />
-      <workItem from="1616484098735" duration="3122000" />
+      <workItem from="1616484098735" duration="5139000" />
     </task>
     <task id="LOCAL-00001" summary="VR Stuff, Bicycle Animations">
       <created>1606399745852</created>
@@ -312,7 +306,14 @@
       <option name="project" value="LOCAL" />
       <updated>1616412877563</updated>
     </task>
-    <option name="localTasksCounter" value="18" />
+    <task id="LOCAL-00018" summary="Automatic tracker indeces">
+      <created>1616487420190</created>
+      <option name="number" value="00018" />
+      <option name="presentableId" value="LOCAL-00018" />
+      <option name="project" value="LOCAL" />
+      <updated>1616487420190</updated>
+    </task>
+    <option name="localTasksCounter" value="19" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -351,7 +352,8 @@
     <MESSAGE value="lean controller" />
     <MESSAGE value="Scene" />
     <MESSAGE value="WIP: Vive Tracker initialization" />
-    <option name="LAST_COMMIT_MESSAGE" value="WIP: Vive Tracker initialization" />
+    <MESSAGE value="Automatic tracker indeces" />
+    <option name="LAST_COMMIT_MESSAGE" value="Automatic tracker indeces" />
   </component>
   <component name="WindowStateProjectService">
     <state x="704" y="291" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1612943194023">
@@ -493,13 +495,13 @@
     <state x="69" y="76" width="1302" height="708" key="VCS.FileHistoryDialog/0.0.1440.860@0.0.1440.860" timestamp="1610365025117" />
     <state x="69" y="80" width="1302" height="741" key="VCS.FileHistoryDialog/0.0.1440.900@0.0.1440.900" timestamp="1608635342446" />
     <state x="98" y="98" width="1852" height="916" key="VCS.FileHistoryDialog/0.0.2048.1112@0.0.2048.1112" timestamp="1615979704751" />
-    <state x="589" y="269" key="Vcs.Push.Dialog.v2" timestamp="1616412879075">
+    <state x="589" y="269" key="Vcs.Push.Dialog.v2" timestamp="1616487421498">
       <screen x="0" y="0" width="2048" height="1112" />
     </state>
     <state x="414" y="208" key="Vcs.Push.Dialog.v2/0.0.1440.860@0.0.1440.860" timestamp="1610362459013" />
     <state x="414" y="218" key="Vcs.Push.Dialog.v2/0.0.1440.900@0.0.1440.900" timestamp="1608628624093" />
     <state x="552" y="252" key="Vcs.Push.Dialog.v2/0.0.1920.1040@0.0.1920.1040" timestamp="1610531923390" />
-    <state x="589" y="269" key="Vcs.Push.Dialog.v2/0.0.2048.1112@0.0.2048.1112" timestamp="1616412879075" />
+    <state x="589" y="269" key="Vcs.Push.Dialog.v2/0.0.2048.1112@0.0.2048.1112" timestamp="1616487421498" />
     <state width="726" height="436" key="XDebugger.FullValuePopup" timestamp="1608570184149">
       <screen x="0" y="0" width="1440" height="860" />
     </state>
@@ -527,24 +529,24 @@
     </state>
     <state x="300" y="85" width="1140" height="689" key="editAsTableFormatDialogDimension/0.0.1440.860@0.0.1440.860" timestamp="1610362422263" />
     <state x="400" y="103" key="editAsTableFormatDialogDimension/0.0.1920.1040@0.0.1920.1040" timestamp="1610533263726" />
-    <state x="524" y="37" width="1001" height="1037" key="find.popup" timestamp="1615988943747">
+    <state x="524" y="37" width="1001" height="1037" key="find.popup" timestamp="1616488733196">
       <screen x="0" y="0" width="2048" height="1112" />
     </state>
     <state x="368" y="29" width="703" height="801" key="find.popup/0.0.1440.860@0.0.1440.860" timestamp="1610363676930" />
     <state x="491" y="35" width="938" height="969" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1610533618773" />
-    <state x="524" y="37" width="1001" height="1037" key="find.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1615988943747" />
+    <state x="524" y="37" width="1001" height="1037" key="find.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1616488733196" />
     <state x="539" y="255" key="run.anything.popup" timestamp="1611924507844">
       <screen x="0" y="0" width="2048" height="1112" />
     </state>
     <state x="379" y="197" key="run.anything.popup/0.0.1440.860@0.0.1440.860" timestamp="1610374243030" />
     <state x="539" y="255" key="run.anything.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1611924507844" />
-    <state x="665" y="241" width="717" height="725" key="search.everywhere.popup" timestamp="1615989125736">
+    <state x="665" y="241" width="717" height="725" key="search.everywhere.popup" timestamp="1616487440405">
       <screen x="0" y="0" width="2048" height="1112" />
     </state>
     <state x="478" y="197" width="672" height="561" key="search.everywhere.popup/0.0.1440.860@0.0.1440.860" timestamp="1610362007792" />
     <state x="476" y="204" width="672" height="588" key="search.everywhere.popup/0.0.1440.900@0.0.1440.900" timestamp="1608636877159" />
     <state x="623" y="225" width="672" height="678" key="search.everywhere.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1610538285122" />
-    <state x="665" y="241" width="717" height="725" key="search.everywhere.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1615989125736" />
+    <state x="665" y="241" width="717" height="725" key="search.everywhere.popup/0.0.2048.1112@0.0.2048.1112" timestamp="1616487440405" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>

+ 1 - 0
Assembly-CSharp.csproj

@@ -334,6 +334,7 @@
      <Compile Include="Assets\AdvancedAnt\Scripts\SpeedDisplay.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Mesg.cs" />
      <Compile Include="Assets\Scripts\Tracking\IViveTracker.cs" />
+     <Compile Include="Assets\Scripts\SicknessReduction\Visual\IpdInfo.cs" />
      <None Include="Assets\TextMesh Pro\Shaders\TMPro.cginc" />
      <None Include="Assets\TextMesh Pro\Shaders\TMP_SDF-Mobile Overlay.shader" />
      <None Include="Assets\AdvancedAnt\Plugins\Ant\License.txt" />

+ 303 - 284
Assets/Scenes/MainScene.unity

@@ -26,7 +26,7 @@ RenderSettings:
   m_AmbientIntensity: 1
   m_AmbientMode: 0
   m_SubtractiveShadowColor: {r: 0.13296545, g: 0.19145328, b: 0.33962262, a: 1}
-  m_SkyboxMaterial: {fileID: 431321931}
+  m_SkyboxMaterial: {fileID: 1542390949}
   m_HaloStrength: 0
   m_FlareStrength: 1
   m_FlareFadeSpeed: 3
@@ -61729,6 +61729,7 @@ MonoBehaviour:
     type: 3}
   padding: {x: 0, y: 0, z: 0.03}
   adjustToIpd: 1
+  ipdFactor: 15.15
 --- !u!1001 &258602537
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -105702,288 +105703,6 @@ PrefabInstance:
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: a8075fecadfce7c4abe277fb835ca5c5, type: 3}
---- !u!21 &431321931
-Material:
-  serializedVersion: 6
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_Name: Sky 02
-  m_Shader: {fileID: 4800000, guid: 6fc9318f5193c094c98c0d450cd61e3b, type: 3}
-  m_ShaderKeywords: _BACKGROUNDMODE_COLORS _CLOUDSLITBYSUN_ON _DISABLEDIRECTIONLIGHT_ON
-    _ENABLECLOUDS_ON _ENABLEDIRECTIONLIGHT_ON _ENABLESUNMOONMASK_ON _ENABLESUNMOON_ON
-    _ENABLESUN_ON _USECUBEMAP_ON _USEENVIRONMENTGRADIENT_ON _USETEXTURE_ON
-  m_LightmapFlags: 0
-  m_EnableInstancingVariants: 0
-  m_DoubleSidedGI: 0
-  m_CustomRenderQueue: -1
-  stringTagMap: {}
-  disabledShaderPasses: []
-  m_SavedProperties:
-    serializedVersion: 3
-    m_TexEnvs:
-    - _BackgroundCubemap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _BumpMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _CloudsCubemap:
-        m_Texture: {fileID: 8900000, guid: ee7bf433ad404fe4cb5e19b8a93b3bed, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Cubemap:
-        m_Texture: {fileID: 8900000, guid: ae71550a4c81f73409f14f4d6eca2c0f, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _CubemapBG:
-        m_Texture: {fileID: 8900000, guid: b8d891a789549494aaa157c0edc53a12, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _DetailAlbedoMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _DetailMask:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _DetailNormalMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _EmissionMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _MainTex:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _MetallicGlossMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _MoonTexture:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Normal:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _OcclusionMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _ParallaxMap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _PatternCubemap:
-        m_Texture: {fileID: 8900000, guid: 3845b30ba2fbdee44a85e5ead4dd2974, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _PatternOverlay:
-        m_Texture: {fileID: 8900000, guid: 1f3407b97870a2e46864ac55deec53b0, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _SkyPatternOverlay:
-        m_Texture: {fileID: 8900000, guid: b8d891a789549494aaa157c0edc53a12, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Spherical:
-        m_Texture: {fileID: 2800000, guid: 61c0b9c0523734e0e91bc6043c72a490, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _StarsCubemap:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Sun:
-        m_Texture: {fileID: 2800000, guid: 19982f8bf5fa2ed42b65ac271d4f0279, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _SunTexture:
-        m_Texture: {fileID: 2800000, guid: dd566660fc358aa4098080e42ca0db56, type: 3}
-        m_Scale: {x: 0, y: 0}
-        m_Offset: {x: 1, y: 1}
-    - _Tex:
-        m_Texture: {fileID: 2800000, guid: 623f215c9cf5dc04aa628d4dd7b6bd73, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _Texture:
-        m_Texture: {fileID: 2800000, guid: 12726e6bff222df4cbbe3ebde547c297, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _TextureSample0:
-        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
-        m_Scale: {x: 4.46, y: 5.19}
-        m_Offset: {x: 0, y: 0}
-    - _TextureSample1:
-        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
-        m_Scale: {x: 1.46, y: -1.61}
-        m_Offset: {x: 1.05, y: 3.12}
-    - _TextureSample2:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _TopTexture0:
-        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _TwinklingTexture:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _scaledTexture:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _tex:
-        m_Texture: {fileID: 2800000, guid: 12726e6bff222df4cbbe3ebde547c297, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _texcoord:
-        m_Texture: {fileID: 0}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    - _texture:
-        m_Texture: {fileID: 2800000, guid: 64e7766099ad46747a07014e44d0aea1, type: 3}
-        m_Scale: {x: 1, y: 1}
-        m_Offset: {x: 0, y: 0}
-    m_Floats:
-    - _BackgroundCat: 1
-    - _BackgroundCubemapSpace: 0
-    - _BackgroundExposure: 1
-    - _BackgroundMode: 0
-    - _Banner: 1
-    - _BumpScale: 1
-    - _CloudHeight: 0
-    - _CloudsCat: 1
-    - _CloudsHeight: 0.1
-    - _CloudsLitbySun: 1
-    - _CloudsRotation: 10
-    - _CloudsRotationSpeed: 1
-    - _Contrast: 0.477
-    - _Contrsat: 1
-    - _Cutoff: 0
-    - _DetailNormalMapScale: 1
-    - _DisableCloudsRotation: 0
-    - _DisableDirectionLight: 1
-    - _DisableRotation: 0
-    - _DstBlend: 0
-    - _Enable1Twinkling: 0
-    - _EnableBuiltinFog: 0
-    - _EnableClouds: 1
-    - _EnableCloudsRotation: 0
-    - _EnableDirectionLight: 1
-    - _EnableFogMessage: 0
-    - _EnableMoon: 0
-    - _EnablePatternOverlay: 0
-    - _EnableSkyPatternOverlay: 0
-    - _EnableStars: 0
-    - _EnableStarsRotation: 0
-    - _EnableStarsTwinkling: 0
-    - _EnableSun: 1
-    - _EnableSunMask: 0
-    - _EnableSunMoon: 1
-    - _EnableSunMoonMask: 1
-    - _EnableTwinkling: 0
-    - _EqHeight: 0.419
-    - _EquatorHeight: 0.275
-    - _EquatorSmoothness: 0.741
-    - _Exposure: 0
-    - _Fade: 0.463
-    - _Float0: 2.7
-    - _Float1: 0
-    - _Float2: 0
-    - _Float3: 8.91
-    - _Float4: -1
-    - _Float5: -0.2
-    - _Float6: 1
-    - _FogCat: 1
-    - _FogFill: 0.273
-    - _FogHeight: 0.165
-    - _FogIntensity: 0
-    - _FogSmoothness: 0.47
-    - _GlossMapScale: 1
-    - _Glossiness: 0.5
-    - _GlossyReflections: 1
-    - _Keyword0: 0
-    - _Metallic: 0
-    - _Mode: 0
-    - _MoonCat: 1
-    - _MoonIntensity: 1
-    - _MoonSize: 0.5
-    - _OcclusionStrength: 1
-    - _Parallax: 0.02
-    - _PatternCat: 1
-    - _PatternContrast: 0.2
-    - _RoatationSpeed: 0.4
-    - _Rotation: 0
-    - _RotationSpeed: 0.5
-    - _SkyPatternContrast: 0.477
-    - _SkyPatternOverlay: 0
-    - _SmoothnessTextureChannel: 0
-    - _SpecularHighlights: 1
-    - _SrcBlend: 1
-    - _StarsAmount: 3
-    - _StarsCat: 1
-    - _StarsHeightMask: 0
-    - _StarsIntensity: 0
-    - _StarsLayer: 1
-    - _StarsRotation: 360
-    - _StarsRotationSpeed: 0.5
-    - _StarsSize: 0
-    - _StarsSunMask: 0
-    - _SunCat: 1
-    - _SunIntensity: 2.33
-    - _SunRadiusB: 0
-    - _SunRadoisA: 0.463
-    - _SunSize: 0.864
-    - _ToggleSwitch0: 0
-    - _TwinklingContrast: 0
-    - _TwinklingSpeed: 0
-    - _UVSec: 0
-    - _UseCUBEMAP: 1
-    - _UseEnvironmentGradient: 1
-    - _UseSkyPatternOverlay: 0
-    - _UseTexture: 1
-    - _WaveScale: 0
-    - _WaveSpeed: 0
-    - _ZWrite: 1
-    - __dirty: 0
-    - _adf: 0
-    - _angle: 145
-    - _fresnell: 0
-    - _mip: 0
-    m_Colors:
-    - _CloudLightColor: {r: 1, g: 1, b: 1, a: 1}
-    - _CloudShadowColor: {r: 0.33239606, g: 0.46899295, b: 0.85294116, a: 1}
-    - _CloudsLightColor: {r: 0.9338235, g: 0.9338235, b: 0.9338235, a: 1}
-    - _CloudsShadowColor: {r: 0.4625865, g: 0.49787903, b: 0.9117647, a: 1}
-    - _Color: {r: 1, g: 1, b: 1, a: 1}
-    - _Color0: {r: 0, g: 0.5054344, b: 1, a: 0}
-    - _Color1: {r: 1, g: 1, b: 1, a: 0}
-    - _Color2: {r: 0.059472326, g: 0.25068596, b: 0.8088235, a: 0}
-    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
-    - _Eq: {r: 1, g: 0.6769777, b: 0.330882, a: 0}
-    - _EquatorColor: {r: 1, g: 0.956522, b: 0.8632076, a: 0}
-    - _Ground: {r: 0.4779411, g: 0.43111518, b: 0.23545504, a: 0}
-    - _GroundColor: {r: 0.3679245, g: 0.3679245, b: 0.3679245, a: 0}
-    - _MoonColor: {r: 1, g: 1, b: 1, a: 1}
-    - _Sky: {r: 0.6691177, g: 0.29519898, b: 0.29519898, a: 0}
-    - _SkyColor: {r: 0.4462442, g: 0.5670902, b: 0.8679245, a: 0}
-    - _Skycol: {r: 0.27941146, g: 0.64219046, b: 1, a: 0}
-    - _SunColor: {r: 1, g: 0.85071, b: 0.66176474, a: 1}
-    - _Tint: {r: 1, g: 1, b: 1, a: 0}
-    - _Vector1: {r: 0, g: 1, b: 0, a: 0}
-    - _water: {r: 0.5, g: 0.5, b: 0.5, a: 1}
-  m_BuildTextureStacks: []
 --- !u!1001 &431797288
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -151040,6 +150759,7 @@ MonoBehaviour:
     type: 3}
   padding: {x: 0, y: 0.05, z: -0.022}
   adjustToIpd: 1
+  ipdFactor: 15.15
 --- !u!1001 &628412133
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -193094,6 +192814,7 @@ MonoBehaviour:
     type: 3}
   padding: {x: 0, y: -0.091, z: -0.07}
   adjustToIpd: 1
+  ipdFactor: 15.15
 --- !u!1001 &803720545
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -207044,6 +206765,7 @@ GameObject:
   - component: {fileID: 868699605}
   - component: {fileID: 868699604}
   - component: {fileID: 868699606}
+  - component: {fileID: 868699607}
   m_Layer: 0
   m_Name: VisualSicknessMeasures
   m_TagString: Untagged
@@ -207116,6 +206838,18 @@ MonoBehaviour:
   postProcessProfile: {fileID: 11400000, guid: 0163074491301254a9c140b40401b296, type: 2}
   gizmoPrefab: {fileID: 2653144741087938940, guid: bf4fe9b783c4c2f4f9bc6232d77a2f18,
     type: 3}
+--- !u!114 &868699607
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 868699603}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: ff3341a35756a884dbb1c162138fb598, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1001 &868867311
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -215464,6 +215198,7 @@ MonoBehaviour:
     type: 3}
   padding: {x: 0, y: 0, z: 0.05}
   adjustToIpd: 1
+  ipdFactor: 15.15
 --- !u!4 &907111746 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 412702, guid: 7b30b5ba44201104fba4e71a527b6905,
@@ -362824,6 +362559,288 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 1413645482}
   m_PrefabAsset: {fileID: 0}
+--- !u!21 &1542390949
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Sky 02
+  m_Shader: {fileID: 4800000, guid: 6fc9318f5193c094c98c0d450cd61e3b, type: 3}
+  m_ShaderKeywords: _BACKGROUNDMODE_COLORS _CLOUDSLITBYSUN_ON _DISABLEDIRECTIONLIGHT_ON
+    _ENABLECLOUDS_ON _ENABLEDIRECTIONLIGHT_ON _ENABLESUNMOONMASK_ON _ENABLESUNMOON_ON
+    _ENABLESUN_ON _USECUBEMAP_ON _USEENVIRONMENTGRADIENT_ON _USETEXTURE_ON
+  m_LightmapFlags: 0
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BackgroundCubemap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _CloudsCubemap:
+        m_Texture: {fileID: 8900000, guid: ee7bf433ad404fe4cb5e19b8a93b3bed, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Cubemap:
+        m_Texture: {fileID: 8900000, guid: ae71550a4c81f73409f14f4d6eca2c0f, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _CubemapBG:
+        m_Texture: {fileID: 8900000, guid: b8d891a789549494aaa157c0edc53a12, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MoonTexture:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Normal:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _PatternCubemap:
+        m_Texture: {fileID: 8900000, guid: 3845b30ba2fbdee44a85e5ead4dd2974, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _PatternOverlay:
+        m_Texture: {fileID: 8900000, guid: 1f3407b97870a2e46864ac55deec53b0, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _SkyPatternOverlay:
+        m_Texture: {fileID: 8900000, guid: b8d891a789549494aaa157c0edc53a12, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Spherical:
+        m_Texture: {fileID: 2800000, guid: 61c0b9c0523734e0e91bc6043c72a490, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _StarsCubemap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Sun:
+        m_Texture: {fileID: 2800000, guid: 19982f8bf5fa2ed42b65ac271d4f0279, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _SunTexture:
+        m_Texture: {fileID: 2800000, guid: dd566660fc358aa4098080e42ca0db56, type: 3}
+        m_Scale: {x: 0, y: 0}
+        m_Offset: {x: 1, y: 1}
+    - _Tex:
+        m_Texture: {fileID: 2800000, guid: 623f215c9cf5dc04aa628d4dd7b6bd73, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Texture:
+        m_Texture: {fileID: 2800000, guid: 12726e6bff222df4cbbe3ebde547c297, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _TextureSample0:
+        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
+        m_Scale: {x: 4.46, y: 5.19}
+        m_Offset: {x: 0, y: 0}
+    - _TextureSample1:
+        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
+        m_Scale: {x: 1.46, y: -1.61}
+        m_Offset: {x: 1.05, y: 3.12}
+    - _TextureSample2:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _TopTexture0:
+        m_Texture: {fileID: 2800000, guid: 84508b93f15f2b64386ec07486afc7a3, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _TwinklingTexture:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _scaledTexture:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _tex:
+        m_Texture: {fileID: 2800000, guid: 12726e6bff222df4cbbe3ebde547c297, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _texcoord:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _texture:
+        m_Texture: {fileID: 2800000, guid: 64e7766099ad46747a07014e44d0aea1, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Floats:
+    - _BackgroundCat: 1
+    - _BackgroundCubemapSpace: 0
+    - _BackgroundExposure: 1
+    - _BackgroundMode: 0
+    - _Banner: 1
+    - _BumpScale: 1
+    - _CloudHeight: 0
+    - _CloudsCat: 1
+    - _CloudsHeight: 0.1
+    - _CloudsLitbySun: 1
+    - _CloudsRotation: 10
+    - _CloudsRotationSpeed: 1
+    - _Contrast: 0.477
+    - _Contrsat: 1
+    - _Cutoff: 0
+    - _DetailNormalMapScale: 1
+    - _DisableCloudsRotation: 0
+    - _DisableDirectionLight: 1
+    - _DisableRotation: 0
+    - _DstBlend: 0
+    - _Enable1Twinkling: 0
+    - _EnableBuiltinFog: 0
+    - _EnableClouds: 1
+    - _EnableCloudsRotation: 0
+    - _EnableDirectionLight: 1
+    - _EnableFogMessage: 0
+    - _EnableMoon: 0
+    - _EnablePatternOverlay: 0
+    - _EnableSkyPatternOverlay: 0
+    - _EnableStars: 0
+    - _EnableStarsRotation: 0
+    - _EnableStarsTwinkling: 0
+    - _EnableSun: 1
+    - _EnableSunMask: 0
+    - _EnableSunMoon: 1
+    - _EnableSunMoonMask: 1
+    - _EnableTwinkling: 0
+    - _EqHeight: 0.419
+    - _EquatorHeight: 0.275
+    - _EquatorSmoothness: 0.741
+    - _Exposure: 0
+    - _Fade: 0.463
+    - _Float0: 2.7
+    - _Float1: 0
+    - _Float2: 0
+    - _Float3: 8.91
+    - _Float4: -1
+    - _Float5: -0.2
+    - _Float6: 1
+    - _FogCat: 1
+    - _FogFill: 0.273
+    - _FogHeight: 0.165
+    - _FogIntensity: 0
+    - _FogSmoothness: 0.47
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _Keyword0: 0
+    - _Metallic: 0
+    - _Mode: 0
+    - _MoonCat: 1
+    - _MoonIntensity: 1
+    - _MoonSize: 0.5
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _PatternCat: 1
+    - _PatternContrast: 0.2
+    - _RoatationSpeed: 0.4
+    - _Rotation: 0
+    - _RotationSpeed: 0.5
+    - _SkyPatternContrast: 0.477
+    - _SkyPatternOverlay: 0
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _StarsAmount: 3
+    - _StarsCat: 1
+    - _StarsHeightMask: 0
+    - _StarsIntensity: 0
+    - _StarsLayer: 1
+    - _StarsRotation: 360
+    - _StarsRotationSpeed: 0.5
+    - _StarsSize: 0
+    - _StarsSunMask: 0
+    - _SunCat: 1
+    - _SunIntensity: 2.33
+    - _SunRadiusB: 0
+    - _SunRadoisA: 0.463
+    - _SunSize: 0.864
+    - _ToggleSwitch0: 0
+    - _TwinklingContrast: 0
+    - _TwinklingSpeed: 0
+    - _UVSec: 0
+    - _UseCUBEMAP: 1
+    - _UseEnvironmentGradient: 1
+    - _UseSkyPatternOverlay: 0
+    - _UseTexture: 1
+    - _WaveScale: 0
+    - _WaveSpeed: 0
+    - _ZWrite: 1
+    - __dirty: 0
+    - _adf: 0
+    - _angle: 145
+    - _fresnell: 0
+    - _mip: 0
+    m_Colors:
+    - _CloudLightColor: {r: 1, g: 1, b: 1, a: 1}
+    - _CloudShadowColor: {r: 0.33239606, g: 0.46899295, b: 0.85294116, a: 1}
+    - _CloudsLightColor: {r: 0.9338235, g: 0.9338235, b: 0.9338235, a: 1}
+    - _CloudsShadowColor: {r: 0.4625865, g: 0.49787903, b: 0.9117647, a: 1}
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _Color0: {r: 0, g: 0.5054344, b: 1, a: 0}
+    - _Color1: {r: 1, g: 1, b: 1, a: 0}
+    - _Color2: {r: 0.059472326, g: 0.25068596, b: 0.8088235, a: 0}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+    - _Eq: {r: 1, g: 0.6769777, b: 0.330882, a: 0}
+    - _EquatorColor: {r: 1, g: 0.956522, b: 0.8632076, a: 0}
+    - _Ground: {r: 0.4779411, g: 0.43111518, b: 0.23545504, a: 0}
+    - _GroundColor: {r: 0.3679245, g: 0.3679245, b: 0.3679245, a: 0}
+    - _MoonColor: {r: 1, g: 1, b: 1, a: 1}
+    - _Sky: {r: 0.6691177, g: 0.29519898, b: 0.29519898, a: 0}
+    - _SkyColor: {r: 0.4462442, g: 0.5670902, b: 0.8679245, a: 0}
+    - _Skycol: {r: 0.27941146, g: 0.64219046, b: 1, a: 0}
+    - _SunColor: {r: 1, g: 0.85071, b: 0.66176474, a: 1}
+    - _Tint: {r: 1, g: 1, b: 1, a: 0}
+    - _Vector1: {r: 0, g: 1, b: 0, a: 0}
+    - _water: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+  m_BuildTextureStacks: []
 --- !u!1001 &1542581854
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -399936,7 +399953,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 0
+  m_IsActive: 1
 --- !u!4 &1713398612
 Transform:
   m_ObjectHideFlags: 0
@@ -399967,6 +399984,7 @@ MonoBehaviour:
     type: 3}
   padding: {x: 0, y: -0.018, z: 0.018}
   adjustToIpd: 1
+  ipdFactor: 3.89
 --- !u!1001 &1713805583
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -413994,6 +414012,7 @@ MonoBehaviour:
     type: 3}
   padding: {x: 0, y: -0.091, z: -0.07}
   adjustToIpd: 1
+  ipdFactor: 15.15
 --- !u!1001 &1769099065
 PrefabInstance:
   m_ObjectHideFlags: 0

+ 60 - 0
Assets/Scripts/SicknessReduction/Visual/IpdInfo.cs

@@ -0,0 +1,60 @@
+using System;
+using UnityEngine;
+using Valve.VR;
+
+namespace SicknessReduction.Visual
+{
+    public class IpdInfo : MonoBehaviour
+    {
+        private SteamVR_Events.Action ipdChangedAction;
+
+        public delegate void OnIpdChangedEvent(float ipdMeters);
+
+        public event OnIpdChangedEvent onIpdChanged; // data event
+
+        private void OnEnable()
+        {
+            SteamVR_Events.DeviceConnected.Listen(OnDeviceConnected);
+            ipdChangedAction = SteamVR_Events.SystemAction(EVREventType.VREvent_IpdChanged, OnIpdChanged);
+            ipdChangedAction.enabled = true;
+        }
+
+        private void OnIpdChanged(VREvent_t vrEvent)
+        {
+            var ipdMeters = vrEvent.data.ipd.ipdMeters;
+            onIpdChanged?.Invoke(ipdMeters);
+            Debug.Log($"IPD changed to {ipdMeters}");
+        }
+
+        private void OnDisable()
+        {
+            ipdChangedAction.enabled = false;
+        }
+
+        private void OnDeviceConnected(int index, bool connected)
+        {
+            if (index < 0) return;
+            if (!connected || OpenVR.System == null) return;
+
+            var deviceClass = OpenVR.System.GetTrackedDeviceClass((uint) index);
+            if (deviceClass != ETrackedDeviceClass.HMD) return;
+
+            var error = ETrackedPropertyError.TrackedProp_Success;
+            var ipdMeters = OpenVR.System.GetFloatTrackedDeviceProperty((uint) index,
+                ETrackedDeviceProperty.Prop_UserIpdMeters_Float, ref error);
+
+
+            if (error != ETrackedPropertyError.TrackedProp_Success)
+            {
+                Debug.LogError($"Could not get ipd for HMD at index {index}");
+            }
+            else
+            {
+                onIpdChanged?.Invoke(ipdMeters);
+                Debug.Log($"Initial IPD = {ipdMeters}");
+            }
+
+            Debug.Log("Controller got connected at index:" + index);
+        }
+    }
+}

+ 11 - 0
Assets/Scripts/SicknessReduction/Visual/IpdInfo.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ff3341a35756a884dbb1c162138fb598
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 17 - 25
Assets/Scripts/SicknessReduction/Visual/VirtualNose.cs

@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.XR;
-using Valve.VR;
+using UnityEngine;
 
 namespace SicknessReduction.Visual
 {
@@ -12,44 +8,40 @@ namespace SicknessReduction.Visual
         public Vector3 padding;
 
         public bool adjustToIpd = true;
+        public float ipdFactor = 15.15f;
 
         private Camera cam;
         private GameObject nose;
-
-        private InputDevice leftEye;
-        private InputDevice rightEye;
+        private IpdInfo ipdInfo;
+        private Vector3 initalLocalScale;
 
         private void OnEnable()
         {
             cam = Camera.main;
             if (cam == null)
             {
-                Debug.LogWarning("No main camera found. Cannot place virtual nose!");
+                Debug.LogError("No main camera found. Cannot place virtual nose!");
                 return;
             }
 
-            Debug.Log($"Main Camera IPD: {cam.stereoSeparation}");
+            ipdInfo = GetComponentInParent<IpdInfo>();
+            if (ipdInfo == null)
+            {
+                Debug.LogError("No IPD Info found as parent of virtual nose");
+            }
+
+            ipdInfo.onIpdChanged += AdjustToIpd;
 
             nose = Instantiate(prefabToSpawn, cam.transform);
             nose.transform.localPosition = Vector3.forward * cam.nearClipPlane + padding;
+            initalLocalScale = nose.transform.localScale;
         }
 
-        private void Start()
+        private void AdjustToIpd(float ipdMeters)
         {
-            List<InputDevice> devices = new List<InputDevice>();
-            InputDevices.GetDevicesWithCharacteristics(
-                InputDeviceCharacteristics.Camera | InputDeviceCharacteristics.HeadMounted, devices);
-
-            if (devices.Count == 0)
-            {
-                Debug.LogWarning("No devices");
-                return;
-            }
-
-            devices[0].TryGetFeatureValue(CommonUsages.rightEyePosition, out var reye);
-            devices[0].TryGetFeatureValue(CommonUsages.leftEyePosition, out var leye);
-
-            Debug.Log($"Eyes: {leye}, {reye}");
+            Debug.Log($"Scaling nose with factor {ipdMeters * ipdFactor}");
+            var newScale = initalLocalScale * (ipdMeters * ipdFactor * ipdFactor);
+            nose.transform.localScale = newScale;
         }
 
         private void OnDisable()

+ 0 - 5
Assets/Scripts/Tracking/TrackerIndexManager.cs

@@ -24,11 +24,6 @@ namespace Tracking
 
             var deviceClass = OpenVR.System.GetTrackedDeviceClass((uint) index);
             if (deviceClass != ETrackedDeviceClass.GenericTracker) return;
-            /* if (deviceClass == ETrackedDeviceClass.HMD)
-                    {
-                        //OpenVR.System.GetFloatTrackedDeviceProperty(ETrackedDeviceProperty.Prop_UserIpdMeters_Float)
-                        Debug.Log("Controller got connected at index:" + index);
-                    }*/
 
             var error = ETrackedPropertyError.TrackedProp_Success;
             var serialNumberBuilder = new StringBuilder();