little offset for camera collision
This commit is contained in:
@@ -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)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user