5#include <Common/primitive_type.h>
6#include <Common/utility.h>
14template<
typename Item,
typename Index>
17 static_assert(std::is_unsigned_v<Index>);
19 inline static constexpr std::size_t NUM_FLAG_BITS = 2;
20 inline static constexpr std::size_t NUM_ITEMS_BITS = sizeof_in_bits<uint8>() - NUM_FLAG_BITS;
22 inline static constexpr uint8 FLAG_BITS_MASK = 0b11;
23 inline static constexpr uint8 X_AXIS_FLAG = 0b00;
24 inline static constexpr uint8 Y_AXIS_FLAG = 0b01;
25 inline static constexpr uint8 Z_AXIS_FLAG = 0b10;
26 inline static constexpr uint8 LEAF_FLAG = 0b11;
30 inline static constexpr std::size_t
MAX_NODE_ITEMS = (std::size_t(1) << NUM_ITEMS_BITS) - 1;
34 std::size_t childOffset,
35 std::size_t splitAxis)
40 std::size_t itemOffset,
75 uint8 m_numItemsAndFlags;
Definition TBinaryBvhNode.h:16
static constexpr std::size_t MAX_NODE_ITEMS
Definition TBinaryBvhNode.h:30
static auto makeInternal(const AABB3D &nodeAABB, std::size_t childOffset, std::size_t splitAxis) -> TBinaryBvhNode
Definition TBinaryBvhNode.ipp:11
std::size_t getSplitAxis() const
Definition TBinaryBvhNode.ipp:91
std::size_t getChildOffset() const
Definition TBinaryBvhNode.ipp:81
bool isInternal() const
Definition TBinaryBvhNode.ipp:74
static auto makeLeaf(const AABB3D &nodeAABB, std::size_t itemOffset, std::size_t numItems) -> TBinaryBvhNode
Definition TBinaryBvhNode.ipp:33
Index u0_itemOffset
Definition TBinaryBvhNode.h:60
bool isLeaf() const
Definition TBinaryBvhNode.ipp:67
std::size_t getItemOffset() const
Definition TBinaryBvhNode.ipp:101
TBinaryBvhNode()
Definition TBinaryBvhNode.ipp:51
Index u0_childOffset
Definition TBinaryBvhNode.h:59
std::size_t numItems() const
Definition TBinaryBvhNode.ipp:111
const AABB3D & getAABB() const
Definition TBinaryBvhNode.ipp:59
Math functions and utilities.
Definition TransformInfo.h:10