ara3d 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -2
- package/dist/cli.js +57 -0
- package/dist/index.js +1806 -0
- package/dist/types/packages/cli/src/index.d.ts +89 -0
- package/dist/types/packages/cli/src/library/colors.d.ts +9 -0
- package/dist/types/packages/cli/src/library/generate.d.ts +40 -0
- package/dist/types/packages/cli/src/library/worker.d.ts +22 -0
- package/dist/types/src/app/character-assist.d.ts +73 -0
- package/dist/types/src/app/share.d.ts +19 -0
- package/dist/types/src/core/anim/boarding.d.ts +4 -0
- package/dist/types/src/core/anim/clips/actions.d.ts +9 -0
- package/dist/types/src/core/anim/clips/aerial.d.ts +7 -0
- package/dist/types/src/core/anim/clips/basic.d.ts +4 -0
- package/dist/types/src/core/anim/clips/climbing.d.ts +37 -0
- package/dist/types/src/core/anim/clips/combat.d.ts +6 -0
- package/dist/types/src/core/anim/clips/cover.d.ts +19 -0
- package/dist/types/src/core/anim/clips/dodge.d.ts +8 -0
- package/dist/types/src/core/anim/clips/emotes.d.ts +21 -0
- package/dist/types/src/core/anim/clips/everyday.d.ts +15 -0
- package/dist/types/src/core/anim/clips/faces.d.ts +11 -0
- package/dist/types/src/core/anim/clips/gait.d.ts +17 -0
- package/dist/types/src/core/anim/clips/gunshot.d.ts +8 -0
- package/dist/types/src/core/anim/clips/helpers.d.ts +26 -0
- package/dist/types/src/core/anim/clips/index.d.ts +8 -0
- package/dist/types/src/core/anim/clips/interaction.d.ts +18 -0
- package/dist/types/src/core/anim/clips/lying.d.ts +8 -0
- package/dist/types/src/core/anim/clips/melee.d.ts +3 -0
- package/dist/types/src/core/anim/clips/mocap-data.d.ts +6 -0
- package/dist/types/src/core/anim/clips/reactions.d.ts +34 -0
- package/dist/types/src/core/anim/clips/recorded.d.ts +12 -0
- package/dist/types/src/core/anim/clips/runner.d.ts +10 -0
- package/dist/types/src/core/anim/clips/shooter.d.ts +15 -0
- package/dist/types/src/core/anim/clips/speech.d.ts +10 -0
- package/dist/types/src/core/anim/clips/swimming.d.ts +17 -0
- package/dist/types/src/core/anim/clips/types.d.ts +152 -0
- package/dist/types/src/core/anim/clips/vehicles.d.ts +28 -0
- package/dist/types/src/core/anim/evaluate.d.ts +188 -0
- package/dist/types/src/core/anim/mocap.d.ts +120 -0
- package/dist/types/src/core/anim/quat.d.ts +14 -0
- package/dist/types/src/core/anim/riding-weapons.d.ts +13 -0
- package/dist/types/src/core/anim/stage.d.ts +5 -0
- package/dist/types/src/core/assets.d.ts +114 -0
- package/dist/types/src/core/face.d.ts +56 -0
- package/dist/types/src/core/garments/bags.d.ts +2 -0
- package/dist/types/src/core/garments/beach.d.ts +9 -0
- package/dist/types/src/core/garments/body.d.ts +70 -0
- package/dist/types/src/core/garments/catalog.d.ts +8 -0
- package/dist/types/src/core/garments/drape.d.ts +86 -0
- package/dist/types/src/core/garments/dress-shoes.d.ts +7 -0
- package/dist/types/src/core/garments/earpiece.d.ts +2 -0
- package/dist/types/src/core/garments/gowns.d.ts +2 -0
- package/dist/types/src/core/garments/gulf.d.ts +2 -0
- package/dist/types/src/core/garments/heels.d.ts +8 -0
- package/dist/types/src/core/garments/index.d.ts +36 -0
- package/dist/types/src/core/garments/kit.d.ts +173 -0
- package/dist/types/src/core/garments/last.d.ts +78 -0
- package/dist/types/src/core/garments/layering.d.ts +4 -0
- package/dist/types/src/core/garments/necklaces.d.ts +2 -0
- package/dist/types/src/core/garments/outfit-cut.d.ts +30 -0
- package/dist/types/src/core/garments/prison.d.ts +2 -0
- package/dist/types/src/core/garments/project.d.ts +61 -0
- package/dist/types/src/core/garments/ring.d.ts +100 -0
- package/dist/types/src/core/garments/sets.d.ts +41 -0
- package/dist/types/src/core/garments/shell.d.ts +37 -0
- package/dist/types/src/core/garments/sheriff.d.ts +2 -0
- package/dist/types/src/core/garments/shirts.d.ts +31 -0
- package/dist/types/src/core/garments/sneakers.d.ts +7 -0
- package/dist/types/src/core/garments/street.d.ts +2 -0
- package/dist/types/src/core/garments/suit.d.ts +2 -0
- package/dist/types/src/core/garments/swimwear.d.ts +2 -0
- package/dist/types/src/core/garments/textures.d.ts +53 -0
- package/dist/types/src/core/garments/wrist.d.ts +2 -0
- package/dist/types/src/core/garments/yoruba.d.ts +2 -0
- package/dist/types/src/core/geometry.d.ts +31 -0
- package/dist/types/src/core/human.d.ts +42 -0
- package/dist/types/src/core/looks/hair.d.ts +64 -0
- package/dist/types/src/core/looks/index.d.ts +38 -0
- package/dist/types/src/core/looks/jewelry.d.ts +20 -0
- package/dist/types/src/core/looks/mouth.d.ts +12 -0
- package/dist/types/src/core/looks/overlay.d.ts +42 -0
- package/dist/types/src/core/looks/tattoos.d.ts +11 -0
- package/dist/types/src/core/looks/textures.d.ts +8 -0
- package/dist/types/src/core/math.d.ts +29 -0
- package/dist/types/src/core/mesh.d.ts +75 -0
- package/dist/types/src/core/morph.d.ts +11 -0
- package/dist/types/src/core/pack.d.ts +7 -0
- package/dist/types/src/core/params.d.ts +103 -0
- package/dist/types/src/core/props/bicycle.d.ts +26 -0
- package/dist/types/src/core/props/carry.d.ts +67 -0
- package/dist/types/src/core/props/helicopter-layout.d.ts +11 -0
- package/dist/types/src/core/props/horse-gait.d.ts +11 -0
- package/dist/types/src/core/props/parachute.d.ts +14 -0
- package/dist/types/src/core/props/stage-props.d.ts +23 -0
- package/dist/types/src/core/props/vehicle-actions.d.ts +23 -0
- package/dist/types/src/core/props/vehicle-bodies.d.ts +5 -0
- package/dist/types/src/core/props/vehicle-car.d.ts +2 -0
- package/dist/types/src/core/props/vehicle-doors.d.ts +2 -0
- package/dist/types/src/core/props/vehicle-helicopter.d.ts +2 -0
- package/dist/types/src/core/props/vehicle-horse.d.ts +2 -0
- package/dist/types/src/core/props/vehicle-kit.d.ts +61 -0
- package/dist/types/src/core/props/vehicle-land.d.ts +3 -0
- package/dist/types/src/core/props/vehicle-merge.d.ts +3 -0
- package/dist/types/src/core/props/vehicle-motion.d.ts +104 -0
- package/dist/types/src/core/props/vehicle-special.d.ts +3 -0
- package/dist/types/src/core/props/vehicle-stunt.d.ts +16 -0
- package/dist/types/src/core/props/vehicle-water.d.ts +2 -0
- package/dist/types/src/core/props/vehicle.d.ts +49 -0
- package/dist/types/src/core/props/vehicles.d.ts +60 -0
- package/dist/types/src/core/props/weapons.d.ts +21 -0
- package/dist/types/src/core/rig/poses.d.ts +7 -0
- package/dist/types/src/core/rig/rig.d.ts +75 -0
- package/dist/types/src/core/rig/skeletons.d.ts +33 -0
- package/dist/types/src/core/rig/socket.d.ts +21 -0
- package/dist/types/src/core/skin-rough.d.ts +11 -0
- package/dist/types/src/export/fbx.d.ts +10 -0
- package/dist/types/src/export/glb.d.ts +9 -0
- package/dist/types/src/export/index.d.ts +22 -0
- package/dist/types/src/export/obj.d.ts +6 -0
- package/dist/types/src/export/plan.d.ts +63 -0
- package/package.json +21 -4
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projected patches: garment pieces designed as a flat grid (front view, back view or from below)
|
|
3
|
+
* and laid onto the body by casting rays along an axis. Edges follow the designed outline exactly,
|
|
4
|
+
* at any resolution, instead of the base mesh's faces (see shell.ts for fitted, body-face garments).
|
|
5
|
+
*/
|
|
6
|
+
import type { PolyMesh } from '../geometry';
|
|
7
|
+
import type { Vec3 } from '../math';
|
|
8
|
+
import { type Body } from './body';
|
|
9
|
+
/** Axis the rays travel along: 'front' casts toward -Z (hits the front), 'back' toward +Z, 'below' toward +Y, 'above' toward -Y. */
|
|
10
|
+
export type CastDir = 'front' | 'back' | 'below' | 'above';
|
|
11
|
+
/** Casts rays at a set of body faces along one axis; a uniform grid over the other two axes. */
|
|
12
|
+
export declare class Caster {
|
|
13
|
+
readonly dir: CastDir;
|
|
14
|
+
private cells;
|
|
15
|
+
private tris;
|
|
16
|
+
private readonly u;
|
|
17
|
+
private readonly w;
|
|
18
|
+
private readonly d;
|
|
19
|
+
private readonly sign;
|
|
20
|
+
private readonly cell;
|
|
21
|
+
/**
|
|
22
|
+
* Casts at body faces (`keep` picks them) or, given a mesh, at all its polygons (a garment
|
|
23
|
+
* already built, to lay things on top of it).
|
|
24
|
+
*/
|
|
25
|
+
constructor(src: Body | PolyMesh, faceVerts: Uint32Array | null, keep: (face: number) => boolean, dir: CastDir);
|
|
26
|
+
/**
|
|
27
|
+
* First surface hit for the ray through (a, b) on the two cross axes (x, y for front/back;
|
|
28
|
+
* x, z for below). Returns the point, the face's normal (toward the ray's origin side) and the face.
|
|
29
|
+
*/
|
|
30
|
+
hit(a: number, b: number): {
|
|
31
|
+
p: Vec3;
|
|
32
|
+
n: Vec3;
|
|
33
|
+
face: number;
|
|
34
|
+
} | null;
|
|
35
|
+
}
|
|
36
|
+
/** Outward direction (away from the body) for each cast direction. */
|
|
37
|
+
export declare const OUTWARD: Record<CastDir, Vec3>;
|
|
38
|
+
/**
|
|
39
|
+
* Smooth a grid of surface points a little (cloth bridges small dips; edges stay on the outline;
|
|
40
|
+
* nothing sinks below the skin) and lift it off the skin along its normals (turned to face
|
|
41
|
+
* `outward`) by `offset`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function liftGrid(grid: Vec3[][], offset: number, outward: Vec3, smooth?: number): Vec3[][];
|
|
44
|
+
/** A quad mesh over a grid of points, with arc-length UVs tiling every `tile` metres. */
|
|
45
|
+
export declare function gridMesh(g: Vec3[][], tile: number): PolyMesh;
|
|
46
|
+
/** Points along the outline of a grid (its boundary loop), for piping and strings. */
|
|
47
|
+
export declare function gridOutline(grid: Vec3[][]): Vec3[];
|
|
48
|
+
/**
|
|
49
|
+
* Rays from a point inside the body outward (a radial projection): patches cast this way wrap
|
|
50
|
+
* round curved parts (the side of a breast) smoothly instead of grazing them from the front.
|
|
51
|
+
*/
|
|
52
|
+
export declare class RadialCaster {
|
|
53
|
+
private tris;
|
|
54
|
+
constructor(body: Body, faceVerts: Uint32Array, keep: (face: number) => boolean);
|
|
55
|
+
/** The farthest surface along the ray from `o` in direction `d` (the outer skin): point, normal and body face. */
|
|
56
|
+
hit(o: Vec3, d: Vec3): {
|
|
57
|
+
p: Vec3;
|
|
58
|
+
n: Vec3;
|
|
59
|
+
face: number;
|
|
60
|
+
} | null;
|
|
61
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ring-based garment geometry. A "hull ring" is the convex cross-section of a
|
|
3
|
+
* set of body vertices on a plane, pushed outward: the natural shape of
|
|
4
|
+
* anything wrapped around the body (wrappers, belts, straps, collars, cuffs,
|
|
5
|
+
* headbands). Plus small props: beads, shells, pouches, cards.
|
|
6
|
+
*/
|
|
7
|
+
import { type PolyMesh } from '../geometry';
|
|
8
|
+
import type { Vec3 } from '../math';
|
|
9
|
+
export declare const v3: {
|
|
10
|
+
add: (a: Vec3, b: Vec3) => Vec3;
|
|
11
|
+
sub: (a: Vec3, b: Vec3) => Vec3;
|
|
12
|
+
scale: (a: Vec3, s: number) => Vec3;
|
|
13
|
+
madd: (a: Vec3, b: Vec3, s: number) => Vec3;
|
|
14
|
+
dot: (a: Vec3, b: Vec3) => number;
|
|
15
|
+
cross: (a: Vec3, b: Vec3) => Vec3;
|
|
16
|
+
len: (a: Vec3) => number;
|
|
17
|
+
norm: (a: Vec3) => Vec3;
|
|
18
|
+
lerp: (a: Vec3, b: Vec3, t: number) => Vec3;
|
|
19
|
+
};
|
|
20
|
+
export interface Plane {
|
|
21
|
+
origin: Vec3;
|
|
22
|
+
normal: Vec3;
|
|
23
|
+
/** In-plane reference direction for angle 0 (projected). Default: +Z, or +X if parallel. */
|
|
24
|
+
ref?: Vec3;
|
|
25
|
+
}
|
|
26
|
+
export interface RingOpts {
|
|
27
|
+
/** Half-thickness of the slab of points considered (decimetres). */
|
|
28
|
+
slab: number;
|
|
29
|
+
samples: number;
|
|
30
|
+
/** Outward offset (decimetres), optionally varying with angle. */
|
|
31
|
+
offset: number | ((angle: number) => number);
|
|
32
|
+
/** Angle range; default full circle starting at the back (seam at the back). */
|
|
33
|
+
arc?: [number, number];
|
|
34
|
+
/** Shift the in-plane centre (decimetres along u, w). */
|
|
35
|
+
centreShift?: [number, number];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Convex cross-section ring of `points` on a plane. Angles: 0 = plane ref
|
|
39
|
+
* direction (front), +PI/2 = n x ref. Returns `samples` points (+1 for arcs).
|
|
40
|
+
*/
|
|
41
|
+
export declare function hullRing(points: Vec3[], pl: Plane, o: RingOpts): Vec3[] | null;
|
|
42
|
+
/**
|
|
43
|
+
* Loft through rings of equal length. `closedAround`: rings are closed loops;
|
|
44
|
+
* `closedAcross`: last ring connects back to the first (solid straps).
|
|
45
|
+
*/
|
|
46
|
+
export declare function loftRings(rings: Vec3[][], o: {
|
|
47
|
+
closedAround: boolean;
|
|
48
|
+
closedAcross?: boolean;
|
|
49
|
+
tileU?: number;
|
|
50
|
+
tileV?: number;
|
|
51
|
+
uRepeats?: number;
|
|
52
|
+
}): PolyMesh;
|
|
53
|
+
/** Flip all faces if they mostly face toward `centre` (so normals point outward). */
|
|
54
|
+
export declare function orientOutward(m: PolyMesh, centre: Vec3): PolyMesh;
|
|
55
|
+
/** Merge several PolyMeshes into one. */
|
|
56
|
+
export declare function merge(parts: (PolyMesh | null | undefined)[]): PolyMesh | null;
|
|
57
|
+
/**
|
|
58
|
+
* A solid band (belt, strap, cuff) around the body: rings on parallel planes
|
|
59
|
+
* across its width, outer surface plus a slightly smaller inner surface.
|
|
60
|
+
*/
|
|
61
|
+
export declare function solidBand(points: Vec3[], pl: Plane, width: number, thickness: number, offset: number, o: {
|
|
62
|
+
samples: number;
|
|
63
|
+
slab?: number;
|
|
64
|
+
arc?: [number, number];
|
|
65
|
+
tileU?: number;
|
|
66
|
+
uRepeats?: number;
|
|
67
|
+
steps?: number;
|
|
68
|
+
}): PolyMesh | null;
|
|
69
|
+
interface Frame {
|
|
70
|
+
o: Vec3;
|
|
71
|
+
x: Vec3;
|
|
72
|
+
y: Vec3;
|
|
73
|
+
z: Vec3;
|
|
74
|
+
}
|
|
75
|
+
/** Frame from an origin, a "forward" (z) and an "up" hint (y). */
|
|
76
|
+
export declare function frameOf(o: Vec3, forward: Vec3, up: Vec3): Frame;
|
|
77
|
+
/** UV sphere / ellipsoid with radii (rx, ry, rz) in the frame. All corners map to `uv`. */
|
|
78
|
+
export declare function ellipsoid(f: Frame, r: Vec3, uv: [number, number], seg?: number, rings?: number): PolyMesh;
|
|
79
|
+
/** Rounded box (a subdivided cube) with half-sizes (hx, hy, hz); planar UVs. */
|
|
80
|
+
export declare function roundedBox(f: Frame, h: Vec3, round?: number): PolyMesh;
|
|
81
|
+
/** Flat card from `base` along `dir` (length) with `width` across `side`; UV 0..1. */
|
|
82
|
+
export declare function card(base: Vec3, dir: Vec3, side: Vec3, length: number, width: number, taper?: number, segs?: number): PolyMesh;
|
|
83
|
+
/** Points spaced evenly (by arc length) along a closed or open polyline. */
|
|
84
|
+
export declare function along(poly: Vec3[], spacing: number, closed: boolean): {
|
|
85
|
+
p: Vec3;
|
|
86
|
+
tangent: Vec3;
|
|
87
|
+
i: number;
|
|
88
|
+
}[];
|
|
89
|
+
/** Thin round cord along a polyline. */
|
|
90
|
+
export declare function cord(poly: Vec3[], radius: number, closed: boolean, sides?: number): PolyMesh;
|
|
91
|
+
/** Farthest crossing of a closed ring (in the horizontal plane) along a ray from c in direction d. */
|
|
92
|
+
export declare function rayRing(ring: Vec3[], c: Vec3, d: Vec3): number | null;
|
|
93
|
+
/**
|
|
94
|
+
* The longest chain of a mesh's boundary edges (an open edge such as a neckline) among those whose
|
|
95
|
+
* ends pass `keep`, in order; closed loops come back with the first point repeated.
|
|
96
|
+
*/
|
|
97
|
+
export declare function boundaryChain(m: PolyMesh, keep: (p: Vec3) => boolean): Vec3[];
|
|
98
|
+
/** A flat strap (webbing) along a polyline, lying on a surface with the given normals: width w. */
|
|
99
|
+
export declare function ribbon(line: Vec3[], normals: Vec3[], w: number, th: number): PolyMesh;
|
|
100
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outfit sets: a top and a bottom worn together (with suggested extras), listed with the full
|
|
3
|
+
* outfits. The pieces either share the set's pattern and colours, or keep their own.
|
|
4
|
+
*/
|
|
5
|
+
import type { HumanParams } from '../params';
|
|
6
|
+
import type { GarmentDef } from './kit';
|
|
7
|
+
import type { CarryId } from '../props/carry';
|
|
8
|
+
/** Outfits that pair a top and a bottom (and suggested extras), listed with the full outfits. */
|
|
9
|
+
export interface OutfitSet {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
top: string;
|
|
13
|
+
/** Worn over the top: a suit jacket. */
|
|
14
|
+
jacket?: string;
|
|
15
|
+
bottom: string;
|
|
16
|
+
/** Added when the set is picked (can be removed afterwards). */
|
|
17
|
+
accessories: string[];
|
|
18
|
+
shoes?: string;
|
|
19
|
+
/** Bag (see props/carry). */
|
|
20
|
+
carry?: CarryId;
|
|
21
|
+
hat?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Patterns offered for the whole set (first = default) and default colours, shared by the top
|
|
24
|
+
* and bottom, or by the jacket and bottom when there is a jacket (a suit; the shirt keeps its
|
|
25
|
+
* own). Without them each piece keeps its own pattern and colours (e.g. a tee and jeans).
|
|
26
|
+
*/
|
|
27
|
+
patterns?: GarmentDef['patterns'];
|
|
28
|
+
color?: string;
|
|
29
|
+
color2?: string;
|
|
30
|
+
}
|
|
31
|
+
type Styles = HumanParams['garmentStyles'];
|
|
32
|
+
/** The pieces of a set that share its pattern and colours: a suit's jacket and trousers, otherwise top and bottom. */
|
|
33
|
+
export declare const sharedPieces: (set: OutfitSet) => string[];
|
|
34
|
+
/**
|
|
35
|
+
* The garment styles a set dresses with: a shared set applies its pattern and colours (and any
|
|
36
|
+
* the user picked for the set) to its shared pieces, and a matching gele unless it has its own.
|
|
37
|
+
*/
|
|
38
|
+
export declare function setStyles(set: OutfitSet, styles: Styles): Styles;
|
|
39
|
+
export declare const OUTFIT_SETS: OutfitSet[];
|
|
40
|
+
export declare const setById: Map<string, OutfitSet>;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fitted garments grown from the body surface: select body faces by a
|
|
3
|
+
* coverage predicate, push them out along the normals, and close the open
|
|
4
|
+
* hems with a rim so the cloth has visible thickness.
|
|
5
|
+
*/
|
|
6
|
+
import type { PolyMesh } from '../geometry';
|
|
7
|
+
import { type Body, type VInfo } from './body';
|
|
8
|
+
export interface ShellSpec {
|
|
9
|
+
covers: (v: VInfo, p: [number, number, number]) => boolean;
|
|
10
|
+
/** Offset from the skin in decimetres (may vary per vertex, e.g. looser at the hem). */
|
|
11
|
+
offset: number | ((v: VInfo, p: [number, number, number]) => number);
|
|
12
|
+
/** Texture tile size in metres. */
|
|
13
|
+
tile?: number;
|
|
14
|
+
/** Laplacian relaxation passes: cloth bridges over small skin detail. */
|
|
15
|
+
relax?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Depth of the hem's turned-in edge. By default the rim runs back down to the skin (right for
|
|
18
|
+
* fitted clothes); loose clothes set a small depth so their edges read as thin fabric.
|
|
19
|
+
*/
|
|
20
|
+
hemDepth?: number;
|
|
21
|
+
/** Leave the hems open (no rim), for garments that continue the surface from a hem. */
|
|
22
|
+
noRim?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Collects face-varying UVs with value de-duplication. */
|
|
25
|
+
export declare class UVs {
|
|
26
|
+
readonly data: number[];
|
|
27
|
+
private keys;
|
|
28
|
+
add(u: number, v: number): number;
|
|
29
|
+
}
|
|
30
|
+
/** Tiling UV for a body vertex: angle around its region axis, distance along it. */
|
|
31
|
+
export declare function bodyUV(body: Body, v: number, tile: number): [number, number];
|
|
32
|
+
export interface ShellResult {
|
|
33
|
+
mesh: PolyMesh;
|
|
34
|
+
/** Body-face mask covered by this shell (for hiding skin underneath). */
|
|
35
|
+
covered: Uint8Array;
|
|
36
|
+
}
|
|
37
|
+
export declare function buildShell(body: Body, faceVerts: Uint32Array, spec: ShellSpec): ShellResult | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shirts: a V neckline cut and a button placket (used by the prison jumpsuit's top), and the
|
|
3
|
+
* resort shirt, cut from a MakeHuman suit and printed.
|
|
4
|
+
*/
|
|
5
|
+
import { type PolyMesh } from '../geometry';
|
|
6
|
+
import type { Material } from '../mesh';
|
|
7
|
+
import { type Body, type VInfo } from './body';
|
|
8
|
+
import { type GarmentDef, type GCtx, type GPart } from './kit';
|
|
9
|
+
/** A V neckline: its point's trunk height (tt), and half-width at the base of the neck (fraction of the shoulder width). */
|
|
10
|
+
export interface VOpts {
|
|
11
|
+
ttV: number;
|
|
12
|
+
vw: number;
|
|
13
|
+
}
|
|
14
|
+
/** Where the V neckline (and a slightly lowered back neck) is cut out of a shirt's shell. */
|
|
15
|
+
export declare function vNeck(b: Body, o: VOpts): (v: VInfo) => boolean;
|
|
16
|
+
export interface PlacketOpts {
|
|
17
|
+
/** Trunk height (tt) of the V's point, where the placket starts. */
|
|
18
|
+
ttV: number;
|
|
19
|
+
/** Buttons below the V, and their spacing (decimetres). */
|
|
20
|
+
buttons: number;
|
|
21
|
+
spacing: number;
|
|
22
|
+
/** Trunk height (tt) the placket runs down to. */
|
|
23
|
+
placketTo: number;
|
|
24
|
+
buttonColor: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The button placket below the V of a shirt whose shell is `top`, with its buttons. A shirt
|
|
28
|
+
* tucked in stops where the bottom (already dressed, in `g.worn`) covers it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function placket(g: GCtx, top: PolyMesh, m: Material, o: PlacketOpts): GPart[];
|
|
31
|
+
export declare const SHIRTS: GarmentDef[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type GarmentDef, type GarmentStyle, type GCtx, type GPart } from './kit';
|
|
2
|
+
/**
|
|
3
|
+
* `st`: the upper's finish (smooth leather, or worn canvas) and colour; color2 tints the sole
|
|
4
|
+
* (a worn pair's sole is grubby too).
|
|
5
|
+
*/
|
|
6
|
+
export declare function sneakers(g: GCtx, st: GarmentStyle): GPart[];
|
|
7
|
+
export declare const SNEAKERS: GarmentDef;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare function encodePNG(w: number, h: number, rgba: Uint8Array, alpha: boolean, level?: 1 | 3 | 6 | 9): Uint8Array;
|
|
2
|
+
/** Same as encodePNG, using the platform's native zlib (CompressionStream) when available: several times faster on big images. */
|
|
3
|
+
export declare function encodePNGAsync(w: number, h: number, rgba: Uint8Array, alpha: boolean): Promise<Uint8Array>;
|
|
4
|
+
export type RGB = [number, number, number];
|
|
5
|
+
export declare const rgb: (hex: string) => RGB;
|
|
6
|
+
export interface TexOut {
|
|
7
|
+
color: Uint8Array;
|
|
8
|
+
normal?: Uint8Array;
|
|
9
|
+
alpha: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Fill a texture from a per-pixel function returning colour, alpha (0..1) and height. */
|
|
12
|
+
export declare function render(size: number, fn: (u: number, v: number) => {
|
|
13
|
+
c: RGB;
|
|
14
|
+
a?: number;
|
|
15
|
+
h?: number;
|
|
16
|
+
}, wantAlpha: boolean, normalStrength?: number): TexOut;
|
|
17
|
+
/** As render, for a w x h texture (u across, v down). */
|
|
18
|
+
export declare function renderRect(w: number, h: number, fn: (u: number, v: number) => {
|
|
19
|
+
c: RGB;
|
|
20
|
+
a?: number;
|
|
21
|
+
h?: number;
|
|
22
|
+
}, wantAlpha: boolean, normalStrength?: number): TexOut;
|
|
23
|
+
export type Pattern = 'solid' | 'camo' | 'kente' | 'asooke' | 'ankara' | 'shuka' | 'leather' | 'hide' | 'leopard' | 'fur' | 'techwear' | 'molle' | 'tattered' | 'beadbands' | 'khaki' | 'adire' | 'adire_panel' | 'ankara_floral' | 'ankara_web' | 'lace' | 'damask' | 'pleated' | 'foil' | 'straw' | 'denim' | 'rib' | 'jersey' | 'nappa' | 'workwear' | 'tropical' | 'linen' | 'suiting' | 'patent' | 'shemagh' | 'satin' | 'striped';
|
|
24
|
+
export declare const PATTERNS: Pattern[];
|
|
25
|
+
/**
|
|
26
|
+
* A pattern texture. `repeat`: how many times the pattern tiles across the texture each way (for
|
|
27
|
+
* an atlas whose UVs span a whole garment, such as a MakeHuman outfit's): one 256 px tile, copied.
|
|
28
|
+
*/
|
|
29
|
+
/** A hex colour scaled by `k` (below 1 darker). */
|
|
30
|
+
export declare const shade: (hex: string, k: number) => string;
|
|
31
|
+
export declare function makePattern(p: Pattern, c1: string, c2: string, seed?: number, repeat?: number): TexOut;
|
|
32
|
+
/** Colour swatch strip for beads: N cells across u. */
|
|
33
|
+
export declare function palette(colors: string[]): TexOut;
|
|
34
|
+
/** Feather card texture (alpha): white/black barred vane. */
|
|
35
|
+
export declare function featherTexture(c1: string, c2: string): TexOut;
|
|
36
|
+
/**
|
|
37
|
+
* Unwrapped wash for one jeans leg (both legs share it): u runs round the leg (0.5 = front,
|
|
38
|
+
* 0.75 = outer side, 0.25 = inseam, 0 / 1 = back), v from the crotch (0) down to the hem (1).
|
|
39
|
+
* Indigo c1 worn toward c2 on the front of the thighs and knees, whiskers at the top, honeycomb
|
|
40
|
+
* behind the knee, roped side seams with topstitching on the outer one, and a worn hem.
|
|
41
|
+
*/
|
|
42
|
+
export declare function jeansLegTexture(c1: string, c2: string, seed?: number): TexOut;
|
|
43
|
+
/**
|
|
44
|
+
* Stencilled block letters (alpha mask) for print on workwear: `text` in c1, worn through in places.
|
|
45
|
+
* Supports the letters the garments use (D, O, C).
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* A shirt-and-tie atlas: the shirt in `shirt` (a fine weave), and inside the polygon `tie` (in
|
|
49
|
+
* 0..1 texture coordinates, y down) the tie in `tieColor`, plain or with `stripe` repp stripes,
|
|
50
|
+
* shaded darker toward its edges so it reads rounded.
|
|
51
|
+
*/
|
|
52
|
+
export declare function shirtTieTexture(size: number, tie: [number, number][], shirt: string, tieColor: string, stripe: string | null): TexOut;
|
|
53
|
+
export declare function stencilText(text: string, c1: string, seed?: number): TexOut;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polygon-mesh helpers: compaction, Catmull-Clark subdivision, normals, and
|
|
3
|
+
* conversion to per-vertex (UV-split) arrays.
|
|
4
|
+
*/
|
|
5
|
+
/** Up to 4 bone influences per vertex. */
|
|
6
|
+
export interface Skin {
|
|
7
|
+
j: Uint16Array;
|
|
8
|
+
w: Float32Array;
|
|
9
|
+
}
|
|
10
|
+
/** A polygon mesh with face-varying UVs (as in OBJ). */
|
|
11
|
+
export interface PolyMesh {
|
|
12
|
+
positions: Float32Array;
|
|
13
|
+
faceSizes: Uint8Array;
|
|
14
|
+
faceVerts: Uint32Array;
|
|
15
|
+
faceUVs: Uint32Array;
|
|
16
|
+
uvs: Float32Array;
|
|
17
|
+
/** Skin weights, once assigned. */
|
|
18
|
+
skin?: Skin;
|
|
19
|
+
/** Base-mesh vertex each vertex was derived from (-1 = none), for weight transfer. */
|
|
20
|
+
ref?: Int32Array;
|
|
21
|
+
/** Blend-shape offsets: one array (vertex count * 3) per face shape, in the same order everywhere. */
|
|
22
|
+
morphs?: Float32Array[];
|
|
23
|
+
}
|
|
24
|
+
/** Blend weighted source influences into the top 4, normalised. */
|
|
25
|
+
export declare function blendInfluences(acc: Map<number, number>, j: Uint16Array, w: Float32Array, o: number): void;
|
|
26
|
+
/** Keep only faces passing `keep` and vertices they use. */
|
|
27
|
+
export declare function compact(m: PolyMesh, keep?: (f: number, corners: Uint32Array) => boolean): PolyMesh;
|
|
28
|
+
/** One level of Catmull-Clark subdivision. Boundaries use the crease rules; UVs are interpolated linearly. */
|
|
29
|
+
export declare function subdivide(m: PolyMesh): PolyMesh;
|
|
30
|
+
/** Smooth, angle-weighted vertex normals. */
|
|
31
|
+
export declare function vertexNormals(m: PolyMesh): Float32Array;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a complete character: morphed body + fitted proxies (eyes, brows,
|
|
3
|
+
* lashes, hair, clothes, shoes, hat) + skeleton, as one multi-material mesh.
|
|
4
|
+
*/
|
|
5
|
+
import type { AssetLibrary, CatalogItem } from './assets';
|
|
6
|
+
import { type Rig } from './rig/rig';
|
|
7
|
+
import { type WeaponId, type WeaponPart } from './props/weapons';
|
|
8
|
+
import { type Q } from './anim/quat';
|
|
9
|
+
import { type MeshData } from './mesh';
|
|
10
|
+
import { type HumanParams } from './params';
|
|
11
|
+
export interface Character {
|
|
12
|
+
params: HumanParams;
|
|
13
|
+
mesh: MeshData;
|
|
14
|
+
/** Skeleton + bind pose (absent when rigging is off). */
|
|
15
|
+
rig?: Rig;
|
|
16
|
+
/** Held weapon: its parts in the weapon frame and the weapon -> WeaponR socket rotation. */
|
|
17
|
+
weapon?: {
|
|
18
|
+
id: WeaponId;
|
|
19
|
+
rot: Q;
|
|
20
|
+
parts: WeaponPart[];
|
|
21
|
+
};
|
|
22
|
+
/** Standing height in metres (body, without hair/hat). */
|
|
23
|
+
height: number;
|
|
24
|
+
/** Facial blend shapes in the mesh (names and the expression's resting weights), if exported. */
|
|
25
|
+
face?: {
|
|
26
|
+
names: string[];
|
|
27
|
+
defaults: number[];
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** Pick the skin texture closest to the character's ethnicity, sex and age. */
|
|
31
|
+
export declare function autoSkin(p: HumanParams, skins: CatalogItem[]): CatalogItem;
|
|
32
|
+
export interface BuildOptions {
|
|
33
|
+
/** Called as the build moves through its stages (for progress UI). */
|
|
34
|
+
onStage?: (stage: string) => void;
|
|
35
|
+
}
|
|
36
|
+
export declare function buildHuman(lib: AssetLibrary, p: HumanParams, opts?: BuildOptions): Promise<Character>;
|
|
37
|
+
/** Texture files referenced by a mesh. */
|
|
38
|
+
export declare function textureFiles(mesh: MeshData): string[];
|
|
39
|
+
/** The character without its held weapon (the weapon parts are the last mesh groups). */
|
|
40
|
+
export declare function meshWithoutWeapon(ch: Character): MeshData;
|
|
41
|
+
/** The held weapon as a standalone prop in WeaponR socket space: attach it to that bone with zero offset. */
|
|
42
|
+
export declare function weaponPropMesh(ch: Character): MeshData | undefined;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Procedural hair: shaved / buzzed scalps and stubble (painted into the skin
|
|
3
|
+
* overlay), plus geometry for punk spikes, cornrows, box braids, beards and
|
|
4
|
+
* buzz cuts (hair cards). Masks are defined on the unmorphed base body (decimetres) and
|
|
5
|
+
* looked up per vertex, so they follow every head shape; geometry is built on
|
|
6
|
+
* the morphed body.
|
|
7
|
+
*/
|
|
8
|
+
import { type Body } from '../garments/body';
|
|
9
|
+
import type { PolyMesh } from '../geometry';
|
|
10
|
+
import { type Vec3 } from '../math';
|
|
11
|
+
import type { Layer } from './overlay';
|
|
12
|
+
export declare const HAIRSTYLES: readonly [{
|
|
13
|
+
readonly id: 'buzz';
|
|
14
|
+
readonly name: 'Buzz cut';
|
|
15
|
+
}, {
|
|
16
|
+
readonly id: 'mohawk';
|
|
17
|
+
readonly name: 'Punk mohawk';
|
|
18
|
+
}, {
|
|
19
|
+
readonly id: 'cornrows';
|
|
20
|
+
readonly name: 'Cornrows';
|
|
21
|
+
}, {
|
|
22
|
+
readonly id: 'box_braids';
|
|
23
|
+
readonly name: 'Box braids';
|
|
24
|
+
}];
|
|
25
|
+
export type HairstyleId = (typeof HAIRSTYLES)[number]['id'];
|
|
26
|
+
export declare const isProceduralHair: (id: string) => id is HairstyleId;
|
|
27
|
+
export declare const FACIAL_HAIR: readonly ['none', 'stubble', 'mustache', 'mustache_stubble', 'goatee', 'short_beard', 'full_beard'];
|
|
28
|
+
export type FacialHairId = (typeof FACIAL_HAIR)[number];
|
|
29
|
+
export declare const FACIAL_HAIR_LABELS: Record<FacialHairId, string>;
|
|
30
|
+
/** Scalp coverage 0..1 at a base-body point. */
|
|
31
|
+
export declare function scalpMask(p: Vec3): number;
|
|
32
|
+
/**
|
|
33
|
+
* Facial hair coverage 0..1 at a base-body point (head + neck). For 'mustache_stubble' this is
|
|
34
|
+
* the mustache (its cards); the stubble round it uses the stubble mask.
|
|
35
|
+
*/
|
|
36
|
+
export declare function beardMask(p: Vec3, style: FacialHairId, region: number): number;
|
|
37
|
+
/** Overlay paint for the scalp (buzzed / shaved) and facial stubble under any beard. */
|
|
38
|
+
export declare function hairLayers(hairstyle: string, facial: FacialHairId, color: string, beardColor: string): Layer[];
|
|
39
|
+
export interface HeadCtx {
|
|
40
|
+
base: Body;
|
|
41
|
+
coords: Float32Array;
|
|
42
|
+
normals: Float32Array;
|
|
43
|
+
regions: Uint8Array;
|
|
44
|
+
faceVerts: Uint32Array;
|
|
45
|
+
seed: number;
|
|
46
|
+
/** Fewer hair cards (low detail). */
|
|
47
|
+
low: boolean;
|
|
48
|
+
/** Base faces under headwear: no hair cards grow there. */
|
|
49
|
+
underHat?: Uint8Array;
|
|
50
|
+
}
|
|
51
|
+
/** Punk liberty spikes along the crest. */
|
|
52
|
+
export declare function spikes(c: HeadCtx): PolyMesh | undefined;
|
|
53
|
+
/** Cornrows: braids running straight back over the scalp. */
|
|
54
|
+
export declare function cornrows(c: HeadCtx): PolyMesh | undefined;
|
|
55
|
+
/** Box braids: many small braids from a grid of parts, hanging to about chin / neck length. */
|
|
56
|
+
export declare function boxBraids(c: HeadCtx, stopY: number): PolyMesh | undefined;
|
|
57
|
+
/** Beard / mustache hair cards rooted on the face. */
|
|
58
|
+
export declare function beardCards(c: HeadCtx, style: FacialHairId): PolyMesh | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Buzz cut: very short hair cards (5–9 mm) over the painted scalp. They stand up and curl a
|
|
61
|
+
* little, so the hairline and the head's outline get soft fuzz instead of a flat painted edge.
|
|
62
|
+
* About 8k triangles at medium detail; none at low detail (game LOD), where the painted scalp is enough.
|
|
63
|
+
*/
|
|
64
|
+
export declare function buzzCards(c: HeadCtx): PolyMesh | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Looks": tattoos, procedural hairstyles, facial hair and earrings. Returns
|
|
3
|
+
* mesh parts in morphed body space (decimetres); human.ts skins and places them.
|
|
4
|
+
*/
|
|
5
|
+
import type { AssetLibrary } from '../assets';
|
|
6
|
+
import { type PolyMesh } from '../geometry';
|
|
7
|
+
import type { Material } from '../mesh';
|
|
8
|
+
import { type HumanParams } from '../params';
|
|
9
|
+
export { TATTOOS, TATTOO_LABELS, type TattooId } from './tattoos';
|
|
10
|
+
export { FACIAL_HAIR, FACIAL_HAIR_LABELS, HAIRSTYLES, isProceduralHair, type FacialHairId, type HairstyleId } from './hair';
|
|
11
|
+
export { EARRINGS, EARRING_LABELS, type EarringId, type Metal } from './jewelry';
|
|
12
|
+
export interface LooksInput {
|
|
13
|
+
p: HumanParams;
|
|
14
|
+
/** Morphed base mesh coordinates and vertex normals (decimetres). */
|
|
15
|
+
coords: Float32Array;
|
|
16
|
+
normals: Float32Array;
|
|
17
|
+
/** The full (skinned) base mesh with morphed positions. */
|
|
18
|
+
fullBody: PolyMesh;
|
|
19
|
+
/** Base faces hidden under clothes (the overlay skips them). */
|
|
20
|
+
hidden: Uint8Array;
|
|
21
|
+
/** Base faces under headwear (no hair cards grow there). */
|
|
22
|
+
underHat?: Uint8Array;
|
|
23
|
+
/** Neck base height (dm): box braids stop above the shoulders. */
|
|
24
|
+
neckY: number;
|
|
25
|
+
low: boolean;
|
|
26
|
+
onStage?: (stage: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface Looks {
|
|
29
|
+
/** Skin overlay (tattoos, stubble, shaved scalp): already skinned via the body. */
|
|
30
|
+
overlay?: [PolyMesh, Material];
|
|
31
|
+
/** Scalp hair geometry (skin to the head). */
|
|
32
|
+
hair: [PolyMesh, Material][];
|
|
33
|
+
/** Beard / mustache cards (skin to head + neck, so the jaw moves them). */
|
|
34
|
+
beard: [PolyMesh, Material][];
|
|
35
|
+
/** Earrings (skin to the head). */
|
|
36
|
+
jewelry: [PolyMesh, Material][];
|
|
37
|
+
}
|
|
38
|
+
export declare function buildLooks(lib: AssetLibrary, i: LooksInput): Promise<Looks>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Earrings: studs or hoops on both ear lobes (located on the base body, built on the morphed one). */
|
|
2
|
+
import type { Body } from '../garments/body';
|
|
3
|
+
import type { PolyMesh } from '../geometry';
|
|
4
|
+
import type { Material } from '../mesh';
|
|
5
|
+
export declare const EARRINGS: readonly ['none', 'studs', 'pearl_drops', 'small_hoops', 'big_hoops'];
|
|
6
|
+
export type EarringId = (typeof EARRINGS)[number];
|
|
7
|
+
export declare const EARRING_LABELS: Record<EarringId, string>;
|
|
8
|
+
export declare const METALS: {
|
|
9
|
+
readonly gold: '#e0b45a';
|
|
10
|
+
readonly silver: '#d9dbe0';
|
|
11
|
+
};
|
|
12
|
+
export type Metal = keyof typeof METALS;
|
|
13
|
+
export declare const metalMaterial: (m: Metal) => Material;
|
|
14
|
+
/**
|
|
15
|
+
* Pearls of the pearl drops (built apart from the metal): a teardrop pearl hanging straight down
|
|
16
|
+
* about a centimetre and a half below each lobe, narrow at the top where its cap holds it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function earringPearls(id: EarringId, base: Body, coords: Float32Array, normals: Float32Array): PolyMesh[];
|
|
19
|
+
/** Earring meshes (decimetres, morphed body space), or [] for none. */
|
|
20
|
+
export declare function earrings(id: EarringId, base: Body, coords: Float32Array, normals: Float32Array): PolyMesh[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mouth shading painted into the skin overlay: the inner lips and the inside of the mouth are in
|
|
3
|
+
* shadow, so they don't glow when the mouth opens.
|
|
4
|
+
*/
|
|
5
|
+
import { type Body } from '../garments/body';
|
|
6
|
+
import type { Layer } from './overlay';
|
|
7
|
+
/**
|
|
8
|
+
* Shade inside the lips and the mouth: real mouths are shadowed inside, but the inner lips and
|
|
9
|
+
* corners are otherwise lit like the outer face and glow when the mouth opens. Only surfaces that
|
|
10
|
+
* face into the mouth (normals pointing back or up/down into it) are shaded, never the outer skin.
|
|
11
|
+
*/
|
|
12
|
+
export declare function mouthShadeLayer(base: Body): Layer;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skin overlay: tattoos, stubble and shaved-scalp hair are painted into one
|
|
3
|
+
* RGBA texture in the base mesh's UV space and shown on a thin copy of the
|
|
4
|
+
* body faces that carry any paint. Designs are evaluated on the *unmorphed*
|
|
5
|
+
* base mesh, so they follow every body shape through the UVs and the texture
|
|
6
|
+
* can be cached across slider changes.
|
|
7
|
+
*/
|
|
8
|
+
import type { AssetLibrary } from '../assets';
|
|
9
|
+
import { type Body } from '../garments/body';
|
|
10
|
+
import type { Vec3 } from '../math';
|
|
11
|
+
/** RGB 0..255 + alpha 0..1 (null / alpha 0 = no paint). */
|
|
12
|
+
export type Paint = [number, number, number, number] | null;
|
|
13
|
+
export interface Layer {
|
|
14
|
+
/** Identifies the layer's look (design + colours): its paint is cached under this key. */
|
|
15
|
+
key: string;
|
|
16
|
+
/** Body regions this layer can paint (limits the faces rasterised). */
|
|
17
|
+
regions: number[];
|
|
18
|
+
/** Optional box on the base body (min xyz, max xyz) outside which the layer never paints: faces outside are skipped. */
|
|
19
|
+
bounds?: [number, number, number, number, number, number];
|
|
20
|
+
/** Paint at a point on the base (unmorphed) body, in decimetres. */
|
|
21
|
+
paint(p: Vec3, region: number, side: number): Paint;
|
|
22
|
+
}
|
|
23
|
+
/** The unmorphed base body with its region coordinates (designs are defined on it). */
|
|
24
|
+
export declare function baseBody(lib: AssetLibrary): Body;
|
|
25
|
+
export interface Painted {
|
|
26
|
+
/** PNG (RGBA). */
|
|
27
|
+
png: Uint8Array;
|
|
28
|
+
/** Base-mesh faces of the overlay: those that carry paint plus two rings of (transparent) neighbours. */
|
|
29
|
+
faces: Uint8Array;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Composite layers (in order, "over") into a size x size RGBA texture. Each
|
|
33
|
+
* layer's paint is cached by its key, so changing one tattoo only repaints
|
|
34
|
+
* that tattoo.
|
|
35
|
+
*/
|
|
36
|
+
export declare function paintOverlay(lib: AssetLibrary, layers: Layer[], size?: number): Promise<Painted>;
|
|
37
|
+
/**
|
|
38
|
+
* The overlay surface: painted faces plus two rings of neighbours (so that
|
|
39
|
+
* subdividing gives the same surface as the body underneath), minus faces
|
|
40
|
+
* hidden under clothes.
|
|
41
|
+
*/
|
|
42
|
+
export declare function overlaySurface(faces: Uint8Array, hidden: Uint8Array): Uint8Array;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tattoo designs, defined on the unmorphed base body (decimetres) and painted
|
|
3
|
+
* into the skin overlay (see overlay.ts). Body art is adult-only (18+).
|
|
4
|
+
*/
|
|
5
|
+
import { type Body } from '../garments/body';
|
|
6
|
+
import type { Layer } from './overlay';
|
|
7
|
+
export declare const TATTOOS: readonly ['armband_l', 'sleeve_r', 'forearm_l', 'chest', 'back', 'face_marks'];
|
|
8
|
+
export type TattooId = (typeof TATTOOS)[number];
|
|
9
|
+
export declare const TATTOO_LABELS: Record<TattooId, string>;
|
|
10
|
+
/** Overlay layers for the chosen tattoos. */
|
|
11
|
+
export declare function tattooLayers(body: Body, ids: TattooId[], ink: string): Layer[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Procedural textures for generated hair: hair cards, braids and gelled spikes (greyscale, tinted by the material colour). */
|
|
2
|
+
import { type TexOut } from '../garments/textures';
|
|
3
|
+
/** Hair card (alpha mask): ~7 tapered strands of varied length, root at v = 0 (bottom). */
|
|
4
|
+
export declare function hairCardTexture(): TexOut;
|
|
5
|
+
/** Braid relief: overlapping lobes slanting left and right along v; u wraps around the braid. */
|
|
6
|
+
export declare function braidTexture(): TexOut;
|
|
7
|
+
/** Gelled spike: fine lengthwise strands. */
|
|
8
|
+
export declare function spikeTexture(): TexOut;
|