5 #ifndef _SPICA_BBVH_ACCEL_H_
6 #define _SPICA_BBVH_ACCEL_H_
10 #include "core/accelerator.h"
11 #include "core/renderparams.h"
24 centroid = (b.posMax() + b.posMin()) * 0.5;
35 void initLeaf(
const Bounds3d& b,
int pid) {
45 this->splitAxis = axis;
59 explicit BVHAccel(
const std::vector<std::shared_ptr<Primitive>> &prims,
60 bool useSIMD =
false);
61 BVHAccel(
const std::vector<std::shared_ptr<Primitive>> &prims,
65 Bounds3d worldBound()
const override;
66 void construct()
override;
68 virtual bool intersect(
Ray& ray)
const override;
69 std::vector<Triangle> triangulate()
const override;
81 bool intersectBVH(
Ray &ray)
const;
83 bool intersectQBVH(
Ray &ray)
const;
85 BVHNode* constructRec(std::vector<BVHPrimitiveInfo>& buildData,
88 void collapse2QBVH(
BVHNode* node);
92 std::vector<std::unique_ptr<BVHNode>> nodes_;
93 std::vector<SIMDBVHNode*> simdNodes_;
97 SPICA_EXPORT_ACCEL_PLUGIN(
BVHAccel,
"Standard bounding volume hierarchy");
101 #endif // _SPICA_BBVH_ACCEL_
Definition: interaction.h:68
Ray class.
Definition: ray.h:24
Interface for intersection test accelerators.
Definition: accelerator.h:23
Definition: renderparams.h:27
Binary BVH accelerator class.
Definition: bvh.h:57