diff --git a/src/p_map.cpp b/src/p_map.cpp index 564b79b933..9700eda4e3 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2945,7 +2945,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, DVector2 &move) double t; dest = actor->Pos() + move; - t = plane->fA() * dest.X + plane->fB() * dest.Y + plane->fC() * actor->Z() + plane->fD(); + t = (plane->Normal() | DVector3(dest, actor->Z())) + plane->fD(); if (t < 0) { // Desired location is behind (below) the plane // (i.e. Walking up the plane) @@ -2979,16 +2979,16 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, DVector2 &move) } if (dopush) { - actor->Vel.X = move.X = plane->fA() * 2; - actor->Vel.Y = move.Y = plane->fB() * 2; + move = plane->Normal() * 2; + actor->Vel.X = move.X; + actor->Vel.Y = move.Y; } return (actor->floorsector == actor->Sector) ? plane : NULL; } } // Slide the desired location along the plane's normal // so that it lies on the plane's surface - dest.X -= plane->fA() * t; - dest.Y -= plane->fB() * t; + dest -= plane->Normal() * t; move = dest - actor->Pos().XY(); return (actor->floorsector == actor->Sector) ? plane : NULL; } @@ -2998,8 +2998,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, DVector2 &move) { // Actor's current spot is on/in the plane, so walk down it // Same principle as walking up, except reversed - dest.X += plane->fA() * t; - dest.Y += plane->fB() * t; + dest += plane->Normal() * t; move = dest - actor->Pos().XY(); return (actor->floorsector == actor->Sector) ? plane : NULL; } diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 55625c9c50..11ee3178ef 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -1086,11 +1086,11 @@ bool secplane_t::CopyPlaneIfValid (secplane_t *dest, const secplane_t *opp) cons // If the planes do not have matching slopes, then always copy them // because clipping would require creating new sectors. - if (fA() != dest->fA() || fB() != dest->fB() || fC() != dest->fC()) + if (Normal() != dest->Normal()) { copy = true; } - else if (opp->fA() != -dest->fA() || opp->fB() != -dest->fB() || opp->fC() != -dest->fC()) + else if (opp->Normal() != -dest->Normal()) { if (fD() < dest->fD()) { diff --git a/src/p_trace.cpp b/src/p_trace.cpp index b5346d96d1..dabc92110e 100644 --- a/src/p_trace.cpp +++ b/src/p_trace.cpp @@ -877,11 +877,11 @@ bool FTraceInfo::TraceTraverse (int ptflags) bool FTraceInfo::CheckPlane (const secplane_t &plane) { - double den = plane.fA() * Vec.X + plane.fB() * Vec.Y + plane.fC() * Vec.Z; + double den = plane.Normal() | Vec; if (den != 0) { - double num = plane.fA() * Start.X + plane.fB() * Start.Y + plane.fC() * Start.Z + plane.fD(); + double num = (plane.Normal() | Start) + plane.fD(); double hitdist = -num / den; diff --git a/src/r_defs.h b/src/r_defs.h index 81e6ec4b9f..c70cd1b5e0 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -302,14 +302,6 @@ public: D = dd; } - double fA() const - { - return normal.X; - } - double fB() const - { - return normal.Y; - } double fC() const { return normal.Z;