@adatechnology/game-characters-three 0.8.0 → 0.8.1
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/dist/{chunk-3CHBEUHW.js → chunk-XSMP7T6O.js} +32 -79
- package/dist/chunk-XSMP7T6O.js.map +1 -0
- package/dist/index.d.ts +106 -63
- package/dist/index.global.js +1071 -132
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{testing-DyQw8dCw.d.ts → testing-CsC-BhNN.d.ts} +205 -3
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-3CHBEUHW.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Vec3, DestructionEvent, SoundRequest, TestableModule, HandTargets } from '@adatechnology/game-contracts';
|
|
2
2
|
import * as THREE_NS from 'three';
|
|
3
|
-
import { CascadeJoint, RestPose, StrideParams, GaitSample, lerpPose, GaitProfile, CharacterKit, CharacterPack, CharacterSpec, DamageCharacter, BodyHit, PoseClipEvent, PoseClip, PoseClipRegistry } from '@adatechnology/game-characters';
|
|
3
|
+
import { CascadeJoint, RestPose, StrideParams, GaitSample, lerpPose, GaitProfile, HairStyle, MoveBlend, CharacterKit, CharacterPack, CharacterSpec, DamageCharacter, BodyHit, PoseClipEvent, PoseClip, PoseClipRegistry } from '@adatechnology/game-characters';
|
|
4
|
+
import { SourceHandle } from '@adatechnology/game-render-three';
|
|
4
5
|
|
|
5
6
|
/** The three.js namespace the host passes in: the package never imports three itself, so one script tag works. */
|
|
6
7
|
type Three = typeof THREE_NS;
|
|
@@ -85,6 +86,207 @@ type RigAnimator = {
|
|
|
85
86
|
*/
|
|
86
87
|
declare const createRigAnimator: (options?: RigAnimatorOptions) => RigAnimator;
|
|
87
88
|
|
|
89
|
+
/** A clothing or gear entry: its id and, for the ones that take it, a colour. */
|
|
90
|
+
type PersonExtra = readonly [id: string, color?: number, ...more: number[]];
|
|
91
|
+
/** A survivor as the page describes one (`sp`): colours are hex numbers, the short names are the page's. */
|
|
92
|
+
type PersonSpec = {
|
|
93
|
+
/** Height scale (default 1). */
|
|
94
|
+
readonly h?: number;
|
|
95
|
+
/** Width scale (default 1). */
|
|
96
|
+
readonly bulk?: number;
|
|
97
|
+
/** Female body. */
|
|
98
|
+
readonly fem?: boolean | number;
|
|
99
|
+
readonly skin: number;
|
|
100
|
+
readonly hair: {
|
|
101
|
+
readonly s: string;
|
|
102
|
+
readonly c: number;
|
|
103
|
+
};
|
|
104
|
+
/** Top: colour, plaid colour (a checked shirt) and sleeve (`tank`, `short`, `long`). */
|
|
105
|
+
readonly top: {
|
|
106
|
+
readonly c: number;
|
|
107
|
+
readonly plaid?: number;
|
|
108
|
+
readonly sl?: string;
|
|
109
|
+
};
|
|
110
|
+
readonly pants: {
|
|
111
|
+
readonly c: number;
|
|
112
|
+
readonly skirt?: boolean;
|
|
113
|
+
};
|
|
114
|
+
readonly shoes: number;
|
|
115
|
+
readonly ex?: readonly PersonExtra[];
|
|
116
|
+
/** Face features by id (beard, glasses, scar...). */
|
|
117
|
+
readonly face?: readonly string[];
|
|
118
|
+
/** Hat kind and colour; a helmet can carry tape (its colour), a photo and night vision goggles. */
|
|
119
|
+
readonly hat?: {
|
|
120
|
+
readonly k: string;
|
|
121
|
+
readonly c: number;
|
|
122
|
+
readonly tape?: number;
|
|
123
|
+
readonly photo?: boolean | number;
|
|
124
|
+
readonly nvg?: boolean | number;
|
|
125
|
+
};
|
|
126
|
+
/** Weapon on the back (`shotgun`). */
|
|
127
|
+
readonly back?: string;
|
|
128
|
+
/** Item in the right and in the left hand. */
|
|
129
|
+
readonly hand?: string;
|
|
130
|
+
readonly lhand?: string;
|
|
131
|
+
/** A dog at the person's side. */
|
|
132
|
+
readonly dog?: boolean | number;
|
|
133
|
+
/** Resting forward lean (radians). */
|
|
134
|
+
readonly hunch?: number;
|
|
135
|
+
};
|
|
136
|
+
/** A household as the page lists it: the adult (`b`) and the children, each at its `x`. */
|
|
137
|
+
type PersonGroupSpec = {
|
|
138
|
+
readonly b?: PersonSpec;
|
|
139
|
+
readonly kid?: boolean | number;
|
|
140
|
+
/** Zombie category (eye colour). */
|
|
141
|
+
readonly zcat?: string;
|
|
142
|
+
readonly kids?: ReadonlyArray<PersonSpec & {
|
|
143
|
+
readonly x: number;
|
|
144
|
+
}>;
|
|
145
|
+
};
|
|
146
|
+
type ArmRig = {
|
|
147
|
+
g: THREE_NS.Group;
|
|
148
|
+
el: THREE_NS.Group;
|
|
149
|
+
hg: THREE_NS.Group;
|
|
150
|
+
mount: THREE_NS.Group;
|
|
151
|
+
/** Side: 1 right, -1 left. */
|
|
152
|
+
s: number;
|
|
153
|
+
fingers: THREE_NS.Group[];
|
|
154
|
+
th: THREE_NS.Group | null;
|
|
155
|
+
/** Holds an item. */
|
|
156
|
+
hold?: boolean;
|
|
157
|
+
/** Two-handed grip. */
|
|
158
|
+
grip?: boolean;
|
|
159
|
+
};
|
|
160
|
+
type LegRig = {
|
|
161
|
+
g: THREE_NS.Group;
|
|
162
|
+
kn: THREE_NS.Group;
|
|
163
|
+
s: number;
|
|
164
|
+
};
|
|
165
|
+
/** One body segment a hit or a cut can reach. */
|
|
166
|
+
type BodySegment = {
|
|
167
|
+
node?: THREE_NS.Object3D;
|
|
168
|
+
label: string;
|
|
169
|
+
hp: number;
|
|
170
|
+
max?: number;
|
|
171
|
+
state?: string;
|
|
172
|
+
r?: number;
|
|
173
|
+
flip?: number;
|
|
174
|
+
arm?: number;
|
|
175
|
+
leg?: number;
|
|
176
|
+
kind?: string;
|
|
177
|
+
};
|
|
178
|
+
/** A built survivor: the scene graph and the rig `pose` moves. */
|
|
179
|
+
type PersonCharacter = {
|
|
180
|
+
/** Lights the person's items took from the host's LightBudget (the flare); whoever removes the person releases them. */
|
|
181
|
+
lightSources: SourceHandle[];
|
|
182
|
+
mv: MoveBlend;
|
|
183
|
+
phase: number;
|
|
184
|
+
turnA: number;
|
|
185
|
+
segs: Record<string, BodySegment>;
|
|
186
|
+
dmg: {
|
|
187
|
+
leg: number;
|
|
188
|
+
dead: number;
|
|
189
|
+
};
|
|
190
|
+
pends: unknown[];
|
|
191
|
+
limp: [number, number];
|
|
192
|
+
skirt: boolean;
|
|
193
|
+
root: THREE_NS.Group;
|
|
194
|
+
fig: THREE_NS.Group;
|
|
195
|
+
upper: THREE_NS.Group;
|
|
196
|
+
headG: THREE_NS.Group;
|
|
197
|
+
arms: ArmRig[];
|
|
198
|
+
legs: LegRig[];
|
|
199
|
+
skinM: THREE_NS.MeshStandardMaterial;
|
|
200
|
+
base: THREE_NS.Color;
|
|
201
|
+
eyeM: THREE_NS.MeshBasicMaterial;
|
|
202
|
+
bags: THREE_NS.Mesh<THREE_NS.BufferGeometry, THREE_NS.MeshBasicMaterial>;
|
|
203
|
+
zb: THREE_NS.Object3D[];
|
|
204
|
+
mouth: THREE_NS.Mesh;
|
|
205
|
+
dog: THREE_NS.Group | null;
|
|
206
|
+
hunch: number;
|
|
207
|
+
ph: number;
|
|
208
|
+
/** Drawn as a zombie. */
|
|
209
|
+
z?: boolean;
|
|
210
|
+
};
|
|
211
|
+
/** Where a Bestiário body is cut or torn (each flag draws a stump, a hole or a hanging part). */
|
|
212
|
+
type BestCuts = {
|
|
213
|
+
readonly legs?: boolean;
|
|
214
|
+
readonly gut?: boolean;
|
|
215
|
+
readonly flaps?: boolean;
|
|
216
|
+
readonly head?: boolean;
|
|
217
|
+
readonly blown?: boolean;
|
|
218
|
+
readonly jaw?: boolean;
|
|
219
|
+
readonly armR?: boolean;
|
|
220
|
+
readonly armL?: boolean;
|
|
221
|
+
readonly dangleR?: boolean;
|
|
222
|
+
readonly dangleL?: boolean;
|
|
223
|
+
readonly shoulderR?: boolean;
|
|
224
|
+
readonly shoulderL?: boolean;
|
|
225
|
+
};
|
|
226
|
+
/** The pose and the look switches of a Bestiário type: the base pose (`BEST` `BASE`) and what a type changes. Angles in radians. */
|
|
227
|
+
type BestPose = {
|
|
228
|
+
s?: number;
|
|
229
|
+
bulk?: number;
|
|
230
|
+
lean?: number;
|
|
231
|
+
armL?: number;
|
|
232
|
+
armR?: number;
|
|
233
|
+
elbL?: number;
|
|
234
|
+
elbR?: number;
|
|
235
|
+
legL?: number;
|
|
236
|
+
legR?: number;
|
|
237
|
+
kneeL?: number;
|
|
238
|
+
kneeR?: number;
|
|
239
|
+
headX?: number;
|
|
240
|
+
headZ?: number;
|
|
241
|
+
headFwd?: number;
|
|
242
|
+
drop?: number;
|
|
243
|
+
neck?: number;
|
|
244
|
+
armOut?: number;
|
|
245
|
+
noLegs?: boolean;
|
|
246
|
+
mouth?: boolean;
|
|
247
|
+
bloat?: boolean;
|
|
248
|
+
dim?: boolean;
|
|
249
|
+
nose?: boolean;
|
|
250
|
+
blind?: boolean;
|
|
251
|
+
wet?: boolean;
|
|
252
|
+
char?: boolean;
|
|
253
|
+
gore?: boolean;
|
|
254
|
+
};
|
|
255
|
+
/** A body of the Bestiário (`BEST.build(spec)`): the type by name and what varies. */
|
|
256
|
+
type BestSpec = {
|
|
257
|
+
/** Type name (`Lento`, `Corredor`, ...); unknown names draw the first card. */
|
|
258
|
+
readonly type?: string;
|
|
259
|
+
readonly pose?: BestPose;
|
|
260
|
+
/** 0 fresh to 3 rotten. */
|
|
261
|
+
readonly decay?: number;
|
|
262
|
+
/** 0 fresh-dead, 1 normal, 2 old. */
|
|
263
|
+
readonly life?: number;
|
|
264
|
+
readonly cut?: BestCuts;
|
|
265
|
+
readonly h?: number;
|
|
266
|
+
readonly bulk?: number;
|
|
267
|
+
readonly lying?: boolean;
|
|
268
|
+
readonly opacity?: number;
|
|
269
|
+
/** Outfit id (`policial`, `militar`, ...). */
|
|
270
|
+
readonly outfit?: string;
|
|
271
|
+
readonly seed?: number;
|
|
272
|
+
/** A baked crowd variant (see `drawAppearance`). */
|
|
273
|
+
readonly uniform?: boolean;
|
|
274
|
+
readonly clothIdx?: number;
|
|
275
|
+
readonly fem?: boolean;
|
|
276
|
+
readonly tone?: number;
|
|
277
|
+
readonly hs?: HairStyle;
|
|
278
|
+
readonly hair?: number;
|
|
279
|
+
/** A living person: human eyes and mouth, no blood. */
|
|
280
|
+
readonly human?: boolean;
|
|
281
|
+
readonly skin?: number;
|
|
282
|
+
readonly wounds?: number;
|
|
283
|
+
readonly eyeDim?: boolean;
|
|
284
|
+
readonly eye?: number;
|
|
285
|
+
readonly eyesOff?: boolean;
|
|
286
|
+
readonly bandage?: boolean;
|
|
287
|
+
readonly phase?: number;
|
|
288
|
+
};
|
|
289
|
+
|
|
88
290
|
/** The part of a fluid world the bridge needs; `FluidWorld` from `@adatechnology/game-fluids` has it. The package does not import the fluids packages. */
|
|
89
291
|
type BloodSink = {
|
|
90
292
|
splash(liquid: string, point: Vec3, liters: number, velocity?: Vec3): void;
|
|
@@ -422,7 +624,7 @@ declare const registerBodyMaterial: (world: {
|
|
|
422
624
|
}) => void;
|
|
423
625
|
|
|
424
626
|
/** The person builder's spec for a profession of the people pack (look and gear as numbers; the builder draws the rest). */
|
|
425
|
-
declare const personSpecOf: (profession: ProfessionCard) =>
|
|
627
|
+
declare const personSpecOf: (profession: ProfessionCard) => PersonSpec;
|
|
426
628
|
|
|
427
629
|
/**
|
|
428
630
|
* The eye the hands are seen from, given per call to `apply` (null or none is the body seen from outside: nothing changes). `reachBend` keeps the elbow bent where a hand is out of reach, the hand stopping
|
|
@@ -603,4 +805,4 @@ declare function createAvatarTestModule(options: AvatarTestOptions): TestableMod
|
|
|
603
805
|
};
|
|
604
806
|
};
|
|
605
807
|
|
|
606
|
-
export {
|
|
808
|
+
export { type VoiceMoment as $, type ArmRig as A, type BestSpec as B, type CharacterSound as C, type FilmSink as D, type FluidsBridgeOptions as E, type FluidsBridge as F, type HitPreset as G, HIT_PRESETS as H, PERSON_ITEM_PREFIX as I, PLAYER_SOUNDS as J, type PlayPoseOptions as K, type LegRig as L, type PlayerAvatarColors as M, type PlayerAvatarOptions as N, type PlayerAvatarSpec as O, type PersonSpec as P, type PoseTargets as Q, type RichRig as R, type ProfessionCard as S, type Three as T, type RigAnimator as U, type RigAnimatorOptions as V, UNDEAD_VOICES as W, UNDEAD_VOICE_SOURCES as X, type UndeadCard as Y, type UndeadLike as Z, type UndeadVoice as _, type BestPose as a, type VoiceStep as a0, type WoundSpray as a1, ZOMBIE_ITEM_PREFIX as a2, bloodLookOfAge as a3, createAvatarTestModule as a4, createCharacterSound as a5, createCharactersTestModule as a6, createFluidsBridge as a7, createPlayerAvatar as a8, createRigAnimator as a9, personSpecOf as aa, registerBodyMaterial as ab, type PersonCharacter as b, type PersonGroupSpec as c, type PersonExtra as d, type BloodLook as e, type AvatarItemUsePose as f, type AvatarViewMode as g, type ReachView as h, type PlayerAvatar as i, AVATAR_AREA_ID as j, type AreaContext as k, type AvatarEvent as l, type AvatarTestOptions as m, type AvatarUpdate as n, BODY_MATERIAL_DEF as o, BODY_SOUNDS as p, type BloodAge as q, type BloodLookOptions as r, type BloodSink as s, type BodySegment as t, type BodySoundRule as u, CHARACTERS_AREA_ID as v, type CharacterSoundOptions as w, type CharacterSoundSink as x, type CharacterSoundStyle as y, type CharactersTestOptions as z };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { j as AVATAR_AREA_ID, k as AreaContext, m as AvatarTestOptions, o as BODY_MATERIAL_DEF, v as CHARACTERS_AREA_ID, z as CharactersTestOptions, H as HIT_PRESETS, G as HitPreset, I as PERSON_ITEM_PREFIX, S as ProfessionCard, Y as UndeadCard, Z as UndeadLike, a2 as ZOMBIE_ITEM_PREFIX, a4 as createAvatarTestModule, a6 as createCharactersTestModule, aa as personSpecOf, ab as registerBodyMaterial } from './testing-CsC-BhNN.js';
|
|
2
2
|
import '@adatechnology/game-contracts';
|
|
3
3
|
import 'three';
|
|
4
4
|
import '@adatechnology/game-characters';
|
|
5
|
+
import '@adatechnology/game-render-three';
|
package/dist/testing.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adatechnology/game-characters-three",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "three.js presentation for @adatechnology/game-characters: the instanced crowd body (GPU animation, LOD, baking, variants, flying limbs) and the rich bodies (the Bestiário v17 builder, survivors with accessories and hands, the animator, wounds, eyes).",
|
|
6
6
|
"keywords": [
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@adatechnology/game-audio": "^0.
|
|
46
|
-
"@adatechnology/game-characters": "^0.2.
|
|
45
|
+
"@adatechnology/game-audio": "^0.5.0",
|
|
46
|
+
"@adatechnology/game-characters": "^0.2.9",
|
|
47
47
|
"@adatechnology/game-characters-people": "^0.4.1",
|
|
48
|
-
"@adatechnology/game-contracts": "^0.
|
|
48
|
+
"@adatechnology/game-contracts": "^0.23.0",
|
|
49
49
|
"@adatechnology/game-render-three": "^0.1.0",
|
|
50
|
-
"@adatechnology/game-shapes-three": "^0.3.
|
|
50
|
+
"@adatechnology/game-shapes-three": "^0.3.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"three": "^0.160.0"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vitest": "^3.2.4",
|
|
63
63
|
"@adatechnology/game-characters-undead": "^0.3.0",
|
|
64
64
|
"@adatechnology/game-kit-defaults": "^0.2.0",
|
|
65
|
-
"@adatechnology/game-test-room": "^0.
|
|
65
|
+
"@adatechnology/game-test-room": "^0.22.0",
|
|
66
66
|
"@adatechnology/golden-tool": "^0.0.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|