wahn/rs_pbrt

Replace nrm_normalize() and vec3_normalize() calls

wahn opened this issue · 1 comments

wahn commented

We could probably search & replace those functions:

https://www.rs-pbrt.org/doc/crates/pbrt/core/geometry/fn.vec3_normalize.html
https://www.rs-pbrt.org/doc/crates/pbrt/core/geometry/fn.nrm_normalize.html

By versions for Vector3:

impl Vector3<Float> {                                                                                                                       
    /// Compute a new vector pointing in the same direction but with unit                                                                   
    /// length.                                                                                                                             
    pub fn normalize(&self) -> Vector3<Float> {                                                                                             
        *self / self.length()                                                                                                               
    }                                                                                                                                       
}                                                                                                                                           

Same for Normal3 ...

wahn commented

Done via commit f271737 and baada18 ...