3 /*************** kDTreeInnerNode ******************/
5 kDTreeInnerNode::kDTreeInnerNode(float split
,
12 kDTreeInnerNode::~kDTreeInnerNode()
14 // think about correct memory management!
17 kDTreeInnerNode::kDTreeInnerNode()
21 kDTreeInnerNode::kDTreeInnerNode(const kDTreeInnerNode
& node
)
27 kDTreeInnerNode::operator=(const kDTreeInnerNode
& )
33 kDTreeInnerNode::Traverse(Ray
& ray
, float& t0
, float& t1
)
35 // implement the traversal of an inner node
36 // think about the correct order
42 kDTreeInnerNode::setChildren(kDTreeNode
* left
,
46 m_children
[1] = right
;
50 /******************** kDTreeLeafNode *******************/
52 kDTreeLeafNode::kDTreeLeafNode(const std::vector
<Primitive
*>& prim
)
58 kDTreeLeafNode::~kDTreeLeafNode()
62 kDTreeLeafNode::kDTreeLeafNode()
66 kDTreeLeafNode::kDTreeLeafNode(const kDTreeLeafNode
& node
)
72 kDTreeLeafNode::operator=(const kDTreeLeafNode
& )
78 kDTreeLeafNode::Traverse(Ray
& ray
, float& t0
, float& t1
)
80 // implement the leaf node traversal here
85 /******************** kDTree ***********************/
87 kDTree::kDTree(const Box
& bounds
,
88 const std::vector
<Primitive
*>& prim
)
94 m_root
= BuildTree(m_bounds
, prim
, 0);
99 // think about correct memory management
109 kDTree::kDTree(const kDTree
& tree
)
115 kDTree::operator=(const kDTree
& )
121 kDTree::BuildTree(const Box
& bounds
,
122 const std::vector
<Primitive
*>& prim
,
125 // setup tree structure here
126 // these two variables are only here to solve compilation issues!
127 float dummy_split
= 0.0f
;
129 kDTreeInnerNode
* node
= new kDTreeInnerNode(dummy_split
, dummy_axis
);
135 kDTree::Intersect(Ray
& ray
)
137 // implement the tree traversal
This page took 0.0557839999999999 seconds and 5 git commands to generate.