easier targeting of small objects
This commit is contained in:
parent
e3de0d56f7
commit
d1dc3da34f
|
@ -622,7 +622,7 @@ pub fn find_closest_target<TargetSpecifier>(
|
||||||
// not on the player mesh but on the camera, which doesn't have a position.
|
// not on the player mesh but on the camera, which doesn't have a position.
|
||||||
let (angular_diameter, angle, distance) = calc_angular_diameter_known_target_vector(
|
let (angular_diameter, angle, distance) = calc_angular_diameter_known_target_vector(
|
||||||
trans, camera_transform, &target_vector);
|
trans, camera_transform, &target_vector);
|
||||||
if angle <= angular_diameter.clamp(0.001, PI) {
|
if angle <= angular_diameter.clamp(0.01, PI) {
|
||||||
// It's in the field of view!
|
// It's in the field of view!
|
||||||
//commands.entity(entity).insert(IsTargeted);
|
//commands.entity(entity).insert(IsTargeted);
|
||||||
let distance_to_surface = distance - trans.scale.x;
|
let distance_to_surface = distance - trans.scale.x;
|
||||||
|
|
Loading…
Reference in a new issue