little offset for camera collision

This commit is contained in:
2025-03-19 21:49:52 +01:00
parent e82e7e1ea6
commit 6c2525cc1c

View File

@@ -82,7 +82,9 @@ fn update(
let cam_pos = if let Some(first_hit) = let cam_pos = if let Some(first_hit) =
spatial_query.cast_ray(target, direction, max_distance, false, &filter) 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 { } else {
target + (direction * camera.distance) target + (direction * camera.distance)
}; };