Skip to main content

oxihuman/
lib.rs

1//! # OxiHuman
2//!
3//! Privacy-first, client-side human body generator — pure Rust MakeHuman port.
4//!
5//! This is the **facade crate** that re-exports all OxiHuman sub-crates
6//! under a single, ergonomic namespace.
7//!
8//! ## Quick Start
9//!
10//! ```rust,no_run
11//! use oxihuman::prelude::*;
12//! ```
13//!
14//! ## Module Overview
15//!
16//! | Module | Crate | Description |
17//! |--------|-------|-------------|
18//! | [`core`] | `oxihuman-core` | Foundation: parsers, policies, asset management, data structures |
19//! | [`morph`] | `oxihuman-morph` | Morphology engine: parameters, blendshapes, synthesis |
20//! | [`mesh`] | `oxihuman-mesh` | Geometry processing: decimation, subdivision, UV, topology |
21//! | [`export`] | `oxihuman-export` | Export pipeline: glTF, OBJ, STL, COLLADA, USD, 50+ formats |
22//! | [`physics`] | `oxihuman-physics` | Physics: collision proxies, cloth, soft body, ragdoll |
23//! | [`viewer`] | `oxihuman-viewer` | Real-time rendering: scene graph, camera, materials (feature-gated) |
24//! | `wasm` | `oxihuman-wasm` | WebAssembly bindings for browser deployment (feature-gated) |
25
26// ── Core sub-crates (always available) ──────────────────────────────
27pub use oxihuman_core as core;
28pub use oxihuman_export as export;
29pub use oxihuman_mesh as mesh;
30pub use oxihuman_morph as morph;
31pub use oxihuman_physics as physics;
32
33// ── Optional sub-crates (feature-gated) ─────────────────────────────
34#[cfg(feature = "viewer")]
35pub use oxihuman_viewer as viewer;
36
37#[cfg(feature = "wasm")]
38pub use oxihuman_wasm as wasm;
39
40/// Convenience prelude — imports the most commonly used types.
41///
42/// ```rust,no_run
43/// use oxihuman::prelude::*;
44/// ```
45pub mod prelude {
46    // Core infrastructure
47    pub use oxihuman_core::{AssetManifest, EventBus, EventKind, Policy, PolicyProfile};
48
49    // Morphology engine
50    pub use oxihuman_morph::{HumanEngine, ParamState};
51
52    // Mesh processing
53    pub use oxihuman_mesh::MeshBuffers;
54
55    // Export pipeline
56    pub use oxihuman_export::{export_auto, ExportFormat, ExportOptions};
57
58    // Physics
59    pub use oxihuman_physics::{BodyProxies, CapsuleProxy, SphereProxy};
60
61    // Viewer (optional)
62    #[cfg(feature = "viewer")]
63    pub use oxihuman_viewer::{CameraState, Scene, Viewer, ViewerConfig};
64}