From 08d808089f659728e7a0d78b9439d6a81ba08ece Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 29 Oct 2023 21:30:48 +1100 Subject: [PATCH] - Simplify some vector math in `calcChaseCamPos()`. --- source/core/gamefuncs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index 71a5e1ce7..8e7926f4f 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -67,7 +67,7 @@ bool calcChaseCamPos(DVector3& ppos, DCoreActor* act, sectortype** psect, const { // Push you a little bit off the wall *psect = hitinfo.hitSector; - hpos.*c -= npos.*c * npos.XY().dot(hitinfo.hitWall->delta().Angle().ToVector().Rotated90CW()) * (1. / 1024.); + hpos.*c += npos.*c * npos.XY().dot(hitinfo.hitWall->normalAngle().ToVector()) * (1. / 1024.); } else if (hitinfo.hitActor == nullptr) { @@ -87,7 +87,7 @@ bool calcChaseCamPos(DVector3& ppos, DCoreActor* act, sectortype** psect, const else { // same as wall calculation. - hpos.*c -= npos.*c * npos.XY().dot((act->spr.Angles.Yaw - DAngle90).ToVector().Rotated90CW()) * (1. / 1024.); + hpos.*c += npos.*c * npos.XY().dot(act->spr.Angles.Yaw.ToVector()) * (1. / 1024.); } const double newdist = hpos.*c / npos.*c;