ara3d 0.1.0 → 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 +29 -8
- package/dist/cli.js +5 -5
- 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 +12 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type Vec3 = [number, number, number];
|
|
2
|
+
export declare const vec: (x?: number, y?: number, z?: number) => Vec3;
|
|
3
|
+
export declare const add: (a: Vec3, b: Vec3) => Vec3;
|
|
4
|
+
export declare const sub: (a: Vec3, b: Vec3) => Vec3;
|
|
5
|
+
export declare const scale: (a: Vec3, s: number) => Vec3;
|
|
6
|
+
/** a + b * s */
|
|
7
|
+
export declare const madd: (a: Vec3, b: Vec3, s: number) => Vec3;
|
|
8
|
+
export declare const dot: (a: Vec3, b: Vec3) => number;
|
|
9
|
+
export declare const cross: (a: Vec3, b: Vec3) => Vec3;
|
|
10
|
+
export declare const length: (a: Vec3) => number;
|
|
11
|
+
export declare const lerpV: (a: Vec3, b: Vec3, t: number) => Vec3;
|
|
12
|
+
export declare function normalize(a: Vec3, fallback?: Vec3): Vec3;
|
|
13
|
+
export declare const lerp: (a: number, b: number, t: number) => number;
|
|
14
|
+
export declare const clamp: (x: number, lo: number, hi: number) => number;
|
|
15
|
+
export declare function smoothstep(e0: number, e1: number, x: number): number;
|
|
16
|
+
/** Rotate v around a unit axis by angle (Rodrigues). */
|
|
17
|
+
export declare function rotate(v: Vec3, axis: Vec3, angle: number): Vec3;
|
|
18
|
+
/**
|
|
19
|
+
* Monotone cubic (PCHIP) interpolation. Never overshoots the key values,
|
|
20
|
+
* which keeps radii positive and silhouettes free of ripples.
|
|
21
|
+
*/
|
|
22
|
+
export declare function pchip(xs: number[], ys: number[]): (x: number) => number;
|
|
23
|
+
/** Deterministic PRNG (mulberry32). */
|
|
24
|
+
export declare function rng(seed: number): () => number;
|
|
25
|
+
export declare function hexToRgb(hex: string): Vec3;
|
|
26
|
+
export declare function rgbToHex(c: Vec3): string;
|
|
27
|
+
export declare const srgbToLinear: (c: number) => number;
|
|
28
|
+
/** Multiply an sRGB hex colour's brightness (in sRGB space). */
|
|
29
|
+
export declare function shade(hex: string, k: number): string;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { PolyMesh } from './geometry';
|
|
2
|
+
export interface Material {
|
|
3
|
+
name: string;
|
|
4
|
+
/** sRGB hex colour; multiplies the texture when there is one. */
|
|
5
|
+
color: string;
|
|
6
|
+
roughness: number;
|
|
7
|
+
metalness: number;
|
|
8
|
+
/** Texture file names (see AssetLibrary.texture). */
|
|
9
|
+
map?: string;
|
|
10
|
+
normalMap?: string;
|
|
11
|
+
/** glTF metallic-roughness texture (roughness in G). Where it's used, it replaces `roughness`, which stays as the average for formats without it. */
|
|
12
|
+
roughnessMap?: string;
|
|
13
|
+
alpha: 'opaque' | 'mask' | 'blend';
|
|
14
|
+
doubleSided: boolean;
|
|
15
|
+
/** sRGB hex glow colour (neon, visors). */
|
|
16
|
+
emissive?: string;
|
|
17
|
+
/** 0..1, for alpha 'blend' materials without a texture. */
|
|
18
|
+
opacity?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface MeshGroup {
|
|
21
|
+
material: number;
|
|
22
|
+
/** Triangle list (for GLB / real-time rendering). */
|
|
23
|
+
indices: Uint32Array;
|
|
24
|
+
/** Original polygons (mostly quads) for FBX / OBJ: sizes + flattened vertex indices. */
|
|
25
|
+
polySizes: Uint8Array;
|
|
26
|
+
polyIndices: Uint32Array;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Format-neutral mesh. Units are metres, +Y up, character faces +Z, feet on y = 0.
|
|
30
|
+
* Vertices are split at UV seams, so every vertex has exactly one uv.
|
|
31
|
+
*/
|
|
32
|
+
export interface MeshData {
|
|
33
|
+
positions: Float32Array;
|
|
34
|
+
normals: Float32Array;
|
|
35
|
+
uvs: Float32Array;
|
|
36
|
+
groups: MeshGroup[];
|
|
37
|
+
materials: Material[];
|
|
38
|
+
/** Skinning (present when rigged): 4 bone indices + 4 weights per vertex. */
|
|
39
|
+
joints?: Uint16Array;
|
|
40
|
+
weights?: Float32Array;
|
|
41
|
+
/** Facial blend shapes: names, per-vertex offsets (vertex count * 3 each) and resting weights. */
|
|
42
|
+
morphs?: {
|
|
43
|
+
names: string[];
|
|
44
|
+
deltas: Float32Array[];
|
|
45
|
+
defaults: number[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Morph offsets moved by more than this (metres) count as changed (for sparse exports): 0.05 mm,
|
|
49
|
+
* far below anything visible, keeps the many barely-moved vertices out of the files. */
|
|
50
|
+
export declare const MORPH_EPSILON = 0.00005;
|
|
51
|
+
/** Positions with the morphs applied at the given weights (e.g. to bake an expression into an OBJ). */
|
|
52
|
+
export declare function morphedPositions(m: MeshData, weights?: number[]): Float32Array;
|
|
53
|
+
export declare function triangleCount(m: MeshData): number;
|
|
54
|
+
/** Accumulates parts (each a PolyMesh + material) into one MeshData. */
|
|
55
|
+
export declare class MeshAssembler {
|
|
56
|
+
private morphs?;
|
|
57
|
+
private pos;
|
|
58
|
+
private nrm;
|
|
59
|
+
private uv;
|
|
60
|
+
private jnt;
|
|
61
|
+
private wgt;
|
|
62
|
+
private skinned;
|
|
63
|
+
private groups;
|
|
64
|
+
private morph;
|
|
65
|
+
readonly materials: Material[];
|
|
66
|
+
/** `morphs`: blend-shape names and resting weights; parts without offsets get zeros. */
|
|
67
|
+
constructor(morphs?: {
|
|
68
|
+
names: string[];
|
|
69
|
+
defaults: number[];
|
|
70
|
+
} | undefined);
|
|
71
|
+
add(part: PolyMesh, material: Material): void;
|
|
72
|
+
build(): MeshData;
|
|
73
|
+
}
|
|
74
|
+
/** A copy of `m` with only the groups `keep` accepts (vertices compacted, materials renumbered). */
|
|
75
|
+
export declare function pickGroups(m: MeshData, keep: (group: number) => boolean): MeshData;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MakeHuman-style morphing: macro parameters (gender, age, muscle, weight,
|
|
3
|
+
* height, proportions, ethnicity, breast) blend between a lattice of targets;
|
|
4
|
+
* detail sliders add individual targets on top.
|
|
5
|
+
*/
|
|
6
|
+
import type { AssetLibrary, Slider } from './assets';
|
|
7
|
+
import type { HumanParams } from './params';
|
|
8
|
+
/** Target name -> weight for the given parameters. */
|
|
9
|
+
export declare function targetWeights(p: HumanParams, sliders: Map<string, Slider>): Map<string, number>;
|
|
10
|
+
/** Morphed copy of all base-mesh coordinates (decimetres, MakeHuman space). */
|
|
11
|
+
export declare function applyTargets(lib: AssetLibrary, weights: Map<string, number>): Float32Array;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type TypedArray = Float32Array | Uint32Array | Uint16Array | Int16Array | Uint8Array;
|
|
2
|
+
export interface Pack<M = unknown> {
|
|
3
|
+
meta: M;
|
|
4
|
+
arrays: Record<string, TypedArray>;
|
|
5
|
+
}
|
|
6
|
+
export declare function encodePack(meta: unknown, arrays: Record<string, TypedArray>, gzip?: boolean): Uint8Array;
|
|
7
|
+
export declare function decodePack<M = unknown>(input: Uint8Array): Pack<M>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { Catalog } from './assets';
|
|
2
|
+
import type { RigType } from './rig/skeletons';
|
|
3
|
+
import { type CarryId } from './props/carry';
|
|
4
|
+
import { type VehicleChoice, type VehicleStyle } from './props/vehicles';
|
|
5
|
+
import { type WeaponId } from './props/weapons';
|
|
6
|
+
import { type EarringId, type FacialHairId, type Metal, type TattooId } from './looks';
|
|
7
|
+
import { type ExpressionId } from './face';
|
|
8
|
+
export declare const DETAILS: readonly ['low', 'medium', 'high'];
|
|
9
|
+
export type Detail = (typeof DETAILS)[number];
|
|
10
|
+
export interface HumanParams {
|
|
11
|
+
name: string;
|
|
12
|
+
seed: number;
|
|
13
|
+
gender: number;
|
|
14
|
+
age: number;
|
|
15
|
+
muscle: number;
|
|
16
|
+
weight: number;
|
|
17
|
+
height: number;
|
|
18
|
+
proportions: number;
|
|
19
|
+
african: number;
|
|
20
|
+
asian: number;
|
|
21
|
+
caucasian: number;
|
|
22
|
+
breastSize: number;
|
|
23
|
+
breastFirmness: number;
|
|
24
|
+
/** Detail sliders: slider id -> value (-1..1 bipolar, 0..1 unipolar). */
|
|
25
|
+
modifiers: Record<string, number>;
|
|
26
|
+
skin: string;
|
|
27
|
+
skinTint: string;
|
|
28
|
+
eyes: string;
|
|
29
|
+
eyebrows: string;
|
|
30
|
+
eyelashes: string;
|
|
31
|
+
/** MakeHuman hair id, a procedural style ('buzz', 'mohawk', 'cornrows', 'box_braids') or 'none'. */
|
|
32
|
+
hair: string;
|
|
33
|
+
hairTint: string;
|
|
34
|
+
/** Colour of procedural hairstyles (buzz cut, spikes, braids). */
|
|
35
|
+
hairColor: string;
|
|
36
|
+
facialHair: FacialHairId;
|
|
37
|
+
beardColor: string;
|
|
38
|
+
/** Tattoo designs (adults 18+ only; ignored for younger characters). */
|
|
39
|
+
tattoos: TattooId[];
|
|
40
|
+
tattooInk: string;
|
|
41
|
+
earrings: EarringId;
|
|
42
|
+
earringMetal: Metal;
|
|
43
|
+
/** MakeHuman outfit id, or 'none' to dress with separate pieces below. */
|
|
44
|
+
outfit: string;
|
|
45
|
+
/** Procedural top / bottom garment ids or 'none' (used when outfit is 'none'). 'none' top = shirtless/topless. */
|
|
46
|
+
top: string;
|
|
47
|
+
/** Procedural jacket worn over the top (used with separate pieces or an outfit set), or 'none'. */
|
|
48
|
+
jacket: string;
|
|
49
|
+
bottom: string;
|
|
50
|
+
/**
|
|
51
|
+
* Briefs under (or instead of) bottoms. Can be switched off for adult (18+)
|
|
52
|
+
* characters only; under-18 characters always keep them.
|
|
53
|
+
*/
|
|
54
|
+
underwear: boolean;
|
|
55
|
+
/** Procedural accessories (garment ids). */
|
|
56
|
+
accessories: string[];
|
|
57
|
+
/** Per-garment pattern / colour overrides. */
|
|
58
|
+
garmentStyles: Record<string, {
|
|
59
|
+
pattern?: string;
|
|
60
|
+
color?: string;
|
|
61
|
+
color2?: string;
|
|
62
|
+
}>;
|
|
63
|
+
/** MakeHuman shoes id, 'sandals', 'combat_boots' or 'none' (barefoot). */
|
|
64
|
+
shoes: string;
|
|
65
|
+
hat: string;
|
|
66
|
+
outfitTint: string;
|
|
67
|
+
detail: Detail;
|
|
68
|
+
rig: RigType;
|
|
69
|
+
/** Add jaw + eye bones (for facial animation). */
|
|
70
|
+
faceBones: boolean;
|
|
71
|
+
/** Bind pose: MakeHuman's natural A-pose, or a T-pose (Mixamo / Unity Humanoid style). */
|
|
72
|
+
restPose: 'A' | 'T';
|
|
73
|
+
/** Include the animation clips in GLB / FBX exports. */
|
|
74
|
+
animations: boolean;
|
|
75
|
+
/** Weapon held in the right hand (attached to the WeaponR socket). */
|
|
76
|
+
weapon: WeaponId;
|
|
77
|
+
/** A bag carried in the left hand. */
|
|
78
|
+
carry: CarryId;
|
|
79
|
+
/** Fitted vehicle prop, shown with compatible riding clips and exported separately. */
|
|
80
|
+
vehicle: VehicleChoice;
|
|
81
|
+
vehicleStyle: VehicleStyle;
|
|
82
|
+
/** Resting facial expression (applied in the viewer and in every exported clip). */
|
|
83
|
+
expression: ExpressionId;
|
|
84
|
+
/** Export facial blend shapes (expressions, blinking). Off: the expression is baked into the mesh. */
|
|
85
|
+
faceShapes: boolean;
|
|
86
|
+
/** With faceShapes: also export the speech mouth shapes (visemes) for lip-sync. */
|
|
87
|
+
speechShapes: boolean;
|
|
88
|
+
/** Teeth variant id or 'none'; the tongue sits behind them. */
|
|
89
|
+
teeth: string;
|
|
90
|
+
tongue: boolean;
|
|
91
|
+
}
|
|
92
|
+
export declare const DEFAULT_PARAMS: HumanParams;
|
|
93
|
+
/** MakeHuman age value <-> years. */
|
|
94
|
+
export declare function ageToYears(a: number): number;
|
|
95
|
+
export declare function yearsToAge(y: number): number;
|
|
96
|
+
export declare const PRESETS: Record<string, Partial<HumanParams>>;
|
|
97
|
+
/** Random but plausible human. Keeps output settings from `base`. */
|
|
98
|
+
export declare function randomParams(seed: number, cat: Catalog, base?: HumanParams): HumanParams;
|
|
99
|
+
/**
|
|
100
|
+
* Make untrusted params (e.g. from a shared link) safe to build: unknown keys are dropped,
|
|
101
|
+
* numbers are clamped, and enumerated options fall back to their defaults.
|
|
102
|
+
*/
|
|
103
|
+
export declare function sanitizeParams(raw: unknown, base?: HumanParams): HumanParams;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A bicycle for the Ride bicycle clip, built to fit the rider: the saddle sits under the hips, the
|
|
3
|
+
* grips under the hands and the crank at the centre of the pedalling circle, all measured from the
|
|
4
|
+
* clip on this character. Each frame the crank turns to follow the left foot and the wheels spin.
|
|
5
|
+
* Preview only (three.js); units are metres, the character faces +Z, +X is its left.
|
|
6
|
+
*/
|
|
7
|
+
import * as THREE from 'three';
|
|
8
|
+
import type { Animator } from '../anim/evaluate';
|
|
9
|
+
import type { Clip } from '../anim/clips';
|
|
10
|
+
import type { Vec3 } from '../math';
|
|
11
|
+
import type { Rig } from '../rig/rig';
|
|
12
|
+
import { type VehicleStyle } from './vehicles';
|
|
13
|
+
export declare const BICYCLE_CLIP = "ride_bicycle";
|
|
14
|
+
export declare class Bicycle {
|
|
15
|
+
private rig;
|
|
16
|
+
readonly group: THREE.Group<THREE.Object3DEventMap>;
|
|
17
|
+
private crank;
|
|
18
|
+
private wheels;
|
|
19
|
+
private crankCentre;
|
|
20
|
+
private lastAngle;
|
|
21
|
+
private wheelAngle;
|
|
22
|
+
constructor(rig: Rig, animator: Animator, clip: Clip, style?: VehicleStyle);
|
|
23
|
+
/** Follow the rider. An absolute wheel angle lets offline renderers seek without accumulating turns. */
|
|
24
|
+
update(pos: Vec3[], absoluteWheelAngle?: number): void;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type Pattern, type TexOut } from '../garments/textures';
|
|
2
|
+
import type { PolyMesh } from '../geometry';
|
|
3
|
+
import type { Vec3 } from '../math';
|
|
4
|
+
import type { Material } from '../mesh';
|
|
5
|
+
/**
|
|
6
|
+
* Bags: carried in the hand (built here), or worn (the backpack, a garment with slot 'bag', built
|
|
7
|
+
* with the clothes).
|
|
8
|
+
*/
|
|
9
|
+
export declare const CARRIED: readonly ['none', 'straw_tote', 'handbag', 'briefcase', 'backpack', 'parcel', 'parachute', 'head_load', 'phone', 'broom'];
|
|
10
|
+
export type CarryId = (typeof CARRIED)[number];
|
|
11
|
+
export declare const CARRY_LABELS: Record<CarryId, string>;
|
|
12
|
+
/** Bags worn on the body rather than carried in the hand. */
|
|
13
|
+
export declare const WORN_BAGS: readonly CarryId[];
|
|
14
|
+
export interface BagStyle {
|
|
15
|
+
pattern: Pattern;
|
|
16
|
+
color: string;
|
|
17
|
+
color2: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Finishes and colours offered for each bag carried in the hand (first finish = default), chosen
|
|
21
|
+
* like a garment's and kept in the params' `garmentStyles` under the bag's id.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CARRY_STYLES: Record<Exclude<CarryId, 'none' | 'backpack'>, {
|
|
24
|
+
patterns: Pattern[];
|
|
25
|
+
color: string;
|
|
26
|
+
color2: string;
|
|
27
|
+
colorLabels: [string, string];
|
|
28
|
+
}>;
|
|
29
|
+
/** A carried bag's style from the params' saved styles (falling back to its defaults). */
|
|
30
|
+
export declare function carryStyle(id: keyof typeof CARRY_STYLES, styles: Record<string, {
|
|
31
|
+
pattern?: string;
|
|
32
|
+
color?: string;
|
|
33
|
+
color2?: string;
|
|
34
|
+
}>): BagStyle;
|
|
35
|
+
export interface CarryPart {
|
|
36
|
+
mesh: PolyMesh;
|
|
37
|
+
material: Material;
|
|
38
|
+
}
|
|
39
|
+
/** Reference dimensions: matches the two-hand interaction grip (metres at 1.8 m height). */
|
|
40
|
+
export declare const PARCEL_SIZE: Vec3;
|
|
41
|
+
export declare const PARCEL_REST: Vec3;
|
|
42
|
+
/**
|
|
43
|
+
* Head load: an enamel basin heaped with round produce on a rolled cloth pad. Metres at 1.8 m height, origin at
|
|
44
|
+
* the crown of the head (+Y up). HEAD_LOAD_RIM is the rim the steadying hand rests on: [radius, height].
|
|
45
|
+
*/
|
|
46
|
+
export declare const HEAD_LOAD_RIM: [number, number];
|
|
47
|
+
export declare function headLoad(st: BagStyle): CarryPart[];
|
|
48
|
+
/**
|
|
49
|
+
* Smartphone on its own prop joint, centred on the origin: screen facing +X, width along Y, top towards +Z.
|
|
50
|
+
* A rounded-rectangle body with a metal frame, black glass front with the display inset, and a camera module
|
|
51
|
+
* on the back near the top.
|
|
52
|
+
*/
|
|
53
|
+
export declare const PHONE_SIZE: Vec3;
|
|
54
|
+
/**
|
|
55
|
+
* Broom on its own prop joint: origin at the bristle tips on the floor, handle rising along +Y. The animator
|
|
56
|
+
* lays it through both hands while sweeping.
|
|
57
|
+
*/
|
|
58
|
+
export declare const BROOM_LENGTH = 1.42;
|
|
59
|
+
/** Rest scale of the phone and broom: packed out of sight inside the hips until a clip shows them (as the parachute canopy). */
|
|
60
|
+
export declare const PROP_REST = 0.001;
|
|
61
|
+
/** Registers a generated texture and returns its file name (see GCtx.texture). */
|
|
62
|
+
export type TextureFn = (key: string, make: () => TexOut) => {
|
|
63
|
+
map: string;
|
|
64
|
+
normalMap?: string;
|
|
65
|
+
alpha: boolean;
|
|
66
|
+
};
|
|
67
|
+
export declare function buildCarry(id: CarryId, texture: TextureFn, styles: Parameters<typeof carryStyle>[1]): CarryPart[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Shared cabin coordinates in anatomical metres; +Z is the nose and +X the left side. */
|
|
2
|
+
export declare const HELICOPTER: {
|
|
3
|
+
readonly centerX: 0.43;
|
|
4
|
+
readonly width: 2.1;
|
|
5
|
+
readonly deck: 0.52;
|
|
6
|
+
readonly seatPitch: 0.94;
|
|
7
|
+
readonly seatWidth: 0.86;
|
|
8
|
+
readonly standRight: -1.3;
|
|
9
|
+
readonly standLeft: 2.16;
|
|
10
|
+
readonly rotorRadius: 3.45;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The horse's working trot. The rider clip and the horse share it so the saddle and seat rise and fall together. */
|
|
2
|
+
export declare const TROT: {
|
|
3
|
+
readonly duration: 0.8;
|
|
4
|
+
readonly duty: 0.42;
|
|
5
|
+
readonly speed: 1.6;
|
|
6
|
+
readonly bob: 0.026;
|
|
7
|
+
};
|
|
8
|
+
/** Height change of the horse's back (in rider-height units), zero at the start of the loop so mounting lines up. */
|
|
9
|
+
export declare function trotBob(time: number): number;
|
|
10
|
+
/** Nose-up pitch (radians) as each diagonal pushes off. */
|
|
11
|
+
export declare function trotPitch(time: number): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CarryPart, BagStyle } from './carry';
|
|
2
|
+
import type { Vec3 } from '../math';
|
|
3
|
+
export declare const PACKED_CANOPY = 0.002;
|
|
4
|
+
export declare const CANOPY_WIDTH = 5.4;
|
|
5
|
+
export declare const canopyPoint: (x: number, z: number) => Vec3;
|
|
6
|
+
export declare const SUSPENSION_ANCHORS: Vec3[];
|
|
7
|
+
export declare function parachutePack(centre: Vec3, width: number, scale: number, style: BagStyle, harness?: Vec3[][]): CarryPart[];
|
|
8
|
+
/**
|
|
9
|
+
* Webbing paths fitted around the clothed torso (metres, bind pose): on each side a strap rises up
|
|
10
|
+
* the chest, arcs over the shoulder and runs down the back into the pack, plus a chest strap.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parachuteHarness(P: Float32Array, level: number, k: number): Vec3[][];
|
|
13
|
+
export declare function parachuteCanopy(style: BagStyle): CarryPart[];
|
|
14
|
+
export declare function parachuteLine(): CarryPart;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage props: a ladder, a vault obstacle, a ledge wall and low cover, built to the dimensions the clips are authored
|
|
3
|
+
* against (scaled to the character). The clips play the same with or without them; the builder and Studio can show
|
|
4
|
+
* them and the export can include them as separate prop files.
|
|
5
|
+
*/
|
|
6
|
+
import * as T from 'three';
|
|
7
|
+
import { type StageProp } from '../anim/stage';
|
|
8
|
+
import type { MeshData } from '../mesh';
|
|
9
|
+
export { STAGE_PROP_LABELS, stagePropFor, type StageProp } from '../anim/stage';
|
|
10
|
+
/**
|
|
11
|
+
* The prop in the character's starting frame (metres). The preview ladder reaches below the floor so its rungs can
|
|
12
|
+
* scroll past a character climbing in place; the exported ladder stands on the floor.
|
|
13
|
+
*/
|
|
14
|
+
export declare function stagePropModel(prop: StageProp, scale: number, preview?: boolean, ahead?: number): T.Group;
|
|
15
|
+
/** Preview prop for a clip, or undefined for clips without one. */
|
|
16
|
+
export declare function stageScenery(clipId: string, scale: number): T.Group | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Where the prop sits at clip time `t`. With root motion the body travels and the prop stays put; played in
|
|
19
|
+
* place, the prop moves the other way so every hand and foot stays on it. A ladder wraps every rung spacing.
|
|
20
|
+
*/
|
|
21
|
+
export declare function placeStageProp(g: T.Group, travel: [number, number, number] | undefined, t: number, scale: number, rootMotion: boolean): void;
|
|
22
|
+
/** The prop as a static export mesh, origin at the character's position (for cover, where Cover idle plays). */
|
|
23
|
+
export declare function stagePropMesh(prop: StageProp, scale: number): MeshData;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Rig } from '../rig/rig';
|
|
2
|
+
/** Anatomical height, excluding the game rig's extrapolated HeadTop_End tail. */
|
|
3
|
+
export declare function boardingScale(rig: Rig): number;
|
|
4
|
+
export declare const VEHICLE_TRANSITIONS: readonly [readonly ['bicycle', 'ride_bicycle', 'bicycle', 1.6], readonly ['car', 'drive_car', 'convertible (driver)', 1.8], readonly ['car_passenger', 'sit_passenger', 'convertible (passenger)', 1.8], readonly ['sports_car', 'drive_sports_car', 'sports car (driver)', 2], readonly ['sports_car_passenger', 'sit_sports_car_passenger', 'sports car (passenger)', 2], readonly ['suv', 'drive_suv', 'SUV (driver)', 2.1], readonly ['suv_passenger', 'sit_suv_passenger', 'SUV (passenger)', 2.1], readonly ['motorcycle', 'ride_motorcycle', 'motorcycle', 1.7], readonly ['horse', 'ride_horse', 'horse', 2.2], readonly ['canoe', 'paddle_canoe', 'canoe', 1.9], readonly ['kayak', 'paddle_kayak', 'kayak', 2.1], readonly ['rowboat', 'row_boat', 'rowing boat', 1.9], readonly ['motorboat', 'drive_boat', 'motorboat', 2], readonly ['pickup', 'drive_pickup', 'pickup (driver)', 2.1], readonly ['pickup_passenger', 'sit_pickup_passenger', 'pickup (passenger)', 2.1], readonly ['tank', 'drive_tank', 'tank', 4.2], readonly ['jet', 'fly_jet', 'jet cockpit', 2.8], readonly ['helicopter', 'fly_helicopter', 'helicopter', 2.2]];
|
|
5
|
+
export interface VehicleTransition {
|
|
6
|
+
ride: string;
|
|
7
|
+
direction: 'board' | 'alight';
|
|
8
|
+
}
|
|
9
|
+
export declare const TRANSITION_BY_CLIP: Readonly<Record<string, VehicleTransition>>;
|
|
10
|
+
export declare const VEHICLE_STUNTS: readonly [readonly ['bicycle', 'ride_bicycle'], readonly ['car', 'drive_car'], readonly ['sports_car', 'drive_sports_car'], readonly ['suv', 'drive_suv'], readonly ['pickup', 'drive_pickup'], readonly ['motorcycle', 'ride_motorcycle'], readonly ['tank', 'drive_tank'], readonly ['canoe', 'paddle_canoe'], readonly ['kayak', 'paddle_kayak'], readonly ['rowboat', 'row_boat'], readonly ['motorboat', 'drive_boat'], readonly ['helicopter', 'fly_helicopter'], readonly ['jet', 'fly_jet']];
|
|
11
|
+
export declare const STUNT_BY_CLIP: Readonly<Record<string, {
|
|
12
|
+
ride: string;
|
|
13
|
+
model: string;
|
|
14
|
+
}>>;
|
|
15
|
+
export declare const ridingClip: (id: string) => string;
|
|
16
|
+
/** Stand beside the appropriate door, saddle or gunwale, facing the vehicle's heading. */
|
|
17
|
+
export declare function boardingStand(ride: string): [number, number];
|
|
18
|
+
export declare const boardProgress: (transition: VehicleTransition, time: number, duration: number) => number;
|
|
19
|
+
export declare const doorOpenAt: (p: number) => number;
|
|
20
|
+
/** Roof height of the enclosed tank hull: just clear of the seated driver's head. */
|
|
21
|
+
export declare const tankRoof: (headTop: number, scale: number) => number;
|
|
22
|
+
/** The tank's roof hatch opens once the driver is on the hull and closes after they are seated inside. */
|
|
23
|
+
export declare const hatchOpenAt: (p: number) => number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { VehicleKit } from './vehicle-kit';
|
|
2
|
+
import { VEHICLE_BODIES, BODY_BASE, type VehicleBody } from './vehicles';
|
|
3
|
+
export { VEHICLE_BODIES, BODY_BASE, type VehicleBody };
|
|
4
|
+
/** Builders for each body; the saloon and muscle car are variants of the covered car. */
|
|
5
|
+
export declare function buildBody(k: VehicleKit, body: VehicleBody): void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Geometry toolkit and measured rider contacts shared by every vehicle. No renderer or DOM. */
|
|
2
|
+
import * as T from 'three';
|
|
3
|
+
import { Animator, type Frame } from '../anim/evaluate';
|
|
4
|
+
import type { Clip } from '../anim/clips';
|
|
5
|
+
import type { Rig } from '../rig/rig';
|
|
6
|
+
import { type VehicleId, type VehicleStyle } from './vehicles';
|
|
7
|
+
export type V = T.Vector3;
|
|
8
|
+
export declare const v: (x?: number, y?: number, z?: number) => T.Vector3;
|
|
9
|
+
export interface Contacts {
|
|
10
|
+
headTop: V;
|
|
11
|
+
hip: V;
|
|
12
|
+
left: V;
|
|
13
|
+
right: V;
|
|
14
|
+
footLeft: V;
|
|
15
|
+
footRight: V;
|
|
16
|
+
kneeLeft: V;
|
|
17
|
+
kneeRight: V;
|
|
18
|
+
chest: T.Quaternion;
|
|
19
|
+
}
|
|
20
|
+
export declare class RiderFit {
|
|
21
|
+
readonly rig: Rig;
|
|
22
|
+
readonly animator: Animator;
|
|
23
|
+
readonly clip: Clip;
|
|
24
|
+
readonly id: VehicleId;
|
|
25
|
+
readonly scale: number;
|
|
26
|
+
readonly lift: number;
|
|
27
|
+
readonly samples: Contacts[];
|
|
28
|
+
constructor(rig: Rig, animator: Animator, clip: Clip, id: VehicleId);
|
|
29
|
+
at(time: number): Contacts;
|
|
30
|
+
fromFrame(f: Frame): Contacts;
|
|
31
|
+
average(key: 'hip' | 'left' | 'right' | 'footLeft' | 'footRight'): T.Vector3;
|
|
32
|
+
}
|
|
33
|
+
export declare class VehicleKit {
|
|
34
|
+
readonly style: VehicleStyle;
|
|
35
|
+
readonly fit: RiderFit;
|
|
36
|
+
readonly group: T.Group<T.Object3DEventMap>;
|
|
37
|
+
readonly paint: T.MeshStandardMaterial;
|
|
38
|
+
readonly trim: T.MeshStandardMaterial;
|
|
39
|
+
readonly seat: T.MeshStandardMaterial;
|
|
40
|
+
readonly rubber: T.MeshStandardMaterial;
|
|
41
|
+
readonly dark: T.MeshStandardMaterial;
|
|
42
|
+
readonly glass: T.MeshPhysicalMaterial;
|
|
43
|
+
readonly light: T.MeshStandardMaterial;
|
|
44
|
+
/** Shared tail and brake lamps; Vehicle.setLights brightens them under braking. */
|
|
45
|
+
readonly tail: T.MeshStandardMaterial;
|
|
46
|
+
readonly updates: ((c: Contacts, time: number) => void)[];
|
|
47
|
+
constructor(style: VehicleStyle, fit: RiderFit);
|
|
48
|
+
mesh(geo: T.BufferGeometry, mat: T.Material, parent?: T.Object3D): T.Mesh<T.BufferGeometry<T.NormalBufferAttributes, T.BufferGeometryEventMap>, T.Material<T.MaterialEventMap>, T.Object3DEventMap>;
|
|
49
|
+
box(p: V, size: V, mat: T.Material, parent?: T.Object3D): T.Mesh<T.BufferGeometry<T.NormalBufferAttributes, T.BufferGeometryEventMap>, T.Material<T.MaterialEventMap>, T.Object3DEventMap>;
|
|
50
|
+
ellipsoid(p: V, size: V, mat: T.Material, parent?: T.Object3D): T.Mesh<T.BufferGeometry<T.NormalBufferAttributes, T.BufferGeometryEventMap>, T.Material<T.MaterialEventMap>, T.Object3DEventMap>;
|
|
51
|
+
tube(a: V, b: V, r: number, mat: T.Material, parent?: T.Object3D): T.Mesh<T.BufferGeometry<T.NormalBufferAttributes, T.BufferGeometryEventMap>, T.Material<T.MaterialEventMap>, T.Object3DEventMap>;
|
|
52
|
+
component(name: string, position?: T.Vector3, parent?: T.Object3D): T.Group<T.Object3DEventMap>;
|
|
53
|
+
/** A tyre with a flat tread, rounded shoulders and bulging sidewalls, turned about the axle (X). */
|
|
54
|
+
tyre(r: number, width: number, parent: T.Object3D): T.Mesh<T.BufferGeometry<T.NormalBufferAttributes, T.BufferGeometryEventMap>, T.Material<T.MaterialEventMap>, T.Object3DEventMap>;
|
|
55
|
+
wheel(name: string, p: V, r: number, width: number, spokes?: boolean | 'alloy', parent?: T.Object3D): T.Group<T.Object3DEventMap>;
|
|
56
|
+
steering(radius: number, tilt: number, offset?: T.Vector3): T.Group<T.Object3DEventMap>;
|
|
57
|
+
/** A steering column from a fixed mount on the body to the hub of a steering wheel that follows the hands. */
|
|
58
|
+
column(anchor: V, steering: T.Object3D, r: number, mat: T.Material): T.Group<T.Object3DEventMap>;
|
|
59
|
+
dispose(): void;
|
|
60
|
+
}
|
|
61
|
+
export declare function raceNumber(k: VehicleKit, n: number, size: number, mat: T.Material): T.Group<T.Object3DEventMap>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clip-authored vehicle manoeuvres: runway, flight, bail-out and gunner actions. Renderer-free, shared by
|
|
3
|
+
* the builder preview, exports and Studio. The builder and exports play the motion baked into the clip;
|
|
4
|
+
* Studio flies the aircraft along the film's own route and height instead.
|
|
5
|
+
*/
|
|
6
|
+
import { type Q } from '../anim/quat';
|
|
7
|
+
import type { Vec3 } from '../math';
|
|
8
|
+
export type ManoeuvreKind = 'taxi' | 'takeoff' | 'land' | 'bailout' | 'gun' | 'crash';
|
|
9
|
+
/** Road vehicles a driver can dive out of as they crash. */
|
|
10
|
+
export declare const CRASH_VEHICLES: readonly [readonly ['car', 'drive_car'], readonly ['sports_car', 'drive_sports_car'], readonly ['suv', 'drive_suv'], readonly ['pickup', 'drive_pickup'], readonly ['motorcycle', 'ride_motorcycle'], readonly ['bicycle', 'ride_bicycle']];
|
|
11
|
+
export declare const VEHICLE_MANOEUVRES: Readonly<Record<string, {
|
|
12
|
+
ride: string;
|
|
13
|
+
kind: ManoeuvreKind;
|
|
14
|
+
}>>;
|
|
15
|
+
export declare const manoeuvre: (clip: string) => ManoeuvreKind;
|
|
16
|
+
/** Default speeds in metres per second. */
|
|
17
|
+
export declare const JET_SPEED = 18, TAXI_SPEED = 8;
|
|
18
|
+
/** Builder/export heights; Studio uses the film's flight height. */
|
|
19
|
+
export declare const DEMO_ALTITUDE = 2.5, BAILOUT_ALTITUDE = 4.5;
|
|
20
|
+
/**
|
|
21
|
+
* Seconds of full-speed travel covered after `local` seconds of a beat. Take-off accelerates from a
|
|
22
|
+
* standstill to cruise over its ground roll; landing holds approach speed, then brakes to a stop.
|
|
23
|
+
*/
|
|
24
|
+
export declare function travelTime(clip: string, local: number, duration: number): number;
|
|
25
|
+
/** Take-off climbs after its ground roll; landing descends to touchdown at 60%, then rolls out. */
|
|
26
|
+
export declare function jetHeight(clip: string, u: number, cruise: number): number;
|
|
27
|
+
export interface FlightState {
|
|
28
|
+
pitch: number;
|
|
29
|
+
roll: number;
|
|
30
|
+
bob: number;
|
|
31
|
+
retract: number;
|
|
32
|
+
throttle: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* How a flown jet sits: pitch follows the flight path (radians) plus a little angle of attack, wings bank a
|
|
36
|
+
* beat behind fly_jet's six-second stick cycle (`phase` seconds), and the gear folds once clear of the ground.
|
|
37
|
+
*/
|
|
38
|
+
export declare function jetFlightState(clip: string, u: number, phase: number, time: number, height: number, path: number, moving: boolean): FlightState;
|
|
39
|
+
export interface VehicleMotion {
|
|
40
|
+
rotation: Q;
|
|
41
|
+
translation: Vec3;
|
|
42
|
+
retract: number;
|
|
43
|
+
throttle: number;
|
|
44
|
+
distance: number;
|
|
45
|
+
}
|
|
46
|
+
/** Pitch and bank about the main-gear contact (`pivotZ`), then lift and bob. */
|
|
47
|
+
export declare function attitudeMotion(s: FlightState, height: number, pivotZ: number, distance?: number): VehicleMotion;
|
|
48
|
+
/**
|
|
49
|
+
* Builder/export motion of the rider and aircraft together for jet clips, played in place: the wheels turn
|
|
50
|
+
* with the distance a film would cover, the jet lifts to a demonstration height and pitches with its climb.
|
|
51
|
+
* Bail-outs hold the aircraft at a safe height while the occupant leaves it.
|
|
52
|
+
*/
|
|
53
|
+
export declare function clipVehicleMotion(clip: string, time: number, duration: number, pivotZ: number): VehicleMotion | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* How far the aircraft has pulled ahead of a bailing occupant (metres along the heading). The jet keeps flying
|
|
56
|
+
* once the pilot is out; the helicopter holds its hover.
|
|
57
|
+
*/
|
|
58
|
+
export declare function bailoutDrift(clip: string, time: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* Bail-out paths (seconds; metres scaled to the rider): out through the open (right, -X) side, up and clear of the
|
|
61
|
+
* airframe, then turning belly-down into free fall. The last values are where free fall continues.
|
|
62
|
+
*/
|
|
63
|
+
export declare const BAILOUT_PATHS: Readonly<Record<string, {
|
|
64
|
+
T: number[];
|
|
65
|
+
x: number[];
|
|
66
|
+
lift: number[];
|
|
67
|
+
pitch: number[];
|
|
68
|
+
pose: [number, number];
|
|
69
|
+
}>>;
|
|
70
|
+
/**
|
|
71
|
+
* Crash escape (seconds; metres scaled to the rider): turn to the driver's door, dive out to the left (+X),
|
|
72
|
+
* shoulder-roll along the ground and stand, turning back to face the original heading.
|
|
73
|
+
*/
|
|
74
|
+
export declare const CRASH_PATH: {
|
|
75
|
+
T: number[];
|
|
76
|
+
x: number[];
|
|
77
|
+
yaw: number[];
|
|
78
|
+
pitch: number[];
|
|
79
|
+
drop: number[];
|
|
80
|
+
y: number[];
|
|
81
|
+
floor: number[];
|
|
82
|
+
};
|
|
83
|
+
export declare const CRASH_DURATION = 3.6;
|
|
84
|
+
/**
|
|
85
|
+
* Crash and fall down: thrown out of the driver's door, twisting in the air, landing hard and tumbling onto
|
|
86
|
+
* the back, ending in Get up (from back)'s starting pose about 3 m to the left.
|
|
87
|
+
*/
|
|
88
|
+
export declare const CRASH_FALL_PATH: {
|
|
89
|
+
T: number[];
|
|
90
|
+
x: number[];
|
|
91
|
+
y: number[];
|
|
92
|
+
yaw: number[];
|
|
93
|
+
pitch: number[];
|
|
94
|
+
drop: number[];
|
|
95
|
+
z: number[];
|
|
96
|
+
floor: number[];
|
|
97
|
+
};
|
|
98
|
+
export declare const CRASH_FALL_DURATION = 3.4;
|
|
99
|
+
/** Where the occupant ends after leaving a vehicle mid-action: [x scaled to the rider, metres behind it, height change]. */
|
|
100
|
+
export declare const vehicleExit: (clip: string, duration: number) => {
|
|
101
|
+
x: number;
|
|
102
|
+
lift: number;
|
|
103
|
+
behind: number;
|
|
104
|
+
} | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Shared rigid transform: both rider and prop roll about the same longitudinal axis. */
|
|
2
|
+
import type { Vec3 } from '../math';
|
|
3
|
+
import { type Q } from '../anim/quat';
|
|
4
|
+
export declare function vehicleStunt(model: string, time: number, duration: number, scale: number): {
|
|
5
|
+
rotation: Q;
|
|
6
|
+
translation: Vec3;
|
|
7
|
+
pivot: Vec3;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The empty vehicle after its driver dives out: it slides on, then rolls one and a half times away from the
|
|
11
|
+
* driver's side and comes to rest upside down. Shares the stunt roll's ground clearance.
|
|
12
|
+
*/
|
|
13
|
+
export declare function vehicleCrash(model: string, time: number, scale: number): {
|
|
14
|
+
rotation: Q;
|
|
15
|
+
translation: Vec3;
|
|
16
|
+
};
|