primitive meshes

This commit is contained in:
Jérôme Bousquié
2026-09-24 14:25:44 +02:00
parent 805babe53d
commit ab3f056dbb
36 changed files with 1531 additions and 808 deletions
+31
View File
@@ -0,0 +1,31 @@
//! File import loaders — each behind a feature flag.
//!
//! | Feature | Function | Format |
//!|---------|----------|--------|
//!| `import-obj` | `load_obj(path)` | Wavefront OBJ |
//!| `import-gltf` | `load_gltf(path)` | glTF 2.0 / GLB |
#[cfg(feature = "import-obj")]
pub mod obj;
#[cfg(feature = "import-gltf")]
#[path = "gltf.rs"]
pub mod gltf_loader;
#[cfg(feature = "import-obj")]
pub use obj::{load_obj, parse_obj};
#[cfg(feature = "import-gltf")]
pub use gltf_loader::load_gltf;
/// Error type for mesh file import.
#[derive(thiserror::Error, Debug)]
pub enum MeshImportError {
/// The file could not be read (I/O error).
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
/// The file content is malformed or cannot be parsed.
#[error("parse error: {0}")]
Parse(String),
/// The file uses features not supported by this loader.
#[error("unsupported format: {0}")]
Unsupported(String),
}