Skip to main content

Module mesh

Module mesh 

Source
Expand description

Mesh decoders for various formats (GLTF, OBJ) plus a sniffing dispatcher.

Unlike texture / font, the mesh slot has multiple competing implementations — the consumer (editor / runtime) explicitly picks one when constructing the crate::asset::AssetService. Default choice is MeshDispatcher, which delegates to gltf or obj based on byte sniffing.

use khora_io::asset::{MeshDispatcher, FileSystemResolver};
use std::sync::Arc;
let resolver = Arc::new(FileSystemResolver::new(project_root.join("assets/meshes")));
svc.register_decoder::<Mesh>("mesh", MeshDispatcher::new(resolver));

Structs§

FileSystemResolver
Resolves resources from the local filesystem relative to a base path.
GltfDecoder
Decoder for GLTF meshes, configured with a resource resolver.
MeshDispatcher
Default mesh dispatcher: delegates to gltf or obj based on byte sniffing.
NoOpResourceResolver
Resolver that fails on every external URI lookup. Suitable as a default for self-contained .glb files (which embed all buffers + images) and as a placeholder when no project context is available.
ObjDecoder
Decoder for OBJ mesh assets.

Traits§

GltfResourceResolver
Resolves external resources (buffers, images) referenced by a URI within an asset file.