2017-03-10 01:22:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "actor.h"
|
|
|
|
#include "r_defs.h"
|
2018-04-01 18:17:39 +00:00
|
|
|
#include "g_levellocals.h"
|
|
|
|
// These depend on both actor.h and r_defs.h so they cannot be in either file without creating a circular dependency.
|
2017-03-10 01:22:42 +00:00
|
|
|
|
|
|
|
inline DVector3 AActor::PosRelative(int portalgroup) const
|
|
|
|
{
|
2018-04-01 18:17:39 +00:00
|
|
|
return Pos() + level.Displacements.getOffset(Sector->PortalGroup, portalgroup);
|
2017-03-10 01:22:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline DVector3 AActor::PosRelative(const AActor *other) const
|
|
|
|
{
|
2018-04-01 18:17:39 +00:00
|
|
|
return Pos() + level.Displacements.getOffset(Sector->PortalGroup, other->Sector->PortalGroup);
|
2017-03-10 01:22:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline DVector3 AActor::PosRelative(sector_t *sec) const
|
|
|
|
{
|
2018-04-01 18:17:39 +00:00
|
|
|
return Pos() + level.Displacements.getOffset(Sector->PortalGroup, sec->PortalGroup);
|
2017-03-10 01:22:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline DVector3 AActor::PosRelative(line_t *line) const
|
|
|
|
{
|
2018-04-01 18:17:39 +00:00
|
|
|
return Pos() + level.Displacements.getOffset(Sector->PortalGroup, line->frontsector->PortalGroup);
|
2017-03-10 01:22:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline DVector3 PosRelative(const DVector3 &pos, line_t *line, sector_t *refsec = NULL)
|
|
|
|
{
|
2018-04-01 18:17:39 +00:00
|
|
|
return pos + level.Displacements.getOffset(refsec->PortalGroup, line->frontsector->PortalGroup);
|
2017-03-10 01:22:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void AActor::ClearInterpolation()
|
|
|
|
{
|
|
|
|
Prev = Pos();
|
|
|
|
PrevAngles = Angles;
|
|
|
|
if (Sector) PrevPortalGroup = Sector->PortalGroup;
|
|
|
|
else PrevPortalGroup = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline double secplane_t::ZatPoint(const AActor *ac) const
|
|
|
|
{
|
|
|
|
return (D + normal.X*ac->X() + normal.Y*ac->Y()) * negiC;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline double sector_t::HighestCeilingAt(AActor *a, sector_t **resultsec)
|
|
|
|
{
|
|
|
|
return HighestCeilingAt(a->Pos(), resultsec);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline double sector_t::LowestFloorAt(AActor *a, sector_t **resultsec)
|
|
|
|
{
|
|
|
|
return LowestFloorAt(a->Pos(), resultsec);
|
|
|
|
}
|
|
|
|
|