enlarge selectagon to a minimum angular diameter

This commit is contained in:
yuni 2024-04-05 22:30:43 +02:00
parent 36eb5a000e
commit 9c5a61767a

View file

@ -676,6 +676,14 @@ fn update_target_selectagon(
selectagon_trans.translation = target_trans.translation; selectagon_trans.translation = target_trans.translation;
selectagon_trans.scale = target_trans.scale; selectagon_trans.scale = target_trans.scale;
selectagon_trans.rotation = camera_trans.rotation; selectagon_trans.rotation = camera_trans.rotation;
// Enlarge Selectagon to a minimum angular diameter
let (angular_diameter, _, _) = camera::calc_angular_diameter(
&selectagon_trans, camera_trans);
let min_angular_diameter = 2.0f32.to_radians();
if angular_diameter < min_angular_diameter {
selectagon_trans.scale *= min_angular_diameter / angular_diameter;
}
} }
else { else {
match *selectagon_vis { match *selectagon_vis {