diff options
author | aap <aap@papnet.eu> | 2020-11-22 22:49:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-22 22:49:22 +0100 |
commit | 9b4cfa618d673f23645dffd6559be45451148a18 (patch) | |
tree | b8bad1a839d94dc7a343715347b7fba8365d7a3d /src/core/ZoneCull.h | |
parent | More audio fix (diff) | |
parent | finished cullzones (diff) | |
download | re3-9b4cfa618d673f23645dffd6559be45451148a18.tar re3-9b4cfa618d673f23645dffd6559be45451148a18.tar.gz re3-9b4cfa618d673f23645dffd6559be45451148a18.tar.bz2 re3-9b4cfa618d673f23645dffd6559be45451148a18.tar.lz re3-9b4cfa618d673f23645dffd6559be45451148a18.tar.xz re3-9b4cfa618d673f23645dffd6559be45451148a18.tar.zst re3-9b4cfa618d673f23645dffd6559be45451148a18.zip |
Diffstat (limited to 'src/core/ZoneCull.h')
-rw-r--r-- | src/core/ZoneCull.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/src/core/ZoneCull.h b/src/core/ZoneCull.h index 9bc07b8c..10742ffb 100644 --- a/src/core/ZoneCull.h +++ b/src/core/ZoneCull.h @@ -12,7 +12,7 @@ public: float maxz; int32 m_indexStart; - int16 m_groupIndexCount[3]; + int16 m_groupIndexCount[3]; // only useful during resolution stage int16 m_numBuildings; int16 m_numTreadablesPlus10m; int16 m_numTreadables; @@ -26,30 +26,35 @@ public: static void DoStuffEnteringZone_OneTreadable(uint16 i); - static bool TestLine(CVector a1, CVector a2); + static bool TestLine(CVector vec1, CVector vec2); + static bool DoThoroughLineTest(CVector vec1, CVector vec2, CEntity *testEntity); float CalcDistToCullZoneSquared(float x, float y); float CalcDistToCullZone(float x, float y) { return Sqrt(CalcDistToCullZoneSquared(x, y)); }; bool IsEntityCloseEnoughToZone(CEntity* entity, bool checkLevel); + bool PointFallsWithinZone(CVector pos, float radius); + bool TestEntityVisibilityFromCullZone(CEntity *entity, float extraDist, CEntity *LODentity); + void FindTestPoints(); void GetGroupStartAndSize(int32 groupid, int32 &start, int32 &size) { switch (groupid) { + case 0: + default: + // buildings + start = m_indexStart; + size = m_groupIndexCount[0]; + break; case 1: + // treadables + 10m start = m_groupIndexCount[0] + m_indexStart; size = m_groupIndexCount[1]; break; case 2: + // treadables start = m_groupIndexCount[0] + m_groupIndexCount[1] + m_indexStart; size = m_groupIndexCount[2]; break; - default: - start = m_indexStart; - size = m_groupIndexCount[0]; - break; } } - - void FindTestPoints() {}; // todo - bool TestEntityVisibilityFromCullZone(CEntity*, float, CEntity*) { return false; }; // todo }; enum eZoneAttribs @@ -121,5 +126,12 @@ public: static void DoVisibilityTestCullZone(int zoneId, bool doIt); static bool DoWeHaveMoreThanXOccurencesOfSet(int32 count, uint16 *set); - static void CompressIndicesArray() {};// todo + static void CompressIndicesArray(); + static bool PickRandomSetForGroup(int32 zone, int32 group, uint16 *set); + static void ReplaceSetForAllGroups(uint16 *set, uint16 setid); + static void TidyUpAndMergeLists(uint16 *extraIndices, int32 numExtraIndices); + + // debug + static bool LoadTempFile(void); + static void SaveTempFile(void); }; |