Skip to content

Commit

Permalink
Colliders & com transform fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitresso committed Sep 9, 2021
1 parent 050deec commit 8ca822c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 49 deletions.
6 changes: 3 additions & 3 deletions Assets/AirplanePhysics/Code/Scripts/Engines/AirplaneEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AirplaneEngine : MonoBehaviour {

private bool isShutOff;
private float lastThrottle;
private float finalShutoffThrollte;
private float finalShutoffThrottle;
private AirplaneFuel fuel;
#endregion

Expand Down Expand Up @@ -57,8 +57,8 @@ public Vector3 CalculateForce(float throttle) {
else {
lastThrottle -= Time.deltaTime * shutOffSpeed;
lastThrottle = Mathf.Clamp01(lastThrottle);
finalShutoffThrollte = powerCurve.Evaluate(lastThrottle);
finalThrottle = finalShutoffThrollte;
finalShutoffThrottle = powerCurve.Evaluate(lastThrottle);
finalThrottle = finalShutoffThrottle;
}

currentRPM = finalThrottle * maxRPM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected virtual void HandleInput() {


protected void HandleStickyThrottle() {
stickyThrottle += - throttle * throttleSpeed * Time.deltaTime;
stickyThrottle += throttle * throttleSpeed * Time.deltaTime;
stickyThrottle = Mathf.Clamp01(stickyThrottle);
}

Expand Down
101 changes: 56 additions & 45 deletions Assets/AirplanePhysics/Scenes/Airplane_Setup_Dev.unity
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ CapsuleCollider:
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.5
m_Height: 3
m_Height: 4
m_Direction: 2
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &138547970
Expand Down Expand Up @@ -638,7 +638,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh-568236
m_Name: pb_Mesh-5676
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
Expand Down Expand Up @@ -814,7 +814,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &217038224
RectTransform:
m_ObjectHideFlags: 0
Expand All @@ -826,8 +826,8 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1340767857}
- {fileID: 1735459715}
- {fileID: 1340767857}
m_Father: {fileID: 260429990}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -1505,9 +1505,9 @@ RectTransform:
m_Father: {fileID: 1091299070}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1920, y: -50}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 640, y: 100}
m_Pivot: {x: 1, y: 0.5}
--- !u!1 &362657632
Expand Down Expand Up @@ -3877,7 +3877,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh-569742
m_Name: pb_Mesh-5714
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
Expand Down Expand Up @@ -4168,7 +4168,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh-572760
m_Name: pb_Mesh-5752
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
Expand Down Expand Up @@ -4432,9 +4432,9 @@ RectTransform:
m_Father: {fileID: 1091299070}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 960, y: -50}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 640, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1226525904
Expand Down Expand Up @@ -4519,7 +4519,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &1279860018
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4897,7 +4897,7 @@ RectTransform:
- {fileID: 537106708}
- {fileID: 1671684221}
m_Father: {fileID: 217038224}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down Expand Up @@ -5153,13 +5153,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1437127569}
m_LocalRotation: {x: 0.17364816, y: 0, z: 0, w: 0.9848078}
m_LocalPosition: {x: 0, y: 0.25, z: -2}
m_LocalRotation: {x: 0.043619405, y: 0, z: 0, w: 0.9990483}
m_LocalPosition: {x: 0, y: 0.1, z: -2.23}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 532661841}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 20, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 5, y: 0, z: 0}
--- !u!136 &1437127571
CapsuleCollider:
m_ObjectHideFlags: 0
Expand All @@ -5171,7 +5171,7 @@ CapsuleCollider:
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.45
m_Height: 2.5
m_Height: 2
m_Direction: 2
m_Center: {x: 0, y: 0, z: 0.3}
--- !u!1 &1463665162
Expand Down Expand Up @@ -5662,7 +5662,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1581266170
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -6097,7 +6097,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1671684221
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -6267,7 +6267,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh-499442
m_Name: pb_Mesh-5790
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
Expand Down Expand Up @@ -6587,7 +6587,7 @@ RectTransform:
- {fileID: 1632614223}
- {fileID: 1091299070}
m_Father: {fileID: 217038224}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down Expand Up @@ -7371,7 +7371,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1911896709}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.5, z: 0.8}
m_LocalPosition: {x: 0, y: -0.6, z: 0.45}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2124795053}
Expand Down Expand Up @@ -7683,9 +7683,9 @@ RectTransform:
m_Father: {fileID: 1091299070}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -50}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 640, y: 100}
m_Pivot: {x: 0, y: 0.5}
--- !u!1 &2124795052
Expand All @@ -7700,6 +7700,7 @@ GameObject:
- component: {fileID: 2124795054}
- component: {fileID: 2124795057}
- component: {fileID: 2124795056}
- component: {fileID: 2124795062}
- component: {fileID: 2124795061}
- component: {fileID: 2124795058}
- component: {fileID: 2124795055}
Expand All @@ -7719,8 +7720,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2124795052}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.58, z: 0}
m_LocalRotation: {x: -0.14780933, y: 0, z: 0, w: 0.9890159}
m_LocalPosition: {x: 0, y: 1.3, z: -495}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1093245661}
Expand All @@ -7733,7 +7734,7 @@ Transform:
- {fileID: 1292016108}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: -17, y: 0, z: 0}
--- !u!54 &2124795054
Rigidbody:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -7791,7 +7792,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2124795052}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7cedf7d1ed46ce5439f44f4e1522f5d8, type: 3}
m_Name:
Expand Down Expand Up @@ -7912,29 +7913,20 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
maxMPH: 110
rbLerpSpeed: 1
rbLerpSpeed: 0.04
maxLiftPower: 3000
liftCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 2
outSlope: 2
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.14140618
value: 0.75793725
inSlope: 1.0016086
outSlope: 1.0016086
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
Expand All @@ -7948,8 +7940,8 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
flapLiftPower: 100
dragFactor: 0.0001
flapDragFactor: 0.1
dragFactor: 0.0004
flapDragFactor: 0.0003
pitchSpeed: 1500
rollSpeed: 1550
yawSpeed: 1500
Expand Down Expand Up @@ -8013,7 +8005,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2124795052}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7718d34474b9a8146a199f0c6639ae8d, type: 3}
m_Name:
Expand All @@ -8027,6 +8019,25 @@ MonoBehaviour:
rFlap: 103
lThumbstick: {fileID: 17489682}
rThumbstick: {fileID: 1576433614}
--- !u!114 &2124795062
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2124795052}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: df4e6d7b56356df46860e325e5ddec34, type: 3}
m_Name:
m_EditorClassIdentifier:
maxFlapIncrements: 2
minFlaps: 0
maxFlaps: 3
cameraKey: 99
brakeKey: 32
lFlap: 102
rFlap: 103
--- !u!1 &2129624026
GameObject:
m_ObjectHideFlags: 0
Expand Down

0 comments on commit 8ca822c

Please # to comment.