mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Rename 'dist_to_pos_xy' variable to 'dist_xy'
This commit is contained in:
parent
83f46658a9
commit
50f877bdf6
@ -2296,13 +2296,13 @@ impl<'a> AgentData<'a> {
|
||||
self.body,
|
||||
read_data.bodies.get(entity),
|
||||
) {
|
||||
let dist_to_pos_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();
|
||||
if dist_to_pos_xy < spacing {
|
||||
if dist_xy < spacing {
|
||||
let dist_to_pos = self.pos.0.xy() - pos.0.xy();
|
||||
sep_vec +=
|
||||
dist_to_pos.try_normalized().unwrap_or_else(Vec2::zero)
|
||||
* ((spacing - dist_to_pos_xy) / spacing);
|
||||
* ((spacing - dist_xy) / spacing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user