From 171a6be7361bf02e0068a4cdb7b10028758be57c Mon Sep 17 00:00:00 2001 From: Sardelka Date: Sat, 30 Jul 2022 21:51:56 +0800 Subject: [PATCH] Revert "Squared" This reverts commit 91035d9a3f780e3264a289b6d66dc403a20fa92c. --- RageCoop.Client/Sync/Entities/SyncedVehicle.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/RageCoop.Client/Sync/Entities/SyncedVehicle.cs b/RageCoop.Client/Sync/Entities/SyncedVehicle.cs index 73bba5d..43ed50d 100644 --- a/RageCoop.Client/Sync/Entities/SyncedVehicle.cs +++ b/RageCoop.Client/Sync/Entities/SyncedVehicle.cs @@ -141,11 +141,11 @@ namespace RageCoop.Client var v = Main.P.CurrentVehicle; if (v!= null && MainVehicle.IsTouching(v)) { - DisplayVehicle(true); + DisplayVehicle(00.1f); } else { - DisplayVehicle(false); + DisplayVehicle(1); } #region FLAGS if (IsDead) @@ -352,18 +352,15 @@ namespace RageCoop.Client } LastUpdated=Main.Ticked; } - void DisplayVehicle(bool touching) + void DisplayVehicle(float calibrationMultiplier=1) { var current = MainVehicle.ReadPosition(); var predicted = Position+Velocity*(Networking.Latency+0.001f*LastSyncedStopWatch.ElapsedMilliseconds); var dist = current.DistanceTo(Position); if (dist<8) { - if (!touching) - { - MainVehicle.Velocity = Velocity; - } - MainVehicle.ApplyForce((touching? 0.001f:1) *dist*dist*(predicted - current)); + MainVehicle.Velocity = Velocity; + MainVehicle.ApplyForce(calibrationMultiplier*dist*(predicted - current)); if (IsFlipped) { MainVehicle.Quaternion=Quaternion.Slerp(MainVehicle.ReadQuaternion(), Quaternion, 0.5f); @@ -374,7 +371,7 @@ namespace RageCoop.Client Vector3 cali = GetCalibrationRotation(); if (cali.Length()<50) { - MainVehicle.RotationVelocity = (touching ? 0.001f : 1)*(RotationVelocity+cali*0.2f); + MainVehicle.RotationVelocity = calibrationMultiplier*(RotationVelocity+cali*0.2f); } else {