28 friend plInternal::QueryHelper;
31 virtual void StartNewFrame()
override;
48#if PL_ENABLED(PL_COMPILE_FOR_DEVELOPMENT)
61 MAX_NUM_REGULAR_GRIDS = (
sizeof(plSpatialData::Category::m_uiValue) * 8),
62 MAX_NUM_CACHED_GRIDS = MAX_NUM_GRIDS - MAX_NUM_REGULAR_GRIDS
68 plUInt32 m_uiFirstCachedGridIndex = MAX_NUM_GRIDS;
72 PL_DECLARE_POD_TYPE();
74 plUInt64 m_uiGridBitmask : MAX_NUM_GRIDS;
75 plUInt64 m_uiAlwaysVisible : 1;
80 bool IsAlwaysVisibleData(
const Data& data)
const;
84 template <
typename Functor>
96 float m_fQueryCount = 0.0f;
97 float m_fFilteredRatio = 0.0f;
98 plUInt32 m_uiGridIndex = plInvalidIndex;
102 mutable plMutex m_CacheCandidatesMutex;
104 struct SortedCacheCandidate
106 plUInt32 m_uiIndex = 0;
109 bool operator<(
const SortedCacheCandidate& other)
const
111 if (m_fScore != other.m_fScore)
112 return m_fScore > other.m_fScore;
114 return m_uiIndex < other.m_uiIndex;
120 void MigrateCachedGrid(plUInt32 uiCandidateIndex);
121 void MigrateSpatialData(plUInt32 uiTargetGridIndex, plUInt32 uiSourceGridIndex);
123 void RemoveCachedGrid(plUInt32 uiCandidateIndex);
124 void RemoveAllCachedGrids();