- floatified AActor::Prev plus the stuff using it.

- rewrote some coordinate functions in AActor to use real float math instead of converting back and forth between float and fixed.
This commit is contained in:
Christoph Oelckers 2016-03-25 16:25:25 +01:00
commit 1125101b37
13 changed files with 108 additions and 92 deletions

View file

@ -757,32 +757,26 @@ int P_Thing_Warp(AActor *caller, AActor *reference, double xofs, double yofs, do
caller->Vel.Zero();
}
#if 0 // needs fixing
// this is no fun with line portals
if (flags & WARPF_WARPINTERPOLATION)
{
// This just translates the movement but doesn't change the vector
fixedvec3 displacedold = old + Displacements.getOffset(oldpgroup, caller->Sector->PortalGroup);
caller->PrevX += caller->_f_X() - displacedold.x;
caller->PrevY += caller->_f_Y() - displacedold.y;
caller->PrevZ += caller->_f_Z() - displacedold.z;
DVector3 displacedold = old + Displacements.getOffset(oldpgroup, caller->Sector->PortalGroup);
caller->Prev += caller->Pos() - displacedold;
caller->PrevPortalGroup = caller->Sector->PortalGroup;
}
else if (flags & WARPF_COPYINTERPOLATION)
{
// Map both positions of the reference actor to the current portal group
fixedvec3 displacedold = old + Displacements.getOffset(reference->PrevPortalGroup, caller->Sector->PortalGroup);
fixedvec3 displacedref = old + Displacements.getOffset(reference->Sector->PortalGroup, caller->Sector->PortalGroup);
caller->PrevX = caller->_f_X() + displacedold.x - displacedref.x;
caller->PrevY = caller->_f_Y() + displacedold.y - displacedref.y;
caller->PrevZ = caller->_f_Z() + displacedold.z - displacedref.z;
DVector3 displacedold = old + Displacements.getOffset(reference->PrevPortalGroup, caller->Sector->PortalGroup);
DVector3 displacedref = old + Displacements.getOffset(reference->Sector->PortalGroup, caller->Sector->PortalGroup);
caller->Prev = caller->Pos() + displacedold - displacedref;
caller->PrevPortalGroup = caller->Sector->PortalGroup;
}
else if (!(flags & WARPF_INTERPOLATE))
{
caller->ClearInterpolation();
}
#endif
if ((flags & WARPF_BOB) && (reference->flags2 & MF2_FLOATBOB))
{