19 KdtreeNode(std::vector<const Intersectable*>* intersectableBuffer);
21 void buildTree(
const std::vector<const Intersectable*>& intersectables);
26 std::unique_ptr<KdtreeNode> m_positiveChild;
27 std::unique_ptr<KdtreeNode> m_negativeChild;
29 std::vector<const Intersectable*>* m_intersectableBuffer;
34 std::size_t m_nodeBufferStartIndex;
35 std::size_t m_nodeBufferEndIndex;
37 void buildChildrenNodes(
const std::vector<const Intersectable*>& intersectables);
38 std::unique_ptr<KdtreeNode> buildChildNode(
const KdtreeAABB& childAABB,
39 const std::vector<const Intersectable*>& parentIntersectables);
40 bool traverseAndFindClosestIntersection(
const Ray& ray,
HitProbe& probe,
41 real rayDistMin, real rayDistMax)
const;
42 void analyzeSplitCostSAH(
const std::vector<const Intersectable*>& intersectables, int32 axis,
43 float64* out_minCost, real* out_splitPoint)
const;
47 static constexpr float64 COST_TRAVERSAL = 1.0;
48 static constexpr float64 COST_INTERSECTION = 1.0;