Skip to content
Snippets Groups Projects
Commit f0b95e0d authored by Matthewit Dechatech's avatar Matthewit Dechatech
Browse files

A few more renames and physics flags

parent 72caf628
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6430,14 +6430,15 @@ MonoBehaviour:
Culture=neutral, PublicKeyToken=null
Interrupted: 0
InterruptTimer: 0
ApplyVelocity: 0
ApplySlopeGravity: 1
ApplyGroundFriction: 1
DetachWhenSlow: 1
DetachLock: 1
DisableMovement: 0
DisableForces: 0
DisableSlopeGravity: 0
DisableGroundFriction: 0
DisableWallDetach: 0
DisableDetach: 0
DisableAttach: 0
ApplyAirGravity: 1
ApplyAirDrag: 1
DisableAirGravity: 0
DisableAirDrag: 0
_facingForward: 0
IgnoreCollision: 0
IgnoringThisCollision: 0
Loading
Loading
@@ -7781,22 +7782,6 @@ Prefab:
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 443758, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
propertyPath: m_LocalPosition.x
value: -0.07999802
objectReference: {fileID: 0}
- target: {fileID: 443758, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
propertyPath: m_LocalPosition.y
value: 0.00000023841858
objectReference: {fileID: 0}
- target: {fileID: 443556, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
propertyPath: m_LocalPosition.x
value: 0.20000076
objectReference: {fileID: 0}
- target: {fileID: 443556, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
propertyPath: m_LocalPosition.y
value: 0.26999998
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: dbca39c759708bb4dbdc512f0b2a13b2, type: 2}
m_IsPrefabParent: 0
Loading
Loading
@@ -30403,131 +30388,131 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 460528, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 3.1238313
value: 5.6820893
objectReference: {fileID: 0}
- target: {fileID: 460528, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 470062, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 3.911162
value: 7.3793707
objectReference: {fileID: 0}
- target: {fileID: 470062, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 446106, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 4.6137023
value: 8.893866
objectReference: {fileID: 0}
- target: {fileID: 446106, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 483802, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 5.2444506
value: 10.253595
objectReference: {fileID: 0}
- target: {fileID: 483802, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 438648, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 5.813876
value: 11.481131
objectReference: {fileID: 0}
- target: {fileID: 438648, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 488482, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 6.330507
value: 12.594852
objectReference: {fileID: 0}
- target: {fileID: 488482, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 415032, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 6.8013606
value: 13.609891
objectReference: {fileID: 0}
- target: {fileID: 415032, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 412700, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 7.232262
value: 14.538804
objectReference: {fileID: 0}
- target: {fileID: 412700, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 403452, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 7.628092
value: 15.39211
objectReference: {fileID: 0}
- target: {fileID: 403452, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 407054, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 7.992961
value: 16.178675
objectReference: {fileID: 0}
- target: {fileID: 407054, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 429100, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 8.330368
value: 16.906036
objectReference: {fileID: 0}
- target: {fileID: 429100, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 487998, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 8.6433
value: 17.580637
objectReference: {fileID: 0}
- target: {fileID: 487998, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 428628, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 8.934326
value: 18.208015
objectReference: {fileID: 0}
- target: {fileID: 428628, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 422262, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 16.048033
value: 34.59541
objectReference: {fileID: 0}
- target: {fileID: 422262, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 402174, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 8.024016
value: 17.297705
objectReference: {fileID: 0}
- target: {fileID: 402174, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 416372, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.x
value: 10.6986885
value: 23.063606
objectReference: {fileID: 0}
- target: {fileID: 416372, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
value: 2.2512019
value: 2.9922347
objectReference: {fileID: 0}
- target: {fileID: 482354, guid: 4ce16cb00cbe5c444ab9214ba05766a7, type: 2}
propertyPath: m_LocalPosition.y
Loading
Loading
@@ -276,7 +276,12 @@ public float SensorsRotation
/// <summary>
/// Whether to move the controller based on current velocity.
/// </summary>
public bool ApplyVelocity;
public bool DisableMovement;
/// <summary>
/// Whether to disable forces acting on the controller.
/// </summary>
public bool DisableForces;
 
/// <summary>
/// Whether to apply slope gravity on the controller when it's on steep ground.
Loading
Loading
@@ -687,14 +692,18 @@ public void FixedUpdate()
 
UpdateGroundVelocity();
 
HandleForces();
UpdateGroundVelocity();
HandleQueuedTranslation();
HandleMovement();
if (!DisableForces)
{
HandleForces();
UpdateGroundVelocity();
}
 
UpdateGroundVelocity();
if (!DisableMovement)
{
HandleQueuedTranslation();
HandleMovement();
UpdateGroundVelocity();
}
}
#endregion
 
Loading
Loading
@@ -859,9 +868,7 @@ private void HandleForces(float timestep)
// Slope gravity
if (!DisableSlopeGravity &&
!DMath.AngleInRange_d(RelativeSurfaceAngle, -SlopeGravityBeginAngle, SlopeGravityBeginAngle))
{
GroundVelocity -= SlopeGravity * Mathf.Sin(RelativeSurfaceAngle * Mathf.Deg2Rad) * timestep;
}
 
// Ground friction
if (!DisableGroundFriction)
Loading
Loading
@@ -1654,17 +1661,22 @@ public bool Attach(float groundSpeed, float angleRadians)
/// <param name="hit">The impact data as th result of a terrain cast.</param>
public ImpactResult CheckImpact(TerrainCastHit hit)
{
if (hit == null || hit.Hit.fraction == 0f) return default(ImpactResult);
if (hit == null) return default(ImpactResult);
// Special case - if the collision found is inside a platform instead of on its surface,
// we have no collision information but the player should still push out of it
if (hit.Hit.fraction == 0f)
return new ImpactResult {ShouldAttach = true, GroundSpeed = 0f, SurfaceAngle = 0f};
 
var surfaceDegrees = DMath.PositiveAngle_d(hit.SurfaceAngle * Mathf.Rad2Deg);
 
// The player can't possibly land on something if he's traveling 90 degrees within the normal
var playerAngle = DMath.Angle(Velocity)*Mathf.Rad2Deg;
const float NormalTolerance = 45f;
if (DMath.AngleInRange_d(playerAngle - 90f, surfaceDegrees - NormalTolerance, surfaceDegrees + NormalTolerance))
{
const float NormalTolerance = 90f;
if (!DMath.AngleInRange_d(playerAngle + 180f,
surfaceDegrees + 90f - NormalTolerance, surfaceDegrees + 90f + NormalTolerance))
return default(ImpactResult);
}
 
var result = 0f;
var shouldAttach = true;
Loading
Loading
Loading
Loading
@@ -73,7 +73,8 @@ public class GroundControl : Move
/// <summary>
/// Whether acceleration is allowed.
/// </summary>
public bool AccelerationLocked;
[DebugFoldout]
public bool DisableAcceleration;
 
/// <summary>
/// Ground deceleration in units per second squared.
Loading
Loading
@@ -85,7 +86,8 @@ public class GroundControl : Move
/// <summary>
/// Whether deceleration is allowed.
/// </summary>
public bool DecelerationLocked;
[DebugFoldout]
public bool DisableDeceleration;
 
/// <summary>
/// Top running speed in unit per second.
Loading
Loading
@@ -183,9 +185,9 @@ public override void Reset()
BrakingBool = TopSpeedPercentFloat = "";
 
Acceleration = 1.6875f;
AccelerationLocked = false;
DisableAcceleration = false;
Deceleration = 18.0f;
DecelerationLocked = false;
DisableDeceleration = false;
TopSpeed = 3.6f;
MinSlopeGravitySpeed = 0.1f;
}
Loading
Loading
@@ -372,12 +374,12 @@ public bool Accelerate(float magnitude, float timestep)
 
if (magnitude < 0.0f)
{
if (!DecelerationLocked && Controller.GroundVelocity > 0.0f)
if (!DisableDeceleration && Controller.GroundVelocity > 0.0f)
{
Controller.GroundVelocity += Deceleration*magnitude*timestep;
return true;
}
else if (!AccelerationLocked && Controller.GroundVelocity > -TopSpeed)
else if (!DisableAcceleration && Controller.GroundVelocity > -TopSpeed)
{
Controller.GroundVelocity += Acceleration*magnitude*timestep;
return true;
Loading
Loading
@@ -385,12 +387,12 @@ public bool Accelerate(float magnitude, float timestep)
}
else if (magnitude > 0.0f)
{
if (!DecelerationLocked && Controller.GroundVelocity < 0.0f)
if (!DisableDeceleration && Controller.GroundVelocity < 0.0f)
{
Controller.GroundVelocity += Deceleration*magnitude*timestep;
return true;
}
else if (!AccelerationLocked && Controller.GroundVelocity < TopSpeed)
else if (!DisableAcceleration && Controller.GroundVelocity < TopSpeed)
{
Controller.GroundVelocity += Acceleration*magnitude*timestep;
return true;
Loading
Loading
Loading
Loading
@@ -193,7 +193,7 @@ public override void OnActiveEnter(State previousState)
_originalDeceleration = GroundControl.Deceleration;
 
Controller.GroundFriction = Friction;
GroundControl.AccelerationLocked = true;
GroundControl.DisableAcceleration = true;
GroundControl.Deceleration = Deceleration;
 
Controller.Sensors.TopOffset += HeightChange/2.0f;
Loading
Loading
@@ -228,7 +228,7 @@ public override void OnActiveExit()
{
Controller.SlopeGravity = _originalSlopeGravity;
Controller.GroundFriction = _originalFriction;
GroundControl.AccelerationLocked = false;
GroundControl.DisableAcceleration = false;
GroundControl.Deceleration = _originalDeceleration;
 
Controller.Sensors.TopOffset -= HeightChange/2.0f;
Loading
Loading
Loading
Loading
@@ -811,7 +811,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 157508}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.204, y: 0.272, z: 0}
m_LocalPosition: {x: 0.20000076, y: 0.26999998, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 425756}
Loading
Loading
@@ -823,7 +823,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 171088}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.08000183, y: -0, z: 0}
m_LocalPosition: {x: -0.07999802, y: 0.00000023841858, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 473634}
Loading
Loading
@@ -1329,14 +1329,15 @@ MonoBehaviour:
Culture=neutral, PublicKeyToken=null
Interrupted: 0
InterruptTimer: 0
ApplyVelocity: 0
ApplySlopeGravity: 1
ApplyGroundFriction: 1
DetachWhenSlow: 1
DetachLock: 1
DisableMovement: 0
DisableForces: 0
DisableSlopeGravity: 0
DisableGroundFriction: 0
DisableWallDetach: 0
DisableDetach: 0
DisableAttach: 0
ApplyAirGravity: 1
ApplyAirDrag: 1
DisableAirGravity: 0
DisableAirDrag: 0
_facingForward: 0
IgnoreCollision: 0
IgnoringThisCollision: 0
Loading
Loading
@@ -2466,9 +2467,9 @@ MonoBehaviour:
MovementAxis: Horizontal
InvertAxis: 0
Acceleration: 1.6875
AccelerationLocked: 0
DisableAcceleration: 0
Deceleration: 18
DecelerationLocked: 0
DisableDeceleration: 0
TopSpeed: 3.6
MinSlopeGravitySpeed: 0.1
DisableControl: 0
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment