1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! A pure Rust runtime for reading and driving Live2D/Cubism-compatible model data.
//!
//! Mocari is split into a small set of layers so applications can choose how much
//! control they need:
//!
//! - [`assets`] loads a `.model3.json` file, its referenced `.moc3` data, pose
//! file, and PNG textures from disk.
//! - [`ModelRuntime`] owns the mutable model state used by motions, expressions,
//! pose fading, and drawable mesh generation.
//! - [`motion`] and [`expression`] provide lightweight players for Cubism motion
//! and expression JSON files.
//! - [`render::common`] contains backend-neutral draw ordering, clipping, and
//! vertex helpers for custom renderers.
//! - `render::wgpu` provides a ready-to-use renderer when the `wgpu` feature is
//! enabled.
//!
//! The usual flow is to load a runtime model, update its parameters each frame,
//! apply motions or expressions, rebuild meshes, then pass those meshes to a
//! renderer.
//!
//! ```no_run
//! use mocari::{assets::load_model_runtime, MotionPlayer};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut model = load_model_runtime("assets/models/Hiyori/Hiyori.model3.json")?;
//! let runtime = model.runtime_mut();
//!
//! runtime.set_parameter_normalized("ParamAngleX", 0.75);
//! runtime.update_meshes();
//!
//! for mesh in runtime.meshes() {
//! // Upload mesh.vertices() and mesh.indices() to your renderer.
//! }
//! # Ok(())
//! # }
//! ```
/// Filesystem helpers for loading model assets and decoded textures.
/// Math, interpolation, parameter, and physics primitives used by the runtime.
/// Shared error types returned by parsers and lower-level runtime code.
/// Expression playback and blending against a [`ModelRuntime`].
/// Parsers and data models for Cubism JSON sidecar files.
/// Parsers and mesh builders for `.moc3` model data.
/// Motion playback against a [`ModelRuntime`].
/// Renderer-facing helpers and optional backend implementations.
/// Mutable model state used for parameter edits, pose updates, and mesh output.
pub use crate;
pub use crate;
pub use crate;
pub use crateMotionPlayer;
pub use crate;