From f61150a75e1e0011e5a30b81ed39569aaf474d68 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 19 Jan 2019 09:58:18 +0100 Subject: [PATCH] - fixed: TVector3::Pitch() got the sign inverted. This caused bad calculations with CMF_OFFSETPITCH. Note that to compensate for the fix, the SphericalCoords function had to have its own inversion of the value removed so that it calculates the same result as before. --- src/g_level.cpp | 2 +- src/vectors.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index d5e28a6f5..99be28e05 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -2143,7 +2143,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, SphericalCoords) ACTION_RETURN_VEC3(DVector3( deltaangle(vecTo.Angle(), viewYaw).Degrees, - deltaangle(-vecTo.Pitch(), viewPitch).Degrees, + deltaangle(vecTo.Pitch(), viewPitch).Degrees, vecTo.Length() )); } diff --git a/src/vectors.h b/src/vectors.h index 002062f8c..f06d26f1d 100644 --- a/src/vectors.h +++ b/src/vectors.h @@ -1417,7 +1417,7 @@ TAngle TVector3::Angle() const template TAngle TVector3::Pitch() const { - return VecToAngle(TVector2(X, Y).Length(), Z); + return -VecToAngle(TVector2(X, Y).Length(), Z); } // Much of this is copied from TVector3. Is all that functionality really appropriate?