diff --git a/lib/common/src/bvh.rs b/lib/common/src/bvh.rs index 938cffe..11e4694 100644 --- a/lib/common/src/bvh.rs +++ b/lib/common/src/bvh.rs @@ -204,6 +204,8 @@ impl<L> BvhNode<L>{ match &node.content{ RecursiveContent::Leaf(leaf)=>if let Some(time)=f(leaf,ray){ let ins=TimedInstruction{time:time.into(),instruction:leaf}; + // this lower bound can also be omitted + // but it causes type inference errors lol if start_time.lt_ratio(ins.time)&&ins.time.lt_ratio(collector.time()){ collector.collect(Some(ins)); } @@ -212,6 +214,8 @@ impl<L> BvhNode<L>{ RecursiveContent::Branch(children)=>for child in children{ // Am I an upcoming superstar? if let Some(t)=intersect_aabb(ray,&child.aabb){ + // we don't need to check the lower bound + // because child aabbs are guaranteed to be within the parent bounds. if t<collector.time(){ nodes.insert(t,child); }