directly visit all bvh nodes
This commit is contained in:
parent
33aa8d5d9c
commit
7e91c85822
@ -40,6 +40,14 @@ impl<T:Copy+Eq+std::hash::Hash> BvhNode<T>{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn into_visitor<F:FnMut(T)>(self,f:&mut F){
|
||||||
|
match self.content{
|
||||||
|
BvhNodeContent::Leaf(model)=>f(model),
|
||||||
|
BvhNodeContent::Branch(children)=>for child in children{
|
||||||
|
child.into_visitor(f)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn generate_bvh<T:Copy+Eq+std::hash::Hash>(boxen:Vec<(T,Aabb)>)->BvhNode<T>{
|
pub fn generate_bvh<T:Copy+Eq+std::hash::Hash>(boxen:Vec<(T,Aabb)>)->BvhNode<T>{
|
||||||
|
Loading…
Reference in New Issue
Block a user