Nebula
Loading...
Searching...
No Matches
Util::Bvh Class Reference

#include <bvh.h>

Classes

class  Node
 

Public Member Functions

 ~Bvh ()
 
void Build (Math::bbox *bboxes, uint32_t numBoxes)
 Builds the bvh tree.
 
Util::Array< uint32_t > Intersect (Math::line line)
 returns all intersected bboxes indices based on the order they were when passed to the Build method.
 
void UpdateNodeBounds (Bvh::Node *node, Math::bbox *bboxes)
 
void Subdivide (Bvh::Node *node, Math::bbox *bboxes)
 
float FindBestSplitPlane (Bvh::Node *node, Math::bbox *bboxes, int &axis, float &splitPos)
 
void Clear ()
 

Public Attributes

Bvh::Nodenodes = nullptr
 
uint32_t * externalIndices = nullptr
 these map to where the original bbox was when passed to the build method.
 
uint32_t rootNodeIndex = 0
 
uint32_t numNodes = 0
 
uint32_t nodesUsed = 0
 

Constructor & Destructor Documentation

◆ ~Bvh()

Util::Bvh::~Bvh ( )
inline

Member Function Documentation

◆ Build()

void Util::Bvh::Build ( Math::bbox * bboxes,
uint32_t numBoxes )
inline

Builds the bvh tree.

◆ Clear()

void Util::Bvh::Clear ( )
inline

◆ FindBestSplitPlane()

float Util::Bvh::FindBestSplitPlane ( Bvh::Node * node,
Math::bbox * bboxes,
int & axis,
float & splitPos )
inline

◆ Intersect()

Util::Array< uint32_t > Util::Bvh::Intersect ( Math::line line)
inline

returns all intersected bboxes indices based on the order they were when passed to the Build method.

◆ Subdivide()

void Util::Bvh::Subdivide ( Bvh::Node * node,
Math::bbox * bboxes )
inline

◆ UpdateNodeBounds()

void Util::Bvh::UpdateNodeBounds ( Bvh::Node * node,
Math::bbox * bboxes )
inline

Member Data Documentation

◆ externalIndices

uint32_t* Util::Bvh::externalIndices = nullptr

these map to where the original bbox was when passed to the build method.

◆ nodes

Bvh::Node* Util::Bvh::nodes = nullptr

◆ nodesUsed

uint32_t Util::Bvh::nodesUsed = 0

◆ numNodes

uint32_t Util::Bvh::numNodes = 0

◆ rootNodeIndex

uint32_t Util::Bvh::rootNodeIndex = 0

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