roxlap_formats/lib.rs
1//! Voxlap on-disk formats and data manipulation.
2//!
3//! Parsers for `.vxl` (heightmap + slab voxel columns), `.kv6` / `.kvx`
4//! (sprite voxel data), and `.kfa` (kv6 transform / animation). Lands
5//! across the R2.* sub-substages of `PORTING-RUST.md`:
6//!
7//! - R2.1: `.kvx`
8//! - R2.2: `.kv6`
9//! - R2.3: `.vxl`
10//! - R2.4: `.kfa`
11//!
12//! [`edit`] hosts voxel-edit primitives (delslab/insslab/expandrle/
13//! compilerle/`ScumCtx`) and high-level wrappers (`set_spans`,
14//! `set_cube`, `set_sphere`, `set_rect`). They live with the data
15//! they manipulate; rendering stays in `roxlap-core`.
16
17mod bytes;
18
19/// Rigged-character container (`.rkc`) — meshes + skeleton + clips, the
20/// on-disk form of a complete animated voxel character. Built on
21/// [`kfa`] / [`kv6`] / [`sprite`].
22pub mod character;
23pub mod edit;
24/// Voxlap's `univec[256]` surface-normal direction table + the
25/// `normal → dir` quantiser ([`equivec::nearest_dir`]). Lives here (not
26/// roxlap-core) so [`kv6`] model builders can fill per-voxel `dir`
27/// without a circular dependency; roxlap-core re-exports it.
28pub mod equivec;
29pub mod kfa;
30pub mod kv6;
31pub mod kvx;
32/// Voxel materials — per-voxel opacity + blend mode (alpha / additive) for
33/// transparent voxels (smoke, glass, water, spell glows). See [`material`]
34/// + `PORTING-TRANSPARENCY.md`.
35pub mod material;
36pub mod palette;
37pub mod sprite;
38/// Animated voxel-sprite clips (`.rvc`) — keyframe + diff "GIF/MP4 for
39/// voxel models" for effects (flame, spells). Frames use the GPU sprite
40/// model's dense-column layout; see [`voxel_clip`] + `PORTING-VOXEL-CLIP.md`.
41pub mod voxel_clip;
42pub mod vxl;
43pub mod xform;
44
45pub use material::{material_for_color, BlendMode, Material, MaterialTable};
46pub use palette::Rgb6;