@adatechnology/game-characters-three 0.9.6 → 0.10.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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Three, B as BestSpec, a as BestPose, P as PersonSpec, b as PersonCharacter, c as PersonGroupSpec, L as LegRig, A as ArmRig, d as PersonExtra, R as RichRig, e as BloodLook, F as FluidsBridge, C as CharacterSound, f as AvatarItemUsePose, g as AvatarViewMode, h as
|
|
2
|
-
export {
|
|
1
|
+
import { T as Three, B as BestSpec, a as BestPose, P as PersonSpec, b as PersonCharacter, c as PersonGroupSpec, L as LegRig, A as ArmRig, d as PersonExtra, R as RichRig, e as BloodLook, F as FluidsBridge, C as CharacterSound, f as AvatarItemUsePose, g as AvatarViewMode, h as AvatarViewOptions, i as ReachView, j as PlayerAvatar } from './testing-7EIhFq92.js';
|
|
2
|
+
export { k as AVATAR_AREA_ID, l as AreaContext, m as AvatarEvent, n as AvatarTestOptions, o as AvatarUpdate, p as BODY_MATERIAL_DEF, q as BODY_SOUNDS, r as BloodAge, s as BloodLookOptions, t as BloodSink, u as BodySegment, v as BodySoundRule, w as CHARACTERS_AREA_ID, x as CharacterSoundOptions, y as CharacterSoundSink, z as CharacterSoundStyle, D as CharactersTestOptions, E as FilmSink, G as FluidsBridgeOptions, H as HIT_PRESETS, I as HitPreset, J as PERSON_ITEM_PREFIX, K as PLAYER_SOUNDS, M as PlayPoseOptions, N as PlayerAvatarColors, O as PlayerAvatarOptions, Q as PlayerAvatarSpec, S as PoseTargets, U as ProfessionCard, V as RigAnimator, W as RigAnimatorOptions, X as UNDEAD_VOICES, Y as UNDEAD_VOICE_SOURCES, Z as UndeadCard, _ as UndeadLike, $ as UndeadVoice, a0 as VoiceMoment, a1 as VoiceStep, a2 as WoundSpray, a3 as ZOMBIE_ITEM_PREFIX, a4 as bloodLookOfAge, a5 as createAvatarTestModule, a6 as createCharacterSound, a7 as createCharactersTestModule, a8 as createFluidsBridge, a9 as createPlayerAvatar, aa as createRigAnimator, ab as personSpecOf, ac as registerBodyMaterial } from './testing-7EIhFq92.js';
|
|
3
3
|
import { BodySpec, SegmentId, PoseClip, PoseClipEvent, FirstPersonClip } from '@adatechnology/game-characters';
|
|
4
4
|
import * as THREE_NS from 'three';
|
|
5
5
|
import { LightBudget, SourceHandle } from '@adatechnology/game-render-three';
|
|
@@ -989,8 +989,8 @@ type RoomAvatarLike = {
|
|
|
989
989
|
shoulder(side: 'R' | 'L'): THREE_NS.Object3D;
|
|
990
990
|
/** Where the body's eyes are after its pose (`RoomAvatar.eye`): the room draws the body in both views and puts the first-person camera there. */
|
|
991
991
|
eye(out?: THREE_NS.Vector3): THREE_NS.Vector3;
|
|
992
|
-
/** Hides the head and neck from `camera` in first person (`RoomAvatar.setView`). */
|
|
993
|
-
setView(mode: AvatarViewMode, camera: THREE_NS.Object3D | null): void;
|
|
992
|
+
/** Hides the head and neck from `camera` in first person, and the arms with `arms` (`RoomAvatar.setView`). */
|
|
993
|
+
setView(mode: AvatarViewMode, camera: THREE_NS.Object3D | null, options?: AvatarViewOptions): void;
|
|
994
994
|
/** Brings the body's hands to the tool in them, in both views; `view` keeps them in the first-person view (`RoomAvatar.reach`). */
|
|
995
995
|
reach(targets: HandTargets | null, view?: ReachView | null): void;
|
|
996
996
|
/** Plays a strike on the body (the only source of it, in both views) and answers the seconds to its impact (`RoomAvatar.strike`). */
|
|
@@ -1199,4 +1199,4 @@ type TwoBone = {
|
|
|
1199
1199
|
*/
|
|
1200
1200
|
declare const solveTwoBone: (root: THREE_NS.Vector3, target: THREE_NS.Vector3, upper: number, lower: number, pole: THREE_NS.Vector3, out: TwoBone) => TwoBone;
|
|
1201
1201
|
|
|
1202
|
-
export { ACCESSORY_BIT, type AccessoryAttach, ArmRig, AvatarItemUsePose, AvatarViewMode, BAKE_NEUTRAL_POSE, BODY_CHUNK, type BakeBuilders, type BakeSpec, type BakedBody, type BestBuilder, type BestBuilderOptions, type BestTypeCard, type BlobShadowBatch, type BlobShadowOptions, BloodLook, type BodyBatch, type BodyBatchMesh, type BodyBatchOptions, type BodyChunkOptions, type BodyInstance, type BodyJoints, type BodyMaterialParams, type BodyVariant, type BuildInstancedBodyParams, CHARACTER_SOUNDS, CHARACTER_SOUND_BANK, CLIPS_BIT, CLIP_BONES, CLIP_LIMIT, CLIP_RATE, CLIP_TEXELS, CharacterSound, type ClipLimp, EXTRAS, type EyeOptions, type Eyes, FACE_FEATURES, FIRST_PERSON_BOB, FIRST_PERSON_COLORS, FIRST_PERSON_RIG, FIRST_PERSON_STANCES, type FirstPersonArms, type FirstPersonArmsOptions, type FirstPersonArmsState, type FirstPersonBob, type FirstPersonColors, type FirstPersonEvent, type FirstPersonRig, FluidsBridge, type FlyingLimb, type FlyingLimbs, type FlyingLimbsOptions, type FlyingPiece, type FlyingPieces, type FlyingPiecesOptions, GAIT_STYLE, type GaitStyle, HAND_ITEMS, HATS, IMPOSTOR_ANGLES, IMPOSTOR_FRAMES, type IdentityLook, type ImpostorAtlas, type ImpostorAtlasOptions, type ImpostorBatch, type ImpostorBatchOptions, type ImpostorBody, type ImpostorBox, type ImpostorInstance, KIT_ACCESSORIES, type KitAccessory, LOD_BAKE, LOD_BATCH_CAPACITY, LOD_CASTS_SHADOW, LOD_DISTANCES, LOD_SEGMENTS, LegRig, type LimbEffects, type LimbLaunch, PENDULUM, type Pendulum, type PersonBuilder, type PersonBuilderOptions, PersonCharacter, PersonExtra, PersonGroupSpec, PersonSpec, PlayerAvatar, ReachView, type RestPose, RichRig, type RoomAvatarLike, SEGMENT_CLIPS, STAGGER_POSE, type SegmentClipSet, type SegmentClipSpec, type SegmentClipUniforms, type StanceDef, TROUSER_PALETTE, Three, type ToRoomAvatarOptions, type TwoBone, UNDEAD_VOICE_GROUP, type VariantBatchesOptions, type VariantType, type WoundBody, type WoundMaterials, type WoundNode, type Wounds, type WoundsOptions, accessoryPlacement, bakeBody, bakeImpostorAtlas, bakeSegmentClips, bakeVariants, blobGeometry, blobRadii, buildInstancedBody, buildKitAccessory, clipIndexOf, clipSpeedOf, createBestBuilder, createBlobShadowBatch, createBodyBatch, createBodyChunk, createBodyChunkExt, createBodyMaterial, createEye, createFirstPersonArms, createFlyingLimbs, createFlyingPieces, createGlowTexture, createImpostorBatch, createPendulum, createPersonBuilder, createSegmentClipUniforms, createVariantBatches, createWoundMaterials, createWounds, exitWound, explodeChunks, findEyes, gouge, jointsOf, lodAt, makeCut, makeStump, packIdentity, ringWound, solveTwoBone, starGeometry, stepPendulum, toRoomAvatar, unpackIdentity, walkPoseVertex, woundBodyOf, woundDecal };
|
|
1202
|
+
export { ACCESSORY_BIT, type AccessoryAttach, ArmRig, AvatarItemUsePose, AvatarViewMode, AvatarViewOptions, BAKE_NEUTRAL_POSE, BODY_CHUNK, type BakeBuilders, type BakeSpec, type BakedBody, type BestBuilder, type BestBuilderOptions, type BestTypeCard, type BlobShadowBatch, type BlobShadowOptions, BloodLook, type BodyBatch, type BodyBatchMesh, type BodyBatchOptions, type BodyChunkOptions, type BodyInstance, type BodyJoints, type BodyMaterialParams, type BodyVariant, type BuildInstancedBodyParams, CHARACTER_SOUNDS, CHARACTER_SOUND_BANK, CLIPS_BIT, CLIP_BONES, CLIP_LIMIT, CLIP_RATE, CLIP_TEXELS, CharacterSound, type ClipLimp, EXTRAS, type EyeOptions, type Eyes, FACE_FEATURES, FIRST_PERSON_BOB, FIRST_PERSON_COLORS, FIRST_PERSON_RIG, FIRST_PERSON_STANCES, type FirstPersonArms, type FirstPersonArmsOptions, type FirstPersonArmsState, type FirstPersonBob, type FirstPersonColors, type FirstPersonEvent, type FirstPersonRig, FluidsBridge, type FlyingLimb, type FlyingLimbs, type FlyingLimbsOptions, type FlyingPiece, type FlyingPieces, type FlyingPiecesOptions, GAIT_STYLE, type GaitStyle, HAND_ITEMS, HATS, IMPOSTOR_ANGLES, IMPOSTOR_FRAMES, type IdentityLook, type ImpostorAtlas, type ImpostorAtlasOptions, type ImpostorBatch, type ImpostorBatchOptions, type ImpostorBody, type ImpostorBox, type ImpostorInstance, KIT_ACCESSORIES, type KitAccessory, LOD_BAKE, LOD_BATCH_CAPACITY, LOD_CASTS_SHADOW, LOD_DISTANCES, LOD_SEGMENTS, LegRig, type LimbEffects, type LimbLaunch, PENDULUM, type Pendulum, type PersonBuilder, type PersonBuilderOptions, PersonCharacter, PersonExtra, PersonGroupSpec, PersonSpec, PlayerAvatar, ReachView, type RestPose, RichRig, type RoomAvatarLike, SEGMENT_CLIPS, STAGGER_POSE, type SegmentClipSet, type SegmentClipSpec, type SegmentClipUniforms, type StanceDef, TROUSER_PALETTE, Three, type ToRoomAvatarOptions, type TwoBone, UNDEAD_VOICE_GROUP, type VariantBatchesOptions, type VariantType, type WoundBody, type WoundMaterials, type WoundNode, type Wounds, type WoundsOptions, accessoryPlacement, bakeBody, bakeImpostorAtlas, bakeSegmentClips, bakeVariants, blobGeometry, blobRadii, buildInstancedBody, buildKitAccessory, clipIndexOf, clipSpeedOf, createBestBuilder, createBlobShadowBatch, createBodyBatch, createBodyChunk, createBodyChunkExt, createBodyMaterial, createEye, createFirstPersonArms, createFlyingLimbs, createFlyingPieces, createGlowTexture, createImpostorBatch, createPendulum, createPersonBuilder, createSegmentClipUniforms, createVariantBatches, createWoundMaterials, createWounds, exitWound, explodeChunks, findEyes, gouge, jointsOf, lodAt, makeCut, makeStump, packIdentity, ringWound, solveTwoBone, starGeometry, stepPendulum, toRoomAvatar, unpackIdentity, walkPoseVertex, woundBodyOf, woundDecal };
|
package/dist/index.global.js
CHANGED
|
@@ -11663,6 +11663,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
11663
11663
|
eyeSocket.position.set(BUILDER_EYE[0] + eyeOffset[0], BUILDER_EYE[1] + eyeOffset[1], BUILDER_EYE[2] + eyeOffset[2]);
|
|
11664
11664
|
rig.headG.children[0].add(eyeSocket);
|
|
11665
11665
|
const headHider = createHeadHider([rig.headG, ...rig.neck ? [rig.neck] : []]);
|
|
11666
|
+
const armsHider = createHeadHider(rig.arms.map((arm) => arm.g));
|
|
11666
11667
|
const eyeLocal = new THREE.Vector3();
|
|
11667
11668
|
let bob = 0;
|
|
11668
11669
|
let hipWithoutBob = null;
|
|
@@ -12010,7 +12011,10 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
12010
12011
|
root.updateWorldMatrix(true, false);
|
|
12011
12012
|
return root.localToWorld(out.copy(eyeLocal));
|
|
12012
12013
|
},
|
|
12013
|
-
setView: (mode, camera) =>
|
|
12014
|
+
setView: (mode, camera, viewOptions) => {
|
|
12015
|
+
headHider.setView(mode, camera);
|
|
12016
|
+
armsHider.setView(viewOptions?.arms ? mode : "third", camera);
|
|
12017
|
+
},
|
|
12014
12018
|
play(clip, playOptions = {}) {
|
|
12015
12019
|
const found = typeof clip === "string" ? clips.get(clip) : clip;
|
|
12016
12020
|
if (!found) throw new Error(`Unknown pose clip: ${String(clip)}`);
|
|
@@ -12516,7 +12520,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
12516
12520
|
root: avatar.root,
|
|
12517
12521
|
avatar,
|
|
12518
12522
|
eye: (out) => avatar.eye(out),
|
|
12519
|
-
setView: (mode, camera) => avatar.setView(mode, camera),
|
|
12523
|
+
setView: (mode, camera, options2) => avatar.setView(mode, camera, options2),
|
|
12520
12524
|
update: (dt, state) => {
|
|
12521
12525
|
stepGuard(dt, state);
|
|
12522
12526
|
updateFeet(state);
|