mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix ray position
Former-commit-id: 772d5652d44c9467d22c9c93547ac154ce3110b3
This commit is contained in:
committed by
Joshua Barretto
parent
9105bf0811
commit
c37db43580
@ -25,13 +25,10 @@ impl<'a, V: ReadVol, F: RayUntil<V::Vox>> Ray<'a, V, F> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn until<G: RayUntil<V::Vox>>(self, g: G) -> Ray<'a, V, G> {
|
pub fn until(self, f: F) -> Ray<'a, V, F> {
|
||||||
Ray {
|
Ray {
|
||||||
vol: self.vol,
|
until: f,
|
||||||
from: self.from,
|
..self
|
||||||
to: self.to,
|
|
||||||
until: g,
|
|
||||||
max_iter: self.max_iter,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +49,7 @@ impl<'a, V: ReadVol, F: RayUntil<V::Vox>> Ray<'a, V, F> {
|
|||||||
let mut ipos = pos.map(|e| e as i32);
|
let mut ipos = pos.map(|e| e as i32);
|
||||||
|
|
||||||
for _ in 0..self.max_iter {
|
for _ in 0..self.max_iter {
|
||||||
pos = dir * dist;
|
pos = self.from + dir * dist;
|
||||||
ipos = pos.map(|e| e as i32);
|
ipos = pos.map(|e| e as i32);
|
||||||
|
|
||||||
match self.vol
|
match self.vol
|
||||||
|
Reference in New Issue
Block a user