Bläddra i källkod

Fixed bike animation

Marcel Zickler 3 år sedan
förälder
incheckning
de16135336

+ 2 - 2
Assembly-CSharp.csproj

@@ -123,6 +123,7 @@
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Mesgs\GoalMesg.cs" />
      <Compile Include="Assets\Scripts\Pools\Pool.cs" />
      <Compile Include="Assets\Scripts\Logging\Data\ViveSensorDataLogger.cs" />
+     <Compile Include="Assets\Scripts\Wheels\SwitchColliderOnStanding.cs" />
      <Compile Include="Assets\Scripts\Controller\Bicycle\WheelConfig.cs" />
      <Compile Include="Assets\Scripts\Tracking\FrontWheelTracker.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Mesgs\HrvMesg.cs" />
@@ -276,6 +277,7 @@
      <Compile Include="Assets\AdvancedAnt\DEMO PREFABS\PrefabDemoDisplay.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Types\LeftRightBalance100.cs" />
      <Compile Include="Assets\Scripts\Logging\Base\ISerializable.cs" />
+     <Compile Include="Assets\Scripts\Display\CountdownDisplay.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Mesgs\VideoClipMesg.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Mesgs\NmeaSentenceMesg.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Profile\Types\DateTime.cs" />
@@ -318,8 +320,6 @@
      <Compile Include="Assets\Scripts\SicknessReduction\Visual\Rendering\BokehFeature.cs" />
      <Compile Include="Assets\AdvancedAnt\Scripts\SpeedDisplay.cs" />
      <Compile Include="Assets\AdvancedAnt\Plugins\Ant\Fit\Mesg.cs" />
-     <Compile Include="Assets\Scripts\Wheels\SwitchColliderOnStanding.cs" />
-     <Compile Include="Assets\Scripts\Display\CountdownDisplay.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" />

+ 4 - 4
Assets/Scripts/Animation/BikeAnimation.cs

@@ -8,7 +8,6 @@ using UnityEngine;
 namespace Animation
 {
     #region Helpers
-    
 
     public enum WheelRotationDirection
     {
@@ -64,11 +63,12 @@ namespace Animation
 
         void Update()
         {
-            var cadence = BikeSensorData.Instance.PowermeterData?.InstantaneousCadence ?? defaultCadence; //rpm
+            var cadence = BikeSensorData.Instance.PowermeterData?.InstantaneousCadence ??
+                          defaultCadence * bicycleController.CurrentSpeed / 8; //rpm
             var cadenceAngle = cadence / 60 * 360 * Time.deltaTime; //rps * 360 deg for one round
 
             RotateWheels();
-            RotateAroundDefinedAxis(fork, bicycleController.CurrentSteerAngle); //FIXME: dont reset?
+            RotateAroundDefinedAxis(fork, bicycleController.CurrentSteerAngle);
             RotateAroundDefinedAxis(crankSet, cadenceAngle, false);
         }
 
@@ -124,7 +124,7 @@ namespace Animation
             else
                 axis = rotatable.rotateAround.right;
 
-            fork.gameObject.transform.RotateAround(rotatable.rotateAround.position, axis, angle);
+            rotatable.gameObject.transform.RotateAround(rotatable.rotateAround.position, axis, angle);
         }
 
 

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