show distance to marked object
This commit is contained in:
parent
dc077ca141
commit
704c249091
|
@ -528,7 +528,8 @@ fn update(
|
|||
if let Some(target_pos) = target {
|
||||
let dist = pos.0 - target_pos;
|
||||
let (x, y, z) = (dist.x, dist.y, dist.z);
|
||||
text.sections[7].value = format!("{x:.0}m / {z:.0}m / {y:.0}m");
|
||||
let dist_scalar = dist.length();
|
||||
text.sections[7].value = format!("{x:.0}m / {z:.0}m / {y:.0}m / distance: {dist_scalar:.0}m");
|
||||
}
|
||||
else {
|
||||
text.sections[7].value = format!("ERROR: MULTIPLE TARGETS");
|
||||
|
|
Loading…
Reference in a new issue