/// Insert a new vertex and return its index.
Insert a new vertex and return its index.
Insert a new vertex and return its index .
fn insert_vertex(&mut self, vec: &Vec3, transform: &Mat4) -> u32 {
        let vec4 = Vec4::new(vec.x, vec.y, vec.z, 1.0);
        let vec = (transform * vec4).truncate();
        match self.vertex_map.get(&vec.into()) {
            Some(index) => *index,
            None => {
                let index = self.vertices.len();
                self.vertices.push(vec.clone());
                let index = index as u32;
                self.vertex_map.insert(vec.into(), index);
                index
            }
        }
    }
fn insert_vertex ( & mut self , vec : & Vec3 , transform : & Mat4 ) -> u32 { let vec4 = Vec4 :: new ( vec . x , vec . y , vec . z , 1.0 ) ; let vec = ( transform * vec4 ) . truncate ( ) ; match self . vertex_map . get ( & vec . into ( ) ) { Some ( index ) => * index , None => { let index = self . vertices . len ( ) ; self . vertices . push ( vec . clone ( ) ) ; let index = index as u32 ; self . vertex_map . insert ( vec . into ( ) , index ) ; index } } }
Insert a new vertex and return its index.
Insert a new vertex and return its index .
&mut self
vec
&Vec3
transform
&Mat4