quantized-mesh-decoder

Crates.ioquantized-mesh-decoder
lib.rsquantized-mesh-decoder
version0.1.0
sourcesrc
created_at2023-09-29 03:12:12.317102
updated_at2023-09-29 03:12:12.317102
descriptionRust decoder for the Quantized Mesh format
homepagehttps://github.com/catnuko/houtu/tree/dev/quantized-mesh-decoder
repositoryhttps://github.com/catnuko/houtu
max_upload_size
id986982
size36,360
但长风起 (catnuko)

documentation

https://github.com/catnuko/houtu/blob/dev/quantized-mesh-decoder/README.md

README

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");
Commit count: 117

cargo fmt