@adatechnology/game-characters-three 0.3.1 → 0.4.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/dist/index.d.ts CHANGED
@@ -1017,6 +1017,9 @@ declare const registerBodyMaterial: (world: {
1017
1017
  readonly materials: Map<string, unknown>;
1018
1018
  }) => void;
1019
1019
 
1020
+ /** The person builder's spec for a profession of the people pack (look and gear as numbers; the builder draws the rest). */
1021
+ declare const personSpecOf: (profession: ProfessionCard) => Record<string, any>;
1022
+
1020
1023
  /** The voice limiter group of the undead (`undead_voice`: five at once, one every 0.25 s, nearer than 40 m). */
1021
1024
  declare const UNDEAD_VOICE_GROUP = "undead_voice";
1022
1025
  /** The sounds of the game and of the art scene for the bodies, in one bank. */
@@ -1354,4 +1357,4 @@ type TwoBone = {
1354
1357
  */
1355
1358
  declare const solveTwoBone: (root: THREE_NS.Vector3, target: THREE_NS.Vector3, upper: number, lower: number, pole: THREE_NS.Vector3, out: TwoBone) => TwoBone;
1356
1359
 
1357
- export { AVATAR_AREA_ID, type AreaContext, type AvatarEvent, type AvatarItemUsePose, type AvatarTestOptions, type AvatarUpdate, BAKE_NEUTRAL_POSE, BODY_CHUNK, BODY_MATERIAL_DEF, BODY_SOUNDS, type BakeBuilders, type BakeSpec, type BakedBody, type BestBuilder, type BestBuilderOptions, type BestTypeCard, type BloodAge, type BloodLook, type BloodLookOptions, type BloodSink, type BodyBatch, type BodyBatchOptions, type BodyChunkOptions, type BodyInstance, type BodyJoints, type BodyMaterialParams, type BodySoundRule, type BodyVariant, type BuildInstancedBodyParams, CHARACTERS_AREA_ID, CHARACTER_SOUNDS, CHARACTER_SOUND_BANK, type CharacterSound, type CharacterSoundOptions, type CharacterSoundSink, type CharacterSoundStyle, type CharactersTestOptions, EXTRAS, type EyeOptions, type Eyes, FACE_FEATURES, FIRST_PERSON_BOB, FIRST_PERSON_COLORS, FIRST_PERSON_RIG, FIRST_PERSON_STANCES, type FilmSink, type FirstPersonArms, type FirstPersonArmsOptions, type FirstPersonArmsState, type FirstPersonBob, type FirstPersonColors, type FirstPersonEvent, type FirstPersonRig, type FluidsBridge, type FluidsBridgeOptions, type FlyingLimb, type FlyingLimbs, type FlyingLimbsOptions, type FlyingPiece, type FlyingPieces, type FlyingPiecesOptions, HAND_ITEMS, HATS, HIT_PRESETS, type HitPreset, LOD_BAKE, LOD_BATCH_CAPACITY, LOD_CASTS_SHADOW, LOD_DISTANCES, LOD_SEGMENTS, type LimbEffects, type LimbLaunch, PENDULUM, PERSON_ITEM_PREFIX, PLAYER_SOUNDS, type Pendulum, type PersonBuilder, type PersonBuilderOptions, type PlayPoseOptions, type PlayerAvatar, type PlayerAvatarColors, type PlayerAvatarOptions, type PlayerAvatarSpec, type PoseTargets, type ProfessionCard, type RestPose, type RichRig, type RigAnimator, type RigAnimatorOptions, type RoomAvatarLike, type StanceDef, type Three, type ToRoomAvatarOptions, type TwoBone, UNDEAD_VOICES, UNDEAD_VOICE_GROUP, UNDEAD_VOICE_SOURCES, type UndeadCard, type UndeadLike, type UndeadVoice, type VariantType, type VoiceMoment, type VoiceStep, type WoundBody, type WoundMaterials, type WoundNode, type WoundSpray, type Wounds, type WoundsOptions, ZOMBIE_ITEM_PREFIX, bakeBody, bakeVariants, blobGeometry, blobRadii, bloodLookOfAge, buildInstancedBody, createAvatarTestModule, createBestBuilder, createBodyBatch, createBodyChunk, createBodyMaterial, createCharacterSound, createCharactersTestModule, createEye, createFirstPersonArms, createFluidsBridge, createFlyingLimbs, createFlyingPieces, createGlowTexture, createPendulum, createPersonBuilder, createPlayerAvatar, createRigAnimator, createVariantBatches, createWoundMaterials, createWounds, exitWound, explodeChunks, findEyes, gouge, jointsOf, lodAt, makeCut, makeStump, registerBodyMaterial, ringWound, solveTwoBone, starGeometry, stepPendulum, toRoomAvatar, woundBodyOf, woundDecal };
1360
+ export { AVATAR_AREA_ID, type AreaContext, type AvatarEvent, type AvatarItemUsePose, type AvatarTestOptions, type AvatarUpdate, BAKE_NEUTRAL_POSE, BODY_CHUNK, BODY_MATERIAL_DEF, BODY_SOUNDS, type BakeBuilders, type BakeSpec, type BakedBody, type BestBuilder, type BestBuilderOptions, type BestTypeCard, type BloodAge, type BloodLook, type BloodLookOptions, type BloodSink, type BodyBatch, type BodyBatchOptions, type BodyChunkOptions, type BodyInstance, type BodyJoints, type BodyMaterialParams, type BodySoundRule, type BodyVariant, type BuildInstancedBodyParams, CHARACTERS_AREA_ID, CHARACTER_SOUNDS, CHARACTER_SOUND_BANK, type CharacterSound, type CharacterSoundOptions, type CharacterSoundSink, type CharacterSoundStyle, type CharactersTestOptions, EXTRAS, type EyeOptions, type Eyes, FACE_FEATURES, FIRST_PERSON_BOB, FIRST_PERSON_COLORS, FIRST_PERSON_RIG, FIRST_PERSON_STANCES, type FilmSink, type FirstPersonArms, type FirstPersonArmsOptions, type FirstPersonArmsState, type FirstPersonBob, type FirstPersonColors, type FirstPersonEvent, type FirstPersonRig, type FluidsBridge, type FluidsBridgeOptions, type FlyingLimb, type FlyingLimbs, type FlyingLimbsOptions, type FlyingPiece, type FlyingPieces, type FlyingPiecesOptions, HAND_ITEMS, HATS, HIT_PRESETS, type HitPreset, LOD_BAKE, LOD_BATCH_CAPACITY, LOD_CASTS_SHADOW, LOD_DISTANCES, LOD_SEGMENTS, type LimbEffects, type LimbLaunch, PENDULUM, PERSON_ITEM_PREFIX, PLAYER_SOUNDS, type Pendulum, type PersonBuilder, type PersonBuilderOptions, type PlayPoseOptions, type PlayerAvatar, type PlayerAvatarColors, type PlayerAvatarOptions, type PlayerAvatarSpec, type PoseTargets, type ProfessionCard, type RestPose, type RichRig, type RigAnimator, type RigAnimatorOptions, type RoomAvatarLike, type StanceDef, type Three, type ToRoomAvatarOptions, type TwoBone, UNDEAD_VOICES, UNDEAD_VOICE_GROUP, UNDEAD_VOICE_SOURCES, type UndeadCard, type UndeadLike, type UndeadVoice, type VariantType, type VoiceMoment, type VoiceStep, type WoundBody, type WoundMaterials, type WoundNode, type WoundSpray, type Wounds, type WoundsOptions, ZOMBIE_ITEM_PREFIX, bakeBody, bakeVariants, blobGeometry, blobRadii, bloodLookOfAge, buildInstancedBody, createAvatarTestModule, createBestBuilder, createBodyBatch, createBodyChunk, createBodyMaterial, createCharacterSound, createCharactersTestModule, createEye, createFirstPersonArms, createFluidsBridge, createFlyingLimbs, createFlyingPieces, createGlowTexture, createPendulum, createPersonBuilder, createPlayerAvatar, createRigAnimator, createVariantBatches, createWoundMaterials, createWounds, exitWound, explodeChunks, findEyes, gouge, jointsOf, lodAt, makeCut, makeStump, personSpecOf, registerBodyMaterial, ringWound, solveTwoBone, starGeometry, stepPendulum, toRoomAvatar, woundBodyOf, woundDecal };
@@ -84,6 +84,7 @@ var GameCharactersThree = (() => {
84
84
  lodAt: () => lodAt,
85
85
  makeCut: () => makeCut,
86
86
  makeStump: () => makeStump,
87
+ personSpecOf: () => personSpecOf,
87
88
  registerBodyMaterial: () => registerBodyMaterial,
88
89
  ringWound: () => ringWound,
89
90
  solveTwoBone: () => solveTwoBone,
@@ -1716,6 +1717,13 @@ var GameCharactersThree = (() => {
1716
1717
  legRBroken: 256,
1717
1718
  jaw: 512
1718
1719
  };
1720
+ var KIT_ORIGIN_KEY = "kitOrigin";
1721
+ function markKitOrigin(object2, origin) {
1722
+ const node = object2;
1723
+ node.userData = node.userData ?? {};
1724
+ node.userData[KIT_ORIGIN_KEY] = { ...origin };
1725
+ return object2;
1726
+ }
1719
1727
 
1720
1728
  // ../game-characters/dist/index.js
1721
1729
  var __defProp2 = Object.defineProperty;
@@ -5430,7 +5438,8 @@ var GameCharactersThree = (() => {
5430
5438
  root.userData.rig = rig;
5431
5439
  return root;
5432
5440
  }
5433
- return { build, TYPES, setLOD(k) {
5441
+ const marked = (...args) => markKitOrigin(build(...args), { owner: "game-characters-three", kind: "person" });
5442
+ return { build: marked, TYPES, setLOD(k) {
5434
5443
  LK = k;
5435
5444
  SEG = Math.max(5, Math.round(16 * k));
5436
5445
  }, topM: () => topM_ref };
@@ -6656,7 +6665,11 @@ var GameCharactersThree = (() => {
6656
6665
  chars.forEach((c) => pose(c, c.z, 0, 0));
6657
6666
  return { root, chars };
6658
6667
  }
6659
- return { build, pose, zombify, buildPerson };
6668
+ const mark = (c) => {
6669
+ markKitOrigin(c.root, { owner: "game-characters-three", kind: "person" });
6670
+ return c;
6671
+ };
6672
+ return { build: (sp, idx) => mark(build(sp, idx)), pose, zombify, buildPerson: (p2, zed) => mark(buildPerson(p2, zed)) };
6660
6673
  };
6661
6674
 
6662
6675
  // src/eyes.ts
@@ -9500,7 +9513,7 @@ var GameCharactersThree = (() => {
9500
9513
  const bob = { ...FIRST_PERSON_BOB, ...options.bob };
9501
9514
  const blendSeconds = options.blend ?? DEFAULT_BLEND;
9502
9515
  const clips = new Map((options.clips ?? []).map((clip) => [clip.id, clip]));
9503
- const root = new THREE.Group();
9516
+ const root = markKitOrigin(new THREE.Group(), { owner: "game-characters-three", kind: "person", id: "first-person-arms" });
9504
9517
  root.name = "first-person-arms";
9505
9518
  root.userData.viewmodel = true;
9506
9519
  const lit = (color2) => new THREE.MeshLambertMaterial({ color: color2, emissive: scaleHex(color2, FILL) });