#include <qbvhaccel.h>
Public Member Functions | |
| QBVHNode () | |
| bool | ChildIsLeaf (int i) const |
| bool | LeafIsEmpty (int i) const |
| u_int | NbQuadsInLeaf (int i) const |
| u_int | NbPrimitivesInLeaf (int i) const |
| u_int | FirstQuadIndexForLeaf (int i) const |
| void | InitializeLeaf (int i, u_int nbQuads, u_int firstQuadIndex) |
| void | SetBBox (int i, const BBox &bbox) |
| int32_t | BBoxIntersect (const QuadRay &ray4, const __m128 invDir[3], const int sign[3]) const |
Static Public Member Functions | |
| static bool | IsLeaf (int32_t index) |
| static bool | IsEmpty (int32_t index) |
| static u_int | NbQuadPrimitives (int32_t index) |
| static u_int | FirstQuadIndex (int32_t index) |
Public Attributes | |
| __m128 | bboxes [2][3] |
| int32_t | children [4] |
Static Public Attributes | |
| static const int32_t | emptyLeafNode = 0xffffffff |
The QBVH node structure, 128 bytes long (perfect for cache)
Definition at line 192 of file qbvhaccel.h.
| luxrays::QBVHNode::QBVHNode | ( | ) | [inline] |
Base constructor, init correct bounding boxes and a "root" node (parentNodeIndex == -1)
Definition at line 222 of file qbvhaccel.h.
References bboxes, children, emptyLeafNode, and INFINITY.
| int32_t luxrays::QBVHNode::BBoxIntersect | ( | const QuadRay & | ray4, | |
| const __m128 | invDir[3], | |||
| const int | sign[3] | |||
| ) | const [inline] |
Intersect a ray described by sse variables with the 4 bounding boxes of the node. (the visit array)
Definition at line 350 of file qbvhaccel.h.
References bboxes, luxrays::QuadRay::maxt, luxrays::QuadRay::mint, luxrays::QuadRay::ox, luxrays::QuadRay::oy, and luxrays::QuadRay::oz.
Referenced by luxrays::QBVHAccel::Intersect(), and luxrays::MQBVHAccel::Intersect().
| bool luxrays::QBVHNode::ChildIsLeaf | ( | int | i | ) | const [inline] |
Indicate whether the ith child is a leaf.
| i |
Definition at line 238 of file qbvhaccel.h.
References children.
| static u_int luxrays::QBVHNode::FirstQuadIndex | ( | int32_t | index | ) | [inline, static] |
Same thing, directly from the index.
| index |
Definition at line 308 of file qbvhaccel.h.
Referenced by luxrays::QBVHAccel::Intersect(), luxrays::MQBVHAccel::Intersect(), and luxrays::OpenCLIntersectionDevice::SetDataSet().
| u_int luxrays::QBVHNode::FirstQuadIndexForLeaf | ( | int | i | ) | const [inline] |
Indicate the index in the quads array of the first quad contained by the the ith child, which must be a leaf.
| i |
Definition at line 300 of file qbvhaccel.h.
References children.
Referenced by luxrays::QBVHAccel::CreateSwizzledLeaf().
| void luxrays::QBVHNode::InitializeLeaf | ( | int | i, | |
| u_int | nbQuads, | |||
| u_int | firstQuadIndex | |||
| ) | [inline] |
Initialize the ith child as a leaf
| i | ||
| nbQuads | ||
| firstQuadIndex |
Definition at line 318 of file qbvhaccel.h.
References children, and emptyLeafNode.
Referenced by luxrays::MQBVHAccel::CreateLeaf(), luxrays::QBVHAccel::CreateSwizzledLeaf(), and luxrays::QBVHAccel::CreateTempLeaf().
| static bool luxrays::QBVHNode::IsEmpty | ( | int32_t | index | ) | [inline, static] |
Same thing, directly from the index.
| index |
Definition at line 262 of file qbvhaccel.h.
References emptyLeafNode.
Referenced by luxrays::QBVHAccel::Intersect(), luxrays::MQBVHAccel::Intersect(), and luxrays::OpenCLIntersectionDevice::SetDataSet().
| static bool luxrays::QBVHNode::IsLeaf | ( | int32_t | index | ) | [inline, static] |
Same thing, directly from the index.
| index |
Definition at line 246 of file qbvhaccel.h.
Referenced by luxrays::QBVHAccel::Intersect(), luxrays::MQBVHAccel::Intersect(), and luxrays::OpenCLIntersectionDevice::SetDataSet().
| bool luxrays::QBVHNode::LeafIsEmpty | ( | int | i | ) | const [inline] |
Indicates whether the ith child is an empty leaf.
| i |
Definition at line 254 of file qbvhaccel.h.
References children, and emptyLeafNode.
Referenced by luxrays::QBVHAccel::CreateSwizzledLeaf().
| u_int luxrays::QBVHNode::NbPrimitivesInLeaf | ( | int | i | ) | const [inline] |
Indicate the number of primitives in the ith child, which must be a leaf.
| i |
Definition at line 290 of file qbvhaccel.h.
References NbQuadsInLeaf().
| static u_int luxrays::QBVHNode::NbQuadPrimitives | ( | int32_t | index | ) | [inline, static] |
Return the number of group of 4 primitives, directly from the index.
| index |
Definition at line 280 of file qbvhaccel.h.
Referenced by luxrays::QBVHAccel::Intersect(), and luxrays::OpenCLIntersectionDevice::SetDataSet().
| u_int luxrays::QBVHNode::NbQuadsInLeaf | ( | int | i | ) | const [inline] |
Indicate the number of quads in the ith child, which must be a leaf.
| i |
Definition at line 272 of file qbvhaccel.h.
References children.
Referenced by luxrays::QBVHAccel::CreateSwizzledLeaf(), and NbPrimitivesInLeaf().
| void luxrays::QBVHNode::SetBBox | ( | int | i, | |
| const BBox & | bbox | |||
| ) | [inline] |
Set the bounding box for the ith child.
| i | ||
| bbox |
Definition at line 337 of file qbvhaccel.h.
References bboxes, luxrays::BBox::pMax, and luxrays::BBox::pMin.
Referenced by luxrays::QBVHAccel::CreateIntermediateNode(), luxrays::MQBVHAccel::CreateLeaf(), luxrays::MQBVHAccel::CreateNode(), and luxrays::QBVHAccel::CreateTempLeaf().
| __m128 luxrays::QBVHNode::bboxes[2][3] |
The 4 bounding boxes, in SoA form, for direct SIMD use (one __m128 for each coordinate)
Definition at line 207 of file qbvhaccel.h.
Referenced by BBoxIntersect(), QBVHNode(), and SetBBox().
| int32_t luxrays::QBVHNode::children[4] |
The 4 children. If a child is a leaf, its index will be negative, the 4 next bits will code the number of primitives in the leaf (more exactly, nbPrimitives = 4 * (p + 1), where p is the integer interpretation of the 4 bits), and the 27 remaining bits the index of the first quad of the node
Definition at line 216 of file qbvhaccel.h.
Referenced by ChildIsLeaf(), luxrays::QBVHAccel::CreateIntermediateNode(), luxrays::MQBVHAccel::CreateNode(), FirstQuadIndexForLeaf(), InitializeLeaf(), luxrays::QBVHAccel::Intersect(), luxrays::MQBVHAccel::Intersect(), LeafIsEmpty(), NbQuadsInLeaf(), QBVHNode(), and luxrays::OpenCLIntersectionDevice::SetDataSet().
const int32_t luxrays::QBVHNode::emptyLeafNode = 0xffffffff [static] |
Definition at line 201 of file qbvhaccel.h.
Referenced by InitializeLeaf(), IsEmpty(), LeafIsEmpty(), and QBVHNode().
1.6.3