- got rid of secplane_t::fA and fB. All uses could be replaced by other functions.

This commit is contained in:
Christoph Oelckers 2016-04-03 19:46:00 +02:00
commit 4e5ba49aca
4 changed files with 10 additions and 19 deletions

View file

@ -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;
}