pub fn pnt3_offset_ray_origin(
    p: &Point3f,
    p_error: &Vector3f,
    n: &Normal3f,
    w: &Vector3f,
) -> Point3f {
    let d: Float = nrm_dot_vec3f(&nrm_absf(n), p_error);
    let mut offset: Vector3f = Vector3f::from(*n) * d;
    if vec3_dot_nrmf(w, n) < 0.0 as Float {
        offset = -offset;
    }
    let mut po: Point3f = *p + offset;
    // round offset point _po_ away from _p_
    for i in XYZEnum::iter() {
        if offset[i] > 0.0 as Float {
            po[i] = next_float_up(po[i]);
        } else if offset[i] < 0.0 as Float {
            po[i] = next_float_down(po[i]);
        }
    }
    po
}
/// When tracing spawned rays leaving the intersection point p, we
/// offset their origins enough to ensure that they are past the
/// boundary of the error box and thus won't incorrectly re-intersect
/// the surface.
When tracing spawned rays leaving the intersection point p, we
offset their origins enough to ensure that they are past the
boundary of the error box and thus won't incorrectly re-intersect
the surface.
When tracing spawned rays leaving the intersection point p we offset their origins enough to ensure that they are past the boundary of the error box and thus won ' t incorrectly re - intersect the surface .
pub fn pnt3_offset_ray_origin(
    p: &Point3f,
    p_error: &Vector3f,
    n: &Normal3f,
    w: &Vector3f,
) -> Point3f {
    let d: Float = nrm_dot_vec3f(&nrm_absf(n), p_error);
    let mut offset: Vector3f = Vector3f::from(*n) * d;
    if vec3_dot_nrmf(w, n) < 0.0 as Float {
        offset = -offset;
    }
    let mut po: Point3f = *p + offset;
    // round offset point _po_ away from _p_
    for i in XYZEnum::iter() {
        if offset[i] > 0.0 as Float {
            po[i] = next_float_up(po[i]);
        } else if offset[i] < 0.0 as Float {
            po[i] = next_float_down(po[i]);
        }
    }
    po
}
pub fn pnt3_offset_ray_origin ( p : & Point3f , p_error : & Vector3f , n : & Normal3f , w : & Vector3f , ) -> Point3f { let d : Float = nrm_dot_vec3f ( & nrm_absf ( n ) , p_error ) ; let mut offset : Vector3f = Vector3f :: from ( * n ) * d ; if vec3_dot_nrmf ( w , n ) < 0.0 as Float { offset = - offset ; } let mut po : Point3f = * p + offset ; // round offset point _po_ away from _p_ for i in XYZEnum :: iter ( ) { if offset [ i ] > 0.0 as Float { po [ i ] = next_float_up ( po [ i ] ) ; } else if offset [ i ] < 0.0 as Float { po [ i ] = next_float_down ( po [ i ] ) ; } } po }
When tracing spawned rays leaving the intersection point p, we
offset their origins enough to ensure that they are past the
boundary of the error box and thus won't incorrectly re-intersect
the surface.
When tracing spawned rays leaving the intersection point p we offset their origins enough to ensure that they are past the boundary of the error box and thus won ' t incorrectly re - intersect the surface .
p
&Point3f
p_error
&Vector3f
n
&Normal3f
w
&Vector3f