9template<
typename Item,
typename Index>
10inline auto TBinaryBvhNode<Item, Index>
13 const std::size_t childOffset,
14 const std::size_t splitAxis)
21 PH_ASSERT_IN_RANGE_INCLUSIVE(splitAxis, 0, 2);
24 node.m_aabb = nodeAABB;
26 node.m_numItemsAndFlags =
static_cast<uint8
>(splitAxis);
31template<
typename Item,
typename Index>
35 const std::size_t itemOffset,
36 const std::size_t numItems)
39 PH_ASSERT_LE(numItems, MAX_NODE_ITEMS);
42 node.m_aabb = nodeAABB;
44 node.m_numItemsAndFlags =
static_cast<uint8
>((numItems << NUM_FLAG_BITS) | LEAF_FLAG);
49template<
typename Item,
typename Index>
52 : m_aabb(
AABB3D::makeEmpty())
53 , u0_itemOffset(static_cast<decltype(u0_itemOffset)>(-1))
54 , m_numItemsAndFlags(LEAF_FLAG)
57template<
typename Item,
typename Index>
65template<
typename Item,
typename Index>
69 return (m_numItemsAndFlags & FLAG_BITS_MASK) == LEAF_FLAG;
72template<
typename Item,
typename Index>
79template<
typename Item,
typename Index>
84 PH_ASSERT(isInternal());
86 return static_cast<std::size_t
>(u0_childOffset);
89template<
typename Item,
typename Index>
94 PH_ASSERT(isInternal());
96 return static_cast<std::size_t
>(m_numItemsAndFlags & FLAG_BITS_MASK);
99template<
typename Item,
typename Index>
106 return static_cast<std::size_t
>(u0_itemOffset);
109template<
typename Item,
typename Index>
116 return static_cast<std::size_t
>(m_numItemsAndFlags >> NUM_FLAG_BITS);
Definition TBinaryBvhNode.h:16
Index u0_itemOffset
Definition TBinaryBvhNode.h:60
Index u0_childOffset
Definition TBinaryBvhNode.h:59
constexpr std::size_t Y_AXIS
Definition constant.h:91
constexpr std::size_t Z_AXIS
Definition constant.h:92
constexpr std::size_t X_AXIS
Definition constant.h:90
Math functions and utilities.
Definition TransformInfo.h:10