mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
bd7476fb8d
Both files can now be included independently without causing problems. This also required moving some inline functions into separate files and splitting off the GC definitions from dobject.h to ensure that r_defs does not need to pull in any part of the object hierarchy.
55 lines
1.4 KiB
C
55 lines
1.4 KiB
C
#pragma once
|
|
|
|
#include "actor.h"
|
|
#include "r_defs.h"
|
|
// These depend on both actor.h and r_defs.h so they cannot be in either file without creating a cross dependency.
|
|
|
|
inline DVector3 AActor::PosRelative(int portalgroup) const
|
|
{
|
|
return Pos() + Displacements.getOffset(Sector->PortalGroup, portalgroup);
|
|
}
|
|
|
|
inline DVector3 AActor::PosRelative(const AActor *other) const
|
|
{
|
|
return Pos() + Displacements.getOffset(Sector->PortalGroup, other->Sector->PortalGroup);
|
|
}
|
|
|
|
inline DVector3 AActor::PosRelative(sector_t *sec) const
|
|
{
|
|
return Pos() + Displacements.getOffset(Sector->PortalGroup, sec->PortalGroup);
|
|
}
|
|
|
|
inline DVector3 AActor::PosRelative(line_t *line) const
|
|
{
|
|
return Pos() + Displacements.getOffset(Sector->PortalGroup, line->frontsector->PortalGroup);
|
|
}
|
|
|
|
inline DVector3 PosRelative(const DVector3 &pos, line_t *line, sector_t *refsec = NULL)
|
|
{
|
|
return pos + Displacements.getOffset(refsec->PortalGroup, line->frontsector->PortalGroup);
|
|
}
|
|
|
|
|
|
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);
|
|
}
|
|
|