1 unstable release

0.1.0 Sep 29, 2023

#2347 in Parser implementations

MIT license

37KB
291 lines

quantized-mesh-decoder

use quantized_mesh_decoder::{from_reader,QuantizedMeshTerrainData};
use std::{path::Path, fs::File};
pub fn from_file(path: &'static str) -> QuantizedMeshTerrainData {
    let path = Path::new(path);
    let file = match File::open(&path) {
        Err(why) => panic!("couldn't open {:?}", why),
        Ok(file) => file,
    };
    match from_reader(file) {
        Ok(terrain) => {
            return terrain;
        }
        Err(error) => {
            panic!("error {:?}", error);
        }
    }
}
let terrain_data = from_file("assets/tile-opentin.terrain");

Dependencies

~120KB