mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Rename 'dist_to_pos' variable to 'pos_diff'
This commit is contained in:
parent
50f877bdf6
commit
f99a637606
@ -2299,10 +2299,9 @@ impl<'a> AgentData<'a> {
|
|||||||
let dist_xy = self.pos.0.xy().distance(pos.0.xy());
|
let dist_xy = self.pos.0.xy().distance(pos.0.xy());
|
||||||
let spacing = body.spacing_radius() + other_body.spacing_radius();
|
let spacing = body.spacing_radius() + other_body.spacing_radius();
|
||||||
if dist_xy < spacing {
|
if dist_xy < spacing {
|
||||||
let dist_to_pos = self.pos.0.xy() - pos.0.xy();
|
let pos_diff = self.pos.0.xy() - pos.0.xy();
|
||||||
sep_vec +=
|
sep_vec += pos_diff.try_normalized().unwrap_or_else(Vec2::zero)
|
||||||
dist_to_pos.try_normalized().unwrap_or_else(Vec2::zero)
|
* ((spacing - dist_xy) / spacing);
|
||||||
* ((spacing - dist_xy) / spacing);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user