diff --git a/src/camera.rs b/src/camera.rs index 15a1c51..a227966 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -82,7 +82,9 @@ fn update( let cam_pos = if let Some(first_hit) = spatial_query.cast_ray(target, direction, max_distance, false, &filter) { - target + (direction * first_hit.distance) + //TODO: maybe shape casting a sphere would be better + let distance = first_hit.distance * 0.9; + target + (direction * distance) } else { target + (direction * camera.distance) };