bvh: don't require T to implement Default

This commit is contained in:
Quaternions 2024-08-09 13:48:20 -07:00
parent 8012a459bf
commit af1f1aad14

View File

@ -19,11 +19,18 @@ impl<R,T> Default for RecursiveContent<R,T>{
Self::Branch(Vec::new()) Self::Branch(Vec::new())
} }
} }
#[derive(Default)]
pub struct BvhNode<T>{ pub struct BvhNode<T>{
content:RecursiveContent<BvhNode<T>,T>, content:RecursiveContent<BvhNode<T>,T>,
aabb:Aabb, aabb:Aabb,
} }
impl<T> Default for BvhNode<T>{
fn default()->Self{
Self{
content:Default::default(),
aabb:Aabb::default(),
}
}
}
pub struct BvhWeightNode<W,T>{ pub struct BvhWeightNode<W,T>{
content:RecursiveContent<BvhWeightNode<W,T>,T>, content:RecursiveContent<BvhWeightNode<W,T>,T>,
weight:W, weight:W,