common: tweak sample_ray

This commit is contained in:
Quaternions 2025-02-18 13:29:22 -08:00
parent c0769abc1b
commit 1016f95b48

@ -159,7 +159,7 @@ impl<L> BvhNode<L>{
start_time:Ratio<Planar64,Planar64>, start_time:Ratio<Planar64,Planar64>,
f:&F, f:&F,
) )
where where
T:Ord+Copy, T:Ord+Copy,
Ratio<Planar64,Planar64>:From<T>, Ratio<Planar64,Planar64>:From<T>,
F:Fn(&L,&Ray)->Option<T>, F:Fn(&L,&Ray)->Option<T>,
@ -185,7 +185,7 @@ impl<L> BvhNode<L>{
ray:&Ray, ray:&Ray,
start_time:T, start_time:T,
time_limit:T, time_limit:T,
f:&F, f:F,
)->Option<(T,&L)> )->Option<(T,&L)>
where where
T:Ord+Copy, T:Ord+Copy,
@ -200,7 +200,7 @@ impl<L> BvhNode<L>{
let time_limit=time_limit.into(); let time_limit=time_limit.into();
let mut collector=InstructionCollector::new(time_limit); let mut collector=InstructionCollector::new(time_limit);
// break open all nodes that contain ray.origin and populate nodes with future intersection times // break open all nodes that contain ray.origin and populate nodes with future intersection times
self.populate_nodes(&mut collector,&mut nodes,ray,start_time,f); self.populate_nodes(&mut collector,&mut nodes,ray,start_time,&f);
// swim through nodes one at a time // swim through nodes one at a time
while let Some((t,node))=nodes.pop_first(){ while let Some((t,node))=nodes.pop_first(){