Skip to main content

Crate thread_avatar

Crate thread_avatar 

Source
Expand description

infinite-avatar — modular humanoid character definition.

Rust port of the Pixygon com.pixygon.avatar Unity package. This crate holds the portable data model only — which part sits in which slot, plus body height. Turning a spec into pixels is the renderer’s job, behind the AvatarRenderer seam (a 3D bone-assembler or a 2D sprite-stack).

Key ideas carried over from the Unity blueprint:

  • An avatar is assembled from slotted parts (AvatarSlot).
  • A race (AvatarRaceMode) is a body mode (biology defaults + a morph weight), not an outfit — a Reptilian and a Human can wear the same shirt.
  • Parts are keyed by StructuredId so they’re stable across games.

Modules§

manifest
The Portable Item Convention — Rust reference implementation.
races
Canonical Pixygon races, grounded in the Codex.

Structs§

AvatarBuilder
Resolves an AvatarSpec against a catalog and drives a renderer.
AvatarCatalog
The per-game wardrobe: the parts available to choose from.
AvatarPart
A catalog entry: one wearable/biological part, with its 3D and 2D assets.
AvatarRaceMode
A race = a set of biology slot defaults plus a morph weight. Applying it sets the biology slots; everything else stays custom.
AvatarSpec
The resolved, portable description of an avatar: which part id fills each slot, plus an overall body height. Part id 0 means “empty”. Serialize it into a save, hand it to an AvatarBuilder to render.

Enums§

AvatarSlot
One of the customization points on a humanoid avatar.
SlotCategory
Coarse grouping of AvatarSlots.

Traits§

AvatarRenderer
The rendering seam. Implemented by a 3D rig-assembler (parent meshes to bones, swap skin material, scale by body height) or a 2D sprite-stacker.