Structure and Parts
SerpentineStructure is the source of truth for generated anatomy. Editing its Body or Head
settings rebuilds the generated meshes; changing a locomotion parameter does not rebuild the
structure.
V1 exposes only the Body controls needed for a useful first version:
- length and radius;
- a normalized radius profile from rear (
0) to front (1); - a detail level;
- advanced height ratio, cross-section shading and custom resolutions.
The generated Body uses an internal reusable axial primitive: a bone chain plus a
SkinnedMeshRenderer. Future Tail and Neck parts can reuse the same primitive without making
Body itself a special technical type.
Heads
Structure stores Heads as a list and supports zero to five entries. Each Head is attached to the front Body articulation, so it follows the final Body pose without becoming part of the locomotion solver yet. Offset and direction controls allow several Heads to branch from the same front connection.
Connection dimensions are inherited from the front Body profile. The Skull and Snout controls then change width, height and vertical offset along the Head instead of reducing the complete shape to one ovoid.
One logical Head owns two generated meshes:
- Upper Head contains the connection, skull and snout;
- Lower Jaw uses the exact same mouth boundary and has an independent
Jaw Pivot.
Jaw Opening sets the downward authoring angle from 0 to 60 degrees independently for each
Head. At 0, the two meshes recover their exact shared closed-mouth boundary. The initial
12-degree opening makes the mouth readable while the pivot preserves a clean path toward
future runtime animation. Neck is deliberately not exposed yet; it will require a
length-constrained chain solver between Body and Head.
Parts API
Use SerpentineStructure.Parts after generation. Parts.Body contains the axial Body and
Parts.Heads contains the logical Head parts in serialized order. Each Head exposes its root,
Upper Head renderer, Jaw Pivot, Lower Jaw renderer and renderer collection. Tails, Eyes and
Legs remain stable empty collections.
StructureRebuilt is raised after the renderer and rig have been recreated. Components that
cache generated Transforms or renderers should refresh their references from this event.
SerpentineLocomotion selects exactly one entry from Parts.Heads as its guiding Head and
leaves every other Head at its authored pose.