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§
- File
System Resolver - Resolves resources from the local filesystem relative to a base path.
- Gltf
Decoder - Decoder for GLTF meshes, configured with a resource resolver.
- Mesh
Dispatcher - Default mesh dispatcher: delegates to gltf or obj based on byte sniffing.
- NoOp
Resource Resolver - Resolver that fails on every external URI lookup. Suitable as a default
for self-contained
.glbfiles (which embed all buffers + images) and as a placeholder when no project context is available. - ObjDecoder
- Decoder for OBJ mesh assets.
Traits§
- Gltf
Resource Resolver - Resolves external resources (buffers, images) referenced by a URI within an asset file.