From 0af9b16b92267764852541957d8b180a9253b5ab Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 11 May 2020 18:23:51 -0400 Subject: [PATCH] CMorphBall: Take torque by const reference in SpinToSpeed() Same behavior, minus unnecessary copies and consistency with the rest of the API. --- Runtime/World/CMorphBall.cpp | 2 +- Runtime/World/CMorphBall.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/World/CMorphBall.cpp b/Runtime/World/CMorphBall.cpp index 10fdbfee1..d2f010a0d 100644 --- a/Runtime/World/CMorphBall.cpp +++ b/Runtime/World/CMorphBall.cpp @@ -2176,7 +2176,7 @@ void CMorphBall::ApplyGravity(CStateManager& mgr) { } } -void CMorphBall::SpinToSpeed(float holdMag, zeus::CVector3f torque, float mag) { +void CMorphBall::SpinToSpeed(float holdMag, const zeus::CVector3f& torque, float mag) { x0_player.ApplyTorqueWR(torque * ((holdMag - x0_player.GetAngularVelocityWR().getVector().magnitude()) * mag)); } diff --git a/Runtime/World/CMorphBall.hpp b/Runtime/World/CMorphBall.hpp index c7dfb633b..fe6153089 100644 --- a/Runtime/World/CMorphBall.hpp +++ b/Runtime/World/CMorphBall.hpp @@ -250,7 +250,7 @@ public: const CStateManager& mgr); float CalculateSurfaceFriction() const; void ApplyGravity(CStateManager& mgr); - void SpinToSpeed(float holdMag, zeus::CVector3f torque, float mag); + void SpinToSpeed(float holdMag, const zeus::CVector3f& torque, float mag); float ComputeMaxSpeed() const; void Touch(CActor& actor, CStateManager& mgr); bool IsClimbable(const CCollisionInfo& cinfo) const;