From c653a0038f3fe33164529e233e9421da18c7bbc5 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 03bf94cc8c..9fea13c166 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -2132,7 +2132,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 002062f8c6..f06d26f1d0 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?