pub fn check_visible_point(&self, origin: Vec3, target: Vec3) -> bool {
        let direction = (target - origin).normalized();
        let mut position = origin;
        for _ in 0..MAX_ITERATIONS {
            let dist_to_geometry = self.signed_distance(position);
            if dist_to_geometry < EPSILON {
                return false;
            }
            let dist_to_target = (target - origin).mag();
            if dist_to_target <= dist_to_geometry {
                return true;
            }

            position += dist_to_geometry * direction;
        }
        return false;
    }
/// Check if 2 points can see each other
Check if 2 points can see each other
Check if 2 points can see each other
pub fn check_visible_point(&self, origin: Vec3, target: Vec3) -> bool {
        let direction = (target - origin).normalized();
        let mut position = origin;
        for _ in 0..MAX_ITERATIONS {
            let dist_to_geometry = self.signed_distance(position);
            if dist_to_geometry < EPSILON {
                return false;
            }
            let dist_to_target = (target - origin).mag();
            if dist_to_target <= dist_to_geometry {
                return true;
            }
            position += dist_to_geometry * direction;
        }
        return false;
    }
pub fn check_visible_point ( & self , origin : Vec3 , target : Vec3 ) -> bool { let direction = ( target - origin ) . normalized ( ) ; let mut position = origin ; for _ in 0 .. MAX_ITERATIONS { let dist_to_geometry = self . signed_distance ( position ) ; if dist_to_geometry < EPSILON { return false ; } let dist_to_target = ( target - origin ) . mag ( ) ; if dist_to_target <= dist_to_geometry { return true ; } position += dist_to_geometry * direction ; } return false ; }
Check if 2 points can see each other
Check if 2 points can see each other
&self
origin
Vec3
target
Vec3
&self
origin
Vec3
target
Vec3