4 #include "IOcclusionResolver.h"
6 #include "IndexPairSet.h"
7 #include "VectorMath.h"
22 OcclusionResolverMode::Type occlusionMode);
28 InputListType& InputList() {
return m_inputList; }
30 InputLodListType& InputLodList() {
return m_inputLodList; }
32 void SetScreenDimensions(
const v2& screenDimensions) { m_screenDimensions = screenDimensions; }
36 const ResultsListType& GetResults()
const {
return m_resultsList; }
38 void SetMode(OcclusionResolverMode::Type occlusionMode) { m_occlusionMode = occlusionMode; }
50 void ClearAllExceptInputLists();
52 void ResetImplicitGrid();
54 void StageLod(
const int objectIndex);
56 void UnstageLod(
const int objectIndex);
58 void PopulateDisabledOcclusionResults();
60 void FindLodsIntersectingAABB(
const int inputLodIndexA,
61 std::vector<u32>& mergedXScratch,
62 std::vector<u32>& mergedYScratch,
63 std::vector<int>& out_inputLodsIntersectingAABB)
const;
65 bool Intersects(
const int inputLodIndexA,
66 const std::vector<int>& potentiallyIntersectingInputLods,
69 inline int CellIndexFromGridCoord(
int cellX,
int cellY)
const
71 return m_gridSizeX*cellY + cellX;
74 inline int GridCoordX(
float x)
const
76 return Math::Clamp(static_cast<int>(x / m_cellWidth), 0, m_gridSizeX - 1);
78 inline int GridCoordY(
float y)
const
80 return Math::Clamp(static_cast<int>(y / m_cellWidth), 0, m_gridSizeY - 1);
83 void PopulateGridAABBs(
const std::vector<OcclusionInputLod>& inputAABBs, std::vector<GridAABB>& out_gridAABBs)
const;
85 size_t CalcStoreElementsPerCell()
const
87 return (m_inputLodList.size() + 31) / 32;
90 bool Intersects(
const int objectIndexA)
const;
101 v2 m_screenDimensions;
103 OcclusionResolverMode::Type m_occlusionMode;
104 float m_oneOverCellWidth;
107 int m_storeElementsPerCell;
109 InputListType m_inputList;
110 InputLodListType m_inputLodList;
111 ResultsListType m_resultsList;
113 std::vector<int> m_inputLodsOrderedByPriority;
114 std::vector<SolutionEntry> m_solutionVector;
116 std::vector<GridAABB> m_gridAABBs;
117 std::vector<u32> m_storeX;
118 std::vector<u32> m_storeY;
120 std::vector<u32> m_scratchMergedX;
121 std::vector<u32> m_scratchMergedY;
122 std::vector<int> m_scratchInputLodsIntersectingAABB;