1 个不稳定版本

0.1.0 2023年9月29日

#2686解析器实现

MIT 许可证

37KB
291

量化网格解码器

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");

依赖关系

~115KB