Functional tracer
This commit is contained in:
parent
716fe65841
commit
a82441677d
|
|
@ -116,13 +116,9 @@ impl Space {
|
|||
|
||||
fn trace_boundary(&self, ray: Ray) -> Ray {
|
||||
assert_eq!(self.which_subspace(ray.pos), Boundary);
|
||||
let mut ray = ray;
|
||||
loop {
|
||||
ray = self.trace_step(ray);
|
||||
if self.which_subspace(ray.pos) != Boundary {
|
||||
break ray;
|
||||
}
|
||||
}
|
||||
std::iter::successors(Some(ray), |&ray| Some(self.trace_step(ray)))
|
||||
.find(|&ray| self.which_subspace(ray.pos) != Boundary)
|
||||
.expect("Can't get outta the wall!")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user