21 size_t IndexBits =
sizeof(
T) * CHAR_BIT,
22 size_t PrimCountBits = 4>
60 bounds[i * 2 + 0] = bbox.min[i];
61 bounds[i * 2 + 1] = bbox.max[i];
78 const Octant& octant)
const
89 const Octant& octant)
const
97 for (
auto&& bound :
bounds)
104 for (
auto& bound : node.
bounds)
105 bound = stream.
read<T>();
122 return std::pair<T, T> { t0,
t1 };
Bool_t operator!=(const TDatime &d1, const TDatime &d2)
Bool_t operator==(const TDatime &d1, const TDatime &d2)
Stream of data that can be used to serialize data structures.
bool write(const T &data)
BVH_ALWAYS_INLINE T robust_max(T a, T b)
BVH_ALWAYS_INLINE T fast_mul_add(T a, T b, T c)
Fast multiply-add operation.
BVH_ALWAYS_INLINE void static_for(F &&f)
Executes the given function once for every integer in the range [Begin, End).
BVH_ALWAYS_INLINE T robust_min(T a, T b)
Packed index data structure.
UnsignedIntType< Bits > Type
BVH_ALWAYS_INLINE BBox< T, Dim > get_bbox() const
static BVH_ALWAYS_INLINE Node deserialize(InputStream &stream)
bvh::v2::Index< IndexBits, PrimCountBits > Index
BVH_ALWAYS_INLINE std::pair< T, T > intersect_robust(const Ray< T, Dim > &ray, const Vec< T, Dim > &inv_dir, const Vec< T, Dim > &inv_dir_pad, const Octant &octant) const
Robust ray-node intersection routine. See "Robust BVH Ray Traversal", by T. Ize.
BVH_ALWAYS_INLINE Vec< T, Dim > get_max_bounds(const Octant &octant) const
static constexpr size_t prim_count_bits
BVH_ALWAYS_INLINE void set_bbox(const BBox< T, Dim > &bbox)
BVH_ALWAYS_INLINE Vec< T, Dim > get_min_bounds(const Octant &octant) const
static BVH_ALWAYS_INLINE std::pair< T, T > make_intersection_result(const Ray< T, Dim > &ray, const Vec< T, Dim > &tmin, const Vec< T, Dim > &tmax)
static constexpr size_t dimension
Index index
Index to the children of an inner node, or to the primitives for a leaf node.
static constexpr size_t index_bits
std::array< T, Dim *2 > bounds
Bounds of the node, laid out in memory as [min_x, max_x, min_y, max_y, ...].
BVH_ALWAYS_INLINE void serialize(OutputStream &stream) const
BVH_ALWAYS_INLINE std::pair< T, T > intersect_fast(const Ray< T, Dim > &ray, const Vec< T, Dim > &inv_dir, const Vec< T, Dim > &inv_org, const Octant &octant) const
BVH_ALWAYS_INLINE bool is_leaf() const
static BVH_ALWAYS_INLINE Vec< T, N > generate(F &&f)