Skip to main content

oxihuman_core/
lib.rs

1// Copyright (C) 2026 COOLJAPAN OU (Team KitaSan)
2// SPDX-License-Identifier: Apache-2.0
3
4//! Core utilities, data structures, and algorithms for the OxiHuman engine.
5//!
6//! This crate is the foundational layer of the OxiHuman workspace. It provides
7//! everything that other crates depend on: parsers for `.obj` and `.target`
8//! files, the [`Policy`] / [`PolicyProfile`] system for content filtering,
9//! spatial indexing with an octree, asset hashing, event buses, undo/redo
10//! stacks, plugin registries, and dozens of supporting subsystems.
11//!
12//! # Quick start
13//!
14//! ```rust
15//! use oxihuman_core::policy::{Policy, PolicyProfile};
16//! use oxihuman_core::parser::obj::parse_obj;
17//!
18//! let obj_src = "v 0 0 0\nv 1 0 0\nv 0 1 0\nvn 0 0 1\nvt 0 0\nf 1/1/1 2/1/1 3/1/1\n";
19//! let mesh = parse_obj(obj_src).expect("OBJ parse failed");
20//! assert_eq!(mesh.positions.len(), 3);
21//!
22//! let policy = Policy::new(PolicyProfile::Standard);
23//! assert!(policy.is_target_allowed("height", &[]));
24//! ```
25//!
26//! # Content policy
27//!
28//! All morph targets are filtered through a [`Policy`] before they can affect
29//! a mesh. [`PolicyProfile::Standard`] blocks targets whose names or tags
30//! contain explicit-content keywords. [`PolicyProfile::Strict`] additionally
31//! requires targets to appear in an explicit allowlist.
32
33// ── Part 1: core infrastructure (policy, manifest, parser, asset pack, …)
34mod _core_part1;
35pub use _core_part1::*;
36
37// ── Part 2: data structures (tree/heap variants, graph algorithms, codecs, …)
38mod _core_part2;
39pub use _core_part2::*;
40
41// ── Part 3: utilities (locale, statistics, observability, DDD, math, …)
42mod _core_part3;
43pub use _core_part3::*;