hide orbital circles when AR is off
This commit is contained in:
parent
e8eb7a77a1
commit
dba6c4183a
|
@ -511,8 +511,8 @@ pub fn update_map_only_object_visibility(
|
|||
let player_pos: &Position = q_player.get_single().unwrap();
|
||||
let cam_pos: Vec3 = cam.translation + player_pos.as_vec3();
|
||||
for (mut vis, onlyinmap) in &mut q_onlyinmap {
|
||||
if let Some(pos) = id2pos.0.get(&onlyinmap.distance_to_id) {
|
||||
if settings.map_active {
|
||||
if settings.map_active && settings.hud_active {
|
||||
if let Some(pos) = id2pos.0.get(&onlyinmap.distance_to_id) {
|
||||
let dist = cam_pos.distance(pos.as_vec3());
|
||||
if dist >= onlyinmap.min_distance as f32 {
|
||||
*vis = Visibility::Inherited;
|
||||
|
@ -520,12 +520,11 @@ pub fn update_map_only_object_visibility(
|
|||
else {
|
||||
*vis = Visibility::Hidden;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
error!("Failed get position of actor ID '{}'", &onlyinmap.distance_to_id);
|
||||
*vis = Visibility::Hidden;
|
||||
}
|
||||
} else {
|
||||
error!("Failed get position of actor ID '{}'", &onlyinmap.distance_to_id);
|
||||
*vis = Visibility::Hidden;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue