From 8c2832d13ec5b5cd9c67fff048d4d590a69c242b Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 2 Jun 2021 22:02:51 -0700 Subject: [PATCH] More Spiderball fixes --- Runtime/World/CMorphBall.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Runtime/World/CMorphBall.cpp b/Runtime/World/CMorphBall.cpp index 9deda7c82..818edf7a2 100644 --- a/Runtime/World/CMorphBall.cpp +++ b/Runtime/World/CMorphBall.cpp @@ -694,21 +694,21 @@ void CMorphBall::ApplySpiderBallRollForces(const CFinalInput& input, CStateManag } x18f8_spiderSurfacePivotTargetAngle = angle; } - x18f4_spiderSurfacePivotAngle += std::copysign( - std::min(std::fabs(x18f8_spiderSurfacePivotTargetAngle - x18f4_spiderSurfacePivotAngle), 0.2f), - x18f8_spiderSurfacePivotTargetAngle - x18f4_spiderSurfacePivotAngle); + const float minAngle = + std::max(std::fabs(x18f8_spiderSurfacePivotTargetAngle - x18f4_spiderSurfacePivotAngle), 0.2f); + x18f4_spiderSurfacePivotAngle = minAngle * 1.f + x18f4_spiderSurfacePivotAngle; x189c_spiderInterpBetweenPoints = x18c4_spiderSurfaceTransform.rotate(zeus::CTransform::RotateY(x18f4_spiderSurfacePivotAngle).basis[2]); } } x0_player.ApplyForceWR( - {0.f, 0.f, g_tweakBall->GetBallGravity() * x0_player.GetMass() * 8.f * (1.f - x188c_spiderPullMovement)}, + {0.f, 0.f, (1.f - x188c_spiderPullMovement) * 8.f * (x0_player.GetMass() * g_tweakBall->GetBallGravity())}, zeus::CAxisAngle()); } else { x18b4_linVelDamp = 0.2f; x18b8_angVelDamp = 0.2f; } - x0_player.SetMomentumWR(4.f * x0_player.GetMass() * g_tweakBall->GetBallGravity() * x1880_playerToSpiderNormal); + x0_player.SetMomentumWR(4.f * (x0_player.GetMass() * g_tweakBall->GetBallGravity()) * x1880_playerToSpiderNormal); } }