Skip to main content

khora_io/asset/decoders/mesh/
mod.rs

1// Copyright 2025 eraflo
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Mesh decoders for various formats (GLTF, OBJ) plus a sniffing dispatcher.
16//!
17//! Unlike texture / font, the mesh slot has multiple competing implementations
18//! — the consumer (editor / runtime) explicitly picks one when constructing
19//! the [`crate::asset::AssetService`]. Default choice is [`MeshDispatcher`],
20//! which delegates to gltf or obj based on byte sniffing.
21//!
22//! ```ignore
23//! use khora_io::asset::{MeshDispatcher, FileSystemResolver};
24//! use std::sync::Arc;
25//! let resolver = Arc::new(FileSystemResolver::new(project_root.join("assets/meshes")));
26//! svc.register_decoder::<Mesh>("mesh", MeshDispatcher::new(resolver));
27//! ```
28
29mod dispatcher;
30mod gltf;
31mod obj;
32mod resource_resolver;
33
34pub use dispatcher::MeshDispatcher;
35pub use gltf::GltfDecoder;
36pub use obj::ObjDecoder;
37pub use resource_resolver::*;