mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'sam/beam-collision-fix' into 'master'
Fix beam collision See merge request veloren/veloren!4178
This commit is contained in:
commit
d7b07ee250
@ -165,10 +165,15 @@ impl<'a> System<'a> for Sys {
|
||||
// We do this last because it's likely to be the
|
||||
// most expensive operation.
|
||||
let tgt_dist = pos.0.distance(pos_b.0);
|
||||
let beam_dir = (beam.bezier.ctrl - beam.bezier.start)
|
||||
/ beam.bezier.start.distance(beam.bezier.ctrl).max(0.01);
|
||||
let hit = hit
|
||||
&& read_data
|
||||
.terrain
|
||||
.ray(pos.0, pos.0 + *ori.look_dir() * (tgt_dist + 1.0))
|
||||
.ray(
|
||||
beam.bezier.start,
|
||||
beam.bezier.start + beam_dir * (tgt_dist + 1.0),
|
||||
)
|
||||
.until(|b| b.is_filled())
|
||||
.cast()
|
||||
.0
|
||||
|
Loading…
Reference in New Issue
Block a user