mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Improve raft handling
This commit is contained in:
parent
51f68030b2
commit
7d86dd56c7
@ -103,10 +103,9 @@ namespace NewHorizons.Patches
|
|||||||
var alignmentDirection = (__instance.transform.position - __instance._alignmentFluid.transform.position).normalized;
|
var alignmentDirection = (__instance.transform.position - __instance._alignmentFluid.transform.position).normalized;
|
||||||
var degreesToTarget = Vector3.Angle(currentDirection, alignmentDirection);
|
var degreesToTarget = Vector3.Angle(currentDirection, alignmentDirection);
|
||||||
|
|
||||||
var adjustedSlerpRate = Mathf.Clamp01(10f / degreesToTarget * Time.fixedDeltaTime);
|
var adjustedSlerpRate = Mathf.Clamp01(0.01f * degreesToTarget * Time.fixedDeltaTime);
|
||||||
|
|
||||||
Vector3 a = OWPhysics.FromToAngularVelocity(currentDirection, alignmentDirection);
|
Vector3 a = OWPhysics.FromToAngularVelocity(currentDirection, alignmentDirection);
|
||||||
//__instance._owRigidbody.SetAngularVelocity(Vector3.zero);
|
|
||||||
__instance._owRigidbody.AddAngularVelocityChange(a * adjustedSlerpRate);
|
__instance._owRigidbody.AddAngularVelocityChange(a * adjustedSlerpRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user