Selaa lähdekoodia

Basic Rigid Body Bike Controller

Marcel Zickler 3 vuotta sitten
vanhempi
commit
15fe0a9f9d

+ 0 - 1
.idea/.idea.VR Cycling/.idea/indexLayout.xml

@@ -32,7 +32,6 @@
       <Path>Integrations</Path>
       <Path>Library</Path>
       <Path>Logs</Path>
-      <Path>Temp</Path>
       <Path>UserSettings</Path>
       <Path>obj</Path>
     </explicitExcludes>

+ 3 - 0
Assembly-CSharp.csproj

@@ -258,6 +258,7 @@
      <Compile Include="Assets\Scripts\Calibration\BikeReset.cs" />
      <Compile Include="Assets\Scripts\Calibration\MovePlayerPosition.cs" />
      <Compile Include="Assets\Scripts\Calibration\PersistatePlayerPosition.cs" />
+     <Compile Include="Assets\Scripts\Controller\Bicycle\DummyBicycleController.cs" />
      <Compile Include="Assets\Scripts\Controller\Bicycle\IBicycleController.cs" />
      <Compile Include="Assets\Scripts\Controller\Bicycle\RbBicycleController.cs" />
      <Compile Include="Assets\Scripts\Controller\Bicycle\WcBicycleController.cs" />
@@ -268,7 +269,9 @@
      <Compile Include="Assets\Scripts\Controller\ViveBikeController.cs" />
      <Compile Include="Assets\Scripts\Display\BikeDataDisplay.cs" />
      <Compile Include="Assets\Scripts\Display\DebugDisplay.cs" />
+     <Compile Include="Assets\Scripts\Display\RbDebugDisplay.cs" />
      <Compile Include="Assets\Scripts\Display\ViveTrackerDebugDisplay.cs" />
+     <Compile Include="Assets\Scripts\Display\WcDebugDisplay.cs" />
      <Compile Include="Assets\Scripts\Sensors\ANT\HrReceiver.cs" />
      <Compile Include="Assets\Scripts\Sensors\ANT\PowerMeterReceiver.cs" />
      <Compile Include="Assets\Scripts\Sensors\ANT\SpeedSensorReceiver.cs" />

+ 65 - 1
Assets/Prefabs/Player/BikePlayer - Rigid Body.prefab → Assets/Prefabs/Player/BikePlayer - RigidBody.prefab

@@ -12,6 +12,22 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: e9349e7eecd845c3a526e46930a4fc32, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  rigidBody: {fileID: 4988978073311274401}
+  controllerMode: 0
+  centerOfMass: {fileID: 0}
+--- !u!114 &4989405759833679730
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4988978071938499209}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 2536d945c8ba43ba857360dbd62685d0, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  bicycleController: {fileID: 3450098086302837850}
 --- !u!1001 &5488976313075237648
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -19,10 +35,45 @@ PrefabInstance:
   m_Modification:
     m_TransformParent: {fileID: 0}
     m_Modifications:
+    - target: {fileID: 653210787133548208, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_Size.y
+      value: 1.9618418
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210787133548208, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_Center.x
+      value: -0.06335412
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210787133548208, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_Center.y
+      value: 0.016522706
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210787133548208, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_Center.z
+      value: 0.01880979
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210787133548208, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_Size.z
+      value: 3.1228366
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210787133548208, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_Size.x
+      value: 1.649444
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210787133548209, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_IsKinematic
+      value: 0
+      objectReference: {fileID: 0}
     - target: {fileID: 653210788318262019, guid: a065ef1d4c56ffa49bb0b821da25d91b,
         type: 3}
       propertyPath: m_Name
-      value: BikePlayer - Rigid Body
+      value: BikePlayer - RigidBody
       objectReference: {fileID: 0}
     - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
         type: 3}
@@ -86,6 +137,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     m_RemovedComponents:
     - {fileID: 653210788318262023, guid: a065ef1d4c56ffa49bb0b821da25d91b, type: 3}
+    - {fileID: 9132626276124788811, guid: a065ef1d4c56ffa49bb0b821da25d91b, type: 3}
   m_SourcePrefab: {fileID: 100100000, guid: a065ef1d4c56ffa49bb0b821da25d91b, type: 3}
 --- !u!1 &4988978072042319891 stripped
 GameObject:
@@ -93,3 +145,15 @@ GameObject:
     type: 3}
   m_PrefabInstance: {fileID: 5488976313075237648}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &4988978071938499209 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 653210788491264409, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 5488976313075237648}
+  m_PrefabAsset: {fileID: 0}
+--- !u!54 &4988978073311274401 stripped
+Rigidbody:
+  m_CorrespondingSourceObject: {fileID: 653210787133548209, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 5488976313075237648}
+  m_PrefabAsset: {fileID: 0}

+ 0 - 0
Assets/Prefabs/Player/BikePlayer - Rigid Body.prefab.meta → Assets/Prefabs/Player/BikePlayer - RigidBody.prefab.meta


+ 432 - 0
Assets/Prefabs/Player/BikePlayer - WheelCollider.prefab

@@ -0,0 +1,432 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &7512265663621178513
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 801321025930522509}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: a27bbfe203006ee44b3dece1ad698c4d, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  rearWheel: {fileID: 801321025748002530}
+  frontWheel: {fileID: 801321025902230701}
+  centerOfMass: {fileID: 801321026778780902}
+  rigidBody: {fileID: 801321026876488255}
+  wheelConfig:
+    frontLeft: {fileID: 8188783719001394119}
+    frontRight: {fileID: 834510411877024686}
+    rearLeft: {fileID: 7021878323384492593}
+    rearRight: {fileID: 2969410334796512581}
+  offsetCollidersFromWheel: 0.5
+  maxLeaningAngle: 20
+  maxSteeringAngle: 15
+  maxSpeed: 11.111
+  maxBreakTorque: 2000
+  maxMotorTorque: 1000
+--- !u!114 &957853408766357258
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 801321025566661911}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 08d84f83c699406a89782ab48646272c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  bicycleController: {fileID: 7512265663621178513}
+--- !u!1 &1465574767010789097
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 3374798822138137626}
+  - component: {fileID: 7021878323384492593}
+  m_Layer: 9
+  m_Name: RearLeft
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &3374798822138137626
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1465574767010789097}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: -0.2, y: -0.394, z: -0.982}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 1296554712610267607}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!146 &7021878323384492593
+WheelCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1465574767010789097}
+  m_Center: {x: 0, y: 0, z: 0}
+  m_Radius: 0.65
+  m_SuspensionSpring:
+    spring: 0
+    damper: 0
+    targetPosition: 0.5
+  m_SuspensionDistance: 0
+  m_ForceAppPointDistance: 0
+  m_Mass: 0.4
+  m_WheelDampingRate: 0.1
+  m_ForwardFriction:
+    m_ExtremumSlip: 0.4
+    m_ExtremumValue: 1
+    m_AsymptoteSlip: 0.8
+    m_AsymptoteValue: 0.5
+    m_Stiffness: 1
+  m_SidewaysFriction:
+    m_ExtremumSlip: 0.2
+    m_ExtremumValue: 1
+    m_AsymptoteSlip: 0.5
+    m_AsymptoteValue: 0.75
+    m_Stiffness: 1
+  m_Enabled: 1
+--- !u!1 &1846639337413859412
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 6864293721890808824}
+  - component: {fileID: 834510411877024686}
+  m_Layer: 9
+  m_Name: FrontRight
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &6864293721890808824
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1846639337413859412}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0.2, y: -0.39400002, z: 0.986}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 1296554712610267607}
+  m_RootOrder: 3
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!146 &834510411877024686
+WheelCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1846639337413859412}
+  m_Center: {x: 0, y: 0, z: 0}
+  m_Radius: 0.65
+  m_SuspensionSpring:
+    spring: 0
+    damper: 0
+    targetPosition: 0.5
+  m_SuspensionDistance: 0
+  m_ForceAppPointDistance: 0
+  m_Mass: 0.4
+  m_WheelDampingRate: 0.1
+  m_ForwardFriction:
+    m_ExtremumSlip: 0.4
+    m_ExtremumValue: 1
+    m_AsymptoteSlip: 0.8
+    m_AsymptoteValue: 0.5
+    m_Stiffness: 1
+  m_SidewaysFriction:
+    m_ExtremumSlip: 0.2
+    m_ExtremumValue: 1
+    m_AsymptoteSlip: 0.5
+    m_AsymptoteValue: 0.75
+    m_Stiffness: 1
+  m_Enabled: 1
+--- !u!1 &2487871355023353472
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1296554712610267607}
+  m_Layer: 9
+  m_Name: Colliders
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1296554712610267607
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2487871355023353472}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children:
+  - {fileID: 3374798822138137626}
+  - {fileID: 6534913685170955953}
+  - {fileID: 7606312893890610443}
+  - {fileID: 6864293721890808824}
+  m_Father: {fileID: 801321026876488252}
+  m_RootOrder: 6
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &3232670606842586248
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 6534913685170955953}
+  - component: {fileID: 2969410334796512581}
+  m_Layer: 9
+  m_Name: RearRight
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &6534913685170955953
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 3232670606842586248}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0.2, y: -0.394, z: -0.982}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 1296554712610267607}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!146 &2969410334796512581
+WheelCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 3232670606842586248}
+  m_Center: {x: 0, y: 0, z: 0}
+  m_Radius: 0.65
+  m_SuspensionSpring:
+    spring: 0
+    damper: 0
+    targetPosition: 0.5
+  m_SuspensionDistance: 0
+  m_ForceAppPointDistance: 0
+  m_Mass: 0.4
+  m_WheelDampingRate: 0.1
+  m_ForwardFriction:
+    m_ExtremumSlip: 0.4
+    m_ExtremumValue: 1
+    m_AsymptoteSlip: 0.8
+    m_AsymptoteValue: 0.5
+    m_Stiffness: 1
+  m_SidewaysFriction:
+    m_ExtremumSlip: 0.2
+    m_ExtremumValue: 1
+    m_AsymptoteSlip: 0.5
+    m_AsymptoteValue: 0.75
+    m_Stiffness: 1
+  m_Enabled: 1
+--- !u!1 &5546454577013593120
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 7606312893890610443}
+  - component: {fileID: 8188783719001394119}
+  m_Layer: 9
+  m_Name: FrontLeft
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &7606312893890610443
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5546454577013593120}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: -0.2, y: -0.39400002, z: 0.986}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 1296554712610267607}
+  m_RootOrder: 2
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!146 &8188783719001394119
+WheelCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5546454577013593120}
+  m_Center: {x: 0, y: 0, z: 0}
+  m_Radius: 0.65
+  m_SuspensionSpring:
+    spring: 0
+    damper: 0
+    targetPosition: 0.5
+  m_SuspensionDistance: 0
+  m_ForceAppPointDistance: 0
+  m_Mass: 0.4
+  m_WheelDampingRate: 0.1
+  m_ForwardFriction:
+    m_ExtremumSlip: 0.4
+    m_ExtremumValue: 1
+    m_AsymptoteSlip: 0.8
+    m_AsymptoteValue: 0.5
+    m_Stiffness: 1
+  m_SidewaysFriction:
+    m_ExtremumSlip: 0.2
+    m_ExtremumValue: 1
+    m_AsymptoteSlip: 0.5
+    m_AsymptoteValue: 0.75
+    m_Stiffness: 1
+  m_Enabled: 1
+--- !u!1001 &148186655818931342
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 0}
+    m_Modifications:
+    - target: {fileID: 653210788318262019, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_Name
+      value: BikePlayer - WheelCollider
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 3.2
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0.7071068
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 0.7071068
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_RootOrder
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 90
+      objectReference: {fileID: 0}
+    - target: {fileID: 653210788318262020, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    m_RemovedComponents:
+    - {fileID: 9132626276124788811, guid: a065ef1d4c56ffa49bb0b821da25d91b, type: 3}
+  m_SourcePrefab: {fileID: 100100000, guid: a065ef1d4c56ffa49bb0b821da25d91b, type: 3}
+--- !u!1 &801321025930522509 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 653210788318262019, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 148186655818931342}
+  m_PrefabAsset: {fileID: 0}
+--- !u!1 &801321025566661911 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 653210788491264409, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 148186655818931342}
+  m_PrefabAsset: {fileID: 0}
+--- !u!4 &801321026876488252 stripped
+Transform:
+  m_CorrespondingSourceObject: {fileID: 653210787133548210, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 148186655818931342}
+  m_PrefabAsset: {fileID: 0}
+--- !u!54 &801321026876488255 stripped
+Rigidbody:
+  m_CorrespondingSourceObject: {fileID: 653210787133548209, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 148186655818931342}
+  m_PrefabAsset: {fileID: 0}
+--- !u!4 &801321026778780902 stripped
+Transform:
+  m_CorrespondingSourceObject: {fileID: 653210787170027624, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 148186655818931342}
+  m_PrefabAsset: {fileID: 0}
+--- !u!1 &801321025748002530 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 653210788269963884, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 148186655818931342}
+  m_PrefabAsset: {fileID: 0}
+--- !u!1 &801321025902230701 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 653210788424474659, guid: a065ef1d4c56ffa49bb0b821da25d91b,
+    type: 3}
+  m_PrefabInstance: {fileID: 148186655818931342}
+  m_PrefabAsset: {fileID: 0}

+ 7 - 0
Assets/Prefabs/Player/BikePlayer - WheelCollider.prefab.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c07a138bbf835c14a8028db71e00af57
+PrefabImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 123 - 431
Assets/Prefabs/Player/BikePlayer.prefab

@@ -112,7 +112,6 @@ Transform:
   m_LocalScale: {x: 0.5000001, y: 0.5, z: 0.5000001}
   m_Children:
   - {fileID: 653210788976783330}
-  - {fileID: 653210788116060806}
   - {fileID: 653210787170027624}
   - {fileID: 653210788045543649}
   - {fileID: 653210788780550639}
@@ -352,7 +351,7 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 653210787133548210}
-  m_RootOrder: 2
+  m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &653210787171919703
 GameObject:
@@ -555,67 +554,6 @@ Transform:
   m_Father: {fileID: 653210788780550639}
   m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!1 &653210787295041975
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 653210787295041960}
-  - component: {fileID: 653210787295041961}
-  m_Layer: 9
-  m_Name: LF
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &653210787295041960
-Transform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210787295041975}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: -0.2500001, y: -0.41, z: 0.9810003}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 653210788116060806}
-  m_RootOrder: 1
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!146 &653210787295041961
-WheelCollider:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210787295041975}
-  m_Center: {x: 0, y: 0.045, z: 0}
-  m_Radius: 0.645
-  m_SuspensionSpring:
-    spring: 10000
-    damper: 100
-    targetPosition: 0.5
-  m_SuspensionDistance: 0.09
-  m_ForceAppPointDistance: 0
-  m_Mass: 23.43
-  m_WheelDampingRate: 1
-  m_ForwardFriction:
-    m_ExtremumSlip: 0.4
-    m_ExtremumValue: 1
-    m_AsymptoteSlip: 0.8
-    m_AsymptoteValue: 0.5
-    m_Stiffness: 1
-  m_SidewaysFriction:
-    m_ExtremumSlip: 0.2
-    m_ExtremumValue: 1
-    m_AsymptoteSlip: 0.5
-    m_AsymptoteValue: 0.75
-    m_Stiffness: 1
-  m_Enabled: 1
 --- !u!1 &653210787296679909
 GameObject:
   m_ObjectHideFlags: 0
@@ -1136,67 +1074,114 @@ MonoBehaviour:
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_PixelsPerUnitMultiplier: 1
---- !u!1 &653210787661403617
-GameObject:
+--- !u!114 &653210788552364707
+MonoBehaviour:
   m_ObjectHideFlags: 0
   m_CorrespondingSourceObject: {fileID: 0}
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 653210787661403618}
-  - component: {fileID: 653210787661403619}
-  m_Layer: 9
-  m_Name: RB
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &653210787661403618
-Transform:
+  m_GameObject: {fileID: 653210787637606582}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_RenderShadows: 1
+  m_RequiresDepthTextureOption: 2
+  m_RequiresOpaqueTextureOption: 2
+  m_CameraType: 0
+  m_Cameras: []
+  m_RendererIndex: -1
+  m_VolumeLayerMask:
+    serializedVersion: 2
+    m_Bits: 1
+  m_VolumeTrigger: {fileID: 0}
+  m_RenderPostProcessing: 0
+  m_Antialiasing: 0
+  m_AntialiasingQuality: 2
+  m_StopNaN: 0
+  m_Dithering: 0
+  m_ClearDepth: 1
+  m_RequiresDepthTexture: 0
+  m_RequiresColorTexture: 0
+  m_Version: 2
+--- !u!114 &653210788051188311
+MonoBehaviour:
   m_ObjectHideFlags: 0
   m_CorrespondingSourceObject: {fileID: 0}
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210787661403617}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0.25000003, y: -0.41, z: -0.98000085}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 653210788116060806}
-  m_RootOrder: 2
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!146 &653210787661403619
-WheelCollider:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210787661403617}
-  m_Center: {x: 0, y: 0.045, z: 0}
-  m_Radius: 0.645
-  m_SuspensionSpring:
-    spring: 10000
-    damper: 100
-    targetPosition: 0.5
-  m_SuspensionDistance: 0.09
-  m_ForceAppPointDistance: 0
-  m_Mass: 23.43
-  m_WheelDampingRate: 1
-  m_ForwardFriction:
-    m_ExtremumSlip: 0.4
-    m_ExtremumValue: 1
-    m_AsymptoteSlip: 0.8
-    m_AsymptoteValue: 0.5
-    m_Stiffness: 1
-  m_SidewaysFriction:
-    m_ExtremumSlip: 0.2
-    m_ExtremumValue: 1
-    m_AsymptoteSlip: 0.5
-    m_AsymptoteValue: 0.75
-    m_Stiffness: 1
+  m_GameObject: {fileID: 653210787637617862}
   m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_RenderShadows: 1
+  m_RequiresDepthTextureOption: 2
+  m_RequiresOpaqueTextureOption: 2
+  m_CameraType: 0
+  m_Cameras: []
+  m_RendererIndex: -1
+  m_VolumeLayerMask:
+    serializedVersion: 2
+    m_Bits: 1
+  m_VolumeTrigger: {fileID: 0}
+  m_RenderPostProcessing: 0
+  m_Antialiasing: 0
+  m_AntialiasingQuality: 2
+  m_StopNaN: 0
+  m_Dithering: 0
+  m_ClearDepth: 1
+  m_RequiresDepthTexture: 0
+  m_RequiresColorTexture: 0
+  m_Version: 2
+--- !u!114 &653210788874333620
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 653210787637621008}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 191e6394491f45a0affa3a8a9b152ffc, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  resetAction:
+    actionPath: /actions/bikevr/in/ResetPosition
+    needsReinit: 0
+  modeAction:
+    actionPath: /actions/bikevr/in/MovePlayerModeSwitch
+    needsReinit: 0
+  moveForwards:
+    actionPath: /actions/bikevr/in/MovePlayerForward
+    needsReinit: 0
+  moveBackwards:
+    actionPath: /actions/bikevr/in/MovePlayerBackward
+    needsReinit: 0
+  moveRight:
+    actionPath: /actions/bikevr/in/MovePlayerRight
+    needsReinit: 0
+  moveLeft:
+    actionPath: /actions/bikevr/in/MovePlayerLeft
+    needsReinit: 0
+  movementSpeed: 1
+--- !u!114 &653210788874333622
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 653210787637621008}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 98b06a0ba8ae04242a768466630b04fd, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  savePos:
+    actionPath: /actions/bikevr/in/ResetBikePosition
+    needsReinit: 0
 --- !u!1 &653210787828121193
 GameObject:
   m_ObjectHideFlags: 0
@@ -2031,7 +2016,7 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 653210787133548210}
-  m_RootOrder: 3
+  m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &653210788048813480
 GameObject:
@@ -2112,37 +2097,6 @@ MeshRenderer:
   m_SortingLayerID: 0
   m_SortingLayer: 0
   m_SortingOrder: 0
---- !u!114 &653210788051188311
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210787637617862}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_RenderShadows: 1
-  m_RequiresDepthTextureOption: 2
-  m_RequiresOpaqueTextureOption: 2
-  m_CameraType: 0
-  m_Cameras: []
-  m_RendererIndex: -1
-  m_VolumeLayerMask:
-    serializedVersion: 2
-    m_Bits: 1
-  m_VolumeTrigger: {fileID: 0}
-  m_RenderPostProcessing: 0
-  m_Antialiasing: 0
-  m_AntialiasingQuality: 2
-  m_StopNaN: 0
-  m_Dithering: 0
-  m_ClearDepth: 1
-  m_RequiresDepthTexture: 0
-  m_RequiresColorTexture: 0
-  m_Version: 2
 --- !u!1 &653210788094787158
 GameObject:
   m_ObjectHideFlags: 0
@@ -2434,40 +2388,6 @@ MeshRenderer:
   m_SortingLayerID: 0
   m_SortingLayer: 0
   m_SortingOrder: 0
---- !u!1 &653210788116060805
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 653210788116060806}
-  m_Layer: 9
-  m_Name: WheelColliders
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &653210788116060806
-Transform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210788116060805}
-  m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: -0, y: 0, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children:
-  - {fileID: 653210788188657168}
-  - {fileID: 653210787295041960}
-  - {fileID: 653210787661403618}
-  - {fileID: 653210789225352595}
-  m_Father: {fileID: 653210787133548210}
-  m_RootOrder: 1
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &653210788137007340
 GameObject:
   m_ObjectHideFlags: 0
@@ -2701,67 +2621,6 @@ MeshRenderer:
   m_SortingLayerID: 0
   m_SortingLayer: 0
   m_SortingOrder: 0
---- !u!1 &653210788188657183
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 653210788188657168}
-  - component: {fileID: 653210788188657169}
-  m_Layer: 9
-  m_Name: LB
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &653210788188657168
-Transform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210788188657183}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: -0.25000003, y: -0.41, z: -0.98000085}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 653210788116060806}
-  m_RootOrder: 0
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!146 &653210788188657169
-WheelCollider:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210788188657183}
-  m_Center: {x: 0, y: 0.045, z: 0}
-  m_Radius: 0.645
-  m_SuspensionSpring:
-    spring: 10000
-    damper: 100
-    targetPosition: 0.5
-  m_SuspensionDistance: 0.09
-  m_ForceAppPointDistance: 0
-  m_Mass: 23.43
-  m_WheelDampingRate: 1
-  m_ForwardFriction:
-    m_ExtremumSlip: 0.4
-    m_ExtremumValue: 1
-    m_AsymptoteSlip: 0.8
-    m_AsymptoteValue: 0.5
-    m_Stiffness: 1
-  m_SidewaysFriction:
-    m_ExtremumSlip: 0.2
-    m_ExtremumValue: 1
-    m_AsymptoteSlip: 0.5
-    m_AsymptoteValue: 0.75
-    m_Stiffness: 1
-  m_Enabled: 1
 --- !u!1 &653210788225458854
 GameObject:
   m_ObjectHideFlags: 0
@@ -3354,13 +3213,13 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 653210788318262020}
-  - component: {fileID: 653210788318262023}
   - component: {fileID: 653210788318262021}
   - component: {fileID: 653210788318262139}
   - component: {fileID: 653210788318262136}
   - component: {fileID: 653210788318262140}
   - component: {fileID: 653210788318262022}
   - component: {fileID: 653210788318262138}
+  - component: {fileID: 9132626276124788811}
   m_Layer: 0
   m_Name: BikePlayer
   m_TagString: Untagged
@@ -3384,33 +3243,6 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
---- !u!114 &653210788318262023
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210788318262019}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: a27bbfe203006ee44b3dece1ad698c4d, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  rearWheel: {fileID: 653210788269963884}
-  frontWheel: {fileID: 653210788424474659}
-  centerOfMass: {fileID: 653210787170027624}
-  rigidBody: {fileID: 653210787133548209}
-  wheelConfig:
-    frontLeft: {fileID: 653210787295041961}
-    frontRight: {fileID: 653210789225352596}
-    rearLeft: {fileID: 653210788188657169}
-    rearRight: {fileID: 653210787661403619}
-  offsetCollidersFromWheel: 0.5
-  maxLeaningAngle: 10
-  maxSteeringAngle: 15
-  maxSpeed: 11.111
-  maxBreakTorque: 2000
-  maxMotorTorque: 1500
 --- !u!114 &653210788318262021
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -3544,6 +3376,18 @@ MonoBehaviour:
   m_DefaultActionMap: Player
   m_SplitScreenIndex: -1
   m_Camera: {fileID: 0}
+--- !u!114 &9132626276124788811
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 653210788318262019}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: b7a0f2b17bf1432ba0a0af0ae563930c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1 &653210788417861314
 GameObject:
   m_ObjectHideFlags: 0
@@ -3790,7 +3634,6 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 653210788491264410}
-  - component: {fileID: 653210788491264411}
   m_Layer: 0
   m_Name: HUD
   m_TagString: Untagged
@@ -3812,19 +3655,6 @@ Transform:
   m_Father: {fileID: 653210788318262020}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!114 &653210788491264411
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210788491264409}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 5bf6ef59c1034b1f8b9c5c713fb4c1b1, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  wcBicycleController: {fileID: 653210788318262023}
 --- !u!1 &653210788492639422
 GameObject:
   m_ObjectHideFlags: 0
@@ -4118,37 +3948,6 @@ MonoBehaviour:
   tracker: {fileID: 653210788976783335}
   posText: {fileID: 653210788094787144}
   rotText: {fileID: 653210788225458840}
---- !u!114 &653210788552364707
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210787637606582}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_RenderShadows: 1
-  m_RequiresDepthTextureOption: 2
-  m_RequiresOpaqueTextureOption: 2
-  m_CameraType: 0
-  m_Cameras: []
-  m_RendererIndex: -1
-  m_VolumeLayerMask:
-    serializedVersion: 2
-    m_Bits: 1
-  m_VolumeTrigger: {fileID: 0}
-  m_RenderPostProcessing: 0
-  m_Antialiasing: 0
-  m_AntialiasingQuality: 2
-  m_StopNaN: 0
-  m_Dithering: 0
-  m_ClearDepth: 1
-  m_RequiresDepthTexture: 0
-  m_RequiresColorTexture: 0
-  m_Version: 2
 --- !u!1 &653210788767862365
 GameObject:
   m_ObjectHideFlags: 0
@@ -4316,7 +4115,7 @@ Transform:
   - {fileID: 653210788876283597}
   - {fileID: 653210787450685107}
   m_Father: {fileID: 653210787133548210}
-  m_RootOrder: 4
+  m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &653210788814296919
 GameObject:
@@ -4397,52 +4196,6 @@ MeshRenderer:
   m_SortingLayerID: 0
   m_SortingLayer: 0
   m_SortingOrder: 0
---- !u!114 &653210788874333620
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210787637621008}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 191e6394491f45a0affa3a8a9b152ffc, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  resetAction:
-    actionPath: /actions/bikevr/in/ResetPosition
-    needsReinit: 0
-  modeAction:
-    actionPath: /actions/bikevr/in/MovePlayerModeSwitch
-    needsReinit: 0
-  moveForwards:
-    actionPath: /actions/bikevr/in/MovePlayerForward
-    needsReinit: 0
-  moveBackwards:
-    actionPath: /actions/bikevr/in/MovePlayerBackward
-    needsReinit: 0
-  moveRight:
-    actionPath: /actions/bikevr/in/MovePlayerRight
-    needsReinit: 0
-  moveLeft:
-    actionPath: /actions/bikevr/in/MovePlayerLeft
-    needsReinit: 0
-  movementSpeed: 1
---- !u!114 &653210788874333622
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210787637621008}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 98b06a0ba8ae04242a768466630b04fd, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  savePos:
-    actionPath: /actions/bikevr/in/ResetBikePosition
-    needsReinit: 0
 --- !u!1 &653210788876283596
 GameObject:
   m_ObjectHideFlags: 0
@@ -5533,7 +5286,7 @@ Transform:
   m_LocalScale: {x: 4.1654, y: 1.7562, z: 3.2095}
   m_Children: []
   m_Father: {fileID: 653210787133548210}
-  m_RootOrder: 5
+  m_RootOrder: 4
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!33 &653210789216524998
 MeshFilter:
@@ -5675,67 +5428,6 @@ MeshRenderer:
   m_SortingLayerID: 0
   m_SortingLayer: 0
   m_SortingOrder: 0
---- !u!1 &653210789225352594
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 653210789225352595}
-  - component: {fileID: 653210789225352596}
-  m_Layer: 9
-  m_Name: RF
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &653210789225352595
-Transform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210789225352594}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0.25000015, y: -0.41, z: 0.9810003}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 653210788116060806}
-  m_RootOrder: 3
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!146 &653210789225352596
-WheelCollider:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 653210789225352594}
-  m_Center: {x: 0, y: 0.045, z: 0}
-  m_Radius: 0.645
-  m_SuspensionSpring:
-    spring: 10000
-    damper: 100
-    targetPosition: 0.5
-  m_SuspensionDistance: 0.09
-  m_ForceAppPointDistance: 0
-  m_Mass: 23.43
-  m_WheelDampingRate: 1
-  m_ForwardFriction:
-    m_ExtremumSlip: 0.4
-    m_ExtremumValue: 1
-    m_AsymptoteSlip: 0.8
-    m_AsymptoteValue: 0.5
-    m_Stiffness: 1
-  m_SidewaysFriction:
-    m_ExtremumSlip: 0.2
-    m_ExtremumValue: 1
-    m_AsymptoteSlip: 0.5
-    m_AsymptoteValue: 0.75
-    m_Stiffness: 1
-  m_Enabled: 1
 --- !u!1001 &653210787637515450
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -5869,7 +5561,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
       propertyPath: m_RootOrder
-      value: 6
+      value: 5
       objectReference: {fileID: 0}
     - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3}
       propertyPath: m_LocalEulerAnglesHint.x
@@ -6021,12 +5713,6 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 653210787637515450}
   m_PrefabAsset: {fileID: 0}
---- !u!1 &653210787637606582 stripped
-GameObject:
-  m_CorrespondingSourceObject: {fileID: 125964, guid: dc06161b6d97feb419f45f03b62e14b9,
-    type: 3}
-  m_PrefabInstance: {fileID: 653210787637515450}
-  m_PrefabAsset: {fileID: 0}
 --- !u!20 &653210787636636274 stripped
 Camera:
   m_CorrespondingSourceObject: {fileID: 2014920, guid: dc06161b6d97feb419f45f03b62e14b9,
@@ -6039,3 +5725,9 @@ GameObject:
     type: 3}
   m_PrefabInstance: {fileID: 653210787637515450}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &653210787637606582 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 125964, guid: dc06161b6d97feb419f45f03b62e14b9,
+    type: 3}
+  m_PrefabInstance: {fileID: 653210787637515450}
+  m_PrefabAsset: {fileID: 0}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3 - 898
Assets/Scenes/MainScene.unity


+ 13 - 0
Assets/Scripts/Controller/Bicycle/DummyBicycleController.cs

@@ -0,0 +1,13 @@
+using UnityEngine;
+
+namespace Controller.Bicycle
+{
+    public class DummyBicycleController : MonoBehaviour, IBicycleController
+    {
+        public BicycleControllerMode ControllerMode { get; set; }
+        public float CurrentSpeed { get; set; }
+        public float CurrentLeaningAngle { get; set; }
+        public float CurrentSteerAngle { get; set; }
+        public Vector3 RigidBodyVelocity => Vector3.zero;
+    }
+}

+ 3 - 0
Assets/Scripts/Controller/Bicycle/DummyBicycleController.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b7a0f2b17bf1432ba0a0af0ae563930c
+timeCreated: 1607510741

+ 8 - 3
Assets/Scripts/Controller/Bicycle/IBicycleController.cs

@@ -1,12 +1,15 @@
-namespace Controller.Bicycle
+using System;
+using UnityEngine;
+
+namespace Controller.Bicycle
 {
     public enum BicycleControllerMode
     {
         Independent,
         LeaningAngleDependentOnSteerAngle
     }
-
-    internal interface IBicycleController
+    
+    public interface IBicycleController
     {
         BicycleControllerMode ControllerMode { get; set; }
 
@@ -15,5 +18,7 @@
         float CurrentLeaningAngle { get; set; }
 
         float CurrentSteerAngle { get; set; }
+        
+        Vector3 RigidBodyVelocity { get; }
     }
 }

+ 57 - 2
Assets/Scripts/Controller/Bicycle/RbBicycleController.cs

@@ -1,12 +1,67 @@
-using UnityEngine;
+using System;
+using UnityEngine;
 
 namespace Controller.Bicycle
 {
     public class RbBicycleController : MonoBehaviour, IBicycleController
     {
-        public BicycleControllerMode ControllerMode { get; set; }
+        #region Variables
+
+        public Rigidbody rigidBody;
+        public BicycleControllerMode controllerMode;
+        public Transform centerOfMass;
+
+        private Transform rbTransform;
+
+        public BicycleControllerMode ControllerMode
+        {
+            get => controllerMode;
+            set => controllerMode = value;
+        }
+
         public float CurrentSpeed { get; set; }
         public float CurrentLeaningAngle { get; set; }
         public float CurrentSteerAngle { get; set; }
+        public Vector3 RigidBodyVelocity => rigidBody.velocity;
+
+        #endregion
+
+        private void Awake()
+        {
+            rbTransform = rigidBody.transform;
+            rigidBody.freezeRotation = true;
+            rigidBody.centerOfMass = centerOfMass.position;
+        }
+
+        private void Update()
+        {
+            throw new NotImplementedException();
+        }
+
+        private void FixedUpdate()
+        {
+            ApplyVelocity();
+        }
+
+        private void ApplyVelocity()
+        {
+            var targetVelocity = new Vector3(CalculateVelocityX(), 0, CurrentSpeed);
+            targetVelocity = rbTransform.TransformDirection(targetVelocity);
+            var velocityChange = targetVelocity - rigidBody.velocity;
+            velocityChange.y = 0;
+            rigidBody.AddForce(velocityChange, ForceMode.VelocityChange);
+        }
+
+        private float CalculateVelocityX()
+        {
+            var previousRotation = rbTransform.localRotation.eulerAngles;
+            rbTransform.localRotation = Quaternion.Euler(previousRotation + new Vector3(0,CurrentSteerAngle,0) * Time.fixedDeltaTime);
+            return 0;
+            //return CurrentSteerAngle/4; //TODO: something a bit smarter
+        }
+
+        private void ApplyLeaningAngle()
+        {
+        }
     }
 }

+ 2 - 0
Assets/Scripts/Controller/Bicycle/WcBicycleController.cs

@@ -51,6 +51,8 @@ namespace Controller.Bicycle
             get => currentLeaningAngle;
             set => currentLeaningAngle = Mathf.Clamp(value, -maxLeaningAngle, maxLeaningAngle);
         }
+        
+        public Vector3 RigidBodyVelocity => rigidBody.velocity;
 
         private WheelCollider[] allWheelColliders;
         private float initialWheelColliderY;

+ 6 - 5
Assets/Scripts/Display/DebugDisplay.cs

@@ -8,9 +8,9 @@ using UnityEngine;
 
 namespace Display
 {
-    public class DebugDisplay : MonoBehaviour
+    public class DebugDisplay<T> : MonoBehaviour where T : IBicycleController
     {
-        public WcBicycleController wcBicycleController;
+        public T bicycleController;
         private BikeSensorData sensorData = BikeSensorData.Instance;
 
         private string ip;
@@ -24,7 +24,7 @@ namespace Display
 
         private void Update()
         {
-            var rbSpeed = wcBicycleController.rigidBody.velocity.magnitude * 3.6;
+            var rbSpeed = bicycleController.RigidBodyVelocity.magnitude * 3.6;
             var sensorSpeed = sensorData.SpeedData?.SpeedKmh ?? 0f;
             var sb = new StringBuilder();
             //sb.Append(
@@ -35,9 +35,9 @@ namespace Display
             sb.Append("\n\n");
             sb.Append($"IP: {ip}\n");
             sb.Append("----BicycleController-----\n");
-            sb.Append($"Actual Speed {rbSpeed:n2} km/h - Dif: {(wcBicycleController.CurrentSpeed * 3.6 - rbSpeed):n2}\n");
+            sb.Append($"Actual Speed {rbSpeed:n2} km/h - Dif: {(bicycleController.CurrentSpeed * 3.6 - rbSpeed):n2}\n");
             sb.Append(
-                $"Current Speed = {wcBicycleController.CurrentSpeed:n2} m/s ({(wcBicycleController.CurrentSpeed * 3.6):n2} km/h)");
+                $"Current Speed = {bicycleController.CurrentSpeed:n2} m/s ({(bicycleController.CurrentSpeed * 3.6):n2} km/h)");
             text = sb.ToString();
         }
 
@@ -70,4 +70,5 @@ namespace Display
             return usedIp;
         }
     }
+
 }

+ 10 - 0
Assets/Scripts/Display/RbDebugDisplay.cs

@@ -0,0 +1,10 @@
+using Controller.Bicycle;
+using UnityEngine;
+
+namespace Display
+{
+    public class RbDebugDisplay : DebugDisplay<RbBicycleController>
+    {
+        
+    }
+}

+ 3 - 0
Assets/Scripts/Display/RbDebugDisplay.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 2536d945c8ba43ba857360dbd62685d0
+timeCreated: 1607514066

+ 10 - 0
Assets/Scripts/Display/WcDebugDisplay.cs

@@ -0,0 +1,10 @@
+using Controller.Bicycle;
+using UnityEngine;
+
+namespace Display
+{
+    public class WcDebugDisplay : DebugDisplay<WcBicycleController>
+    {
+        
+    }
+}

+ 3 - 0
Assets/Scripts/Display/WcDebugDisplay.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 08d84f83c699406a89782ab48646272c
+timeCreated: 1607514039

+ 1 - 1
ProjectSettings/QualitySettings.asset

@@ -95,7 +95,7 @@ QualitySettings:
     skinWeights: 2
     textureQuality: 0
     anisotropicTextures: 1
-    antiAliasing: 0
+    antiAliasing: 2
     softParticles: 0
     softVegetation: 1
     realtimeReflectionProbes: 1

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


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


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä