From 81b09d183aedf4caeebdb3d933a327930cf66c9c Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 17 Apr 2024 15:24:00 +0200 Subject: [PATCH] boost interaction distance --- src/actor.rs | 2 +- src/camera.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index 564c935..2d275fd 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -6,7 +6,7 @@ use crate::{actor, audio, camera, chat, commands, effects, hud, nature, var, wor pub const ENGINE_SPEED_FACTOR: f32 = 30.0; const MAX_TRANSMISSION_DISTANCE: f32 = 100.0; -const MAX_INTERACT_DISTANCE: f32 = 40.0; +const MAX_INTERACT_DISTANCE: f32 = 50.0; pub struct ActorPlugin; impl Plugin for ActorPlugin { diff --git a/src/camera.rs b/src/camera.rs index 87dc1bf..606ecc3 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -414,10 +414,10 @@ pub fn find_closest_target( // 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( trans, camera_transform, &target_vector); - let distance_to_surface = distance - trans.scale.x; if angle <= angular_diameter.clamp(0.001, PI) { // It's in the field of view! //commands.entity(entity).insert(IsTargeted); + let distance_to_surface = distance - trans.scale.x; if distance_to_surface < closest_distance { closest_distance = distance_to_surface; closest_entity = Some(entity);