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:
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 {
|
||||
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<V::Vox>> 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
|
||||
|
Loading…
Reference in New Issue
Block a user