Przeglądaj źródła

Scene updates + fan controller based on restriction suggedtor

Marcel Zickler 3 lat temu
rodzic
commit
5771b11102

+ 36 - 2
.idea/.idea.VR Cycling/.idea/indexLayout.xml

@@ -2,8 +2,42 @@
 <project version="4">
   <component name="ContentModelUserStore">
     <attachedFolders />
-    <explicitIncludes />
-    <explicitExcludes />
+    <explicitIncludes>
+      <Path>Library/PackageCache/com.autodesk.fbx@3.1.0-preview.2</Path>
+      <Path>Library/PackageCache/com.unity.collab-proxy@1.3.9</Path>
+      <Path>Library/PackageCache/com.unity.ext.nunit@1.0.6</Path>
+      <Path>Library/PackageCache/com.unity.formats.fbx@3.2.1-preview.2</Path>
+      <Path>Library/PackageCache/com.unity.ide.rider@1.2.1</Path>
+      <Path>Library/PackageCache/com.unity.ide.visualstudio@2.0.3</Path>
+      <Path>Library/PackageCache/com.unity.ide.vscode@1.2.3</Path>
+      <Path>Library/PackageCache/com.unity.inputsystem@1.0.1</Path>
+      <Path>Library/PackageCache/com.unity.recorder@2.2.0-preview.4</Path>
+      <Path>Library/PackageCache/com.unity.render-pipelines.core@8.2.0</Path>
+      <Path>Library/PackageCache/com.unity.render-pipelines.universal@8.2.0</Path>
+      <Path>Library/PackageCache/com.unity.searcher@4.0.9</Path>
+      <Path>Library/PackageCache/com.unity.shadergraph@8.2.0</Path>
+      <Path>Library/PackageCache/com.unity.subsystemregistration@1.0.6</Path>
+      <Path>Library/PackageCache/com.unity.test-framework@1.1.22</Path>
+      <Path>Library/PackageCache/com.unity.textmeshpro@3.0.1</Path>
+      <Path>Library/PackageCache/com.unity.timeline@1.2.16</Path>
+      <Path>Library/PackageCache/com.unity.xr.legacyinputhelpers@2.1.4</Path>
+      <Path>Library/PackageCache/com.unity.xr.management@3.2.16</Path>
+      <Path>Library/PackageCache/com.valvesoftware.unity.openvr@ecdf2388462c-1610414760000</Path>
+      <Path>Packages</Path>
+      <Path>ProjectSettings</Path>
+    </explicitIncludes>
+    <explicitExcludes>
+      <Path>.git</Path>
+      <Path>.idea</Path>
+      <Path>Docu</Path>
+      <Path>External</Path>
+      <Path>Integrations</Path>
+      <Path>Library</Path>
+      <Path>Logs</Path>
+      <Path>UserSettings</Path>
+      <Path>obj</Path>
+      <Path>out</Path>
+    </explicitExcludes>
   </component>
   <component name="UserContentModel">
     <attachedFolders />

+ 1 - 1
Assembly-CSharp.csproj

@@ -179,6 +179,7 @@
      <Compile Include="Assets\Scripts\Routes\Turn.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Mesgs\AntChannelIdMesg.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Types\ActivitySubtype.cs" />
+     <Compile Include="Assets\Scripts\Roads\SlopeExtras.cs" />
      <Compile Include="Assets\Scripts\Animation\Rotatable.cs" />
      <Compile Include="Assets\Scripts\Display\ViveTrackerDebugDisplay.cs" />
      <Compile Include="Assets\Scripts\SicknessReduction\Haptic\VibrationController.cs" />
@@ -346,7 +347,6 @@
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Types\StrokeType.cs" />
      <Compile Include="Assets\AdvancedAnt\Scripts\SpeedDisplay.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Mesg.cs" />
-     <Compile Include="Assets\Scripts\Roads\SlopeExtras.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" />

+ 2 - 2
Assets/Materials/Vignette.mat

@@ -58,10 +58,10 @@ Material:
     - _GlossMapScale: 0
     - _Glossiness: 0
     - _GlossyReflections: 0
-    - _IFOV: 0.9267527
+    - _IFOV: 0.92836356
     - _InnerRadius: 0.15
     - _Metallic: 0
-    - _OFOV: 0.9967527
+    - _OFOV: 0.99836355
     - _OcclusionStrength: 1
     - _QueueOffset: 0
     - _ReceiveShadows: 1

Plik diff jest za duży
+ 897 - 19
Assets/Scenes/MainScene.unity


+ 24 - 2
Assets/Scripts/SicknessReduction/Haptic/DeskFanController.cs

@@ -1,14 +1,20 @@
 using System;
+using System.Diagnostics;
 using System.Threading.Tasks;
 using Controller.Bicycle;
 using UnityEngine;
 
 namespace SicknessReduction.Haptic
 {
+    [RequireComponent(typeof(DynamicReductionSource))]
     public class DeskFanController : EspController
     {
         private const int MAX_FAN_VALUE = 95; //in %. Sometimes 100% doesn't work correctly
-        private const int MIN_FAN_VALUE = 25; //everything below 35 will not be enough to let the fan spin; a bit of buffer for not starting to high
+
+        private const int
+            MIN_FAN_VALUE =
+                25; //everything below 35 will not be enough to let the fan spin; a bit of buffer for not starting to high
+
         private const string TOPIC = "DeskFan/Control";
 
         public float maxValueAtSpeed = 6.94f; //25km/h
@@ -16,18 +22,34 @@ namespace SicknessReduction.Haptic
         public RbBicycleController bicycleController;
         private int previousFanValue;
 
+        private bool useReductionSource = true;
+        private DynamicReductionSource reductionSource;
+
+
+        protected override void Start()
+        {
+            base.Start();
+            reductionSource = GetComponent<DynamicReductionSource>();
+        }
+
         protected override async void Update()
         {
             base.Update();
             if (!DoUpdate || PreviousUpdateActive) return;
             PreviousUpdateActive = true;
 
-            var cycle = FanCycleForSpeed();
+            var cycle = useReductionSource ? FanCycleForReductionSource() : FanCycleForSpeed();
             await SendFanValue(cycle);
 
             PreviousUpdateActive = false;
         }
 
+        private int FanCycleForReductionSource()
+        {
+            var reductionValue = reductionSource.CurrentValue;
+            return (int) Mathf.Lerp(MIN_FAN_VALUE, MAX_FAN_VALUE, reductionValue);
+        }
+
         private async Task SendFanValue(int value)
         {
             if (previousFanValue != value)

BIN
obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików