ignore raycast hit when behind controller

This commit is contained in:
galister
2024-02-01 18:48:22 +01:00
parent 7888898018
commit 91f21352c9

View File

@@ -443,6 +443,11 @@ impl Pointer {
let d = plane.translation.dot(-plane_normal);
let dist = -(d + self.pose.translation.dot(plane_normal)) / ray_dir.dot(plane_normal);
if dist < 0.0 {
// plane is behind the caster
return None;
}
let hit_pos = self.pose.translation + ray_dir * dist;
Some(RayHit {