TrinityCore
Loading...
Searching...
No Matches
BIH Class Reference

#include <BoundingIntervalHierarchy.h>

Classes

struct  buildData
 
class  BuildStats
 
struct  StackNode
 

Public Member Functions

 BIH ()
 
template<class BoundsFunc , class PrimArray >
void build (PrimArray const &primitives, BoundsFunc const &getBounds, uint32 leafSize=3, bool printStats=false)
 
uint32 primCount () const
 
G3D::AABox const & bound () const
 
template<typename RayCallback >
void intersectRay (G3D::Ray const &r, RayCallback &intersectCallback, float &maxDist, bool stopAtFirst=false) const
 
template<typename IsectCallback >
void intersectPoint (G3D::Vector3 const &p, IsectCallback &intersectCallback) const
 
bool writeToFile (FILE *wf) const
 
bool readFromFile (FILE *rf)
 

Protected Member Functions

void buildHierarchy (std::vector< uint32 > &tempTree, buildData &dat, BuildStats &stats) const
 

Static Protected Member Functions

static void createNode (std::vector< uint32 > &tempTree, int nodeIndex, uint32 left, uint32 right)
 
static void subdivide (int left, int right, std::vector< uint32 > &tempTree, buildData &dat, AABound &gridBox, AABound &nodeBox, int nodeIndex, int depth, BuildStats &stats)
 

Protected Attributes

std::vector< uint32 > tree
 
std::vector< uint32 > objects
 
G3D::AABox bounds
 

Private Member Functions

void init_empty ()
 

Detailed Description

Bounding Interval Hierarchy Class. Building and Ray-Intersection functions based on BIH from Sunflow, a Java Raytracer, released under MIT/X11 License http://sunflow.sourceforge.net/ Copyright (c) 2003-2007 Christopher Kulla

Definition at line 42 of file BoundingIntervalHierarchy.h.

Constructor & Destructor Documentation

◆ BIH()

BIH::BIH ( )
inline

Definition at line 54 of file BoundingIntervalHierarchy.h.

Member Function Documentation

◆ bound()

G3D::AABox const & BIH::bound ( ) const
inline

◆ build()

template<class BoundsFunc , class PrimArray >
void BIH::build ( PrimArray const &  primitives,
BoundsFunc const &  getBounds,
uint32  leafSize = 3,
bool  printStats = false 
)
inline

◆ buildHierarchy()

void BIH::buildHierarchy ( std::vector< uint32 > &  tempTree,
buildData &  dat,
BuildStats &  stats 
) const
protected

◆ createNode()

static void BIH::createNode ( std::vector< uint32 > &  tempTree,
int  nodeIndex,
uint32  left,
uint32  right 
)
inlinestaticprotected

Definition at line 366 of file BoundingIntervalHierarchy.h.

Referenced by subdivide().

◆ init_empty()

void BIH::init_empty ( )
inlineprivate

Definition at line 45 of file BoundingIntervalHierarchy.h.

◆ intersectPoint()

template<typename IsectCallback >
void BIH::intersectPoint ( G3D::Vector3 const &  p,
IsectCallback &  intersectCallback 
) const
inline

◆ intersectRay()

template<typename RayCallback >
void BIH::intersectRay ( G3D::Ray const &  r,
RayCallback &  intersectCallback,
float &  maxDist,
bool  stopAtFirst = false 
) const
inline

◆ primCount()

uint32 BIH::primCount ( ) const
inline

Definition at line 86 of file BoundingIntervalHierarchy.h.

Referenced by VMAP::StaticMapTree::InitMap().

◆ readFromFile()

bool BIH::readFromFile ( FILE *  rf)

◆ subdivide()

void BIH::subdivide ( int  left,
int  right,
std::vector< uint32 > &  tempTree,
buildData &  dat,
AABound &  gridBox,
AABound &  nodeBox,
int  nodeIndex,
int  depth,
BuildStats &  stats 
)
staticprotected

◆ writeToFile()

bool BIH::writeToFile ( FILE *  wf) const

Member Data Documentation

◆ bounds

G3D::AABox BIH::bounds
protected

Definition at line 319 of file BoundingIntervalHierarchy.h.

Referenced by buildHierarchy(), readFromFile(), and writeToFile().

◆ objects

std::vector<uint32> BIH::objects
protected

Definition at line 318 of file BoundingIntervalHierarchy.h.

Referenced by readFromFile(), and writeToFile().

◆ tree

std::vector<uint32> BIH::tree
protected

Definition at line 317 of file BoundingIntervalHierarchy.h.

Referenced by readFromFile(), and writeToFile().


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