From c37db43580fa0ad5ed1a80506cbe1cb28d73d969 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Wed, 24 Apr 2019 18:47:11 +0200 Subject: [PATCH] Fix ray position Former-commit-id: 772d5652d44c9467d22c9c93547ac154ce3110b3 --- common/src/ray.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/common/src/ray.rs b/common/src/ray.rs index d10ee1ef3e..1c7f37628d 100644 --- a/common/src/ray.rs +++ b/common/src/ray.rs @@ -25,13 +25,10 @@ impl<'a, V: ReadVol, F: RayUntil> Ray<'a, V, F> { } } - pub fn until>(self, g: G) -> Ray<'a, V, G> { + pub fn until(self, f: F) -> Ray<'a, V, F> { Ray { - vol: self.vol, - from: self.from, - to: self.to, - until: g, - max_iter: self.max_iter, + until: f, + ..self } } @@ -52,7 +49,7 @@ impl<'a, V: ReadVol, F: RayUntil> Ray<'a, V, F> { let mut ipos = pos.map(|e| e as i32); for _ in 0..self.max_iter { - pos = dir * dist; + pos = self.from + dir * dist; ipos = pos.map(|e| e as i32); match self.vol