mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- preparation for upcoming work: rename the fixed point versions of PosRelative.
This commit is contained in:
parent
a3b687bc4e
commit
8b6b5e7b1c
11 changed files with 54 additions and 54 deletions
30
src/actor.h
30
src/actor.h
|
@ -837,13 +837,13 @@ public:
|
||||||
// to distinguish between portal-aware and portal-unaware distance calculation.
|
// to distinguish between portal-aware and portal-unaware distance calculation.
|
||||||
fixed_t AproxDistance(AActor *other, bool absolute = false)
|
fixed_t AproxDistance(AActor *other, bool absolute = false)
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->_f_PosRelative(this);
|
||||||
return P_AproxDistance(_f_X() - otherpos.x, _f_Y() - otherpos.y);
|
return P_AproxDistance(_f_X() - otherpos.x, _f_Y() - otherpos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed_t AproxDistance(AActor *other, fixed_t xadd, fixed_t yadd, bool absolute = false)
|
fixed_t AproxDistance(AActor *other, fixed_t xadd, fixed_t yadd, bool absolute = false)
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->_f_PosRelative(this);
|
||||||
return P_AproxDistance(_f_X() - otherpos.x + xadd, _f_Y() - otherpos.y + yadd);
|
return P_AproxDistance(_f_X() - otherpos.x + xadd, _f_Y() - otherpos.y + yadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -855,7 +855,7 @@ public:
|
||||||
// more precise, but slower version, being used in a few places
|
// more precise, but slower version, being used in a few places
|
||||||
double Distance2D(AActor *other, bool absolute = false)
|
double Distance2D(AActor *other, bool absolute = false)
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->_f_PosRelative(this);
|
||||||
return (DVector2(_f_X() - otherpos.x, _f_Y() - otherpos.y).Length())/FRACUNIT;
|
return (DVector2(_f_X() - otherpos.x, _f_Y() - otherpos.y).Length())/FRACUNIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -867,13 +867,13 @@ public:
|
||||||
// a full 3D version of the above
|
// a full 3D version of the above
|
||||||
fixed_t Distance3D(AActor *other, bool absolute = false)
|
fixed_t Distance3D(AActor *other, bool absolute = false)
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->_f_PosRelative(this);
|
||||||
return xs_RoundToInt(DVector3(_f_X() - otherpos.x, _f_Y() - otherpos.y, _f_Z() - otherpos.z).Length());
|
return xs_RoundToInt(DVector3(_f_X() - otherpos.x, _f_Y() - otherpos.y, _f_Z() - otherpos.z).Length());
|
||||||
}
|
}
|
||||||
|
|
||||||
angle_t __f_AngleTo(AActor *other, bool absolute = false)
|
angle_t __f_AngleTo(AActor *other, bool absolute = false)
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->_f_PosRelative(this);
|
||||||
return R_PointToAngle2(_f_X(), _f_Y(), otherpos.x, otherpos.y);
|
return R_PointToAngle2(_f_X(), _f_Y(), otherpos.x, otherpos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -884,13 +884,13 @@ public:
|
||||||
|
|
||||||
DAngle AngleTo(AActor *other, bool absolute = false)
|
DAngle AngleTo(AActor *other, bool absolute = false)
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->_f_PosRelative(this);
|
||||||
return VecToAngle(otherpos.x - _f_X(), otherpos.y - _f_Y());
|
return VecToAngle(otherpos.x - _f_X(), otherpos.y - _f_Y());
|
||||||
}
|
}
|
||||||
|
|
||||||
DAngle AngleTo(AActor *other, fixed_t oxofs, fixed_t oyofs, bool absolute = false) const
|
DAngle AngleTo(AActor *other, fixed_t oxofs, fixed_t oyofs, bool absolute = false) const
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->_f_Pos() : other->_f_PosRelative(this);
|
||||||
return VecToAngle(otherpos.y + oxofs - _f_Y(), otherpos.x + oyofs - _f_X());
|
return VecToAngle(otherpos.y + oxofs - _f_Y(), otherpos.x + oyofs - _f_X());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -901,27 +901,27 @@ public:
|
||||||
|
|
||||||
fixedvec2 _f_Vec2To(AActor *other) const
|
fixedvec2 _f_Vec2To(AActor *other) const
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = other->PosRelative(this);
|
fixedvec3 otherpos = other->_f_PosRelative(this);
|
||||||
fixedvec2 ret = { otherpos.x - _f_X(), otherpos.y - _f_Y() };
|
fixedvec2 ret = { otherpos.x - _f_X(), otherpos.y - _f_Y() };
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedvec3 _f_Vec3To(AActor *other) const
|
fixedvec3 _f_Vec3To(AActor *other) const
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = other->PosRelative(this);
|
fixedvec3 otherpos = other->_f_PosRelative(this);
|
||||||
fixedvec3 ret = { otherpos.x - _f_X(), otherpos.y - _f_Y(), otherpos.z - _f_Z() };
|
fixedvec3 ret = { otherpos.x - _f_X(), otherpos.y - _f_Y(), otherpos.z - _f_Z() };
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
DVector2 Vec2To(AActor *other) const
|
DVector2 Vec2To(AActor *other) const
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = other->PosRelative(this);
|
fixedvec3 otherpos = other->_f_PosRelative(this);
|
||||||
return{ FIXED2DBL(otherpos.x - _f_X()), FIXED2DBL(otherpos.y - _f_Y()) };
|
return{ FIXED2DBL(otherpos.x - _f_X()), FIXED2DBL(otherpos.y - _f_Y()) };
|
||||||
}
|
}
|
||||||
|
|
||||||
DVector3 Vec3To(AActor *other) const
|
DVector3 Vec3To(AActor *other) const
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = other->PosRelative(this);
|
fixedvec3 otherpos = other->_f_PosRelative(this);
|
||||||
return { FIXED2DBL(otherpos.x - _f_X()), FIXED2DBL(otherpos.y - _f_Y()), FIXED2DBL(otherpos.z - _f_Z()) };
|
return { FIXED2DBL(otherpos.x - _f_X()), FIXED2DBL(otherpos.y - _f_Y()), FIXED2DBL(otherpos.z - _f_Z()) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1419,10 +1419,10 @@ public:
|
||||||
return DVector3(X(), Y(), Z());
|
return DVector3(X(), Y(), Z());
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedvec3 PosRelative(int grp) const;
|
fixedvec3 _f_PosRelative(int grp) const;
|
||||||
fixedvec3 PosRelative(const AActor *other) const;
|
fixedvec3 _f_PosRelative(const AActor *other) const;
|
||||||
fixedvec3 PosRelative(sector_t *sec) const;
|
fixedvec3 _f_PosRelative(sector_t *sec) const;
|
||||||
fixedvec3 PosRelative(line_t *line) const;
|
fixedvec3 _f_PosRelative(line_t *line) const;
|
||||||
|
|
||||||
fixed_t SoundX() const
|
fixed_t SoundX() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -2732,7 +2732,7 @@ void AM_drawPlayers ()
|
||||||
|
|
||||||
if (p->mo != NULL)
|
if (p->mo != NULL)
|
||||||
{
|
{
|
||||||
fixedvec3 pos = p->mo->PosRelative(MapPortalGroup);
|
fixedvec3 pos = p->mo->_f_PosRelative(MapPortalGroup);
|
||||||
pt.x = pos.x >> FRACTOMAPBITS;
|
pt.x = pos.x >> FRACTOMAPBITS;
|
||||||
pt.y = pos.y >> FRACTOMAPBITS;
|
pt.y = pos.y >> FRACTOMAPBITS;
|
||||||
|
|
||||||
|
@ -2766,7 +2766,7 @@ void AM_drawKeys ()
|
||||||
|
|
||||||
while ((key = it.Next()) != NULL)
|
while ((key = it.Next()) != NULL)
|
||||||
{
|
{
|
||||||
fixedvec3 pos = key->PosRelative(MapPortalGroup);
|
fixedvec3 pos = key->_f_PosRelative(MapPortalGroup);
|
||||||
p.x = pos.x >> FRACTOMAPBITS;
|
p.x = pos.x >> FRACTOMAPBITS;
|
||||||
p.y = pos.y >> FRACTOMAPBITS;
|
p.y = pos.y >> FRACTOMAPBITS;
|
||||||
|
|
||||||
|
@ -2813,7 +2813,7 @@ void AM_drawThings ()
|
||||||
{
|
{
|
||||||
if (am_cheat > 0 || !(t->flags6 & MF6_NOTONAUTOMAP))
|
if (am_cheat > 0 || !(t->flags6 & MF6_NOTONAUTOMAP))
|
||||||
{
|
{
|
||||||
fixedvec3 pos = t->PosRelative(MapPortalGroup);
|
fixedvec3 pos = t->_f_PosRelative(MapPortalGroup);
|
||||||
p.x = pos.x >> FRACTOMAPBITS;
|
p.x = pos.x >> FRACTOMAPBITS;
|
||||||
p.y = pos.y >> FRACTOMAPBITS;
|
p.y = pos.y >> FRACTOMAPBITS;
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ void AFastProjectile::Tick ()
|
||||||
if (tm.ceilingline &&
|
if (tm.ceilingline &&
|
||||||
tm.ceilingline->backsector &&
|
tm.ceilingline->backsector &&
|
||||||
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
|
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
|
||||||
Z() >= tm.ceilingline->backsector->ceilingplane.ZatPointF(PosRelative(tm.ceilingline)))
|
Z() >= tm.ceilingline->backsector->ceilingplane.ZatPointF(_f_PosRelative(tm.ceilingline)))
|
||||||
{
|
{
|
||||||
// Hack to prevent missiles exploding against the sky.
|
// Hack to prevent missiles exploding against the sky.
|
||||||
// Does not handle sky floors.
|
// Does not handle sky floors.
|
||||||
|
|
|
@ -588,7 +588,7 @@ bool P_Move (AActor *actor)
|
||||||
else
|
else
|
||||||
{ // The monster just hit the floor, so trigger any actions.
|
{ // The monster just hit the floor, so trigger any actions.
|
||||||
if (actor->floorsector->SecActTarget != NULL &&
|
if (actor->floorsector->SecActTarget != NULL &&
|
||||||
actor->_f_floorz() == actor->floorsector->floorplane.ZatPoint(actor->PosRelative(actor->floorsector)))
|
actor->_f_floorz() == actor->floorsector->floorplane.ZatPoint(actor->_f_PosRelative(actor->floorsector)))
|
||||||
{
|
{
|
||||||
actor->floorsector->SecActTarget->TriggerAction(actor, SECSPAC_HitFloor);
|
actor->floorsector->SecActTarget->TriggerAction(actor, SECSPAC_HitFloor);
|
||||||
}
|
}
|
||||||
|
@ -898,8 +898,8 @@ void P_NewChaseDir(AActor * actor)
|
||||||
box.Bottom() < line->bbox[BOXTOP] &&
|
box.Bottom() < line->bbox[BOXTOP] &&
|
||||||
box.BoxOnLineSide(line) == -1)
|
box.BoxOnLineSide(line) == -1)
|
||||||
{
|
{
|
||||||
double front = line->frontsector->floorplane.ZatPointF(actor->PosRelative(line));
|
double front = line->frontsector->floorplane.ZatPointF(actor->_f_PosRelative(line));
|
||||||
double back = line->backsector->floorplane.ZatPointF(actor->PosRelative(line));
|
double back = line->backsector->floorplane.ZatPointF(actor->_f_PosRelative(line));
|
||||||
DAngle angle;
|
DAngle angle;
|
||||||
|
|
||||||
// The monster must contact one of the two floors,
|
// The monster must contact one of the two floors,
|
||||||
|
|
|
@ -638,7 +638,7 @@ double P_GetFriction(const AActor *mo, double *frictionfactor)
|
||||||
for (m = mo->touching_sectorlist; m; m = m->m_tnext)
|
for (m = mo->touching_sectorlist; m; m = m->m_tnext)
|
||||||
{
|
{
|
||||||
sec = m->m_sector;
|
sec = m->m_sector;
|
||||||
fixedvec3 pos = mo->PosRelative(sec);
|
fixedvec3 pos = mo->_f_PosRelative(sec);
|
||||||
|
|
||||||
// 3D floors must be checked, too
|
// 3D floors must be checked, too
|
||||||
for (unsigned i = 0; i < sec->e->XFloor.ffloors.Size(); i++)
|
for (unsigned i = 0; i < sec->e->XFloor.ffloors.Size(); i++)
|
||||||
|
@ -809,7 +809,7 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec
|
||||||
spechit_t spec;
|
spechit_t spec;
|
||||||
spec.line = ld;
|
spec.line = ld;
|
||||||
spec.refpos = cres.position;
|
spec.refpos = cres.position;
|
||||||
spec.oldrefpos = tm.thing->PosRelative(ld);
|
spec.oldrefpos = tm.thing->_f_PosRelative(ld);
|
||||||
portalhit.Push(spec);
|
portalhit.Push(spec);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -977,14 +977,14 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec
|
||||||
{
|
{
|
||||||
spec.line = ld;
|
spec.line = ld;
|
||||||
spec.refpos = cres.position;
|
spec.refpos = cres.position;
|
||||||
spec.oldrefpos = tm.thing->PosRelative(ld);
|
spec.oldrefpos = tm.thing->_f_PosRelative(ld);
|
||||||
spechit.Push(spec);
|
spechit.Push(spec);
|
||||||
}
|
}
|
||||||
if (ld->isLinePortal())
|
if (ld->isLinePortal())
|
||||||
{
|
{
|
||||||
spec.line = ld;
|
spec.line = ld;
|
||||||
spec.refpos = cres.position;
|
spec.refpos = cres.position;
|
||||||
spec.oldrefpos = tm.thing->PosRelative(ld);
|
spec.oldrefpos = tm.thing->_f_PosRelative(ld);
|
||||||
portalhit.Push(spec);
|
portalhit.Push(spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1242,7 +1242,7 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch
|
||||||
|
|
||||||
if (((tm.FromPMove || tm.thing->player != NULL) && thing->flags&MF_SOLID))
|
if (((tm.FromPMove || tm.thing->player != NULL) && thing->flags&MF_SOLID))
|
||||||
{
|
{
|
||||||
fixedvec3 oldpos = tm.thing->PosRelative(thing);
|
fixedvec3 oldpos = tm.thing->_f_PosRelative(thing);
|
||||||
// Both actors already overlap. To prevent them from remaining stuck allow the move if it
|
// Both actors already overlap. To prevent them from remaining stuck allow the move if it
|
||||||
// takes them further apart or the move does not change the position (when called from P_ChangeSector.)
|
// takes them further apart or the move does not change the position (when called from P_ChangeSector.)
|
||||||
if (oldpos.x == thing->_f_X() && oldpos.y == thing->_f_Y())
|
if (oldpos.x == thing->_f_X() && oldpos.y == thing->_f_Y())
|
||||||
|
@ -1963,7 +1963,7 @@ static void CheckForPushSpecial(line_t *line, int side, AActor *mobj, fixedvec2
|
||||||
if (posforwindowcheck && !(ib_compatflags & BCOMPATF_NOWINDOWCHECK) && line->backsector != NULL)
|
if (posforwindowcheck && !(ib_compatflags & BCOMPATF_NOWINDOWCHECK) && line->backsector != NULL)
|
||||||
{ // Make sure this line actually blocks us and is not a window
|
{ // Make sure this line actually blocks us and is not a window
|
||||||
// or similar construct we are standing inside of.
|
// or similar construct we are standing inside of.
|
||||||
fixedvec3 pos = mobj->PosRelative(line);
|
fixedvec3 pos = mobj->_f_PosRelative(line);
|
||||||
fixed_t fzt = line->frontsector->ceilingplane.ZatPoint(*posforwindowcheck);
|
fixed_t fzt = line->frontsector->ceilingplane.ZatPoint(*posforwindowcheck);
|
||||||
fixed_t fzb = line->frontsector->floorplane.ZatPoint(*posforwindowcheck);
|
fixed_t fzb = line->frontsector->floorplane.ZatPoint(*posforwindowcheck);
|
||||||
fixed_t bzt = line->backsector->ceilingplane.ZatPoint(*posforwindowcheck);
|
fixed_t bzt = line->backsector->ceilingplane.ZatPoint(*posforwindowcheck);
|
||||||
|
@ -2698,7 +2698,7 @@ void FSlide::HitSlideLine(line_t* ld)
|
||||||
// The wall is angled. Bounce if the angle of approach is // phares
|
// The wall is angled. Bounce if the angle of approach is // phares
|
||||||
// less than 45 degrees. // phares
|
// less than 45 degrees. // phares
|
||||||
|
|
||||||
fixedvec3 pos = slidemo->PosRelative(ld);
|
fixedvec3 pos = slidemo->_f_PosRelative(ld);
|
||||||
side = P_PointOnLineSide(pos.x, pos.y, ld);
|
side = P_PointOnLineSide(pos.x, pos.y, ld);
|
||||||
|
|
||||||
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
|
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
|
||||||
|
@ -2804,7 +2804,7 @@ void FSlide::SlideTraverse(fixed_t startx, fixed_t starty, fixed_t endx, fixed_t
|
||||||
|
|
||||||
if (!(li->flags & ML_TWOSIDED) || !li->backsector)
|
if (!(li->flags & ML_TWOSIDED) || !li->backsector)
|
||||||
{
|
{
|
||||||
fixedvec3 pos = slidemo->PosRelative(li);
|
fixedvec3 pos = slidemo->_f_PosRelative(li);
|
||||||
if (P_PointOnLineSide(pos.x, pos.y, li))
|
if (P_PointOnLineSide(pos.x, pos.y, li))
|
||||||
{
|
{
|
||||||
// don't hit the back side
|
// don't hit the back side
|
||||||
|
@ -3020,7 +3020,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, fixed_t &xmove, fixed_t &ymov
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedvec3 pos = actor->PosRelative(actor->floorsector);
|
fixedvec3 pos = actor->_f_PosRelative(actor->floorsector);
|
||||||
const secplane_t *plane = &actor->floorsector->floorplane;
|
const secplane_t *plane = &actor->floorsector->floorplane;
|
||||||
fixed_t planezhere = plane->ZatPoint(pos);
|
fixed_t planezhere = plane->ZatPoint(pos);
|
||||||
|
|
||||||
|
@ -3100,7 +3100,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, fixed_t &xmove, fixed_t &ymov
|
||||||
sector_t *sec = node->m_sector;
|
sector_t *sec = node->m_sector;
|
||||||
if (sec->floorplane.c >= STEEPSLOPE)
|
if (sec->floorplane.c >= STEEPSLOPE)
|
||||||
{
|
{
|
||||||
fixedvec3 pos = actor->PosRelative(sec);
|
fixedvec3 pos = actor->_f_PosRelative(sec);
|
||||||
pos.x += xmove;
|
pos.x += xmove;
|
||||||
pos.y += ymove;
|
pos.y += ymove;
|
||||||
|
|
||||||
|
|
|
@ -497,7 +497,7 @@ void AActor::LinkToWorld(bool spawningmapthing, sector_t *sector)
|
||||||
|
|
||||||
for (int i = -1; i < (int)check.Size(); i++)
|
for (int i = -1; i < (int)check.Size(); i++)
|
||||||
{
|
{
|
||||||
fixedvec3 pos = i==-1? _f_Pos() : PosRelative(check[i]);
|
fixedvec3 pos = i==-1? _f_Pos() : _f_PosRelative(check[i]);
|
||||||
|
|
||||||
int x1 = GetSafeBlockX(pos.x - _f_radius() - bmaporgx);
|
int x1 = GetSafeBlockX(pos.x - _f_radius() - bmaporgx);
|
||||||
int x2 = GetSafeBlockX(pos.x + _f_radius() - bmaporgx);
|
int x2 = GetSafeBlockX(pos.x + _f_radius() - bmaporgx);
|
||||||
|
|
|
@ -1388,7 +1388,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
|
||||||
|
|
||||||
if (line != NULL && cl_missiledecals)
|
if (line != NULL && cl_missiledecals)
|
||||||
{
|
{
|
||||||
fixedvec3 pos = mo->PosRelative(line);
|
fixedvec3 pos = mo->_f_PosRelative(line);
|
||||||
int side = P_PointOnLineSidePrecise (pos.x, pos.y, line);
|
int side = P_PointOnLineSidePrecise (pos.x, pos.y, line);
|
||||||
if (line->sidedef[side] == NULL)
|
if (line->sidedef[side] == NULL)
|
||||||
side ^= 1;
|
side ^= 1;
|
||||||
|
@ -2116,7 +2116,7 @@ explode:
|
||||||
if (tm.ceilingline &&
|
if (tm.ceilingline &&
|
||||||
tm.ceilingline->backsector &&
|
tm.ceilingline->backsector &&
|
||||||
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
|
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
|
||||||
mo->_f_Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->PosRelative(tm.ceilingline)))
|
mo->_f_Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->_f_PosRelative(tm.ceilingline)))
|
||||||
{
|
{
|
||||||
// Hack to prevent missiles exploding against the sky.
|
// Hack to prevent missiles exploding against the sky.
|
||||||
// Does not handle sky floors.
|
// Does not handle sky floors.
|
||||||
|
@ -3263,7 +3263,7 @@ fixedvec3 AActor::GetPortalTransition(fixed_t byoffset, sector_t **pSec)
|
||||||
AActor *port = sec->SkyBoxes[sector_t::ceiling];
|
AActor *port = sec->SkyBoxes[sector_t::ceiling];
|
||||||
if (testz > port->specialf1)
|
if (testz > port->specialf1)
|
||||||
{
|
{
|
||||||
pos = PosRelative(port->Sector);
|
pos = _f_PosRelative(port->Sector);
|
||||||
sec = P_PointInSector(pos.x, pos.y);
|
sec = P_PointInSector(pos.x, pos.y);
|
||||||
moved = true;
|
moved = true;
|
||||||
}
|
}
|
||||||
|
@ -3276,7 +3276,7 @@ fixedvec3 AActor::GetPortalTransition(fixed_t byoffset, sector_t **pSec)
|
||||||
AActor *port = sec->SkyBoxes[sector_t::floor];
|
AActor *port = sec->SkyBoxes[sector_t::floor];
|
||||||
if (testz <= port->specialf1)
|
if (testz <= port->specialf1)
|
||||||
{
|
{
|
||||||
pos = PosRelative(port->Sector);
|
pos = _f_PosRelative(port->Sector);
|
||||||
sec = P_PointInSector(pos.x, pos.y);
|
sec = P_PointInSector(pos.x, pos.y);
|
||||||
}
|
}
|
||||||
else break;
|
else break;
|
||||||
|
@ -3298,7 +3298,7 @@ void AActor::CheckPortalTransition(bool islinked)
|
||||||
{
|
{
|
||||||
fixedvec3 oldpos = _f_Pos();
|
fixedvec3 oldpos = _f_Pos();
|
||||||
if (islinked && !moved) UnlinkFromWorld();
|
if (islinked && !moved) UnlinkFromWorld();
|
||||||
SetXYZ(PosRelative(port->Sector));
|
SetXYZ(_f_PosRelative(port->Sector));
|
||||||
PrevX += _f_X() - oldpos.x;
|
PrevX += _f_X() - oldpos.x;
|
||||||
PrevY += _f_Y() - oldpos.y;
|
PrevY += _f_Y() - oldpos.y;
|
||||||
PrevZ += _f_Z() - oldpos.z;
|
PrevZ += _f_Z() - oldpos.z;
|
||||||
|
@ -3317,7 +3317,7 @@ void AActor::CheckPortalTransition(bool islinked)
|
||||||
{
|
{
|
||||||
fixedvec3 oldpos = _f_Pos();
|
fixedvec3 oldpos = _f_Pos();
|
||||||
if (islinked && !moved) UnlinkFromWorld();
|
if (islinked && !moved) UnlinkFromWorld();
|
||||||
SetXYZ(PosRelative(port->Sector));
|
SetXYZ(_f_PosRelative(port->Sector));
|
||||||
PrevX += _f_X() - oldpos.x;
|
PrevX += _f_X() - oldpos.x;
|
||||||
PrevY += _f_Y() - oldpos.y;
|
PrevY += _f_Y() - oldpos.y;
|
||||||
PrevZ += _f_Z() - oldpos.z;
|
PrevZ += _f_Z() - oldpos.z;
|
||||||
|
@ -3681,7 +3681,7 @@ void AActor::Tick ()
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fixedvec3 pos = PosRelative(sec);
|
fixedvec3 pos = _f_PosRelative(sec);
|
||||||
height = sec->floorplane.ZatPoint (pos);
|
height = sec->floorplane.ZatPoint (pos);
|
||||||
if (_f_Z() > height)
|
if (_f_Z() > height)
|
||||||
{
|
{
|
||||||
|
@ -3731,7 +3731,7 @@ void AActor::Tick ()
|
||||||
floorplane = P_FindFloorPlane(floorsector, _f_X(), _f_Y(), _f_floorz());
|
floorplane = P_FindFloorPlane(floorsector, _f_X(), _f_Y(), _f_floorz());
|
||||||
|
|
||||||
if (floorplane.c < STEEPSLOPE &&
|
if (floorplane.c < STEEPSLOPE &&
|
||||||
floorplane.ZatPoint (PosRelative(floorsector)) <= _f_floorz())
|
floorplane.ZatPoint (_f_PosRelative(floorsector)) <= _f_floorz())
|
||||||
{
|
{
|
||||||
const msecnode_t *node;
|
const msecnode_t *node;
|
||||||
bool dopush = true;
|
bool dopush = true;
|
||||||
|
@ -3743,7 +3743,7 @@ void AActor::Tick ()
|
||||||
const sector_t *sec = node->m_sector;
|
const sector_t *sec = node->m_sector;
|
||||||
if (sec->floorplane.c >= STEEPSLOPE)
|
if (sec->floorplane.c >= STEEPSLOPE)
|
||||||
{
|
{
|
||||||
if (floorplane.ZatPointF (PosRelative(node->m_sector)) >= Z() - MaxStepHeight)
|
if (floorplane.ZatPointF (_f_PosRelative(node->m_sector)) >= Z() - MaxStepHeight)
|
||||||
{
|
{
|
||||||
dopush = false;
|
dopush = false;
|
||||||
break;
|
break;
|
||||||
|
@ -4517,7 +4517,7 @@ void AActor::AdjustFloorClip ()
|
||||||
// do the floorclipping instead of the terrain type.
|
// do the floorclipping instead of the terrain type.
|
||||||
for (m = touching_sectorlist; m; m = m->m_tnext)
|
for (m = touching_sectorlist; m; m = m->m_tnext)
|
||||||
{
|
{
|
||||||
fixedvec3 pos = PosRelative(m->m_sector);
|
fixedvec3 pos = _f_PosRelative(m->m_sector);
|
||||||
sector_t *hsec = m->m_sector->GetHeightSec();
|
sector_t *hsec = m->m_sector->GetHeightSec();
|
||||||
if (hsec == NULL && m->m_sector->floorplane.ZatPoint (pos) == _f_Z())
|
if (hsec == NULL && m->m_sector->floorplane.ZatPoint (pos) == _f_Z())
|
||||||
{
|
{
|
||||||
|
@ -5684,7 +5684,7 @@ bool P_HitFloor (AActor *thing)
|
||||||
fixedvec3 pos;
|
fixedvec3 pos;
|
||||||
for (m = thing->touching_sectorlist; m; m = m->m_tnext)
|
for (m = thing->touching_sectorlist; m; m = m->m_tnext)
|
||||||
{
|
{
|
||||||
pos = thing->PosRelative(m->m_sector);
|
pos = thing->_f_PosRelative(m->m_sector);
|
||||||
if (thing->_f_Z() == m->m_sector->floorplane.ZatPoint(pos.x, pos.y))
|
if (thing->_f_Z() == m->m_sector->floorplane.ZatPoint(pos.x, pos.y))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -5729,7 +5729,7 @@ void P_CheckSplash(AActor *self, double distance)
|
||||||
// Explosion splashes never alert monsters. This is because A_Explode has
|
// Explosion splashes never alert monsters. This is because A_Explode has
|
||||||
// a separate parameter for that so this would get in the way of proper
|
// a separate parameter for that so this would get in the way of proper
|
||||||
// behavior.
|
// behavior.
|
||||||
fixedvec3 pos = self->PosRelative(floorsec);
|
fixedvec3 pos = self->_f_PosRelative(floorsec);
|
||||||
pos.z = self->_f_floorz();
|
pos.z = self->_f_floorz();
|
||||||
P_HitWater (self, floorsec, pos, false, false);
|
P_HitWater (self, floorsec, pos, false, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,8 +112,8 @@ public:
|
||||||
|
|
||||||
void init(AActor * t1, AActor * t2, sector_t *startsector, SightTask *task, int flags)
|
void init(AActor * t1, AActor * t2, sector_t *startsector, SightTask *task, int flags)
|
||||||
{
|
{
|
||||||
sightstart = t1->PosRelative(task->portalgroup);
|
sightstart = t1->_f_PosRelative(task->portalgroup);
|
||||||
sightend = t2->PosRelative(task->portalgroup);
|
sightend = t2->_f_PosRelative(task->portalgroup);
|
||||||
sightstart.z += t1->_f_height() - (t1->_f_height() >> 2);
|
sightstart.z += t1->_f_height() - (t1->_f_height() >> 2);
|
||||||
|
|
||||||
startfrac = task->frac;
|
startfrac = task->frac;
|
||||||
|
|
|
@ -2307,7 +2307,7 @@ void DPusher::Tick ()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sector_t *hsec = sec->GetHeightSec();
|
sector_t *hsec = sec->GetHeightSec();
|
||||||
fixedvec3 pos = thing->PosRelative(sec);
|
fixedvec3 pos = thing->_f_PosRelative(sec);
|
||||||
DVector2 pushvel;
|
DVector2 pushvel;
|
||||||
if (m_Type == p_wind)
|
if (m_Type == p_wind)
|
||||||
{
|
{
|
||||||
|
|
|
@ -140,7 +140,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, fixedvec3 *optpo
|
||||||
|
|
||||||
P_MakeDivline (line, &dll);
|
P_MakeDivline (line, &dll);
|
||||||
|
|
||||||
fixedvec3 pos = optpos? *optpos : user->PosRelative(line);
|
fixedvec3 pos = optpos? *optpos : user->_f_PosRelative(line);
|
||||||
dlu.x = pos.x;
|
dlu.x = pos.x;
|
||||||
dlu.y = pos.y;
|
dlu.y = pos.y;
|
||||||
dlu.dx = finecosine[user->_f_angle() >> ANGLETOFINESHIFT];
|
dlu.dx = finecosine[user->_f_angle() >> ANGLETOFINESHIFT];
|
||||||
|
|
10
src/r_defs.h
10
src/r_defs.h
|
@ -1334,27 +1334,27 @@ inline sector_t *P_PointInSector(const DVector2 &pos)
|
||||||
return P_PointInSubsector(FLOAT2FIXED(pos.X), FLOAT2FIXED(pos.Y))->sector;
|
return P_PointInSubsector(FLOAT2FIXED(pos.X), FLOAT2FIXED(pos.Y))->sector;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fixedvec3 AActor::PosRelative(int portalgroup) const
|
inline fixedvec3 AActor::_f_PosRelative(int portalgroup) const
|
||||||
{
|
{
|
||||||
return __pos + Displacements.getOffset(Sector->PortalGroup, portalgroup);
|
return __pos + Displacements.getOffset(Sector->PortalGroup, portalgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fixedvec3 AActor::PosRelative(const AActor *other) const
|
inline fixedvec3 AActor::_f_PosRelative(const AActor *other) const
|
||||||
{
|
{
|
||||||
return __pos + Displacements.getOffset(Sector->PortalGroup, other->Sector->PortalGroup);
|
return __pos + Displacements.getOffset(Sector->PortalGroup, other->Sector->PortalGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fixedvec3 AActor::PosRelative(sector_t *sec) const
|
inline fixedvec3 AActor::_f_PosRelative(sector_t *sec) const
|
||||||
{
|
{
|
||||||
return __pos + Displacements.getOffset(Sector->PortalGroup, sec->PortalGroup);
|
return __pos + Displacements.getOffset(Sector->PortalGroup, sec->PortalGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fixedvec3 AActor::PosRelative(line_t *line) const
|
inline fixedvec3 AActor::_f_PosRelative(line_t *line) const
|
||||||
{
|
{
|
||||||
return __pos + Displacements.getOffset(Sector->PortalGroup, line->frontsector->PortalGroup);
|
return __pos + Displacements.getOffset(Sector->PortalGroup, line->frontsector->PortalGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fixedvec3 PosRelative(const fixedvec3 &pos, line_t *line, sector_t *refsec = NULL)
|
inline fixedvec3 _f_PosRelative(const fixedvec3 &pos, line_t *line, sector_t *refsec = NULL)
|
||||||
{
|
{
|
||||||
return pos + Displacements.getOffset(refsec->PortalGroup, line->frontsector->PortalGroup);
|
return pos + Displacements.getOffset(refsec->PortalGroup, line->frontsector->PortalGroup);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue