#include <mqbvhaccel.h>
Public Member Functions | |
| MQBVHAccel (const Context *context, u_int fst, u_int sf) | |
| ~MQBVHAccel () | |
| BBox | WorldBound () const |
| AcceleratorType | GetType () const |
| void | Init (const std::deque< Mesh * > &meshes, const unsigned int totalVertexCount, const unsigned int totalTriangleCount) |
| const TriangleMeshID | GetMeshID (const unsigned int index) const |
| const TriangleMeshID * | GetMeshIDTable () const |
| const TriangleID | GetMeshTriangleID (const unsigned int index) const |
| const TriangleID * | GetMeshTriangleIDTable () const |
| bool | Intersect (const Ray *ray, RayHit *hit) const |
| void | Update () |
Private Member Functions | |
| void | BuildTree (u_int start, u_int end, u_int *primsIndexes, BBox *primsBboxes, Point *primsCentroids, const BBox &nodeBbox, const BBox ¢roidsBbox, int32_t parentIndex, int32_t childIndex, int depth) |
| void | CreateLeaf (int32_t parentIndex, int32_t childIndex, u_int start, const BBox &nodeBbox) |
| int32_t | CreateNode (int32_t parentIndex, int32_t childIndex, const BBox &nodeBbox) |
Static Private Member Functions | |
| static bool | MeshPtrCompare (Mesh *, Mesh *) |
Private Attributes | |
| std::deque< Mesh * > | meshList |
| QBVHNode * | nodes |
| u_int | nNodes |
| u_int | maxNodes |
| BBox | worldBound |
| u_int | fullSweepThreshold |
| u_int | skipFactor |
| u_int | nLeafs |
| std::map< Mesh *, QBVHAccel *, bool(*)(Mesh *, Mesh *)> | accels |
| QBVHAccel ** | leafs |
| const Transform ** | leafsInvTransform |
| unsigned int * | leafsOffset |
| TriangleMeshID * | meshIDs |
| TriangleID * | meshTriangleIDs |
| const Context * | ctx |
| bool | initialized |
Friends | |
| class | OpenCLIntersectionDevice |
Definition at line 37 of file mqbvhaccel.h.
| MQBVHAccel::MQBVHAccel | ( | const Context * | context, | |
| u_int | fst, | |||
| u_int | sf | |||
| ) |
Definition at line 29 of file mqbvhaccel.cpp.
References initialized.
| MQBVHAccel::~MQBVHAccel | ( | ) |
Definition at line 35 of file mqbvhaccel.cpp.
References accels, luxrays::FreeAligned(), initialized, leafs, leafsInvTransform, leafsOffset, meshIDs, meshTriangleIDs, and nodes.
| void MQBVHAccel::BuildTree | ( | u_int | start, | |
| u_int | end, | |||
| u_int * | primsIndexes, | |||
| BBox * | primsBboxes, | |||
| Point * | primsCentroids, | |||
| const BBox & | nodeBbox, | |||
| const BBox & | centroidsBbox, | |||
| int32_t | parentIndex, | |||
| int32_t | childIndex, | |||
| int | depth | |||
| ) | [private] |
Definition at line 192 of file mqbvhaccel.cpp.
References CreateLeaf(), CreateNode(), luxrays::Floor2Int(), fullSweepThreshold, INFINITY, luxrays::BBox::MaximumExtent(), luxrays::Min(), NB_BINS, luxrays::BBox::pMax, luxrays::BBox::pMin, skipFactor, luxrays::BBox::SurfaceArea(), and luxrays::Union().
Referenced by Update().
| void MQBVHAccel::CreateLeaf | ( | int32_t | parentIndex, | |
| int32_t | childIndex, | |||
| u_int | start, | |||
| const BBox & | nodeBbox | |||
| ) | [private] |
Definition at line 378 of file mqbvhaccel.cpp.
References luxrays::QBVHNode::InitializeLeaf(), nNodes, nodes, and luxrays::QBVHNode::SetBBox().
Referenced by BuildTree().
| int32_t MQBVHAccel::CreateNode | ( | int32_t | parentIndex, | |
| int32_t | childIndex, | |||
| const BBox & | nodeBbox | |||
| ) | [private] |
Definition at line 357 of file mqbvhaccel.cpp.
References luxrays::QBVHNode::children, luxrays::FreeAligned(), maxNodes, nNodes, nodes, and luxrays::QBVHNode::SetBBox().
Referenced by BuildTree().
| const TriangleMeshID luxrays::MQBVHAccel::GetMeshID | ( | const unsigned int | index | ) | const [inline, virtual] |
| const TriangleMeshID* luxrays::MQBVHAccel::GetMeshIDTable | ( | ) | const [inline, virtual] |
| const TriangleID luxrays::MQBVHAccel::GetMeshTriangleID | ( | const unsigned int | index | ) | const [inline, virtual] |
Implements luxrays::Accelerator.
Definition at line 50 of file mqbvhaccel.h.
References meshTriangleIDs.
| const TriangleID* luxrays::MQBVHAccel::GetMeshTriangleIDTable | ( | ) | const [inline, virtual] |
Implements luxrays::Accelerator.
Definition at line 51 of file mqbvhaccel.h.
References meshTriangleIDs.
| AcceleratorType luxrays::MQBVHAccel::GetType | ( | ) | const [inline, virtual] |
Implements luxrays::Accelerator.
Definition at line 44 of file mqbvhaccel.h.
References luxrays::ACCEL_QBVH.
Referenced by Init().
| void MQBVHAccel::Init | ( | const std::deque< Mesh * > & | meshes, | |
| const unsigned int | totalVertexCount, | |||
| const unsigned int | totalTriangleCount | |||
| ) | [virtual] |
Implements luxrays::Accelerator.
Definition at line 54 of file mqbvhaccel.cpp.
References accels, ctx, luxrays::ExtInstanceTriangleMesh::GetExtTriangleMesh(), luxrays::ExtInstanceTriangleMesh::GetInvTransformation(), luxrays::InstanceTriangleMesh::GetInvTransformation(), luxrays::InstanceTriangleMesh::GetTriangleMesh(), GetType(), luxrays::QBVHAccel::Init(), initialized, leafs, leafsInvTransform, leafsOffset, LR_LOG, maxNodes, meshIDs, meshList, meshTriangleIDs, nLeafs, nodes, luxrays::TYPE_EXT_TRIANGLE, luxrays::TYPE_EXT_TRIANGLE_INSTANCE, luxrays::TYPE_TRIANGLE, luxrays::TYPE_TRIANGLE_INSTANCE, Update(), and luxrays::WallClockTime().
Implements luxrays::Accelerator.
Definition at line 392 of file mqbvhaccel.cpp.
References luxrays::RayHit::b1, luxrays::RayHit::b2, luxrays::QBVHNode::BBoxIntersect(), luxrays::QBVHNode::children, luxrays::Ray::d, luxrays::QBVHNode::FirstQuadIndex(), luxrays::Ray::GetDirectionSigns(), luxrays::RayHit::index, luxrays::QBVHAccel::Intersect(), luxrays::QBVHNode::IsEmpty(), luxrays::QBVHNode::IsLeaf(), leafs, leafsInvTransform, leafsOffset, luxrays::Ray::maxt, luxrays::RayHit::Miss(), nodes, luxrays::RayHit::SetMiss(), luxrays::RayHit::t, luxrays::Vector::x, luxrays::Vector::y, and luxrays::Vector::z.
Definition at line 50 of file mqbvhaccel.cpp.
| void MQBVHAccel::Update | ( | ) |
Definition at line 146 of file mqbvhaccel.cpp.
References BuildTree(), ctx, luxrays::BBox::Expand(), LR_LOG, maxNodes, meshList, nLeafs, nNodes, nodes, luxrays::BBox::pMax, luxrays::BBox::pMin, luxrays::RAY_EPSILON, luxrays::Union(), and worldBound.
Referenced by Init(), and luxrays::DataSet::UpdateMeshes().
| BBox luxrays::MQBVHAccel::WorldBound | ( | ) | const |
friend class OpenCLIntersectionDevice [friend] |
Definition at line 57 of file mqbvhaccel.h.
std::map<Mesh *, QBVHAccel *, bool (*)(Mesh *, Mesh *)> luxrays::MQBVHAccel::accels [private] |
Definition at line 82 of file mqbvhaccel.h.
Referenced by Init(), luxrays::OpenCLIntersectionDevice::SetDataSet(), and ~MQBVHAccel().
const Context* luxrays::MQBVHAccel::ctx [private] |
Definition at line 89 of file mqbvhaccel.h.
u_int luxrays::MQBVHAccel::fullSweepThreshold [private] |
Definition at line 78 of file mqbvhaccel.h.
Referenced by BuildTree().
bool luxrays::MQBVHAccel::initialized [private] |
Definition at line 90 of file mqbvhaccel.h.
Referenced by Init(), MQBVHAccel(), and ~MQBVHAccel().
QBVHAccel** luxrays::MQBVHAccel::leafs [private] |
Definition at line 83 of file mqbvhaccel.h.
Referenced by Init(), Intersect(), luxrays::OpenCLIntersectionDevice::SetDataSet(), and ~MQBVHAccel().
const Transform** luxrays::MQBVHAccel::leafsInvTransform [private] |
Definition at line 84 of file mqbvhaccel.h.
Referenced by Init(), Intersect(), luxrays::OpenCLIntersectionDevice::SetDataSet(), luxrays::OpenCLIntersectionDevice::UpdateDataSet(), and ~MQBVHAccel().
unsigned int* luxrays::MQBVHAccel::leafsOffset [private] |
Definition at line 85 of file mqbvhaccel.h.
Referenced by Init(), Intersect(), luxrays::OpenCLIntersectionDevice::SetDataSet(), and ~MQBVHAccel().
u_int luxrays::MQBVHAccel::maxNodes [private] |
Definition at line 75 of file mqbvhaccel.h.
Referenced by CreateNode(), Init(), and Update().
TriangleMeshID* luxrays::MQBVHAccel::meshIDs [private] |
Definition at line 86 of file mqbvhaccel.h.
Referenced by GetMeshID(), GetMeshIDTable(), Init(), and ~MQBVHAccel().
std::deque<Mesh *> luxrays::MQBVHAccel::meshList [private] |
Definition at line 72 of file mqbvhaccel.h.
TriangleID* luxrays::MQBVHAccel::meshTriangleIDs [private] |
Definition at line 87 of file mqbvhaccel.h.
Referenced by GetMeshTriangleID(), GetMeshTriangleIDTable(), Init(), and ~MQBVHAccel().
u_int luxrays::MQBVHAccel::nLeafs [private] |
Definition at line 81 of file mqbvhaccel.h.
Referenced by Init(), luxrays::OpenCLIntersectionDevice::SetDataSet(), Update(), and luxrays::OpenCLIntersectionDevice::UpdateDataSet().
u_int luxrays::MQBVHAccel::nNodes [private] |
Definition at line 75 of file mqbvhaccel.h.
Referenced by CreateLeaf(), CreateNode(), luxrays::OpenCLIntersectionDevice::SetDataSet(), Update(), and luxrays::OpenCLIntersectionDevice::UpdateDataSet().
QBVHNode* luxrays::MQBVHAccel::nodes [private] |
Definition at line 74 of file mqbvhaccel.h.
Referenced by CreateLeaf(), CreateNode(), Init(), Intersect(), luxrays::OpenCLIntersectionDevice::SetDataSet(), Update(), luxrays::OpenCLIntersectionDevice::UpdateDataSet(), and ~MQBVHAccel().
u_int luxrays::MQBVHAccel::skipFactor [private] |
Definition at line 79 of file mqbvhaccel.h.
Referenced by BuildTree().
BBox luxrays::MQBVHAccel::worldBound [private] |
Definition at line 76 of file mqbvhaccel.h.
Referenced by Update().
1.6.3