Sector portals sunlight only

This commit is contained in:
RaveYard 2023-09-05 15:47:48 +02:00 committed by Magnus Norddahl
commit 036debfac6
5 changed files with 69 additions and 2 deletions

View file

@ -55,7 +55,9 @@ struct LevelMeshSurface
//
// Required for internal lightmapper:
//
// int portalDestinationIndex = -1; // line or sector index
int portalIndex = 0;
int sectorGroup = 0;
BBox bounds;
@ -146,6 +148,25 @@ struct LevelMeshPortal
}
};
// for use with std::set to recursively go through portals and skip returning portals
struct RecursivePortalComparator
{
bool operator()(const LevelMeshPortal& a, const LevelMeshPortal& b) const
{
return !a.IsInversePortal(b) && std::memcmp(&a.transformation, &b.transformation, sizeof(VSMatrix)) < 0;
}
};
// for use with std::map to reject portals which have the same effect for light rays
struct IdenticalPortalComparator
{
bool operator()(const LevelMeshPortal& a, const LevelMeshPortal& b) const
{
return !a.IsEqualPortal(b) && std::memcmp(&a.transformation, &b.transformation, sizeof(VSMatrix)) < 0;
}
};
class LevelMesh
{
public: