KiCad PCB EDA Suite
Loading...
Searching...
No Matches
BVH_PBRT Class Reference

#include <bvh_pbrt.h>

Inheritance diagram for BVH_PBRT:
ACCELERATOR_3D

Public Member Functions

 BVH_PBRT (const CONTAINER_3D_BASE &aObjectContainer, int aMaxPrimsInNode=4, SPLITMETHOD aSplitMethod=SPLITMETHOD::SAH)
 
 ~BVH_PBRT ()
 
bool Intersect (const RAY &aRay, HITINFO &aHitInfo) const override
 
bool Intersect (const RAY &aRay, HITINFO &aHitInfo, unsigned int aAccNodeInfo) const override
 
bool Intersect (const RAYPACKET &aRayPacket, HITINFO_PACKET *aHitInfoPacket) const override
 
bool IntersectP (const RAY &aRay, float aMaxDistance) const override
 

Protected Attributes

BBOX_3D m_bbox
 

Private Member Functions

BVHBuildNoderecursiveBuild (std::vector< BVHPrimitiveInfo > &primitiveInfo, int start, int end, int *totalNodes, CONST_VECTOR_OBJECT &orderedPrims)
 
BVHBuildNodeHLBVHBuild (const std::vector< BVHPrimitiveInfo > &primitiveInfo, int *totalNodes, CONST_VECTOR_OBJECT &orderedPrims)
 
BVHBuildNodeemitLBVH (BVHBuildNode *&buildNodes, const std::vector< BVHPrimitiveInfo > &primitiveInfo, MortonPrimitive *mortonPrims, int nPrimitives, int *totalNodes, CONST_VECTOR_OBJECT &orderedPrims, int *orderedPrimsOffset, int bit)
 TODO: after implement memory arena, put const back to this functions.
 
BVHBuildNodebuildUpperSAH (std::vector< BVHBuildNode * > &treeletRoots, int start, int end, int *totalNodes)
 
int flattenBVHTree (BVHBuildNode *node, uint32_t *offset)
 

Private Attributes

const int m_maxPrimsInNode
 
SPLITMETHOD m_splitMethod
 
CONST_VECTOR_OBJECT m_primitives
 
LinearBVHNodem_nodes
 
std::list< void * > m_nodesToFree
 
unsigned int m_I [RAYPACKET_RAYS_PER_PACKET]
 

Detailed Description

Definition at line 110 of file bvh_pbrt.h.

Constructor & Destructor Documentation

◆ BVH_PBRT()

◆ ~BVH_PBRT()

BVH_PBRT::~BVH_PBRT ( )

Definition at line 306 of file bvh_pbrt.cpp.

References m_nodesToFree.

Member Function Documentation

◆ buildUpperSAH()

◆ emitLBVH()

BVHBuildNode * BVH_PBRT::emitLBVH ( BVHBuildNode *&  buildNodes,
const std::vector< BVHPrimitiveInfo > &  primitiveInfo,
MortonPrimitive mortonPrims,
int  nPrimitives,
int *  totalNodes,
CONST_VECTOR_OBJECT orderedPrims,
int *  orderedPrimsOffset,
int  bit 
)
private

TODO: after implement memory arena, put const back to this functions.

Definition at line 795 of file bvh_pbrt.cpp.

References emitLBVH(), BVHBuildNode::InitInterior(), BVHBuildNode::InitLeaf(), m_maxPrimsInNode, m_primitives, MortonPrimitive::mortonCode, MortonPrimitive::primitiveIndex, BBOX_3D::Reset(), and BBOX_3D::Union().

Referenced by emitLBVH(), and HLBVHBuild().

◆ flattenBVHTree()

◆ HLBVHBuild()

◆ Intersect() [1/3]

◆ Intersect() [2/3]

bool BVH_PBRT::Intersect ( const RAY aRay,
HITINFO aHitInfo,
unsigned int  aAccNodeInfo 
) const
overridevirtual

◆ Intersect() [3/3]

◆ IntersectP()

◆ recursiveBuild()

Member Data Documentation

◆ m_bbox

BBOX_3D ACCELERATOR_3D::m_bbox
protectedinherited

Definition at line 53 of file accelerator_3d.h.

Referenced by ACCELERATOR_3D::ACCELERATOR_3D().

◆ m_I

unsigned int BVH_PBRT::m_I[RAYPACKET_RAYS_PER_PACKET]
private

Definition at line 150 of file bvh_pbrt.h.

Referenced by BVH_PBRT().

◆ m_maxPrimsInNode

const int BVH_PBRT::m_maxPrimsInNode
private

Definition at line 142 of file bvh_pbrt.h.

Referenced by emitLBVH(), and recursiveBuild().

◆ m_nodes

LinearBVHNode* BVH_PBRT::m_nodes
private

Definition at line 145 of file bvh_pbrt.h.

Referenced by BVH_PBRT(), flattenBVHTree(), Intersect(), and IntersectP().

◆ m_nodesToFree

std::list<void*> BVH_PBRT::m_nodesToFree
private

Definition at line 147 of file bvh_pbrt.h.

Referenced by buildUpperSAH(), BVH_PBRT(), HLBVHBuild(), recursiveBuild(), and ~BVH_PBRT().

◆ m_primitives

CONST_VECTOR_OBJECT BVH_PBRT::m_primitives
private

Definition at line 144 of file bvh_pbrt.h.

Referenced by BVH_PBRT(), emitLBVH(), HLBVHBuild(), Intersect(), IntersectP(), and recursiveBuild().

◆ m_splitMethod

SPLITMETHOD BVH_PBRT::m_splitMethod
private

Definition at line 143 of file bvh_pbrt.h.

Referenced by BVH_PBRT(), and recursiveBuild().


The documentation for this class was generated from the following files: