- removed the one-sided line portals on polyobjects only limitation. Using Eternity's polyportal testmap shows that it expects one-sided crossable portals on non-polyobject walls.
- converted the P_TranslatePortal* functions to use floating point trigonometry. The combination of R_PointToAngle and finesine even created discrepancies with perfectly parallel portals which is just not acceptable. - added a function to FPathTraverse to relocate the trace and restart from the new position. - made P_UseLines portal aware. Traversal through line portals is complete (all types, even teleporters), whether sector portals need better treatment remains to be seen - at the moment it only checks the range at the player's vertical center.
This commit is contained in:
parent
6bcaa51968
commit
2584108200
9 changed files with 133 additions and 64 deletions
|
|
@ -3286,6 +3286,42 @@ void AActor::SetRoll(angle_t r, bool interpolate)
|
|||
}
|
||||
|
||||
|
||||
fixedvec3 AActor::GetPortalTransition(fixed_t byoffset)
|
||||
{
|
||||
bool moved = false;
|
||||
sector_t *sec = Sector;
|
||||
fixed_t testz = Z() + byoffset;
|
||||
fixedvec3 pos = Pos();
|
||||
|
||||
while (!sec->PortalBlocksMovement(sector_t::ceiling))
|
||||
{
|
||||
AActor *port = sec->SkyBoxes[sector_t::ceiling];
|
||||
if (testz > port->threshold)
|
||||
{
|
||||
pos = PosRelative(port->Sector);
|
||||
sec = P_PointInSector(pos.x, pos.y);
|
||||
moved = true;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
if (!moved)
|
||||
{
|
||||
while (!sec->PortalBlocksMovement(sector_t::floor))
|
||||
{
|
||||
AActor *port = sec->SkyBoxes[sector_t::floor];
|
||||
if (testz <= port->threshold)
|
||||
{
|
||||
pos = PosRelative(port->Sector);
|
||||
sec = P_PointInSector(pos.x, pos.y);
|
||||
}
|
||||
else break;
|
||||
}
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AActor::CheckPortalTransition(bool islinked)
|
||||
{
|
||||
bool moved = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue