@ferret/humans
People and anthropomorphic characters from a spec: faces from words or a picture, clothes, kits and species, gait clips, crowds, glb bake, the humans.* commands and the viewer.
Read the guide: how to use it →
Classes
IdleLife class
class IdleLifeIdle life: blinks at a seeded rhythm (every 2..6 s, 0.2 s long, sometimes double) and micro-saccades of the gaze (small jumps every 0.4..1.6 s). A pure function of time: the same seed gives the same weights, so a replay or a client on the network sees the same eyes.
constructor(seed: number, horizon = 600) | |
blink(t: number): number | Eyelid closure 0..1 at time t (seconds): a fast close, a slower open. |
saccade(t: number): { yaw: number; pitch: number } | The small gaze offset (radians) at time t. |
weights(t: number, gaze = { yaw: 0, pitch: 0 }): ExpressionWeights | Blink and saccade as expression weights (combine with blendExpressions). |
packages/humans/src/expressions.ts:66
Rng class
class RngA small seeded generator (sfc32).
constructor(seed: number) | |
next(): number | 0 <= x < 1 |
range(lo: number, hi: number) | |
int(n: number) | |
chance(p: number) | |
normal(): number | standard normal (Box-Muller) |
pick<T>(items: readonly { v: T; w?: number }[]): T |
packages/humans/src/random.ts:20
Functions
add function
function add: (a: V3, b: V3) => V3packages/humans/src/primitives.ts:12
addCoat function
function addCoat(kit: BuiltKit, coat: CoatKit): voidAdds the geometry of a coat: shells on hero tiers, tufts and feathers on hero and mid tiers.
packages/humans/src/coat.ts:179
addEarChains function
function addEarChains(b: BuiltKit, k: EarKit): voidEars as spring chains: three joints from the base to the tip, the mesh bound along them (ears that flick and sway).
packages/humans/src/chain.ts:76
addJoint function
function addJoint(b: BuiltHuman, name: string, parent: string, at: V3): numberAppends a joint (world rest position) under parent; returns its index.
packages/humans/src/kit-core.ts:138
addMissing function
function addMissing(kit: BuiltKit, o: { hand?: 'l' | 'r'; eye?: 'l' | 'r' }): voidA missing hand (the fingers and palm collapse into a rounded stump on the wrist) and a missing eye (the eyeball is gone, the lids stay).
packages/humans/src/props.ts:194
addOutfitBundle function
function addOutfitBundle(id: string, ruStems: string, enWords: string, text: string): voidpackages/humans/src/outfit-words.ts:63
addPart function
function addPart(b: BuiltHuman, part: BuiltPart, role?: string, kit?: BuiltKit): voidAdds a part (its id must be unused).
packages/humans/src/kit-core.ts:144
addProps function
function addProps(kit: BuiltKit): voidBuilds the held and worn items of the kit options.
packages/humans/src/props.ts:220
addRobot function
function addRobot(kit: BuiltKit, o: RobotKit): voidpackages/humans/src/rigid.ts:20
addTail function
function addTail(b: BuiltKit, o: TailKit): voidAdds a tail: joints, a mesh bound along them, a chain with its spring constants.
packages/humans/src/chain.ts:41
addUniform function
function addUniform(id: string, pieces: () => OutfitPiece[]): voidpackages/humans/src/uniforms.ts:65
ageWeights function
function ageWeights(age: number): { ageBaby: number; ageChild: number; ageOld: number }Weights of the three age axes for an age in years.
packages/humans/src/weights.ts:17
ageWord function
function ageWord(age: number, sex: number): stringpackages/humans/src/describe.ts:12
applyExpression function
function applyExpression(data: HumanData, built: BuiltHuman, weights: ExpressionWeights): Map<string, Float32Array>The positions of the head parts with the expression applied, as new arrays per part id (the built person is not touched). A tier that is a vertex
subset applies the deltas through source.
packages/humans/src/expressions.ts:109
assertValid function
function assertValid(spec: HumanSpec, opts?: ValidateOptions): Issue[]Throws with every error listed; returns the warnings.
packages/humans/src/validate.ts:136
attachCell function
function attachCell: (tier: string) => numberThe cluster size of a tier by its name ('L2d', 'L2m' and 'L2' all mean the level 2).
packages/humans/src/hair.ts:21
attachIds function
function attachIds: (pack: AttachPack, kind: string) => string[]Ids of the items of one kind.
packages/humans/src/attach.ts:41
attachmentIds function
function attachmentIds(data: HumanData, spec: HumanSpec): string[]The attachment ids a spec asks for: hair style, brows, lashes, beard. 'none' gives nothing; 'default' picks by sex.
packages/humans/src/hair.ts:9
axisWeights function
function axisWeights(spec: HumanSpec, pack: ShapePack): AxisWeightsThe pack's axes a spec asks for, at which signed weights. Axes the pack does not have are ignored (a spec may name future ones).
packages/humans/src/weights.ts:33
bakeVariant function
function bakeVariant(data: HumanData, spec: HumanSpec, id: number, opts: BakeOptions = {}): CrowdVariantBuilds a variant from a spec: the merged mesh and its baked clips (planted at the person's own walking speed, so every body walks without sliding).
packages/humans/src/crowd.ts:107
bindChain function
function bindChain(m: Mesh, joints: number[], rest: V3[], id: string, material?: PartMaterial, root?: number): BuiltPartSkin data that binds a mesh along a chain of joints: each vertex takes the two joints whose rest positions bracket its projection on the chain, weighted by
where it falls between them (a tail, an ear or a tentacle bends smoothly). joints are indices into the built joint list, rest their rest positions.
packages/humans/src/primitives.ts:143
bindRigid function
function bindRigid(m: Mesh, joint: number, id: string, material?: PartMaterial, opts: { flat?: boolean } = {}): BuiltPartSkin data that binds every vertex of a mesh to one joint.
packages/humans/src/primitives.ts:132
blendExpressions function
function blendExpressions(...sets: ExpressionWeights[]): ExpressionWeightsBlend several weight sets: the largest value of each shape wins (so two emotions do not add into a grimace).
packages/humans/src/expressions.ts:47
bodyRegions function
function bodyRegions(built: BuiltHuman): BodyRegionspackages/humans/src/garment.ts:94
box function
function box(c: V3, h: V3, forward?: V3): MeshAn axis-aligned or oriented box: centre, half sizes, and an optional forward for the local z axis (y stays up when possible).
packages/humans/src/primitives.ts:84
buildAttachment function
function buildAttachment(data: HumanData, built: BuiltHuman, id: string, skinPositions?: Map<string, Float32Array>): BuiltPart | nullBuilds one attachment on a built person. built must hold head0 (and body0 for long hair) at the SAME tier it was built for; the attachment follows the
displacement of those vertices. skinPositions overrides the head positions (an expression applied by applyExpression), so brows and lashes move with the face.
packages/humans/src/attach.ts:47
buildAttachments function
function buildAttachments(data: HumanData, built: BuiltHuman, spec: HumanSpec, skinPositions?: Map<string, Float32Array>): BuiltPart[]All attachments of a spec on a built person, simplified for the tier.
packages/humans/src/hair.ts:24
buildFigure function
function buildFigure(data: HumanData, spec: HumanSpec, tier = 'full'): Figurepackages/humans/src/figure.ts:18
buildGarment function
function buildGarment(built: BuiltHuman, spec: GarmentSpec, regions?: BodyRegions): GarmentResult | nullBuilds a garment on the built person. Returns null when the template covers nothing.
packages/humans/src/garment.ts:196
buildHeadKit function
function buildHeadKit(b: BuiltKit, o: HeadKit): voidBuilds the kit head: warps, moves eyes, and adds the rigid pieces. Returns nothing; parts are added to b.
packages/humans/src/kit-head.ts:166
buildHeadwear function
function buildHeadwear(built: BuiltHuman, spec: HeadwearSpec): HeadwearResultpackages/humans/src/headwear.ts:75
buildHuman function
function buildHuman(data: HumanData, spec: HumanSpec | AxisWeights, tier = 'full', parts: readonly string[] = PART_IDS): BuiltHumanBuilds a person: the base figure plus the weighted sum of the shape fields, per part and LOD tier. tier is a name of the LOD pack
('L0d', 'L1m', ...) or 'full' for all base vertices. Deterministic: the same spec and data give the same numbers on every machine.
packages/humans/src/build.ts:106
buildKit function
function buildKit(data: HumanData, spec: HumanSpec, tier = 'full'): BuiltKitBuilds a person of a kit: the human build of the spec (with the kit's raw axis weights, which may lie beyond the +-1 of the face axes), the stylised proportions,
the head (muzzle, beak, eyes, ears, horns, tusks, crest, patch), the legs (digitigrade), the tail and ear chains, the coat (fur, scales, feathers), the robot
body, missing limbs, held and worn props. spec.kit === 'human' returns the plain build with the kit fields empty.
packages/humans/src/kit.ts:20
buildOutfit function
function buildOutfit(built: BuiltHuman, specs: GarmentSpec[]): { garments: GarmentResult[]; bodyIndices: Uint16Array | Uint32Array }An outfit: the garments of a person in layer order, and the body0 index list with the covered triangles of opaque layers removed.
packages/humans/src/garment.ts:305
buildOutfitFromPieces function
function buildOutfitFromPieces(built: BuiltHuman, pieces: readonly OutfitPiece[], seed: number, tileSize = 256, data?: HumanData): OutfitBuiltThe outfit of a spec on a built person: garments in layer order with their fabric tiles, and the body index list without the covered triangles.
packages/humans/src/outfit.ts:39
buildTrims function
function buildTrims(built: BuiltHuman, garment: GarmentResult, trims: readonly Trim[], regions?: BodyRegions): { trims: TrimResult[]; missing: Trim[] }Builds the trims of one garment. garment comes from buildGarment; pieces that find no surface in their region are left out (the result says which).
packages/humans/src/trim.ts:59
cadenceRate function
function cadenceRate(measure: GaitMeasure, rig: Rig, speed: number): numberPlayback rate that makes the stance feet of this body move at speed m/s: speed / (clip speed on the base figure x leg scale).
packages/humans/src/motion.ts:349
cardImage function
function cardImage(kind: 'tuft' | 'feather', size: number, colour: Rgb, tip: Rgb, seed = 1): ImgThe alpha tile of a card: 'tuft' = a bunch of tapering strands, 'feather' = a vane with a shaft and barbs. RGBA, colour from colour (root) to tip.
packages/humans/src/coat.ts:106
clamp function
function clamp: (v: number, lo: number, hi: number) => numberpackages/humans/src/axes.ts:47
coatAlbedo function
function coatAlbedo(kit: BuiltKit, partId: string, size = 1024): ImgThe albedo of a coated part: the coat colour at every texel, painted by position. Parts without UVs (cards, tails made without UV) cannot be painted: see uvFromProjection.
packages/humans/src/coat.ts:88
coatColour function
function coatColour(c: CoatKit, ctx: CoatContext, p: V3, n: V3): Rgbpackages/humans/src/coat.ts:38
colourDistance function
function colourDistance(a: Rgb, b: Rgb): numberCIE-like distance between two linear colours (weighted for the eye); 0 identical, about 0.1 a visible difference.
packages/humans/src/picture.ts:49
colourName function
function colourName(c: readonly [number, number, number]): stringpackages/humans/src/describe.ts:20
composeEye function
function composeEye(e: { iris: Rgb; iris2?: Rgb; sclera: number; pupil: number; /** 'slit' (cat, reptile) or 'horizontal' (goat, horse): a kit's pupil */ shape?: 'round' | 'slit' | 'horizontal' }, seed: number, size = 512, second = false): Uint8ClampedArrayThe eyeball sheet (centre = pupil, like the Customizer's planar eye UVs): sclera that darkens and reddens toward the rim with a seeded network of veins,
an iris with radial fibres, a collarette, a dark limbal ring and a round pupil. second picks the iris colour of the second eye (heterochromia).
RGBA, sRGB, size x size.
packages/humans/src/compose.ts:146
composeFabric function
function composeFabric(o: FabricInput): FabricTilepackages/humans/src/fabric.ts:74
composeMicro function
function composeMicro(o: MicroOptions): Uint8ClampedArrayMicro relief of skin as one tileable RGBA tile for Babylon's PBR detail map (R albedo grey, G normal Y, B roughness, A normal X; 128 = flat). Three layers of one height field: pores (a Worley field of small pits on a torus, so the tile repeats), the skin-line lattice (two crossing families of shallow furrows, warped by low-frequency noise so it is not a grid) and fine grain. A slow noise modulates the depth over the tile so the relief is not uniform. Pores come out a little rougher and darker than the plateaus between them. Deterministic: the same seed gives the same tile.
packages/humans/src/compose.ts:210
composeSkin function
function composeSkin(o: ComposeOptions): Uint8ClampedArrayThe albedo of one skin sheet for one person: the person's tone times the tint map, then freckles, moles, age spots and makeup (all seeded, so the same spec gives the same pixels). Returns RGBA, sRGB, 8 bit. Pure arithmetic over arrays: runs in a worker, in node and in the tests alike.
packages/humans/src/compose.ts:37
composeSurface function
function composeSurface(o: { tint: Img; zones: FaceZones; base: number; reduce?: number }): Uint8ClampedArrayMetallic-roughness sheet of the face (glTF layout: G roughness, B metallic = 0, R = 255) from the zones: lips and lids are wet and smooth, cheeks and
forehead drier. base is the person's average roughness (skinTone().roughness). Same UV sheet as the albedo; size = tint size / 2^(reduce + 1).
packages/humans/src/compose.ts:267
computeNormals function
function computeNormals(positions: Float32Array, indices: ArrayLike<number>, group: Uint32Array | null): Float32ArraySmooth normals of positions over triangles, welded by group (indices over the same vertex numbering as positions).
packages/humans/src/build.ts:82
createHumanMaterials function
function createHumanMaterials(scene: BABYLON.Scene, tier: MaterialTier, i: HumanMaterialInput): HumanMaterialspackages/humans/src/materials.ts:64
cross function
function cross: (a: V3, b: V3) => V3packages/humans/src/primitives.ts:16
crowdMesh function
function crowdMesh(F: Figure): { part: BuiltPart; colours: Uint8Array }One merged, vertex-coloured part of a figure built at a crowd tier.
packages/humans/src/crowd.ts:64
cylinder function
function cylinder: (a: V3, b: V3, ra: number, rb: number, seg?: number, cap?: boolean) => MeshA frustum (or cylinder, cone) from a to b.
packages/humans/src/primitives.ts:67
decodeHuman function
function decodeHuman(code: string): HumanSpecpackages/humans/src/code.ts:178
defaultHuman function
function defaultHuman(seed = 0): HumanSpecA neutral adult: every axis at the base figure. Not a typical person, only the origin of the spaces.
packages/humans/src/spec.ts:127
deriveMotion function
function deriveMotion(built: BuiltHuman, spec: HumanSpec): DerivedMotionMovement values from the real body: sizes from the built geometry, speeds by the Froude number of the leg (walking about 0.27, running about 2.9: a person of leg length L walks at sqrt(Fr g L)), mass from BMI and muscle, then age, fat and style (energy) adjust. Everything is a default that a spec can override.
packages/humans/src/motion.ts:158
deriveSeed function
function deriveSeed(seed: number, ...salt: number[]): number32-bit hash used to derive seeds; the same inputs give the same output on every machine.
packages/humans/src/random.ts:8
describeBack function
function describeBack(face: FaceSpec, limit = 10): string[]The face in words again (English ids with intensity): the descriptors whose axes the face matches, strongest first. The agent compares these with the request.
packages/humans/src/vocab.ts:170
describeFace function
function describeFace(text: string, seed: number, opts: { spread?: number; asym?: number } = {}): DescribedFace from words. spread is the standard deviation of the seeded fill of axes the text does not mention (0 = exactly the average face for the rest).
packages/humans/src/vocab.ts:134
describeHuman function
function describeHuman(spec: HumanSpec): stringpackages/humans/src/describe.ts:47
describeOutfit function
function describeOutfit(text: string): OutfitDescribedClothes from words.
packages/humans/src/outfit-words.ts:122
describeParts function
function describeParts(spec: HumanSpec): Record<string, string>One sentence per aspect, in a fixed order, as a list; describeHuman joins them.
packages/humans/src/describe.ts:30
diffSpecs function
function diffSpecs(a: unknown, b: unknown, path = ''): { path: string; from: unknown; to: unknown }[]The changes between two specs as JSON-pointer entries.
packages/humans/src/commands.ts:54
dominantColours function
function dominantColours(img: Img, region: Region, k = 3, gain: Rgb = [1, 1, 1], mask?: (r: Rgb) => boolean): { colour: Rgb; share: number }[]Dominant colours of a region (linear RGB, balanced): k-means with farthest-point start, ordered by area. Skips transparent and near-black/white background when skipBackground.
packages/humans/src/picture.ts:25
dot function
function dot: (a: V3, b: V3) => numberpackages/humans/src/primitives.ts:15
drapeCloth function
function drapeCloth(built: BuiltHuman, spec: DrapeSpec): DrapeResultpackages/humans/src/loose.ts:28
earMesh function
function earMesh(k: EarKit): MeshOne ear in local coordinates (base at the origin, pointing +y, wide along x, thin along z), left side; the caller orients and mirrors it.
packages/humans/src/kit-head.ts:102
ellipsoid function
function ellipsoid(c: V3, r: V3, seg = 14, ring = 9, up?: V3): MeshAn ellipsoid: centre, three semi-axes, optionally rotated so that its local y axis points along up.
packages/humans/src/primitives.ts:70
emotion function
function emotion(name: EmotionName, k = 1): ExpressionWeightsAn emotion at intensity k (0..1.5), as expression weights.
packages/humans/src/expressions.ts:40
encodeHuman function
function encodeHuman(s: HumanSpec): stringpackages/humans/src/code.ts:103
encodePng function
function encodePng(rgba: ArrayLike<number>, width: number, height: number): Uint8ArrayPNG (RGBA 8 bit) with stored deflate blocks: no compressor needed, so it runs everywhere.
packages/humans/src/gltf.ts:21
everydayOutfit function
function everydayOutfit(rng: Rng, spec: HumanSpec): HumanSpec['outfit']['pieces']A random everyday outfit as words (colours, a top, a bottom, shoes), read by describeOutfit: a profile's outfit may use it or bring its own.
packages/humans/src/crowd.ts:152
exportGlb function
function exportGlb(data: HumanData, F: Figure, opts: GlbOptions = {}): Uint8ArrayThe glb bytes of a figure. data supplies the motion pack (the rig) and the expression targets.
packages/humans/src/gltf.ts:79
eyeColours function
function eyeColours(e: EyesSpec): EyeColoursEye colours (linear sRGB). sclera 0..1: 1 = clean white, 0 = yellowed and bloodshot.
packages/humans/src/skin.ts:85
faceDistance function
function faceDistance(a: FaceSpec, b: FaceSpec): numberHow different two faces look: the weighted root-mean-square difference of the shape axes (weights = how much an axis changes the front view and the profile), plus the difference of the base-face blends. 0 = the same face. Two faces drawn independently with a per-axis spread s are about 1.41 * s apart.
packages/humans/src/face.ts:12
faceFitModel function
function faceFitModel(data: HumanData): FaceFitModelThe landmark vertices of the base head and the response of every axis there. Computed once per HumanData.
packages/humans/src/fit.ts:57
fatFromBmi function
function fatFromBmi(bmi: number): numberProvisional: BMI 22 is 0, 16 is -1, 38 is +1.
packages/humans/src/resolve.ts:27
fitFaceToLandmarks function
function fitFaceToLandmarks(model: FaceFitModel, picture: Record<string, [number, number]>, opts: FitOptions = {}): FitResultFits face axes to picture landmarks. picture: for each landmark name an [x, y] in picture units (x to the person's left, y up; any scale), front view. Alternates a 2D similarity alignment of the picture onto the current face with a ridge least-squares for the axes (bounded to -1..1).
packages/humans/src/fit.ts:109
fk function
function fk(rig: Rig, pose: Pose): WorldFK: world positions and rotations of every joint.
packages/humans/src/motion.ts:105
flatten function
function flatten(m: Mesh): MeshA flat-shaded copy: every triangle gets its own vertices, for hard-edged parts (boxes, plates, panels).
packages/humans/src/primitives.ts:125
frameOf function
function frameOf(d: V3): [V3, V3]Two unit vectors perpendicular to d (and to each other).
packages/humans/src/primitives.ts:22
fromMediaPipe function
function fromMediaPipe(points: ArrayLike<{ x: number; y: number }>): Record<string, [number, number]>The MediaPipe Face Mesh index of each landmark, for a caller that turns a 468-point result into the picture record.
packages/humans/src/fit.ts:163
fromSrgb function
function fromSrgb: (c: number) => numberpackages/humans/src/skin.ts:34
furCards function
function furCards(part: BuiltPart, count: number, length: number, width: number, droop: number, keep: TriMask, seed: number, card: 'tuft' | 'feather', colour: Rgb, id: string): BuiltPart | nullTufts: two crossing quads per tuft at area-weighted random points of the selected triangles, leaning down by droop, skinned like the triangle they grow from.
packages/humans/src/coat.ts:145
furShells function
function furShells(part: BuiltPart, layers: number, length: number, keep: TriMask, colour: Rgb): BuiltPart[]Shell layers of a skin part: layers copies of the selected triangles pushed out along the normals, each a part of its own (fur-<id>-<k>), outermost last.
packages/humans/src/coat.ts:126
gazeWeights function
function gazeWeights(yaw: number, pitch: number): ExpressionWeightsEye-look shapes for a gaze direction in head space (yaw to the person's right +, pitch up +, radians).
packages/humans/src/expressions.ts:54
getPointer function
function getPointer(obj: any, ptr: string): unknownpackages/humans/src/commands.ts:45
hairColour function
function hairColour(h: Pick<HairSpec, 'melanin' | 'redness' | 'greying' | 'dye'>): RgbHair colour: eumelanin darkens (L* 80 blond .. 12 black), pheomelanin (redness) adds red-orange; greying mixes toward white-grey. dye replaces the pigment colour. Linear sRGB.
packages/humans/src/skin.ts:70
headFrame function
function headFrame(built: BuiltHuman): HeadFrameThe head's measures: centre of the skull, top, brow level and the outer radius by height and angle (0 = +z, front).
packages/humans/src/headwear.ts:29
headMarks function
function headMarks(b: BuiltKit): HeadMarksLandmarks measured on the built head (they follow every face axis and the stylised proportions).
packages/humans/src/kit-head.ts:26
headScale function
function headScale(data: HumanData, built: BuiltHuman): [number, number, number]Per-axis scale of this person's head against the base head: expression deltas are multiplied by it (the re-basing).
packages/humans/src/expressions.ts:97
hitCapsules function
function hitCapsules(built: BuiltHuman): HitCapsule[]Combat hit capsules (the CapsuleSpec of @ferret/combat) with radii measured on this body's vertices: the median distance of the vertices each bone drives to its segment.
packages/humans/src/motion.ts:190
hornMesh function
function hornMesh(k: HornKit, sx = 1): Meshpackages/humans/src/kit-head.ts:124
humanAvatarLook function
function humanAvatarLook(scene: BABYLON.Scene, data: HumanData, o: HumanAvatarOptions): AvatarLookThe avatar look for Multiplayer: the look that travels is the spec's share code (a short string), and each machine builds the person from it. A player who sends none gets a person made from their name, the same on every machine.
packages/humans/src/babylon.ts:126
humanLook function
async function humanLook(scene: BABYLON.Scene, data: HumanData, spec: HumanSpec, o: FigureOptions = {}): Promise<Look>A Look for the transform package: the figure as one profile of a Transformer (profiles.knight = { build: (_e, parent) => look }).
packages/humans/src/babylon.ts:107
itaClass function
function itaClass(ita: number): 'very light' | 'light' | 'intermediate' | 'tan' | 'brown' | 'dark'Chardon's classes by ITA.
packages/humans/src/skin.ts:48
jointAt function
function jointAt(pack: MotionPack, rig: Rig, clip: GaitClip, joint: string, t: number): [number, number, number]World position of a joint at time t (seconds) of a clip on a rig.
packages/humans/src/motion.ts:316
jointIndex function
function jointIndex: (b: BuiltHuman, name: string) => numberpackages/humans/src/kit-core.ts:134
jointRest function
function jointRest: (b: BuiltHuman, name: string) => V3packages/humans/src/kit-core.ts:135
kitDef function
function kitDef(id: string): KitDefpackages/humans/src/kit-core.ts:121
kitHeadTop function
function kitHeadTop: (b: BuiltKit) => numberThe eye line and brow line of the built head, for hats and crowns of kits.
packages/humans/src/kit-head.ts:213
kitIds function
function kitIds: () => string[]packages/humans/src/kit-core.ts:120
kitRig function
function kitRig(pack: MotionPack, kit: BuiltKit): RigThe rig of a kit: the 87-joint rig plus the kit's own joints (identity rest rotation, so they follow their parent until the simulation moves them).
packages/humans/src/chain.ts:92
labToLinear function
function labToLinear(L: number, a: number, b: number): RgbCIELAB (D65) to linear sRGB, unclamped.
packages/humans/src/skin.ts:19
landmarksOf function
function landmarksOf(model: FaceFitModel, axes: Record<string, number>): Float64ArrayLandmark positions (metres, 3 per landmark) of a face given as axis values, by the model's linear response (the sparse fields are linear in the weight).
packages/humans/src/fit.ts:79
lathe function
function lathe(origin: V3, axis: V3, profile: [number, number][], seg = 20): MeshA solid of revolution about the line through origin along axis; profile is [height along axis, radius] pairs. Closed at both ends when the radii there are above 0.
packages/humans/src/primitives.ts:118
len function
function len: (a: V3) => numberpackages/humans/src/primitives.ts:17
lerp3 function
function lerp3: (a: V3, b: V3, t: number) => V3packages/humans/src/primitives.ts:19
linearToLab function
function linearToLab(c: Rgb): [number, number, number]Linear sRGB to CIELAB (D65).
packages/humans/src/skin.ts:27
loadFigure function
async function loadFigure(scene: BABYLON.Scene, data: HumanData, spec: HumanSpec, o: FigureOptions = {}): Promise<LoadedFigure>packages/humans/src/babylon.ts:80
loadHumanData function
async function loadHumanData(get: (name: string) => Promise<ArrayBuffer>): Promise<HumanData>Loads the three assets through any fetcher: get('humans-shape.json') and so on.
packages/humans/src/data.ts:125
makeDigitigrade function
function makeDigitigrade(b: BuiltKit, o: DigiOptions = {}): voidpackages/humans/src/digitigrade.ts:20
makeRig function
function makeRig(pack: MotionPack, joints: BuiltHuman['joints'], opts: { legScale?: number } = {}): Rigpackages/humans/src/motion.ts:63
makeTongue function
function makeTongue(lower: Float32Array, rest = 1): TongueShapelower: positions of the lower teeth (the person's own).
packages/humans/src/tongue.ts:37
mapMesh function
function mapMesh: (m: Mesh, f: (p: V3) => V3) => MeshApplies a function to every vertex.
packages/humans/src/primitives.ts:35
maskHair function
function maskHair(p: BuiltPart, headwear: { yCut: number; radius?: number }): BuiltPartA hat or helmet hides hair: triangles whose centre is above yCut (and inside radius of the head axis when given) are dropped.
packages/humans/src/hair.ts:94
material function
function material: (colour: Rgb, rest?: Partial<PartMaterial>) => PartMaterialpackages/humans/src/kit-core.ts:150
meanPlainSrgb function
function meanPlainSrgb(img: Uint8ClampedArray, tint: TintMap, reduce = 0): RgbMean sRGB colour of the plain-skin pixels of a composed sheet (for tests and the sheet report).
packages/humans/src/compose.ts:112
measureGait function
function measureGait(pack: MotionPack, rig: Rig, clip: GaitClip): GaitMeasureThe ground-facing metrics of a gait clip on a rig: travel speed (positive forward, negative backward), the stance frames of each foot and the clip's own slide. Stance: the ball is near its lowest AND moves along z at the speed the others in that group move at (the median), so the toe-off and heel-strike frames, where the foot rolls, are not counted. A clip that stays in place (idle) has speed 0 and every frame is stance.
packages/humans/src/motion.ts:325
merge function
function merge: (...ms: (Mesh | null | undefined)[]) => Meshpackages/humans/src/primitives.ts:28
mergeParts function
function mergeParts(parts: BuiltPart[], id: string): BuiltPartConcatenates parts into one (same material).
packages/humans/src/garment.ts:234
migrate function
function migrate(raw: unknown): HumanSpecpackages/humans/src/migrate.ts:22
mirrorX function
function mirrorX: (m: Mesh) => MeshMirrors across x = 0 (left to right); the winding is flipped to keep the faces outward.
packages/humans/src/primitives.ts:38
moveEyes function
function moveEyes(b: BuiltKit, m: HeadMarks, o: NonNullable<HeadKit['eyes']>): voidEyes to the side of the head (rabbit, horse, bird, lizard): both eyeballs and the lids around them move out and back, optionally larger.
packages/humans/src/kit-head.ts:74
movementValues function
function movementValues(built: BuiltHuman, spec: HumanSpec, overrides: Partial<MovementValues> = {}): MovementValuesThe CharacterParams a body gets: derived values where the spec has no override (overrides wins).
packages/humans/src/motion.ts:183
mul function
function mul: (a: V3, k: number) => V3packages/humans/src/primitives.ts:14
nearestPair function
function nearestPair(faces: readonly FaceSpec[]): { distance: number; i: number; j: number }The smallest distance between any two faces of a set (Infinity for fewer than two), and the pair that has it.
packages/humans/src/face.ts:22
newChainState function
function newChainState: (kit: BuiltKit) => ChainStatepackages/humans/src/chain.ts:114
noise3 function
function noise3(x: number, y: number, z: number, s = 0): numbervalue noise 0..1 at a 3D point
packages/humans/src/coat.ts:19
norm function
function norm: (a: V3) => V3packages/humans/src/primitives.ts:18
outfitFromPicture function
function outfitFromPicture(img: Img, reads: readonly PictureRead[], defaults: { fabric?: string } = {}): OutfitPiece[]Fills the colours and patterns of the read garments from the pixels.
packages/humans/src/picture.ts:88
paintByPosition function
function paintByPosition(part: BuiltPart, size: number, fn: (p: V3, n: V3) => Rgb, background: Rgb = [0.5, 0.5, 0.5]): ImgPaints a texture by 3D position: every texel of every triangle is evaluated at its interpolated position and normal. fn returns linear RGB.
packages/humans/src/coat.ts:61
panelRest function
function panelRest(points: Float32Array, rows: number, seg: number): Float32ArrayRing-to-ring rest lengths of a panel laid out like the grids above, for swingPanel.
packages/humans/src/loose.ts:152
panelStart function
function panelStart(goal: Float32Array): PanelStateStarts a panel at rest: the points are the posed goal and at rest.
packages/humans/src/loose.ts:124
parseAttach function
function parseAttach(json: string | object, bin: ArrayBuffer): AttachPackpackages/humans/src/attach.ts:24
parseBase function
function parseBase(json: string | object, bin: ArrayBuffer): BaseFigurepackages/humans/src/data.ts:33
parseLod function
function parseLod(json: string | object, bin: ArrayBuffer): LodPackpackages/humans/src/data.ts:104
parseMotion function
function parseMotion(json: string | object, bin: ArrayBuffer): MotionPackpackages/humans/src/motion.ts:44
parseShapePack function
function parseShapePack(json: string | object, bin: ArrayBuffer): ShapePackpackages/humans/src/data.ts:74
patternFromPixels function
function patternFromPixels(img: Img, region: Region, gain: Rgb = [1, 1, 1], across = 0.5): { pattern: Pattern; colour: Rgb }A pattern read from a region of cloth: solid, stripes (periodic along one axis only) or check (periodic along both); scale is repeats across across metres of cloth.
packages/humans/src/picture.ts:73
penetration function
function penetration(F: Figure): { checked: number; inside: number; fraction: number; deepest: number }Garment vertices that sit inside the body: nearest body vertex by a hash grid, signed distance along its normal.
packages/humans/src/commands.ts:64
pieceToGarment function
function pieceToGarment(p: OutfitPiece): GarmentSpec | nullThe garment spec of an outfit piece (templates only; library items are bound by the bind tool). Unknown parameter keys are ignored, bad values are dropped.
packages/humans/src/outfit.ts:21
placeEars function
function placeEars(local: Mesh, base: V3, tilt: number, back: number): { l: Mesh; r: Mesh }Places a local ear (left) on the head and returns the left and right meshes. tilt leans it outward, back backward.
packages/humans/src/kit-head.ts:118
planCrowd function
function planCrowd(profile: Profile, n: number, opts: CrowdOptions): CrowdPlanPlans a crowd: variants different people from the profile (population, with its face-distance rule) and n instances spread over a square arena. Each instance's
clip, rate, phase, scale and tint come from its own seed; each variant's gait style comes from its spec (the profile's motionSpread). Pure of (profile, n, options).
packages/humans/src/crowd.ts:164
plantedCycle function
function plantedCycle(pack: MotionPack, rig: Rig, clip: GaitClip, speed: number): { poses: Pose[]; fps: number; rate: number; duration: number }One planted cycle of a gait at speed m/s: the clip played at the cadence-matched rate with the stance feet held still on the ground (IK), as treadmill does, one pose per clip frame (the middle of three simulated cycles, so the foot states are in their steady cycle). fps is the playback rate in poses per second. The body moves forward by speed (m/s) while the poses play: the foot positions in the world are constant during stance.
packages/humans/src/motion.ts:455
plantFeet function
function plantFeet(rig: Rig, pose: Pose, targets: Partial<Record<'l' | 'r', [number, number, number]>>): PosePlants the stance feet of a pose: where a target is farther than the leg can reach, the pelvis is lowered just enough (at most 25 % of the leg) so that it can be reached, then each leg is bent with plantFoot. targets are world positions of the balls.
packages/humans/src/motion.ts:386
plantFoot function
function plantFoot(rig: Rig, pose: Pose, side: 'l' | 'r', target: [number, number, number]): PosePlants a stance foot with two-bone IK: the pose's leg is bent so the ball stays at target (world). side 'l' or 'r'. Returns a new pose. The knee bends forward, the foot keeps its world orientation.
packages/humans/src/motion.ts:357
population function
function population(profile: Profile, n: number, seed: number, attempts = 40): Populationn different people from one profile. With minFaceDistance, a person too close to an earlier one is drawn again (up to attempts times); the result is a pure function of (profile, n, seed).
packages/humans/src/random.ts:187
poseSkin function
function poseSkin(part: BuiltPart, rig: Rig, w: World): Float32ArrayLinear blend skinning of a built part (8 joints per vertex) to a pose.
packages/humans/src/motion.ts:117
proofIds function
function proofIds: () => string[]packages/humans/src/proofs.ts:35
proofSpec function
function proofSpec(id: string): HumanSpecpackages/humans/src/proofs.ts:36
qaxis function
function qaxis: (axis: [number, number, number], angle: number) => Qpackages/humans/src/motion.ts:24
qconj function
function qconj: (a: ArrayLike<number>) => Qpackages/humans/src/motion.ts:19
qfromTo function
function qfromTo: (a: [number, number, number], b: [number, number, number]) => Qthe rotation taking direction a to direction b (both nonzero)
packages/humans/src/motion.ts:32
qmul function
function qmul: (a: ArrayLike<number>, b: ArrayLike<number>) => Qpackages/humans/src/motion.ts:16
qnorm function
function qnorm: (a: Q) => Qpackages/humans/src/motion.ts:20
qrot function
function qrot: (q: ArrayLike<number>, v: ArrayLike<number>) => [number, number, number]packages/humans/src/motion.ts:21
qslerp function
function qslerp: (a: ArrayLike<number>, b: ArrayLike<number>, t: number) => Qpackages/humans/src/motion.ts:25
quantise function
function quantise(s: HumanSpec): HumanSpecWhat a spec becomes after a trip through the code (the quantised spec); useful for comparing two specs.
packages/humans/src/code.ts:237
randomHuman function
function randomHuman(seed: number, profile: Profile = UNIFORM_PROFILE): HumanSpecOne person from a seed and a profile, the same on every machine. The profile's constraints are hard: the person is drawn again (with seeds derived from seed) until all hold and the spec is valid; if 64 draws fail, it throws with the reasons rather than relax a rule.
packages/humans/src/random.ts:162
recipe function
function recipe(id: string): KitOptionspackages/humans/src/kits.ts:44
recipeIds function
function recipeIds: () => string[]packages/humans/src/kits.ts:43
registerHumansCommands function
function registerHumansCommands(host: CommandHost, data: HumanData, opts: HumansSessionOptions = {}): SessionRegisters the commands on a host and returns the session they work on.
packages/humans/src/commands.ts:104
registerKit function
function registerKit(def: KitDef): voidpackages/humans/src/kit-core.ts:119
registerProp function
function registerProp: (id: string, b: PropBuilder) => voidpackages/humans/src/props.ts:30
registerWorn function
function registerWorn: (id: string, w: Worn) => voidpackages/humans/src/props.ts:115
resolveBody function
function resolveBody(spec: HumanSpec): ResolvedBodypackages/humans/src/resolve.ts:31
resolveKitOptions function
function resolveKitOptions(spec: HumanSpec): KitOptionsThe options of a spec: the kit's defaults, with the spec's own kitOptions laid over them (objects merged one level deep, arrays and scalars replaced).
packages/humans/src/kit-core.ts:124
restPose function
function restPose(rig: Rig): Posepackages/humans/src/motion.ts:85
restyle function
function restyle(b: BuiltHuman, axes: Partial<Record<StyleAxis, number>>): voidThe stylised-proportion transform: each joint gets a length factor for the bone from its parent (per axis) and a cross-section factor for the skin it drives, and
every vertex is moved by the weighted sum over its joints (J'_k + (p - J_k) * section_k). Works on every part of the built person (skin, hair, garments built
later do not need it: they are made on the result). Afterwards the figure is put back on the ground.
packages/humans/src/kit-core.ts:168
rotateMesh function
function rotateMesh: (m: Mesh, axis: V3, a: number, about?: V3) => Meshpackages/humans/src/primitives.ts:44
rotAxis function
function rotAxis: (v: V3, axis: V3, a: number) => V3Rotation of a vector about a unit axis by a radians (Rodrigues).
packages/humans/src/primitives.ts:40
sample function
function sample(rng: Rng, d: Dist): numberpackages/humans/src/random.ts:52
samplePose function
function samplePose(pack: MotionPack, rig: Rig, clip: GaitClip, t: number): PoseThe pose of a gait clip at time t seconds (looping), rotations slerped between the 30 fps frames, the pelvis translation scaled by leg length.
packages/humans/src/motion.ts:88
scaleKit function
function scaleKit(b: BuiltHuman, k: number): voidUniform scale of the whole built kit about the ground (all parts, joints, stature).
packages/humans/src/kit-core.ts:236
scaleMesh function
function scaleMesh: (m: Mesh, s: V3, about?: V3) => Meshpackages/humans/src/primitives.ts:45
setPointer function
function setPointer(obj: any, ptr: string, value: unknown): voidpackages/humans/src/commands.ts:46
simplifyPart function
function simplifyPart(p: BuiltPart, cell: number): BuiltPartCluster simplification: vertices in one grid cell merge (positions and uv averaged, skin of the first), degenerate and duplicate triangles go.
packages/humans/src/hair.ts:65
skinFromColour function
function skinFromColour(c: Rgb, age = 30): { melanin: number; redness: number }The melanin and redness whose skin tone is nearest (linear) to a colour sampled from a picture.
packages/humans/src/commands.ts:88
skinReduce function
function skinReduce(tier: MaterialTier, mobile: boolean): numberTexture size reduction (power of two, see composeSkin's reduce) per tier and device: the phone gets one step less detail at the same tier, and a
crowd figure never needs more than a quarter-size sheet (it is a few dozen pixels tall on screen).
packages/humans/src/materials.ts:141
skinToBody function
function skinToBody(kit: BuiltKit, m: Mesh, id: string, mat: PartMaterial, k = 3): BuiltPartSkins a mesh by the weights of the nearest body vertices (the way hair is bound): worn cloth-like pieces then follow the torso and the pelvis.
packages/humans/src/props.ts:76
skinTone function
function skinTone(skin: Pick<SkinSpec, 'melanin' | 'redness'>, age = 30): SkinToneAverage skin colour of a person. age in years: old skin is a little paler in chroma and rougher.
packages/humans/src/skin.ts:53
socketsOf function
function socketsOf(kit: BuiltKit): Record<string, Socket>packages/humans/src/props.ts:97
splitEyes function
function splitEyes(part: Pick<BuiltPart, 'positions' | 'indices'>): EyeSplitpackages/humans/src/eyes.ts:11
springStep function
function springStep(points: Float32Array, prev: Float32Array, rest: Float32Array, pin: [number, number, number], dt: number, opts: { gravity?: number; damping?: number; iterations?: number } = {}): { points: Float32Array; prev: Float32Array }Spring chain for long hair and beards (Verlet with length constraints). points are 3 floats per node, node 0 is pinned to the head; prev is the
previous step; gravity m/s², damping kept per step. Pure: returns new arrays, so the same inputs give the same motion.
packages/humans/src/hair.ts:111
statureOf function
function statureOf(pack: ShapePack, w: AxisWeights): numberThe stature a weight set gives (metres), from the pack's calibration.
packages/humans/src/weights.ts:54
stepChains function
function stepChains(rig: Rig, kit: BuiltKit, state: ChainState, pose: Pose, dt: number): PoseAdvances the chains by dt seconds and writes their local rotations into a copy of the pose. Each chain is a pinned Verlet chain with fixed segment lengths
pulled back toward the pose it would have without physics (stiffness) and down by gravity: the root (an animated body joint) drives it, so a tail swings when the
body turns and an ear flicks when the head shakes. Deterministic.
packages/humans/src/chain.ts:121
strandLayer function
function strandLayer(albedo: Img, layer: number, layers: number, seed = 1, cell = 2): ImgA strand layer: the albedo with the alpha cut where the strand is shorter than the layer, root darker. Returns RGBA with alpha 0 / 255.
packages/humans/src/coat.ts:96
styleClip function
function styleClip(rig: Rig, clip: GaitClip, style: MotionStyle): GaitClipApplies a motion style to a gait clip, returning a new clip (same bones and frames). Every parameter -1..1, 0 = the clip as it is: armSwing and shoulderRoll and hipSway scale the amplitude of that part's swing about its cycle mean, energy scales all swing and bounce the pelvis rise (reduced by heaviness), posture leans the spine forward when negative and straightens it when positive, confidence lifts the head and chest or drops them, strideWidth sets the legs apart, limp weakens one leg and drops the pelvis on its side, load pulls the arms in and leans forward. Tempo is not baked here: a brisk person walks faster (deriveMotion scales the speeds by it) and the cadence match sets the playback rate for that speed.
packages/humans/src/motion.ts:252
sub function
function sub: (a: V3, b: V3) => V3packages/humans/src/primitives.ts:13
swingPanel function
function swingPanel(state: PanelState, goal: Float32Array, rest: Float32Array, rows: number, seg: number, dt: number, opts: { stiffness?: number; damping?: number; iterations?: number } = {}): PanelStateOne step of a hanging panel. goal is the panel posed by the skeleton (skinned, no lag) in the same layout; ring 0 is pinned to it. Each lower ring is pulled to its goal with spring stiffness per second, keeps inertia (damping per step) and its ring-to-ring length (rest, from the unposed panel) is kept, so a hem trails a moving leg and swings back. Pure: new arrays, the same inputs give the same motion.
packages/humans/src/loose.ts:131
teethRows function
function teethRows(positions: Float32Array, indices: ArrayLike<number>): { upper: number[]; lower: number[] }The two tooth rows of the head4 part (it also holds the shells at the eyes): connected components, by welded position, that sit on the midline and are wide. Returns the vertex lists of the upper and the lower row (lower = the one with the lower mean height); empty when the part has no teeth.
packages/humans/src/tongue.ts:13
tongueBuiltPart function
function tongueBuiltPart(shape: TongueShape, joint: number, normals: Float32Array): BuiltPartThe tongue as a BuiltPart skinned to the head joint (index joint).
packages/humans/src/tongue.ts:72
tongueOutDelta function
function tongueOutDelta(rest: Float32Array, reach = 0.05): Float32ArrayThe displacement of tongueOut = 1 (metres, 3 per vertex) of a tongue's rest positions: the tip comes forward past the teeth and lifts a little; the root stays.
packages/humans/src/tongue.ts:64
torus function
function torus(c: V3, axis: V3, R: number, r: number, seg = 24, segr = 8): MeshA torus (ring) about axis: major radius R, minor radius r.
packages/humans/src/primitives.ts:109
toSpecColour function
function toSpecColour: (c: Rgb) => RgbLinear RGB to the sRGB the spec stores? No: the spec stores linear-ish scene colours as in colour: Rgb; this returns them unchanged for clarity.
packages/humans/src/picture.ts:46
toSrgb function
function toSrgb: (c: number) => numberpackages/humans/src/skin.ts:33
translate function
function translate: (m: Mesh, d: V3) => Meshpackages/humans/src/primitives.ts:36
treadmill function
function treadmill(pack: MotionPack, rig: Rig, clip: GaitClip, speed: number): SlideReportTreadmill test of a body: plays the (styled) gait at the cadence-matched rate while the ground slides back at speed, and measures how fast the stance feet move on the ground, before and after planting them with IK. A foot on the ground does not move: the numbers are the foot sliding.
packages/humans/src/motion.ts:421
tube function
function tube(path: V3[], radii: (number | [number, number])[], seg = 10, cap = true): MeshA tube along a polyline with a radius (or [rx, rz]) per point, seg sides, capped at both ends when cap is set. Closed at the tip when its last radius is 0.
packages/humans/src/primitives.ts:48
turtle function
function turtle(p0: V3, dir: V3, axis: V3, length: number, curve: number, steps = 14, twist = 0): V3[]A turtle path: starts at p0 going dir, bends about axis by curve radians per metre. Returns the points.
packages/humans/src/kit-head.ts:94
tuskMesh function
function tuskMesh(len: number, curve: number, x: number, sx: number): MeshTwo tusks rising from the lower jaw (orc, boar).
packages/humans/src/kit-head.ts:142
typicalStature function
function typicalStature(age: number, sex: number): numberMedian stature (metres) by age and sex (0 female .. 1 male), from the WHO/CDC growth medians; a reference for when a text gives an age but no height.
packages/humans/src/weights.ts:57
uniform function
function uniform(id: string): OutfitPiece[]The pieces of a named uniform (a fresh array each time). Throws on an unknown id so a typo is not a silent naked soldier.
packages/humans/src/uniforms.ts:59
uniformIds function
function uniformIds: () => string[]packages/humans/src/uniforms.ts:64
validateSpec function
function validateSpec(spec: HumanSpec, opts: ValidateOptions = {}): Issue[]Checks a spec; returns every problem found (errors make the spec unusable, warnings are reported and the spec still builds).
packages/humans/src/validate.ts:34
variantBytes function
function variantBytes: (v: CrowdVariant) => numberMemory of a baked variant in bytes (positions and normals as the GPU gets them: float32).
packages/humans/src/crowd.ts:181
warpMuzzle function
function warpMuzzle(b: BuiltKit, m: HeadMarks, o: NonNullable<HeadKit['muzzle']>): voidWarps the head parts (not the eyes) into a muzzle: the lower face from the chin up to the nose bridge is pushed forward by length (the lips and teeth ride with it,
the cheeks stay), pinched in width and flattened in height. Sets exprGain so that the jaw opens further on a longer jaw. Returns the new nose tip z.
packages/humans/src/kit-head.ts:52
weldNormals function
function weldNormals(p: BuiltPart): voidPosition-welded normals (UV seams and duplicated vertices share a normal): used after a part's positions are changed.
packages/humans/src/kit-core.ts:153
whiteBalance function
function whiteBalance(img: Img, white?: Region): RgbGray-world white balance of a whole picture: the gain per channel that makes the mean grey. Pass white (a region of something known to be white or grey) to use it instead.
packages/humans/src/picture.ts:16
withCap function
function withCap(data: HumanData, built: BuiltHuman, id: string, p: BuiltPart, lift = 0.005): BuiltPartA solid scalp shell under a simplified style: the skin triangles the style is bound to (two of three vertices), lifted by lift metres along their normals and merged
into the style part. Clustered curls leave gaps; the shell keeps the head covered at the crowd tiers.
packages/humans/src/hair.ts:38
worley function
function worley(x: number, y: number, z: number, s = 0): { f1: number; f2: number; id: number }Worley noise: distance to the nearest and second nearest jittered cell point, and the nearest cell's id (0..1).
packages/humans/src/coat.ts:25
Interfaces
AttachItem interface
interface AttachItemAttachments: hair styles, brows, lashes and beards bound to the skin. Each vertex stores its 4 nearest skin vertices (head0 numbering, then body0) and weights; it moves by the weighted displacement of the BUILT skin (positions minus base), so it follows every shape axis and every expression with no per-axis data. Joints and skin weights are those of the nearest skin vertex, so a long style follows the neck and shoulders too.
id: string | |
kind: 'hair' | 'brows' | 'lashes' | 'beard' | string | |
source: string | |
female: boolean | |
vertices: number | |
triangles: number | |
positions: Float32Array | |
uv: Float32Array | null | |
indices: Uint16Array | Uint32Array | |
bindIdx: Uint32Array | 4 skin vertices per vertex: head0 index, or head0 vertex count + body0 index |
bindW: Uint8Array | |
ranges?: { start: number; count: number; mesh: string; prim: number }[] | library garments: material ranges (triangle start and count per original primitive) and the body0 triangles the garment hides |
hidden?: Uint32Array |
packages/humans/src/attach.ts:11
AttachPack interface
interface AttachPackskinParts: string[] | |
items: Map<string, AttachItem> |
packages/humans/src/attach.ts:20
AxisDef interface
interface AxisDefThe shape axes of a person. Every axis is a number; face and proportion axes are signed, -1..1, 0 = the base figure. The tables are APPEND-ONLY: the share code (code.ts) refers to an axis by its index here, so reordering or removing one breaks every saved code.
id: string | |
region: string | the region of the face |
min: number | |
max: number | |
weight: number | how much the axis changes the front view and the profile; used by faceDistance |
packages/humans/src/axes.ts:6
BakedClip interface
interface BakedClipCrowds: many different people for little. Each distinct person is a VARIANT: one merged mesh at a crowd tier (body, head, hair and clothes in one
part, colours per vertex), baked into vertex animation for a planted walk cycle, a jog cycle and an idle (positions and normals for every frame). Everybody on screen
is an INSTANCE of a variant: a start position, heading, phase, playback rate (which is also the travel speed, so feet do not slide), scale and a colour tint. The
GPU does the rest (see tools/humans/p10-crowd.mjs for the shader): the CPU cost per frame is one time value. Any instance can be swapped for a full figure when it
comes close (buildFigure of the same spec at L0/L1): the variant keeps its spec.
name: 'walk' | 'jog' | 'idle' | |
frames: number | |
fps: number | poses per second at rate 1 |
duration: number | |
speed: number | travel speed in m/s at rate 1 (0 for idle) |
positions: Float32Array | frames x vertices x 3 |
normals: Float32Array | frames x vertices x 3, unit |
packages/humans/src/crowd.ts:21
BakeOptions interface
interface BakeOptionstier?: string | crowd tier of the geometry: 'L3d' (far) or 'L2d' (near) |
idleFrames?: number | frames of the idle clip (subsampled) |
clips?: ('walk' | 'jog' | 'idle')[] |
packages/humans/src/crowd.ts:98
BaseFigure interface
interface BaseFigurepackages/humans/src/data.ts:24
BaseJoint interface
interface BaseJointname: string | |
parent: number | |
rest: [number, number, number] |
packages/humans/src/data.ts:23
BasePart interface
interface BasePartid: string | |
vertices: number | |
triangles: number | |
positions: Float32Array | |
uv: Float32Array | null | |
indices: Uint16Array | Uint32Array | |
joints: Uint8Array | 8 joint indices (into joints) per vertex |
weights: Uint8Array | 8 weights per vertex, 0..255, summing to 255 |
packages/humans/src/data.ts:11
BeakKit interface
interface BeakKitpackages/humans/src/kit-core.ts:76
BodyRegions interface
interface BodyRegionsThe body0 vertices classified by region, with the limb parameter and the measures the templates cut by.
group: Uint8Array | |
t: Float32Array | |
neckY: number | |
crotchY: number | |
waistY: number | |
soleY: number | |
ankleY: number | |
jointPos(name: string): [number, number, number] |
packages/humans/src/garment.ts:87
BodySpec interface
interface BodySpecsex: number | 0 female .. 1 male, continuous |
age: number | years |
height: number | metres |
build?: { /** Heath-Carter ratings [endomorphy, mesomorphy, ectomorphy], 0.5..9 */ somatotype?: [number, number, number]; /** bone breadth, -1 slight .. 1 heavy */ frame?: number; /** -1 gynoid (hips, thighs) .. 1 android (belly, waist) */ fatPattern?: number; /** kg; with height gives BMI */ mass?: number; } | the high level (5a); resolves to the low level where that is left unset |
weight?: number | the low level: -1 emaciated .. 1 obese (0 average). Unset = resolved from build. |
muscle?: number | the low level: -1 wasted .. 1 very muscular (0 average). Unset = resolved from build. |
proportions: Partial<Record<typeof PROPORTION_AXES[number], number>> |
packages/humans/src/spec.ts:42
BuiltHuman interface
interface BuiltHumantier: string | |
parts: Map<string, BuiltPart> | |
joints: { name: string; parent: number; rest: [number, number, number] }[] | joint names, parents and shaped rest positions (the skeleton follows the shape) |
weights: AxisWeights | |
stature: number | head top to sole, metres, measured on the built geometry |
predictedStature: number | what the pack's calibration predicted (the check of stature) |
packages/humans/src/build.ts:47
BuiltKit interface
interface BuiltKit extends BuiltHumankit: string | |
options: KitOptions | |
extraJoints: number | number of joints beyond the 87 of the contract |
chains: ChainInfo[] | |
sockets: Record<string, Socket> | |
digitigrade: boolean | the legs were rebuilt with a hock: the IK of plantFoot must aim the ball (see kitRig) |
tierName?: string | the geometry tier this was built at |
rigid: boolean | parts hold one joint per vertex (robots): no skin blending anywhere |
motion?: Record<string, number> | the gait style a kit asks for by default (robots snap, giants lumber) |
hidden: string[] | parts that are built (clothes and props fit them) but not drawn: the skin under a robot's panels |
roles: Record<string, string[]> | the ids of the parts the kit added, by role (for hiding/replacing in a viewer) |
packages/humans/src/kit-core.ts:25
BuiltPart interface
interface BuiltPartThe geometry of one part of a built person at one LOD tier.
id: string | |
positions: Float32Array | 3 floats per vertex, metres, the shaped positions |
normals: Float32Array | smooth normals (UV seams are welded) |
uv: Float32Array | null | |
indices: Uint16Array | Uint32Array | |
skinJoints: Uint8Array | 8 joints and 8 weights per vertex, indices into joints of the built person |
skinWeights: Uint8Array | |
source: Uint32Array | the base vertex each built vertex came from (identity at the full tier) |
material?: PartMaterial | a material of its own (kit parts, props); absent for skin, hair and garments that the material set colours |
morphs?: Record<string, Float32Array> | kit parts that move with an expression (a beak's lower half opens with jawOpen): additive position deltas at weight 1, by ARKit name |
exprGain?: Float32Array | per-vertex gain on expression deltas (a kit with a long muzzle opens its jaw further than the base head); absent = 1 |
ranges?: { start: number; count: number; mesh: string; prim: number }[] | library garments: material ranges over the triangles |
packages/humans/src/build.ts:24
ChainInfo interface
interface ChainInfoname: string | |
kind: 'tail' | 'ear' | 'horn' | 'cloth' | 'feather' | 'tentacle' | |
joints: number[] | joint indices from the root outward (the root is an existing body joint) |
stiffness: number | spring stiffness 0..1 per step, damping 0..1, gravity m/s^2 along -y, seconds of lag |
damping: number | |
gravity: number | |
side?: 'l' | 'r' |
packages/humans/src/kit-core.ts:15
ChainState interface
interface ChainStateState of the chain simulation of one kit (positions of every chain particle, current and previous).
pos: Float32Array[] | |
prev: Float32Array[] | |
started: boolean |
packages/humans/src/chain.ts:113
CoatContext interface
interface CoatContextThe colour of a coat at a point of the body, by pattern. ctx carries the measures the patterns use.
chestY: number | |
noseZ: number | |
chinY: number | |
pelvisY: number |
packages/humans/src/coat.ts:37
CoatKit interface
interface CoatKitkind: 'fur' | 'scales' | 'feathers' | 'plain' | |
colour: Rgb | |
colour2?: Rgb | |
pattern?: string | fur and feathers: 'plain' | 'tabby' | 'spots' | 'saddle' | 'bicolour' | 'stripes' | 'mane'; scales: 'plain' | 'bands' | 'diamond' |
length?: number | fur length in metres |
bare?: ('face' | 'hands' | 'feet')[] | where the coat does NOT reach: face front, hands... 'face' | 'hands' | 'feet' |
tufts?: ('cheeks' | 'chest' | 'neck' | 'tail' | 'ears' | 'arms' | 'legs' | 'back' | 'crown' | 'face')[] | tufts of cards at the silhouette: where they grow |
tuftLength?: number | |
seed?: number |
packages/humans/src/kit-core.ts:90
CommandHost interface
interface CommandHostThe humans.* commands, host-agnostic: a host gives register(name, description, fn) (the viewer passes world.commands.register, a test passes a Map) and gets a session of named specs. Every command takes and returns plain JSON (bytes aside), so a person, a test and an agent drive the same things.
register(name: string, description: string, fn: (args: any) => unknown | Promise<unknown>): void |
packages/humans/src/commands.ts:27
ComposeOptions interface
interface ComposeOptionstint: TintMap | |
zones?: FaceZones | only for the head sheet |
skin: SkinSpec | |
age: number | |
seed: number | |
reduce?: number | output size = tint size / 2^reduce (the mobile tiers use 1) |
sheet: 'head' | 'body' | 'head' or 'body': what the sheet is, for the density of the marks |
packages/humans/src/compose.ts:15
Condition interface
interface ConditionHow worn a garment is, 0..1 each (8a.5).
wear?: number | |
dirt?: number | |
mud?: number | |
wet?: number | |
torn?: number | |
blood?: number | |
faded?: number |
packages/humans/src/spec.ts:27
Conflict interface
interface Conflictaxis: string | |
a: string | |
b: string |
packages/humans/src/vocab.ts:116
CrowdOptions interface
interface CrowdOptionsvariants: number | |
arena?: number | |
seed?: number | |
idleShare?: number | |
jogShare?: number |
packages/humans/src/crowd.ts:158
CrowdPerson interface
interface CrowdPersonvariant: number | |
x: number | metres in the arena (square, centred), heading in radians (0 = +z) |
z: number | |
heading: number | |
clip: 'walk' | 'jog' | 'idle' | |
rate: number | playback rate: also the speed relative to the baked speed (feet do not slide) |
phase: number | 0..1 of the cycle at time 0 |
scale: number | |
tint: Rgb | multiplies the vertex colours (linear), a slight difference between people sharing a variant |
packages/humans/src/crowd.ts:133
CrowdPlan interface
interface CrowdPlanspecs: HumanSpec[] | |
people: CrowdPerson[] |
packages/humans/src/crowd.ts:147
CrowdVariant interface
interface CrowdVariantid: number | |
spec: HumanSpec | |
tier: string | |
vertices: number | |
triangles: number | |
indices: Uint16Array | Uint32Array | |
rest: Float32Array | rest positions, and 3 bytes of sRGB colour per vertex |
colours: Uint8Array | |
clips: BakedClip[] | |
height: number | |
radius: number |
packages/humans/src/crowd.ts:35
DerivedMotion interface
interface DerivedMotionradius: number | metres |
height: number | |
crouchHeight: number | |
eyeHeight: number | |
legLength: number | |
strideLength: number | |
mass: number | |
walkSpeed: number | |
runSpeed: number | |
crouchSpeed: number | |
acceleration: number | |
braking: number | |
maxStepHeight: number | |
jumpVelocity: number |
packages/humans/src/motion.ts:143
Described interface
interface Describedface: FaceSpec | |
age?: number | age in years if the text gave one |
sex?: number | 0 female .. 1 male if the text said |
matched: { id: string; text: string; factor: number }[] | |
conflicts: Conflict[] | |
unmatched: string[] | words of the text no descriptor took (so the caller can see what was ignored) |
packages/humans/src/vocab.ts:117
Descriptor interface
interface DescriptorWords to a face. The text is split into words, descriptors are found by longest match (Russian by stem, English by whole word), an intensity word just before a descriptor scales it, "не"/"not" flips it. Descriptors CONSTRAIN the axes they name; the seed FILLS every other axis, so one description with different seeds gives different people who all match it. Two descriptors that pull an axis in opposite directions are reported as a conflict.
id: string | |
ru: string[][] | |
en: string[][] | |
axes: Record<string, number> | axis targets (for a composite, the targets of its members, summed and clamped) |
composite: boolean | |
group: string |
packages/humans/src/vocab.ts:13
DigiOptions interface
interface DigiOptionsDigitigrade legs (dogs, cats, birds, lizardfolk): the same four leg joints of the contract (thigh, calf, foot, ball) in a different rest shape. The knee goes forward, the "foot" joint becomes the hock behind and above the toes, and the long segment from hock to ball is the metatarsus; the mesh is carried along by a rigid transform per bone (with the length stretched to fit), the toes keep lying flat. The clips are plantigrade: they are retargeted by local rotations and the stance foot is planted by plantFoot aiming the ball (the rig of kitRig takes the leg scale from hip to ball), so the feet do not slide.
hock?: number | |
meta?: number | |
shank?: number |
packages/humans/src/digitigrade.ts:11
Dist interface
interface DistA range with an optional normal shape: truncated to min..max; without sd it is uniform.
min: number | |
max: number | |
mean?: number | |
sd?: number |
packages/humans/src/random.ts:50
DrapeResult interface
interface DrapeResult extends GarmentResultpanel: { first: number; rows: number; seg: number } |
packages/humans/src/loose.ts:26
DrapeSpec interface
interface DrapeSpeckind: DrapeKind | |
width?: number | metres, default per kind |
length?: number | |
thickness?: number | cloth thickness over the skin, metres |
cols?: number | grid resolution (columns, rows) |
rows?: number |
packages/humans/src/loose.ts:14
EarKit interface
interface EarKitkind: 'pointed' | 'round' | 'long' | 'floppy' | 'elf' | 'bat' | 'jackal' | 'horse' | |
size: number | |
height?: number | |
tilt?: number | |
back?: number | |
colour?: Rgb | |
inner?: Rgb | |
physics?: boolean | |
x?: number |
packages/humans/src/kit-core.ts:74
EyeColours interface
interface EyeColourspackages/humans/src/skin.ts:82
EyeSplit interface
interface EyeSplitThe eyeball part (head1) holds both eyes in one UV layout. To give each eye its own iris (heterochromia) the triangles are split by the side of the head they sit on: x > 0 is the person's left eye. The vertices stay shared (same positions, uv, skin), only the index lists differ, so a renderer draws the part twice with two textures (composeEye with second = false / true).
left: Uint16Array | Uint32Array | |
right: Uint16Array | Uint32Array |
packages/humans/src/eyes.ts:9
EyesSpec interface
interface EyesSpecpackages/humans/src/spec.ts:89
FabricInfo interface
interface FabricInfoFabrics and condition. A fabric is a procedural weave or grain on a tileable square: the colour (solid, stripes, check, tartan, print, camouflage) times the weave shading, then the condition baked in (wear, dirt, mud, wet, tears, blood, fading). The result is one RGBA tile per garment (alpha 0 = a tear, for alpha cut-off), reused by every tier, so the frame cost does not grow with the number of details.
id: string | |
roughness: number | PBR roughness of the clean cloth |
sheen: number | velvet/silk sheen 0..1 |
metallic: number | metalness (mail, plate, gilding) |
weave: number | weave period in pixels of a 256 tile and amplitude of the shading 0..1 |
amp: number | |
thickness: number | thickness in mm, for the hem and the lift of layers |
kind: 'plain' | 'twill' | 'knit' | 'leather' | 'felt' | 'mail' | 'plate' | 'sheen' | 'denim' | 'canvas' |
packages/humans/src/fabric.ts:10
FabricInput interface
interface FabricInputpackages/humans/src/fabric.ts:35
FabricTile interface
interface FabricTilesize: number | |
rgba: Uint8ClampedArray | |
info: FabricInfo | |
roughness: number | |
torn: boolean |
packages/humans/src/fabric.ts:36
FaceFitModel interface
interface FaceFitModelvertex: Int32Array | vertex of head0 for each landmark |
base: Float64Array | base positions of the landmarks, 3 per landmark |
pos: Map<string, Float64Array> | response at weight +1 and -1 of every face axis, landmarks x 3 per axis (rows: axis, then pos|neg) |
neg: Map<string, Float64Array> |
packages/humans/src/fit.ts:35
FaceSpec interface
interface FaceSpecwords?: string | the description it was made from; kept for reading and correcting as text, not part of the share code |
blends: { id: string; w: number }[] | named base faces, mixed by weight |
axes: Record<string, number> | shape axes by id (axes.ts FACE_AXES), signed -1..1; unset = 0 |
asym: number | 0..1, strength of the seeded asymmetry |
marks?: Mark[] |
packages/humans/src/spec.ts:67
FaceZones interface
interface FaceZonesFace zones (p4-zones.mjs): a = lips, lids, cheeks, freckle; b = brows, liner (one per channel).
packages/humans/src/compose.ts:13
FieldRef interface
interface FieldRefOne side of one axis of the shape pack, ready to add into a position array.
part: string | |
count: number | |
scale: number | |
idx: Uint16Array | Uint32Array | |
d: Int8Array | Int16Array |
packages/humans/src/data.ts:61
Figure interface
interface FigureA complete person of any kit: the kit build (buildKit), hair, brows, lashes and beard bound to the kit's own skin (so they follow a muzzle or a restyled head),
and the outfit (words or pieces) generated on the kit body. Hair under a hat is cut by the hat's mask. This is what viewers, proofs and games build.
spec: HumanSpec | |
kit: BuiltKit | |
attachments: BuiltPart[] | |
outfit: OutfitBuilt | null | |
pieces: OutfitPiece[] |
packages/humans/src/figure.ts:16
FigureOptions interface
interface FigureOptionsThe bridge from a spec to the running game. loadFigure bakes the glb in memory (exportGlb) and loads it through Babylon's glTF loader, so the figure is what every other model is: a node tree, a skinned mesh set, a skeleton. Its clips are the nine gait clips of the motion pack restyled for this body (styleClip), written as animation groups on the joint nodes, so no clips file has to be loaded and the graph (locomotionGraph) plays at the body's own derived walk and run speeds. Tails and ears are driven by stepChains each frame (ChainDriver).
tier?: string | |
parent?: BABYLON.TransformNode | parent of the figure's root node |
glb?: GlbOptions | |
name?: string | a name for the root node |
packages/humans/src/babylon.ts:22
FitOptions interface
interface FitOptionsridge?: number | ridge strength: how hard the axes are pulled to the prior (the words); 0.02 is gentle |
prior?: Record<string, number> | the prior axes (from a description); the fit changes them only where the picture insists |
iterations?: number | landmark names present in the picture (others are ignored); default all that are given |
packages/humans/src/fit.ts:88
FitResult interface
interface FitResultaxes: Record<string, number> | |
residual: number | root-mean-square distance between the fitted face and the picture's landmarks after alignment, in units of the interocular distance |
similarity: { scale: number; rotation: number; shift: [number, number] } | scale, rotation (radians) and shift that map the picture onto the head frame |
packages/humans/src/fit.ts:97
GaitClip interface
interface GaitClipname: string | |
duration: number | |
frames: number | |
fps: number | |
rotBones: string[] | |
posBones: string[] | |
rot: Float32Array | |
pos: Float32Array | |
loop: boolean | |
ignoreSide?: 'l' | 'r' |
packages/humans/src/motion.ts:41
GaitMeasure interface
interface GaitMeasurespeed: number | m/s the clip travels at on the BASE figure, from the stance feet |
stance: { l: boolean[]; r: boolean[] } | stance frames per foot (ball height near its lowest) |
slide: number | m/s RMS horizontal speed of the stance feet in the world frame after removing the mean: the clip's own slide |
packages/humans/src/motion.ts:306
GarmentResult interface
interface GarmentResultpart: BuiltPart | |
source: GarmentSpec | |
spec: GarmentSpec & { layer: GarmentLayer } | |
covers: Uint32Array | |
panel?: { first: number; rows: number; seg: number } |
packages/humans/src/garment.ts:122
GarmentSpec interface
interface GarmentSpectemplate: Template | |
length?: number | hem of a top: 0 neck .. 1 crotch, above 1 over the thighs (default per template) |
ease?: number | extra metres over the layer lift: 0 tight, 0.02 normal, 0.05 loose |
sleeve?: number | sleeve as a fraction of the arm from shoulder to wrist: 0 none, 0.5 elbow, 1 wrist |
legLength?: number | trouser/skirt length as a fraction of the leg from hip to ankle (1 reaches the ankle) |
neck?: 'crew' | 'v' | 'open' | 'scoop' | neck: 'crew' high, 'v' open to the chest, 'open' wide, 'scoop' |
flare?: number | skirt flare: metres of radius added at the hem |
height?: number | footwear height above the sole in metres (shoe 0.07, ankle boot 0.15, knee boot 0.45) |
layer?: GarmentLayer | |
fabric?: string | fabric id and colour for the material layer; pattern for checks, stripes (used by the fabric composer) |
colour?: [number, number, number] | |
pattern?: string |
packages/humans/src/garment.ts:21
GlbOptions interface
interface GlbOptionsexpressions?: boolean | readonly string[] | expression targets on the head parts: true = all 51 ARKit shapes, a list = those; false = none |
skinSheets?: { body?: { rgba: ArrayLike<number>; width: number; height: number }; head?: { rgba: ArrayLike<number>; width: number; height: number } } | RGBA sheets for the skin ('body' for body0, 'head' for head parts); without them the skin is its flat colour |
name?: string | name of the scene |
packages/humans/src/gltf.ts:41
HairSpec interface
interface HairSpecstyle: string | |
melanin: number | |
redness: number | |
dye?: Rgb | |
greying: number |
packages/humans/src/spec.ts:97
HeadKit interface
interface HeadKitmuzzle?: { length: number; pinch?: number; flat?: number; lift?: number } | |
nose?: { kind: 'dog' | 'cat' | 'pig' | 'horse' | 'none'; colour?: Rgb; size?: number } | |
beak?: BeakKit | |
eyes?: { spread?: number; back?: number; scale?: number; pupil?: 'round' | 'slit' | 'horizontal'; colour?: Rgb } | |
ears?: EarKit | |
horns?: HornKit | |
tusks?: { length: number; curve?: number; colour?: Rgb; x?: number } | |
crest?: { kind: 'spikes' | 'fin' | 'comb'; height: number; count?: number; colour?: Rgb } | |
patch?: { side: 'l' | 'r'; colour?: Rgb } | an eye patch on side (Odin) |
packages/humans/src/kit-core.ts:77
HeadMarks interface
interface HeadMarksHeads of kits: a muzzle or beak made by warping the human head (so teeth, tongue, lips and every expression still work, with a gain for the longer jaw), eyes moved to the side, a nose, ears, horns, tusks and crests as rigid pieces on the head joint (ears also as spring chains, see chain.ts).
joint: number | |
eyeL: V3 | eye centres, nose tip, mouth centre (teeth), chin, top of the skull, back of the skull |
eyeR: V3 | |
noseTip: V3 | |
mouth: V3 | |
chin: V3 | |
topY: number | |
backZ: number | |
browY: number | |
halfWidth: number | half width of the skull at the eye line |
packages/humans/src/kit-head.ts:11
HeadwearResult interface
interface HeadwearResultpart: BuiltPart | |
spec: HeadwearSpec | |
hairMask: { yCut: number; radius: number } | |
centre: [number, number, number] | |
topY: number |
packages/humans/src/headwear.ts:24
HeadwearSpec interface
interface HeadwearSpectemplate: HeadwearTemplate | |
crown?: number | crown height above the brow line, metres (default per template) |
brim?: number | brim width in metres (hat, helmet rim); for a peaked cap the width of the peak |
ease?: number | clearance over the head, metres |
strap?: boolean | a chin strap line is a trim; strap adds the strap geometry for helmets |
packages/humans/src/headwear.ts:12
HitCapsule interface
interface HitCapsulename: string | |
from: string | |
to: string | |
radius: number | |
extend?: number |
packages/humans/src/motion.ts:188
HornKit interface
interface HornKitkind: 'straight' | 'curl' | 'bull' | 'antler' | 'unicorn' | |
length: number | |
radius?: number | |
colour?: Rgb | |
x?: number | |
tilt?: number |
packages/humans/src/kit-core.ts:75
HumanAvatarOptions interface
interface HumanAvatarOptionsmine: () => HumanSpec | this player's person |
tier?: string | |
placed?(copy: Entity, fig: LoadedFigure): void | called with each remote figure once placed (default: puts an Animator on the copy, fed from its movement) |
profile?: Parameters<typeof randomHuman>[1] | the people of players who sent none: a profile (default the uniform one); the same on every machine by name |
packages/humans/src/babylon.ts:112
HumanData interface
interface HumanDatabase: BaseFigure | |
shape: ShapePack | |
lod: LodPack | |
expr?: ShapePack | |
attach?: AttachPack | |
garments?: AttachPack | |
motion?: MotionPack |
packages/humans/src/data.ts:122
HumanMaterialInput interface
interface HumanMaterialInputspec: HumanSpec | |
head: SkinPixels | composed head and body skin sheets (composeSkin) |
body: SkinPixels | |
eyeLeft: Uint8ClampedArray | composed eyeball sheets, one per eye (composeEye, 512 x 512 RGBA) |
eyeRight: Uint8ClampedArray | |
eyeSize: number | |
micro?: { rgba: Uint8ClampedArray; size: number } | tileable micro relief tile (composeMicro, RGBA); without it the skin is smooth |
headSurface?: SkinPixels | metallic-roughness sheet of the head (composeSurface): G = roughness per zone |
teethTexture?: BABYLON.BaseTexture | a teeth picture (decoded by the caller). The Customizer's own teeth atlas has an alpha channel that hides the crowns, so it must be used with its alpha dropped; without a picture the teeth are a plain ivory |
headNormal?: BABYLON.BaseTexture | optional Customizer normal/roughness maps (already decoded to textures by the caller) |
bodyNormal?: BABYLON.BaseTexture |
packages/humans/src/materials.ts:20
HumanMaterials interface
interface HumanMaterialstier: MaterialTier | |
head: BABYLON.Material | |
body: BABYLON.Material | |
eyeLeft: BABYLON.Material | |
eyeRight: BABYLON.Material | |
hair: BABYLON.Material | |
lashes: BABYLON.Material | brows and beard use hair; lashes are always near black |
teeth: BABYLON.Material | |
mouth: BABYLON.Material | the plain mouth lining, for a kit without the teeth atlas. NOTE: in the Customizer head the crowns, gums and palate are ONE part (head5) painted by the teeth atlas, so head4 and head5 both take teeth |
tongue: BABYLON.Material | |
dispose(): void |
packages/humans/src/materials.ts:40
HumanSpec interface
interface HumanSpecv: 1 | |
seed: number | |
kit: string | 'human' or the id of an anthropomorphic kit |
body: BodySpec | |
face: FaceSpec | |
skin: SkinSpec | |
eyes: EyesSpec | |
hair: HairSpec | |
brows: { style: string } | |
lashes: { style: string } | |
beard?: { style: string } | |
outfit: OutfitSpec | |
motion: MotionStyle | |
kitOptions?: Record<string, unknown> | kit parameters: see KitOptions in kit.ts; free-form here so the spec does not depend on the kit code. Unset = the kit's defaults. |
packages/humans/src/spec.ts:107
HumansSessionOptions interface
interface HumansSessionOptionssave?: (name: string, spec: HumanSpec, code: string) => unknown | Promise<unknown> | persists a spec as a library item (the viewer wires the asset library); absent = humans.save keeps it in the session only |
writeFile?: (path: string, bytes: Uint8Array) => unknown | Promise<unknown> | writes a baked glb; absent = the bytes are returned |
render?: (spec: HumanSpec, view: string) => Promise<Img> | renders a spec to a picture (browser/viewer); lets humans.compare compare pixels with pixels |
sheet?: (specs: HumanSpec[], opts: Record<string, unknown>) => Promise<unknown> | a picture sheet of figures (viewer) |
skinSheets?: (spec: HumanSpec) => GlbOptions['skinSheets'] | skin sheets for a spec (browser path), used by humans.bake |
packages/humans/src/commands.ts:29
Img interface
interface ImgA decoded 8-bit image: 3 (RGB) or 4 (RGBA) channels, row-major, row 0 = v 0 of the UV sheet.
width: number | |
height: number | |
channels: 3 | 4 | |
data: Uint8Array | Uint8ClampedArray |
packages/humans/src/compose.ts:8
Issue interface
interface Issuelevel: 'error' | 'warning' | |
path: string | |
message: string |
packages/humans/src/validate.ts:6
KitDef interface
interface KitDefA kit: its defaults, and what it is called. The registry lives in kits.ts.
id: string | |
name: string | |
description: string | |
defaults: KitOptions | |
proof?: Partial<HumanSpec> |
packages/humans/src/kit-core.ts:116
KitOptions interface
interface KitOptionsstylise?: Partial<Record<StyleAxis, number>> | proportion exaggeration beyond the realistic limits (STYLE_AXES) |
axes?: Record<string, number> | raw shape-pack axes at any weight (beyond the +-1 of the face axes): { browRidgeProjection: 1.8 } |
head?: HeadKit | |
tail?: TailKit | |
legs?: 'plantigrade' | 'digitigrade' | 'digitigrade': legs with a hock (dogs, cats, birds, lizardfolk); 'plantigrade' (default) |
coat?: CoatKit | a coat over the whole skin |
robot?: RobotKit | robot / machine body |
scale?: number | uniform scale of the whole figure after everything else (giants, small folk); the shape pack's height axis stops at about 2.3 m |
missing?: { hand?: 'l' | 'r'; eye?: 'l' | 'r' } | body options: a missing hand or eye (Tyr, Odin) |
held?: { item: string; hand: 'l' | 'r'; scale?: number }[] | held and worn things by id (props.ts) |
worn?: { item: string; scale?: number; colour?: Rgb }[] | |
motion?: Record<string, number> | default gait style of the kit (merged under the spec's own motion style) |
packages/humans/src/kit-core.ts:50
LandmarkDef interface
interface LandmarkDefA face from a photo or a drawing, step 2: fit the face axes to facial landmarks. Step 1 (words) is the vocabulary; step 3 (the agent comparing picture and render) is a loop of commands. Landmarks come from any detector (MediaPipe Face Mesh indices are named below); this file does the maths: the base head's landmark vertices, the response of every axis at those vertices, and a regularised least-squares fit with the similarity (scale, rotation, shift) of the picture solved alongside. Front view fits width and height proportions; a second profile set (z, y) fits depth.
name: string | |
mediapipe: number | index in the 468-point MediaPipe Face Mesh |
at: [number, number] | where to look for the vertex on the base head: x (m, person's left +), y (m), and the vertex is the front-most one nearby |
packages/humans/src/fit.ts:11
LoadedFigure interface
interface LoadedFigurespec: HumanSpec | |
root: BABYLON.TransformNode | |
meshes: BABYLON.AbstractMesh[] | |
skeleton: BABYLON.Skeleton | null | |
groups: Record<string, BABYLON.AnimationGroup> | animation groups by graph clip name: idle, walk, run, jump, fall |
loops: Record<string, boolean> | |
graph: GraphDef | |
walkSpeed: number | metres per second the body walks and runs at (derived from its legs) |
runSpeed: number | |
stature: number | |
morphs: { numTargets: number; getTarget(i: number): { name: string; influence: number } } | null | morph targets by ARKit name on the head mesh, or null when the figure has none |
setExpression(weights: Record<string, number>): void | set an expression: ARKit weights |
stepChains(dt: number): void | advance the tail and ear chains (call from onUpdate with dt seconds) |
dispose(): void |
packages/humans/src/babylon.ts:31
LodPack interface
interface LodPacktiers: string[] | |
part(tier: string, part: string): LodPart | undefined | |
triangles(tier: string): number |
packages/humans/src/data.ts:102
LodPart interface
interface LodPartOne part of one LOD tier: the base vertices it keeps and its triangles over them.
keep: Uint32Array | |
indices: Uint16Array | |
triangles: number |
packages/humans/src/data.ts:101
MakeupLayer interface
interface MakeupLayerkind: 'lips' | 'eyes' | 'cheeks' | 'foundation' | 'brows' | 'liner' | |
colour: Rgb | |
strength: number |
packages/humans/src/spec.ts:17
Mark interface
interface MarkA mark on the face or body: scar, mole, ... at names a region ('brow.left', 'cheek.right').
kind: 'scar' | 'mole' | 'freckles' | 'pockmark' | 'burn' | 'tattoo' | 'missingTooth' | 'brokenNose' | |
at?: string | |
size?: number | |
strength?: number | |
seed?: number | |
decal?: string | a tattoo or decal image (library id) |
packages/humans/src/spec.ts:7
Mesh interface
interface Meshp: number[] | |
i: number[] |
packages/humans/src/primitives.ts:10
MicroOptions interface
interface MicroOptionsseed: number | |
size?: number | pixels per side of the tile (the tile repeats seamlessly) |
age: number | years: older skin has deeper lines and wider pores |
coarseness?: number | 0..1 how pronounced the relief is (oily/coarse skin high, fine skin low) |
packages/humans/src/compose.ts:194
MotionJoint interface
interface MotionJointname: string | |
parent: number | |
t: [number, number, number] | |
q: Q | |
rest: [number, number, number] |
packages/humans/src/motion.ts:40
MotionPack interface
interface MotionPackfps: number | |
skeleton: MotionJoint[] | |
clips: Map<string, GaitClip> |
packages/humans/src/motion.ts:42
OutfitBuilt interface
interface OutfitBuiltgarments: (GarmentResult & { piece: OutfitPiece; tile: FabricTile; trims: TrimResult[] })[] | |
headwear: (HeadwearResult & { piece: OutfitPiece; tile: FabricTile })[] | helmets, hats, hoods: each with the hair cut (apply with maskHair) |
bodyIndices: Uint16Array | Uint32Array |
packages/humans/src/outfit.ts:31
OutfitDescribed interface
interface OutfitDescribedWords to clothes, Russian by stem and English by whole word. Garment words make pieces (a bundle word such as "battledress" makes several);
colour, fabric, fit, length, pattern and condition words before a garment (or right after it) belong to it; words before a bundle belong to all its pieces.
Period and uniform bundles are data rows: a game or an agent can add its own with addOutfitBundle.
pieces: OutfitPiece[] | |
matched: string[] | |
unmatched: string[] |
packages/humans/src/outfit-words.ts:9
OutfitSpec interface
interface OutfitSpecwords?: string | |
pieces: OutfitPiece[] |
packages/humans/src/spec.ts:105
PanelState interface
interface PanelStatepoints: Float32Array | |
prev: Float32Array |
packages/humans/src/loose.ts:121
PartMaterial interface
interface PartMaterialWhat a part is made of when it is not skin (kits, props, robots): the renderer and the exporters read it.
colour: [number, number, number] | |
metallic?: number | |
roughness?: number | |
emissive?: [number, number, number] | linear emissive colour (robot lights, a sun disc) |
fur?: { layer: number; layers: number; length: number } | shell fur: this part is layer layer of layers, length metres out; the strand alpha is cut at layer/layers |
card?: 'tuft' | 'feather' | a card (tuft, feather): drawn alpha-tested with its own tile |
kind?: 'fur' | 'scales' | 'cloth' | 'metal' | 'bone' | 'skin' | 'glass' | 'feather' |
packages/humans/src/build.ts:9
PictureRead interface
interface PictureReadWhat the vision model reads for one garment: which template, its parameters, fabric, condition and where it is in the picture.
template: string | |
params?: Record<string, unknown> | |
fabric?: string | |
condition?: Record<string, number> | |
region: Region | |
white?: Region |
packages/humans/src/picture.ts:85
Population interface
interface Populationspecs: HumanSpec[] | |
relaxed: number[] | indices of people who could not be kept at least minFaceDistance from all earlier ones in the allowed draws (the best draw is kept) |
packages/humans/src/random.ts:177
Pose interface
interface PoseA pose: local rotations of every joint and the local translation of the pelvis (the only joint that moves relative to its parent in a gait).
q: Float32Array | |
pelvis: [number, number, number] |
packages/humans/src/motion.ts:82
Profile interface
interface ProfileA population profile: the distributions a game gives to make people. The engine ships NO statistics: every number comes from the profile, which cites its source in source. UNIFORM_PROFILE below is a neutral spread for tests and first drafts, not data about any real population.
name: string | |
source: string | where the numbers come from (a named public dataset, a historical source, or "none: test spread") |
kit?: string | |
sex: Dist | 0 female .. 1 male |
age: Dist | years |
height: Dist | { female: Dist; male: Dist } | metres; by sex when both are given (mixed by the sampled sex) |
somatotype?: [Dist, Dist, Dist] | Heath-Carter ratings; unset = no somatotype |
weight?: Dist | |
muscle?: Dist | |
frame?: Dist | |
fatPattern?: Dist | |
proportionSpread?: number | sd of each proportion axis |
faceSpread: number | sd of each face axis (0 = the base face for everyone) |
faceAxes?: Record<string, Dist> | axes drawn from their own distribution instead of faceSpread |
faceBlends?: string[] | names of base-face blends the profile may use; one to two are mixed |
skin: { melanin: Dist; redness: Dist; freckles?: Dist; moles?: Dist } | |
irises: { v: Rgb; w?: number }[] | |
hair: { styles: { v: string; w?: number }[]; melanin: Dist; redness: Dist; greying: Dist } | |
brows?: { v: string; w?: number }[] | |
beard?: { chance: number; styles: { v: string; w?: number }[] } | |
outfit?: (rng: Rng, spec: HumanSpec) => OutfitPiece[] | the game dresses the person: called after the body and face are drawn |
constraints?: ((spec: HumanSpec) => string | null)[] | hard rules: return null when satisfied, else a reason; the person is drawn again until all are |
minFaceDistance?: number | no two faces of a population closer than this (faceDistance) |
motionSpread?: number | motion style spread (sd per axis) |
packages/humans/src/random.ts:64
PropPiece interface
interface PropPiecemesh: Mesh | |
mat: PartMaterial |
packages/humans/src/props.ts:21
Region interface
interface Regionx: number | |
y: number | |
w: number | |
h: number |
packages/humans/src/picture.ts:10
ResolvedBody interface
interface ResolvedBodyThe low-level body numbers a spec resolves to. Precedence: an explicit low-level value wins, then build.mass (with height, as BMI) for fat, then the somatotype. The coefficients below are PROVISIONAL: P2 refits them on the MakeHuman targets and published somatotype data; the interface and the precedence stay.
sex: number | |
age: number | |
height: number | |
fat: number | |
muscle: number | |
frame: number | |
fatPattern: number | |
proportions: Record<typeof PROPORTION_AXES[number], number> | final proportion axes after frame and linearity are added, each -1..1 |
bmi?: number | kg / m^2 when mass is given |
source: { fat: 'weight' | 'mass' | 'somatotype' | 'default'; muscle: 'muscle' | 'somatotype' | 'default' } | where fat and muscle came from |
packages/humans/src/resolve.ts:10
Rig interface
interface Rign: number | |
names: string[] | |
index: Map<string, number> | |
parent: Int16Array | |
restQ: Float32Array | local rest rotations (base figure) and the rest world rotations |
restWorldQ: Float32Array | |
tLocal: Float32Array | this body's local rest translations (from its own bone lengths) and its rest world positions |
restWorld: Float32Array | |
legScale: number | leg length of this body / of the base figure: scales the clip's pelvis translation |
packages/humans/src/motion.ts:53
RobotKit interface
interface RobotKitshell: Rgb | panel colour, joint colour, light colour |
joint?: Rgb | |
light?: Rgb | |
style?: 'android' | 'full' | 'android': a human face and hands on the machine body; 'full': a machine head |
stand?: number | how many millimetres the panels stand off the body |
segments?: boolean |
packages/humans/src/kit-core.ts:105
Session interface
interface Sessionpackages/humans/src/commands.ts:94
ShapePack interface
interface ShapePackaxes: Map<string, { kind: string; negMode: string; pos: FieldRef[]; neg: FieldRef[] }> | |
joints: string[] | |
jointField(axis: string, side: Side): Float32Array | undefined | joint displacements (metres) of an axis side: 3 floats per joint, or undefined when the axis does not move joints |
statureBase: number | stature (metres, head top to sole) of the base figure and the change of one axis side at weight 1 |
statureDelta(axis: string, side: Side): number | |
partVertices(part: string): number |
packages/humans/src/data.ts:63
SkinPixels interface
interface SkinPixelsrgba: Uint8ClampedArray | |
width: number | |
height: number |
packages/humans/src/materials.ts:18
SkinSpec interface
interface SkinSpecmelanin: number | |
redness: number | |
freckles: number | |
moles: number | |
ageing: number | 0..1 extra weathering/ageing beyond what the age gives |
makeup?: MakeupLayer[] |
packages/humans/src/spec.ts:79
SkinTone interface
interface SkinTonelinear: Rgb | linear sRGB albedo of average skin, 0..1 |
lab: [number, number, number] | |
ita: number | Individual Typology Angle, degrees |
scatter: Rgb | colour of light that scatters under the skin (linear), redder than the albedo |
roughness: number |
packages/humans/src/skin.ts:36
SlideReport interface
interface SlideReportmatched: number | m/s RMS of the stance feet's horizontal motion relative to the ground, after rate matching only |
planted: number | the same after foot planting |
matchedRatio: number | as a fraction of the travel speed |
plantedRatio: number | |
rate: number | |
speed: number |
packages/humans/src/motion.ts:407
Socket interface
interface SocketA named place on the body where props, crowns and held things go: a joint, a point and a forward direction in world rest space.
packages/humans/src/kit-core.ts:13
TailKit interface
interface TailKitkind: 'bushy' | 'thin' | 'whip' | 'puff' | 'lizard' | 'horse' | 'rat' | |
length: number | |
thickness?: number | |
segments?: number | |
colour?: Rgb | |
colour2?: Rgb | |
physics?: boolean |
packages/humans/src/kit-core.ts:89
TintMap interface
interface TintMap extends ImgThe tint map of a skin sheet (tools/humans/p4-ratio.mjs): pixel / plain skin, stored as value / 2.
scale: number |
packages/humans/src/compose.ts:11
TongueShape interface
interface TongueShapepositions: Float32Array | |
indices: Uint16Array | |
uv: Float32Array | |
along: Float32Array |
packages/humans/src/tongue.ts:34
Trim interface
interface TrimInsignia, buttons, piping ... placed by name on a garment (8a.2).
kind: string | |
at: string | |
colour?: Rgb | |
text?: string | |
size?: number |
packages/humans/src/spec.ts:24
TrimResult interface
interface TrimResultTrims: buttons, patches (pockets, badges, stripes, epaulettes), belts, placed by name on a garment. Every trim is geometry cut from or built on the garment surface, so it follows the body like the garment. Kinds: buttons, buttons-double, pockets, epaulettes, belt, stripe, badge, piping.
packages/humans/src/trim.ts:11
ValidateOptions interface
interface ValidateOptionsitemInfo?: (item: string) => { adultOnly?: boolean; kits?: string[] } | undefined | what the library knows about an item (a garment, a hair style ...); unknown items are reported as warnings |
knownKits?: readonly string[] | the kit ids that exist; 'human' always does |
stylised?: boolean | stylised kits may leave the realistic limits of the body; default: true only for kits other than 'human' |
packages/humans/src/validate.ts:8
World interface
interface Worldpos: Float32Array | |
q: Float32Array |
packages/humans/src/motion.ts:83
Types
AxisWeights type
type AxisWeights = Map<string, number>Axis weights of a person: every shape axis of the pack with the signed number it is applied at (sign picks the pos or neg side, |w| the amount).
The sex axis is stored as female minus male and is applied at 1 - sex. Age is blended from the keys baby (1 y), child (11 y), young (25 y, the
base), old (90 y). height is solved so that the stature comes out at the requested metres (the pack records each axis' change of stature).
packages/humans/src/weights.ts:12
DrapeKind type
type DrapeKind = 'cloak' | 'shawl' | 'wrap'Loose cloth: (1) drapeCloth lets a cloth rectangle fall on the built body at build time (position-based dynamics against the skin, deterministic: no random numbers, fixed step and iteration counts) and returns it as a garment; (2) swingPanel is the runtime follower of a hanging panel (skirt, coat tails, cloak, drape): every ring below the top lags behind the posed goal with a damped spring and keeps its length, so the hem swings instead of stretching between the knees. Both work on grids laid out as (rows+1) rings of (seg+1) vertices, ring 0 at the top.
packages/humans/src/loose.ts:12
EmotionName type
type EmotionName = keyof typeof EMOTIONSpackages/humans/src/expressions.ts:37
ExpressionName type
type ExpressionName = typeof ARKIT[number]packages/humans/src/expressions.ts:17
ExpressionWeights type
type ExpressionWeights = Partial<Record<ExpressionName, number>>packages/humans/src/expressions.ts:18
GarmentLayer type
type GarmentLayer = 'underwear' | 'shirt' | 'waistcoat' | 'jacket' | 'coat' | 'trousers' | 'footwear' | 'gloves' | 'armour'packages/humans/src/garment.ts:17
HeadwearTemplate type
type HeadwearTemplate = 'helmet' | 'cap' | 'peaked-cap' | 'hat' | 'witch-hat' | 'beret' | 'hood' | 'scarf' | 'crown'Headwear and rigid head pieces: lathes around the head axis whose radius follows the built head at every height and angle, so a hat or a
helmet fits every head shape. Skinned to the head joint only. Each piece names how it treats hair (hairMask): the hair above the cut is hidden, the hair under
a brim stays.
packages/humans/src/headwear.ts:10
Layer type
type Layer = typeof LAYERS[number]packages/humans/src/spec.ts:30
MaterialTier type
type MaterialTier = 'hero' | 'standard' | 'crowd'Babylon materials of a person at three shader tiers. The pixels come from compose.ts (pure arrays); this file only turns them
into textures and sets the parameters, so it is the only place of the package that touches BABYLON.
- hero: PBR, albedo + normal + roughness maps, translucency (thin-skin scattering) tinted by the person's scatter colour, clear coat on the eyes - standard: PBR, albedo + normal, no translucency - crowd: one flat-lit albedo, no maps (the vertex colour carries the shading); the cheapest thing that still reads as skin
Skin is rough and barely specular: roughness >= 0.5 and a low reflectivity (the first sheets were glossy like plastic).
packages/humans/src/materials.ts:16
MotionAxis type
type MotionAxis = typeof MOTION_AXES[number]packages/humans/src/axes.ts:45
MotionStyle type
type MotionStyle = Partial<Record<typeof MOTION_AXES[number], number>> & { limp?: { side: -1 | 1; severity: number }; /** kg carried */ load?: number; }packages/humans/src/spec.ts:99
MovementValues type
type MovementValues = Pick<DerivedMotion, 'radius' | 'height' | 'crouchHeight' | 'eyeHeight' | 'mass' | 'walkSpeed' | 'runSpeed' | 'crouchSpeed' | 'acceleration' | 'braking' | 'maxStepHeight' | 'jumpVelocity'>Parameter names of @ferret/character's CharacterParams that the derived values fill (the type is duck-compatible, so the package need not depend on character).
packages/humans/src/motion.ts:150
OutfitPiece type
type OutfitPiece = PieceSource & { layer?: Layer; fabric: string; colour?: Rgb; pattern?: Pattern; trims?: Trim[]; condition?: Condition; }packages/humans/src/spec.ts:33
Pattern type
type Pattern = | { kind: 'solid' } | { kind: 'stripes' | 'check' | 'tartan' | 'print' | 'camouflage'; scale: number; colour2?: Rgb; image?: string }packages/humans/src/spec.ts:19
PieceSource type
type PieceSource = { template: string; params: Record<string, unknown> } | { item: string; variant?: string }packages/humans/src/spec.ts:32
PropBuilder type
type PropBuilder = () => PropPiece[]A prop in its own frame: origin at the grip, +y along the item (the end that points away from the arm), +x across, +z toward the palm side; metres at scale 1 (an adult).
packages/humans/src/props.ts:23
ProportionAxis type
type ProportionAxis = typeof PROPORTION_AXES[number]packages/humans/src/axes.ts:41
Q type
type Q = [number, number, number, number]Motion of a built person: the Customizer skeleton as a rig that does FK on the body's own bone lengths, the gait clips of cc-clips sampled as data, a style layer on them (posture, arm swing, hip sway, bounce, tempo, energy, confidence, heaviness, limp, load), cadence matching so feet do not slide on any leg length, foot planting by two-bone IK, skinning to see it, values for CharacterMovement and capsules for combat read from the real bones. Quaternions are x, y, z, w (glTF); the body faces +z and its left side is +x.
packages/humans/src/motion.ts:15
Rgb type
type Rgb = [number, number, number]packages/humans/src/spec.ts:4
Side type
type Side = 'pos' | 'neg'packages/humans/src/data.ts:58
StyleAxis type
type StyleAxis = typeof STYLE_AXES[number]packages/humans/src/kit-core.ts:48
Template type
type Template = | 'tshirt' | 'shirt' | 'sweater' | 'jacket' | 'coat' | 'waistcoat' | 'tanktop' | 'dress' | 'trousers' | 'jeans' | 'shorts' | 'breeches' | 'skirt' | 'kilt' | 'shoes' | 'boots' | 'sandals' | 'gloves' /** rigid armour (8a.3): plates that follow one bone each and do not bend */ | 'breastplate' | 'backplate' | 'pauldrons' | 'bracers' | 'greaves' | 'cuisses' | 'gorget'Garments generated on the built body. A template picks the body0 vertices it covers by region (torso, arms, legs, feet, with cuts given as
fractions of the limb or of the torso), lifts them along the body normal by ease plus a layer offset, and keeps the body UVs and skin weights, so the garment
follows every shape axis, the constitution and every animation exactly as the body does. Skirts and coat tails are lathes around the pelvis axis (own UVs).
packages/humans/src/garment.ts:10
V3 type
type V3 = [number, number, number]Procedural geometry for kits, props and costume pieces: small meshes in world rest space (metres, +y up, +z forward, left +x) that
are bound to a joint (rigid) or to a chain of joints (tails, ears, tentacles) and become a BuiltPart like any other part.
packages/humans/src/primitives.ts:9
Constants
AGE_KEYS const
const AGE_KEYS: { readonly baby: 1; readonly child: 11; readonly young: 25; readonly old: 90; }packages/humans/src/weights.ts:14
ARKIT const
const ARKIT: readonly ["browDownLeft", "browDownRight", "browInnerUp", "browOuterUpLeft", "browOuterUpRight", "cheekPuff", "cheekSquintLeft", "cheekSquintRight", "eyeBlinkLeft", "eyeBlinkRight", "eyeLookDownLeft", "eyeLookDownRight", "eyeLookInLeft", "eyeLookInRight", "eyeLookOutLeft", "eyeLookOutRight", "eyeLookUpLeft", "eyeLookUpRight", "eyeSquintLeft", "eyeSquintRight", "eyeWideLeft", "eyeWideRight", "jawFo …Live expressions: the 52 ARKit shape names, emotion presets as weight sets, a seeded blink and saccade rhythm, and gaze. The shapes are the Customizer head's morph targets (pack humans-expr), additive deltas on the head parts. They are RE-BASED on the person: a delta is scaled per axis by how much this head is wider, taller or deeper than the base head, so a broad face smiles broad.
packages/humans/src/expressions.ts:12
ATTACH_CELL const
const ATTACH_CELL: Record<string, number>Vertex-cluster size (metres) per tier: the detail of cards and curls goes first; at the crowd tiers hair becomes a solid shell.
packages/humans/src/hair.ts:19
CURRENT_VERSION const
const CURRENT_VERSION: 1Reads a stored spec of any version into the current one. A spec saved today stays readable: each version change adds a function to MIGRATIONS (from version n to n+1). Missing optional parts are filled with the defaults of defaultHuman, so a partial spec (written by hand or by an agent) is accepted.
packages/humans/src/migrate.ts:9
EMOTIONS const
const EMOTIONS: { readonly neutral: {}; readonly smile: Partial<Record<"browDownLeft" | "browDownRight" | "browInnerUp" | "browOuterUpLeft" | "browOuterUpRight" | "cheekPuff" | "cheekSquintLeft" | "cheekSquintRight" | "eyeBlinkLeft" | "eyeBlinkRight" | "eyeLookDownLeft" | "eyeLookDownRight" | "eyeLookInLeft" | "eyeLookInRight" | "eyeLookOutLeft" | "eyeLookOutRight" | "eyeLookUpLeft" | "eyeLookUpRight" | "eyeSquin …Emotion presets at full intensity (scale them with emotion(name, k)).
packages/humans/src/expressions.ts:24
FABRICS const
const FABRICS: Record<string, FabricInfo>packages/humans/src/fabric.ts:26
FACE_AXES const
const FACE_AXES: readonly AxisDef[]Face axes, the plan Append only.
packages/humans/src/axes.ts:19
FACE_AXES_V1 const
const FACE_AXES_V1: 78The version-1 table has this many axes; later versions append.
packages/humans/src/axes.ts:35
FACE_AXIS_INDEX const
const FACE_AXIS_INDEX: ReadonlyMap<string, number>packages/humans/src/axes.ts:37
LANDMARKS const
const LANDMARKS: readonly LandmarkDef[]packages/humans/src/fit.ts:20
LATHE_ROWS const
const LATHE_ROWS: 14packages/humans/src/garment.ts:124
LATHE_SEG const
const LATHE_SEG: 40packages/humans/src/garment.ts:124
LAYER_LIFT const
const LAYER_LIFT: Record<GarmentLayer, number>metres of lift of each layer over the skin, so layers never z-fight and the outer one sits over the inner
packages/humans/src/garment.ts:19
LAYERS const
const LAYERS: readonly ["skin", "underwear", "shirt", "waistcoat", "jacket", "coat", "outer", "trousers", "skirt", "socks", "footwear", "headwear", "belt", "gear"]packages/humans/src/spec.ts:29
LIMITS const
const LIMITS: { readonly heightMin: 0.4; readonly heightMax: 3; readonly ageMin: 0; readonly ageMax: 120; readonly bmiWarnLow: 12; readonly bmiWarnHigh: 60; readonly childAge: 16; }Realistic limits (engineering limits of the shape space, not statistics).
packages/humans/src/validate.ts:18
MIGRATIONS const
const MIGRATIONS: Record<number, (s: any) => any>MIGRATIONS[n] turns a version-n object into version n+1. Empty while the current version is 1.
packages/humans/src/migrate.ts:12
MOTION_AXES const
const MOTION_AXES: readonly ["posture", "armSwing", "strideWidth", "bounce", "hipSway", "shoulderRoll", "tempo", "energy", "confidence", "heaviness"]Motion style axes (signed -1..1, 0 = the neutral gait). Append only.
packages/humans/src/axes.ts:44
PART_IDS const
const PART_IDS: readonly ["body0", "head0", "head1", "head2", "head3", "head4", "head5"]packages/humans/src/build.ts:100
PROOFS const
const PROOFS: Record<string, () => HumanSpec>packages/humans/src/proofs.ts:17
PROPORTION_AXES const
const PROPORTION_AXES: readonly ["legs", "arms", "torso", "shoulders", "hips", "waist", "chest", "neck", "head", "hands", "feet"]Body proportion axes (signed -1..1, 0 = the base figure). Append only.
packages/humans/src/axes.ts:40
PROPS const
const PROPS: Map<string, PropBuilder>The held items. Add yours with registerProp.
packages/humans/src/props.ts:29
RECIPES const
const RECIPES: Record<string, KitOptions>Species and characters as option sets. recipe(id) throws for an unknown one; recipeIds() lists them.
packages/humans/src/kits.ts:21
STYLE_AXES const
const STYLE_AXES: readonly ["headSize", "neckLength", "torsoLength", "legLength", "armLength", "shoulderWidth", "hipWidth", "girth", "legGirth", "armGirth", "handSize", "footSize"]Stylised proportion axes: numbers beyond the realistic range, 0 = the base figure, 1 = a strongly exaggerated but still human figure. Append only.
packages/humans/src/kit-core.ts:47
STYLE_GROUPS const
const STYLE_GROUPS: { readonly arms: readonly ["clavicle", "upperarm", "lowerarm", "hand"]; readonly legs: readonly ["thigh", "calf", "foot", "ball"]; readonly spineUp: readonly ["spine_03", "spine_04", "spine_05", "clavicle_l", "clavicle_r"]; readonly pelvis: readonly ["pelvis", "spine_01", "spine_02"]; }packages/humans/src/motion.ts:240
TONGUE_RINGS const
const TONGUE_RINGS: 16packages/humans/src/tongue.ts:31
TONGUE_SIDES const
const TONGUE_SIDES: 12packages/humans/src/tongue.ts:32
UNIFORM_PROFILE const
const UNIFORM_PROFILE: Profilepackages/humans/src/random.ts:104
VOCABULARY const
const VOCABULARY: readonly Descriptor[]packages/humans/src/vocab.ts:56
WORN const
const WORN: Map<string, Worn>packages/humans/src/props.ts:114