13 , m_offsets(make_array<Index, N>(static_cast<Index>(-1)))
17 for(std::size_t di = 0; di < 3; ++di)
19 for(std::size_t ni = 0; ni < N; ++ni)
21 m_aabbMins[di][ni] = emptyAABB.getMinVertex()[di];
22 m_aabbMaxs[di][ni] = emptyAABB.getMaxVertex()[di];
32 PH_ASSERT_LT(childIdx, N);
35 Vector3R(m_aabbMins[0][childIdx], m_aabbMins[1][childIdx], m_aabbMins[2][childIdx]),
36 Vector3R(m_aabbMaxs[0][childIdx], m_aabbMaxs[1][childIdx], m_aabbMaxs[2][childIdx]));
116 const std::size_t childIdx,
118 const std::size_t childOffset,
119 const std::size_t splitAxis)
122 PH_ASSERT_LT(childIdx, N);
123 PH_ASSERT_IN_RANGE_INCLUSIVE(splitAxis, 0, 2);
125 for(std::size_t di = 0; di < 3; ++di)
127 m_aabbMins[di][childIdx] = childAABB.getMinVertex()[di];
128 m_aabbMaxs[di][childIdx] = childAABB.getMaxVertex()[di];
131 m_offsets[childIdx] = lossless_cast<Index>(childOffset);
132 m_childrenData[childIdx] = {
134 .splitAxis =
static_cast<uint8
>(splitAxis),
143 const std::size_t childIdx,
145 const std::size_t itemOffset,
146 const std::size_t splitAxis,
147 const std::size_t numItems)
150 PH_ASSERT_LT(childIdx, N);
151 PH_ASSERT_IN_RANGE_INCLUSIVE(splitAxis, 0, 2);
152 PH_ASSERT_LE(numItems, MAX_NODE_ITEMS);
154 for(std::size_t di = 0; di < 3; ++di)
156 m_aabbMins[di][childIdx] = childAABB.getMinVertex()[di];
157 m_aabbMaxs[di][childIdx] = childAABB.getMaxVertex()[di];
160 m_offsets[childIdx] = lossless_cast<Index>(itemOffset);
161 m_childrenData[childIdx] = {
163 .splitAxis =
static_cast<uint8
>(splitAxis),
164 .numItems =
static_cast<uint8
>(numItems)};
std::span< const T, EXTENT > TSpanView
Same as TSpan, except that the objects are const-qualified. Note that for pointer types,...
Definition TSpan.h:19