20 #ifndef __OPC_TREEBUILDERS_H__ 21 #define __OPC_TREEBUILDERS_H__ 55 mNbInvalidSplits(0) {}
67 virtual bool ComputeGlobalBox(
const udword* primitives,
udword nb_prims,
AABB& global_box)
const = 0;
89 virtual float GetSplittingValue(
const udword* primitives,
udword nb_prims,
const AABB& global_box,
udword axis)
const 104 virtual BOOL ValidateSubdivision(
const udword* primitives,
udword nb_prims,
const AABB& global_box)
108 if(nb_prims<=mSettings.mLimit)
return FALSE;
173 #endif // __OPC_TREEBUILDERS_H__ AABBTreeOfVerticesBuilder()
Constructor.
AABBTreeOfAABBsBuilder()
Constructor.
#define null
our own NULL pointer
Split at geometric center (else split in the middle)
inline_ void SetCount(udword nb)
Splatter primitive centers (QuickCD-style)
inline_ void IncreaseNbInvalidSplits()
virtual ~AABBTreeOfAABBsBuilder()
Destructor.
virtual ~AABBTreeOfTrianglesBuilder()
Destructor.
inline_ void SetNbInvalidSplits(udword nb)
virtual ~AABBTreeOfVerticesBuilder()
Destructor.
udword mNbPrimitives
Total number of primitives.
const Point * mVertexArray
Shortcut to an app-controlled array of vertices.
void * mNodeBase
Address of node pool [Opcode 1.3].
int BOOL
Another boolean type.
virtual float GetSplittingValue(udword index, udword axis) const =0
unsigned int udword
sizeof(udword) must be 4
const AABB * mAABBArray
Shortcut to an app-controlled array of AABBs.
inline_ void IncreaseCount(udword nb)
Simple wrapper around build-related settings [Opcode 1.3].
udword mLimit
Limit number of primitives / node. If limit is 1, build a complete tree (2*N-1 nodes) ...
AABBTreeBuilder()
Constructor.
virtual bool ComputeGlobalBox(const udword *primitives, udword nb_prims, AABB &global_box) const =0
inline_ void GetCenter(Point ¢er) const
Get box center.
const MeshInterface * mIMesh
Shortcut to an app-controlled mesh interface.
inline_ udword GetNbInvalidSplits() const
udword mRules
Building/Splitting rules (a combination of SplittingRules flags)
SplittingRules
Tree splitting rules.
BuildSettings mSettings
Splitting rules & split limit [Opcode 1.3].
Try largest axis, then second, then last.
udword mNbInvalidSplits
Stats: number of invalid splits.
AABBTreeOfTrianglesBuilder()
Constructor.
virtual ~AABBTreeBuilder()
Destructor.
Try to keep a well-balanced tree.
udword mCount
Stats: number of nodes created.
Split along the largest axis.
inline_ udword GetCount() const