fn import(&self, bytes: Vec<u8>, _: ()) -> AssetResult<MeshData> {
        let data: String = String::from_utf8(bytes)?;

        let trimmed: Vec<&str> = data.lines().filter(|line| line.len() >= 1).collect();

        let mut result = Vec::new();

        for line in trimmed {
            let nums: Vec<&str> = line.split_whitespace().collect();

            let position = [
                nums[0].parse::<f32>().unwrap(),
                nums[1].parse::<f32>().unwrap(),
                nums[2].parse::<f32>().unwrap(),
            ];

            let normal = [
                nums[3].parse::<f32>().unwrap(),
                nums[4].parse::<f32>().unwrap(),
                nums[5].parse::<f32>().unwrap(),
            ];

            result.push(PosNormTex {
                position,
                normal,
                tex_coord: [0.0, 0.0],
            });
        }
        Ok(result.into())
    }
/// Reads the given bytes and produces asset data.
Reads the given bytes and produces asset data.
Reads the given bytes and produces asset data .
fn import(&self, bytes: Vec<u8>, _: ()) -> AssetResult<MeshData> {
        let data: String = String::from_utf8(bytes)?;
        let trimmed: Vec<&str> = data.lines().filter(|line| line.len() >= 1).collect();
        let mut result = Vec::new();
        for line in trimmed {
            let nums: Vec<&str> = line.split_whitespace().collect();
            let position = [
                nums[0].parse::<f32>().unwrap(),
                nums[1].parse::<f32>().unwrap(),
                nums[2].parse::<f32>().unwrap(),
            ];
            let normal = [
                nums[3].parse::<f32>().unwrap(),
                nums[4].parse::<f32>().unwrap(),
                nums[5].parse::<f32>().unwrap(),
            ];
            result.push(PosNormTex {
                position,
                normal,
                tex_coord: [0.0, 0.0],
            });
        }
        Ok(result.into())
    }
fn import ( & self , bytes : Vec < u8 > , _ : ( ) ) -> AssetResult < MeshData > { let data : String = String :: from_utf8 ( bytes ) ? ; let trimmed : Vec < & str > = data . lines ( ) . filter ( | line | line . len ( ) >= 1 ) . collect ( ) ; let mut result = Vec :: new ( ) ; for line in trimmed { let nums : Vec < & str > = line . split_whitespace ( ) . collect ( ) ; let position = [ nums [ 0 ] . parse :: < f32 > ( ) . unwrap ( ) , nums [ 1 ] . parse :: < f32 > ( ) . unwrap ( ) , nums [ 2 ] . parse :: < f32 > ( ) . unwrap ( ) , ] ; let normal = [ nums [ 3 ] . parse :: < f32 > ( ) . unwrap ( ) , nums [ 4 ] . parse :: < f32 > ( ) . unwrap ( ) , nums [ 5 ] . parse :: < f32 > ( ) . unwrap ( ) , ] ; result . push ( PosNormTex { position , normal , tex_coord : [ 0.0 , 0.0 ] , } ) ; } Ok ( result . into ( ) ) }
Reads the given bytes and produces asset data.
Reads the given bytes and produces asset data .
&self
bytes
()
&self
bytes
()