From 204dce366f00d5cf9f451adaa5ef062df919d500 Mon Sep 17 00:00:00 2001 From: Quaternions <krakow20@gmail.com> Date: Fri, 21 Feb 2025 12:07:36 -0800 Subject: [PATCH] comments --- lib/common/src/bvh.rs | 4 ++++ 1 file changed, 4 insertions(+) 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); }