From b8f2b8d3f0c9f66327a1d90867a63a9d313d97fe Mon Sep 17 00:00:00 2001 From: 0b5vr <0b5vr@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:31:55 +0000 Subject: [PATCH] deploy: 5d7116ab3ac4e229d900b6abefbfa6c3959a436d --- .../docs/classes/VRMAnimation.html | 4 +- .../classes/VRMAnimationLoaderPlugin.html | 4 +- .../classes/VRMLookAtQuaternionProxy.html | 8 +- .../functions/createVRMAnimationClip.html | 2 +- .../createVRMAnimationExpressionTracks.html | 2 +- .../createVRMAnimationHumanoidTracks.html | 2 +- .../createVRMAnimationLookAtTrack.html | 2 +- .../lib/three-vrm-animation.cjs | 28 +- .../lib/three-vrm-animation.min.cjs | 4 +- .../lib/three-vrm-animation.module.js | 28 +- .../lib/three-vrm-animation.module.min.js | 4 +- packages/three-vrm-core/docs/assets/search.js | 2 +- .../three-vrm-core/docs/classes/VRMCore.html | 18 +- .../docs/classes/VRMCoreLoaderPlugin.html | 4 +- .../docs/classes/VRMExpression.html | 47 +- .../classes/VRMExpressionLoaderPlugin.html | 4 +- .../docs/classes/VRMExpressionManager.html | 34 +- .../VRMExpressionMaterialColorBind.html | 16 +- .../classes/VRMExpressionMorphTargetBind.html | 14 +- .../VRMExpressionTextureTransformBind.html | 14 +- .../docs/classes/VRMFirstPerson.html | 20 +- .../classes/VRMFirstPersonLoaderPlugin.html | 4 +- .../docs/classes/VRMHumanoid.html | 62 +-- .../docs/classes/VRMHumanoidHelper.html | 10 +- .../docs/classes/VRMHumanoidLoaderPlugin.html | 6 +- .../docs/classes/VRMLookAt.html | 52 +- .../docs/classes/VRMLookAtBoneApplier.html | 22 +- .../classes/VRMLookAtExpressionApplier.html | 20 +- .../docs/classes/VRMLookAtHelper.html | 10 +- .../docs/classes/VRMLookAtLoaderPlugin.html | 6 +- .../docs/classes/VRMLookAtRangeMap.html | 10 +- .../docs/classes/VRMMetaLoaderPlugin.html | 10 +- .../docs/interfaces/VRM0Meta.html | 30 +- .../docs/interfaces/VRM1Meta.html | 42 +- .../VRMCoreLoaderPluginOptions.html | 6 +- .../docs/interfaces/VRMCoreParameters.html | 4 +- .../docs/interfaces/VRMExpressionBind.html | 6 +- .../VRMFirstPersonMeshAnnotation.html | 4 +- .../docs/interfaces/VRMHumanBone.html | 4 +- .../VRMHumanoidLoaderPluginOptions.html | 6 +- .../docs/interfaces/VRMLookAtApplier.html | 6 +- .../interfaces/VRMMetaImporterOptions.html | 8 +- .../docs/interfaces/VRMPoseTransform.html | 6 +- .../types/VRMExpressionMaterialColorType.html | 2 +- .../docs/types/VRMExpressionOverrideType.html | 2 +- .../docs/types/VRMExpressionPresetName.html | 2 +- .../VRMFirstPersonMeshAnnotationType.html | 2 +- .../docs/types/VRMHumanBoneName.html | 2 +- .../docs/types/VRMHumanBones.html | 2 +- .../docs/types/VRMLookAtTypeName.html | 2 +- .../three-vrm-core/docs/types/VRMMeta.html | 2 +- .../three-vrm-core/docs/types/VRMPose.html | 2 +- .../docs/types/VRMRequiredHumanBoneName.html | 2 +- .../VRMExpressionMaterialColorType-1.html | 2 +- .../VRMExpressionOverrideType-1.html | 2 +- .../variables/VRMExpressionPresetName-1.html | 2 +- .../VRMFirstPersonMeshAnnotationType-1.html | 2 +- .../docs/variables/VRMHumanBoneList.html | 2 +- .../docs/variables/VRMHumanBoneName-1.html | 2 +- .../docs/variables/VRMHumanBoneParentMap.html | 2 +- .../docs/variables/VRMLookAtTypeName-1.html | 2 +- .../variables/VRMRequiredHumanBoneName-1.html | 2 +- .../three-vrm-core/lib/three-vrm-core.cjs | 29 +- .../three-vrm-core/lib/three-vrm-core.min.cjs | 2 +- .../lib/three-vrm-core.module.js | 29 +- .../lib/three-vrm-core.module.min.js | 2 +- .../types/expressions/VRMExpression.d.ts | 18 + ...ialsHDREmissiveMultiplierLoaderPlugin.html | 4 +- ...-vrm-materials-hdr-emissive-multiplier.cjs | 2 +- ...aterials-hdr-emissive-multiplier.module.js | 2 +- .../docs/classes/MToonMaterial.html | 32 +- .../classes/MToonMaterialLoaderPlugin.html | 12 +- .../MToonMaterialLoaderPluginOptions.html | 10 +- .../interfaces/MToonMaterialParameters.html | 16 +- .../docs/types/MToonMaterialDebugMode.html | 2 +- .../types/MToonMaterialOutlineWidthMode.html | 2 +- .../variables/MToonMaterialDebugMode-1.html | 2 +- .../MToonMaterialOutlineWidthMode-1.html | 2 +- .../lib/nodes/index.cjs | 2 +- .../lib/nodes/index.module.js | 2 +- .../lib/three-vrm-materials-mtoon.cjs | 2 +- .../lib/three-vrm-materials-mtoon.module.js | 2 +- .../classes/VRMMaterialsV0CompatPlugin.html | 4 +- .../lib/three-vrm-materials-v0compat.cjs | 2 +- .../three-vrm-materials-v0compat.module.js | 2 +- .../docs/classes/VRMAimConstraint.html | 18 +- .../docs/classes/VRMNodeConstraint.html | 14 +- .../docs/classes/VRMNodeConstraintHelper.html | 8 +- .../VRMNodeConstraintLoaderPlugin.html | 8 +- .../classes/VRMNodeConstraintManager.html | 4 +- .../docs/classes/VRMRollConstraint.html | 18 +- .../docs/classes/VRMRotationConstraint.html | 14 +- .../lib/three-vrm-node-constraint.cjs | 2 +- .../lib/three-vrm-node-constraint.module.js | 2 +- .../docs/assets/search.js | 2 +- .../docs/classes/VRMSpringBoneCollider.html | 18 +- .../classes/VRMSpringBoneColliderHelper.html | 10 +- .../classes/VRMSpringBoneColliderShape.html | 10 +- .../VRMSpringBoneColliderShapeCapsule.html | 16 +- .../VRMSpringBoneColliderShapePlane.html | 12 +- .../VRMSpringBoneColliderShapeSphere.html | 14 +- .../docs/classes/VRMSpringBoneJoint.html | 20 +- .../classes/VRMSpringBoneJointHelper.html | 10 +- .../classes/VRMSpringBoneLoaderPlugin.html | 10 +- .../docs/classes/VRMSpringBoneManager.html | 10 +- .../VRMSpringBoneColliderGroup.html | 6 +- .../VRMSpringBoneJointSettings.html | 6 +- .../lib/three-vrm-springbone.cjs | 327 ++++++------ .../lib/three-vrm-springbone.min.cjs | 2 +- .../lib/three-vrm-springbone.module.js | 327 ++++++------ .../lib/three-vrm-springbone.module.min.js | 2 +- .../types/VRMSpringBoneCollider.d.ts | 5 + .../types/VRMSpringBoneColliderShape.d.ts | 4 + .../types/VRMSpringBoneJoint.d.ts | 6 +- .../types/VRMSpringBoneManager.d.ts | 38 +- .../types/utils/lowestCommonAncestor.d.ts | 6 + packages/three-vrm/docs/assets/search.js | 2 +- packages/three-vrm/docs/classes/VRM.html | 12 +- .../three-vrm/docs/classes/VRMExpression.html | 33 +- .../docs/classes/VRMLoaderPlugin.html | 4 +- .../docs/classes/VRMSpringBoneCollider.html | 14 +- .../classes/VRMSpringBoneColliderShape.html | 6 +- .../VRMSpringBoneColliderShapeCapsule.html | 2 +- .../VRMSpringBoneColliderShapePlane.html | 2 +- .../VRMSpringBoneColliderShapeSphere.html | 2 +- .../docs/classes/VRMSpringBoneJoint.html | 12 +- .../docs/classes/VRMSpringBoneManager.html | 8 +- packages/three-vrm/docs/classes/VRMUtils.html | 16 +- .../interfaces/VRMLoaderPluginOptions.html | 6 +- .../docs/interfaces/VRMParameters.html | 4 +- packages/three-vrm/examples/animations.html | 1 + packages/three-vrm/examples/basic.html | 1 + packages/three-vrm/examples/bones.html | 1 + packages/three-vrm/examples/debug.html | 1 + packages/three-vrm/examples/dnd.html | 1 + packages/three-vrm/examples/expressions.html | 3 +- packages/three-vrm/examples/firstperson.html | 1 + .../examples/humanoidAnimation/main.js | 5 + .../three-vrm/examples/lookat-advanced.html | 1 + packages/three-vrm/examples/lookat.html | 1 + .../three-vrm/examples/materials-debug.html | 1 + packages/three-vrm/examples/meta.html | 1 + packages/three-vrm/examples/mouse.html | 1 + packages/three-vrm/examples/webgpu-dnd.html | 1 + packages/three-vrm/lib/nodes/index.cjs | 4 +- packages/three-vrm/lib/nodes/index.min.cjs | 2 +- packages/three-vrm/lib/nodes/index.module.js | 4 +- .../three-vrm/lib/nodes/index.module.min.js | 2 +- packages/three-vrm/lib/three-vrm.cjs | 478 +++++++++++------ packages/three-vrm/lib/three-vrm.min.cjs | 18 +- packages/three-vrm/lib/three-vrm.module.js | 486 ++++++++++++------ .../three-vrm/lib/three-vrm.module.min.js | 18 +- .../types/VRMUtils/combineMorphs.d.ts | 9 + packages/three-vrm/types/VRMUtils/index.d.ts | 2 + .../docs/interfaces/BlendShape.html | 4 +- .../docs/interfaces/BlendShapeBind.html | 6 +- .../docs/interfaces/BlendShapeGroup.html | 12 +- .../interfaces/BlendShapeMaterialbind.html | 4 +- .../docs/interfaces/FirstPerson.html | 10 +- .../docs/interfaces/FirstPersonDegreeMap.html | 8 +- .../interfaces/FirstPersonMeshAnnotation.html | 4 +- .../docs/interfaces/Humanoid.html | 18 +- .../docs/interfaces/HumanoidBone.html | 16 +- .../docs/interfaces/Material.html | 4 +- .../types-vrm-0.0/docs/interfaces/Meta.html | 28 +- .../docs/interfaces/SecondaryAnimation.html | 4 +- .../SecondaryAnimationCollider.html | 6 +- .../SecondaryAnimationColliderGroup.html | 6 +- .../interfaces/SecondaryAnimationSpring.html | 20 +- .../types-vrm-0.0/docs/interfaces/VRM.html | 8 +- .../docs/interfaces/Vector3.html | 4 +- .../docs/types/BlendShapePresetName.html | 2 +- .../docs/types/HumanoidBoneName.html | 2 +- .../VRMCMaterialsHDREmissiveMultiplier.html | 4 +- ...MaterialsMToonShadingShiftTextureInfo.html | 10 +- .../interfaces/MaterialsMToonTextureInfo.html | 8 +- .../docs/interfaces/VRMCMaterialsMToon.html | 16 +- .../types/MaterialsMToonOutlineWidthMode.html | 2 +- .../docs/interfaces/AimConstraint.html | 8 +- .../docs/interfaces/Constraint.html | 4 +- .../docs/interfaces/RollConstraint.html | 10 +- .../docs/interfaces/RotationConstraint.html | 8 +- .../docs/interfaces/VRMCNodeConstraint.html | 6 +- .../docs/interfaces/SpringBoneCollider.html | 4 +- .../interfaces/SpringBoneColliderCapsule.html | 8 +- .../interfaces/SpringBoneColliderGroup.html | 4 +- .../interfaces/SpringBoneColliderShape.html | 4 +- .../interfaces/SpringBoneColliderSphere.html | 6 +- .../docs/interfaces/SpringBoneJoint.html | 14 +- .../docs/interfaces/SpringBoneSpring.html | 10 +- .../docs/interfaces/VRMCSpringBone.html | 10 +- .../SpringBoneExtendedColliderShape.html | 4 +- ...pringBoneExtendedColliderShapeCapsule.html | 10 +- .../SpringBoneExtendedColliderShapePlane.html | 6 +- ...SpringBoneExtendedColliderShapeSphere.html | 8 +- .../VRMCSpringBoneExtendedCollider.html | 8 +- .../docs/interfaces/Expression.html | 22 +- .../ExpressionMaterialColorBind.html | 8 +- .../interfaces/ExpressionMorphTargetBind.html | 10 +- .../ExpressionTextureTransformBind.html | 10 +- .../docs/interfaces/Expressions.html | 4 +- .../docs/interfaces/FirstPerson.html | 6 +- .../interfaces/FirstPersonMeshAnnotation.html | 8 +- .../docs/interfaces/Humanoid.html | 4 +- .../docs/interfaces/HumanoidHumanBone.html | 6 +- .../docs/interfaces/LookAt.html | 14 +- .../docs/interfaces/LookAtRangeMap.html | 8 +- .../docs/interfaces/Meta.html | 40 +- .../docs/interfaces/VRMCVRM.html | 12 +- .../types/ExpressionMaterialColorType.html | 2 +- .../docs/types/ExpressionOverrideType.html | 2 +- .../docs/types/ExpressionPresetName.html | 2 +- .../docs/types/HumanoidHumanBoneName.html | 2 +- .../docs/types/HumanoidHumanBones.html | 2 +- .../docs/interfaces/Expression.html | 6 +- .../docs/interfaces/Expressions.html | 6 +- .../docs/interfaces/Humanoid.html | 4 +- .../docs/interfaces/HumanoidHumanBone.html | 6 +- .../docs/interfaces/LookAt.html | 6 +- .../docs/interfaces/VRMCVRMAnimation.html | 10 +- .../docs/types/HumanoidHumanBones.html | 2 +- 221 files changed, 2000 insertions(+), 1470 deletions(-) create mode 100644 packages/three-vrm-springbone/types/utils/lowestCommonAncestor.d.ts create mode 100644 packages/three-vrm/types/VRMUtils/combineMorphs.d.ts diff --git a/packages/three-vrm-animation/docs/classes/VRMAnimation.html b/packages/three-vrm-animation/docs/classes/VRMAnimation.html index 6866fe390..5880a862f 100644 --- a/packages/three-vrm-animation/docs/classes/VRMAnimation.html +++ b/packages/three-vrm-animation/docs/classes/VRMAnimation.html @@ -1,9 +1,9 @@ VRMAnimation | @pixiv/three-vrm-animation

Represents a single VRM Animation. You probably want to create an AnimationClip using createVRMAnimationClip.

-

Constructors

Constructors

Properties

duration: number
expressionTracks: {
    custom: Map<string, NumberKeyframeTrack>;
    preset: Map<VRMExpressionPresetName, NumberKeyframeTrack>;
}
humanoidTracks: {
    rotation: Map<VRMHumanBoneName, QuaternionKeyframeTrack>;
    translation: Map<"hips", VectorKeyframeTrack>;
}
lookAtTrack: null | QuaternionKeyframeTrack
restHipsPosition: Vector3
+

Constructors

Properties

duration: number
expressionTracks: {
    custom: Map<string, NumberKeyframeTrack>;
    preset: Map<VRMExpressionPresetName, NumberKeyframeTrack>;
}
humanoidTracks: {
    rotation: Map<VRMHumanBoneName, QuaternionKeyframeTrack>;
    translation: Map<"hips", VectorKeyframeTrack>;
}
lookAtTrack: null | QuaternionKeyframeTrack
restHipsPosition: Vector3
diff --git a/packages/three-vrm-animation/docs/classes/VRMAnimationLoaderPlugin.html b/packages/three-vrm-animation/docs/classes/VRMAnimationLoaderPlugin.html index d752ba4f0..73b65caed 100644 --- a/packages/three-vrm-animation/docs/classes/VRMAnimationLoaderPlugin.html +++ b/packages/three-vrm-animation/docs/classes/VRMAnimationLoaderPlugin.html @@ -1,6 +1,6 @@ VRMAnimationLoaderPlugin | @pixiv/three-vrm-animation

A plugin of GLTFLoader that imports VRMAnimations from a VRMC_vrm_animation extension and gltf animations.

-

Implements

  • GLTFLoaderPlugin

Constructors

Implements

  • GLTFLoaderPlugin

Constructors

Properties

Accessors

Methods

Constructors

Properties

parser: GLTFParser

Accessors

Methods

+

Constructors

Properties

parser: GLTFParser

Accessors

Methods

diff --git a/packages/three-vrm-animation/docs/classes/VRMLookAtQuaternionProxy.html b/packages/three-vrm-animation/docs/classes/VRMLookAtQuaternionProxy.html index 4520f246e..f9ec7c3e6 100644 --- a/packages/three-vrm-animation/docs/classes/VRMLookAtQuaternionProxy.html +++ b/packages/three-vrm-animation/docs/classes/VRMLookAtQuaternionProxy.html @@ -1,4 +1,4 @@ -VRMLookAtQuaternionProxy | @pixiv/three-vrm-animation

Hierarchy

  • Object3D
    • VRMLookAtQuaternionProxy

Constructors

constructor +VRMLookAtQuaternionProxy | @pixiv/three-vrm-animation

Hierarchy

  • Object3D
    • VRMLookAtQuaternionProxy

Constructors

Properties

animations: AnimationClip[]

Array with object's animation clips.

+

Constructors

Properties

animations: AnimationClip[]

Array with object's animation clips.

[]

castShadow: boolean

Whether the object gets rendered into shadow map.

false

@@ -148,7 +148,7 @@

This can be used to find a specific type of Object3D in a scene. Sub-classes will update this value.

Object3D

-
up: Vector3

This is used by the lookAt method, for example, to determine the orientation of the result.

+
up: Vector3

This is used by the lookAt method, for example, to determine the orientation of the result.

Object3D.DEFAULT_UP - that is (0, 1, 0).

userData: Record<string, any>

An object that can be used to store custom data about the Object3D.

It should not hold references to functions as these will not be cloned.

@@ -157,7 +157,7 @@

This gets automatically assigned and shouldn't be edited.

visible: boolean

Object gets rendered if true.

true

-
vrmLookAt: VRMLookAt
DEFAULT_MATRIX_AUTO_UPDATE: boolean

The default setting for matrixAutoUpdate for newly created Object3Ds.

+
vrmLookAt: VRMLookAt
DEFAULT_MATRIX_AUTO_UPDATE: boolean

The default setting for matrixAutoUpdate for newly created Object3Ds.

true

DEFAULT_MATRIX_WORLD_AUTO_UPDATE: boolean

The default setting for matrixWorldAutoUpdate for newly created Object3Ds.

true

diff --git a/packages/three-vrm-animation/docs/functions/createVRMAnimationClip.html b/packages/three-vrm-animation/docs/functions/createVRMAnimationClip.html index cfa7bd3a9..0ecfe5db2 100644 --- a/packages/three-vrm-animation/docs/functions/createVRMAnimationClip.html +++ b/packages/three-vrm-animation/docs/functions/createVRMAnimationClip.html @@ -2,4 +2,4 @@

Parameters

Returns THREE.AnimationClip

An AnimationClip

-
+
diff --git a/packages/three-vrm-animation/docs/functions/createVRMAnimationExpressionTracks.html b/packages/three-vrm-animation/docs/functions/createVRMAnimationExpressionTracks.html index d9797865b..be5e80112 100644 --- a/packages/three-vrm-animation/docs/functions/createVRMAnimationExpressionTracks.html +++ b/packages/three-vrm-animation/docs/functions/createVRMAnimationExpressionTracks.html @@ -1 +1 @@ -createVRMAnimationExpressionTracks | @pixiv/three-vrm-animation

Function createVRMAnimationExpressionTracks

  • Parameters

    • vrmAnimation: VRMAnimation
    • expressionManager: VRMExpressionManager

    Returns {
        custom: Map<string, THREE.NumberKeyframeTrack>;
        preset: Map<VRMExpressionPresetName, THREE.NumberKeyframeTrack>;
    }

    • custom: Map<string, THREE.NumberKeyframeTrack>
    • preset: Map<VRMExpressionPresetName, THREE.NumberKeyframeTrack>
+createVRMAnimationExpressionTracks | @pixiv/three-vrm-animation

Function createVRMAnimationExpressionTracks

  • Parameters

    • vrmAnimation: VRMAnimation
    • expressionManager: VRMExpressionManager

    Returns {
        custom: Map<string, THREE.NumberKeyframeTrack>;
        preset: Map<VRMExpressionPresetName, THREE.NumberKeyframeTrack>;
    }

    • custom: Map<string, THREE.NumberKeyframeTrack>
    • preset: Map<VRMExpressionPresetName, THREE.NumberKeyframeTrack>
diff --git a/packages/three-vrm-animation/docs/functions/createVRMAnimationHumanoidTracks.html b/packages/three-vrm-animation/docs/functions/createVRMAnimationHumanoidTracks.html index 9a4b32b10..443497dbd 100644 --- a/packages/three-vrm-animation/docs/functions/createVRMAnimationHumanoidTracks.html +++ b/packages/three-vrm-animation/docs/functions/createVRMAnimationHumanoidTracks.html @@ -1 +1 @@ -createVRMAnimationHumanoidTracks | @pixiv/three-vrm-animation

Function createVRMAnimationHumanoidTracks

  • Parameters

    • vrmAnimation: VRMAnimation
    • humanoid: VRMHumanoid
    • metaVersion: "0" | "1"

    Returns {
        rotation: Map<VRMHumanBoneName, THREE.QuaternionKeyframeTrack>;
        translation: Map<"hips", THREE.VectorKeyframeTrack>;
    }

    • rotation: Map<VRMHumanBoneName, THREE.QuaternionKeyframeTrack>
    • translation: Map<"hips", THREE.VectorKeyframeTrack>
+createVRMAnimationHumanoidTracks | @pixiv/three-vrm-animation

Function createVRMAnimationHumanoidTracks

  • Parameters

    • vrmAnimation: VRMAnimation
    • humanoid: VRMHumanoid
    • metaVersion: "0" | "1"

    Returns {
        rotation: Map<VRMHumanBoneName, THREE.QuaternionKeyframeTrack>;
        translation: Map<"hips", THREE.VectorKeyframeTrack>;
    }

    • rotation: Map<VRMHumanBoneName, THREE.QuaternionKeyframeTrack>
    • translation: Map<"hips", THREE.VectorKeyframeTrack>
diff --git a/packages/three-vrm-animation/docs/functions/createVRMAnimationLookAtTrack.html b/packages/three-vrm-animation/docs/functions/createVRMAnimationLookAtTrack.html index 236fe99de..901d90cc0 100644 --- a/packages/three-vrm-animation/docs/functions/createVRMAnimationLookAtTrack.html +++ b/packages/three-vrm-animation/docs/functions/createVRMAnimationLookAtTrack.html @@ -1 +1 @@ -createVRMAnimationLookAtTrack | @pixiv/three-vrm-animation

Function createVRMAnimationLookAtTrack

+createVRMAnimationLookAtTrack | @pixiv/three-vrm-animation

Function createVRMAnimationLookAtTrack

diff --git a/packages/three-vrm-animation/lib/three-vrm-animation.cjs b/packages/three-vrm-animation/lib/three-vrm-animation.cjs index 4f7a2deae..52e1cd3e8 100644 --- a/packages/three-vrm-animation/lib/three-vrm-animation.cjs +++ b/packages/three-vrm-animation/lib/three-vrm-animation.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-animation v3.2.0 + * @pixiv/three-vrm-animation v3.3.0 * The implementation of VRM Animation * * Copyright (c) 2019-2024 pixiv Inc. @@ -122,6 +122,12 @@ var VRMExpression = class extends THREE.Object3D { this.type = "VRMExpression"; this.visible = false; } + /** + * Binds that this expression influences. + */ + get binds() { + return this._binds; + } /** * A value represents how much it should override blink expressions. * `0.0` == no override at all, `1.0` == completely block the expressions. @@ -170,9 +176,25 @@ var VRMExpression = class extends THREE.Object3D { } return this.weight; } + /** + * Add an expression bind to the expression. + * + * @param bind A bind to add + */ addBind(bind) { this._binds.push(bind); } + /** + * Delete an expression bind from the expression. + * + * @param bind A bind to delete + */ + deleteBind(bind) { + const index = this._binds.indexOf(bind); + if (index >= 0) { + this._binds.splice(index, 1); + } + } /** * Apply weight to every assigned blend shapes. * Should be called every frame. @@ -2023,11 +2045,11 @@ var VRMAnimationLoaderPlugin = class { } }; /*! - * @pixiv/three-vrm-core v3.2.0 + * @pixiv/three-vrm-core v3.3.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. * @pixiv/three-vrm-core is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uL3NyYy9jcmVhdGVWUk1BbmltYXRpb25DbGlwLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy91dGlscy9nbHRmRXh0cmFjdFByaW1pdGl2ZXNGcm9tTm9kZS50cyIsICIuLi8uLi90aHJlZS12cm0tY29yZS9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvblByZXNldE5hbWUudHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL3V0aWxzL3NhdHVyYXRlLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTWFuYWdlci50cyIsICIuLi8uLi90aHJlZS12cm0tY29yZS9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JUeXBlLnRzIiwgIi4uLy4uL3R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bXSB8IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChtYXRlcmlhbCkge1xuICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShtYXRlcmlhbCkpIHtcbiAgICAgICAgICAgICAgICBnbHRmTWF0ZXJpYWxzLnB1c2goLi4ubWF0ZXJpYWwpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGdsdGZNYXRlcmlhbHMucHVzaChtYXRlcmlhbCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNjaGVtYUV4cHJlc3Npb24ubWF0ZXJpYWxDb2xvckJpbmRzPy5mb3JFYWNoKGFzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbHMgPSBnbHRmTWF0ZXJpYWxzLmZpbHRlcigobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxJbmRleCA9IHRoaXMucGFyc2VyLmFzc29jaWF0aW9ucy5nZXQobWF0ZXJpYWwpPy5tYXRlcmlhbHM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIHR5cGU6IGJpbmQudHlwZSxcbiAgICAgICAgICAgICAgICAgIHRhcmdldFZhbHVlOiBuZXcgVEhSRUUuQ29sb3IoKS5mcm9tQXJyYXkoYmluZC50YXJnZXRWYWx1ZSksXG4gICAgICAgICAgICAgICAgICB0YXJnZXRBbHBoYTogYmluZC50YXJnZXRWYWx1ZVszXSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgc2NoZW1hRXhwcmVzc2lvbi50ZXh0dXJlVHJhbnNmb3JtQmluZHM/LmZvckVhY2goYXN5bmMgKGJpbmQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFscyA9IGdsdGZNYXRlcmlhbHMuZmlsdGVyKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbEluZGV4ID0gdGhpcy5wYXJzZXIuYXNzb2NpYXRpb25zLmdldChtYXRlcmlhbCk/Lm1hdGVyaWFscztcbiAgICAgICAgICAgICAgcmV0dXJuIGJpbmQubWF0ZXJpYWwgPT09IG1hdGVyaWFsSW5kZXg7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBuZXcgVEhSRUUuVmVjdG9yMigpLmZyb21BcnJheShiaW5kLm9mZnNldCA/PyBbMC4wLCAwLjBdKSxcbiAgICAgICAgICAgICAgICAgIHNjYWxlOiBuZXcgVEhSRUUuVmVjdG9yMigpLmZyb21BcnJheShiaW5kLnNjYWxlID8/IFsxLjAsIDEuMF0pLFxuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBtYW5hZ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R3JvdXApID0+IHtcbiAgICAgICAgY29uc3QgdjBQcmVzZXROYW1lID0gc2NoZW1hR3JvdXAucHJlc2V0TmFtZTtcbiAgICAgICAgY29uc3QgdjFQcmVzZXROYW1lID1cbiAgICAgICAgICAodjBQcmVzZXROYW1lICE9IG51bGwgJiYgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbi52MHYxUHJlc2V0TmFtZU1hcFt2MFByZXNldE5hbWVdKSB8fCBudWxsO1xuICAgICAgICBjb25zdCBuYW1lID0gdjFQcmVzZXROYW1lID8/IHNjaGVtYUdyb3VwLm5hbWU7XG5cbiAgICAgICAgaWYgKG5hbWUgPT0gbnVsbCkge1xuICAgICAgICAgIGNvbnNvbGUud2FybignVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogT25lIG9mIGN1c3RvbSBleHByZXNzaW9ucyBoYXMgbm8gbmFtZS4gSWdub3JpbmcgdGhlIGV4cHJlc3Npb24nKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBkdXBsaWNhdGlvbiBjaGVja1xuICAgICAgICBpZiAoYmxlbmRTaGFwZU5hbWVTZXQuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46IEFuIGV4cHJlc3Npb24gcHJlc2V0ICR7djBQcmVzZXROYW1lfSBoYXMgZHVwbGljYXRlZCBlbnRyaWVzLiBJZ25vcmluZyB0aGUgZXhwcmVzc2lvbmAsXG4gICAgICAgICAgKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBibGVuZFNoYXBlTmFtZVNldC5hZGQobmFtZSk7XG5cbiAgICAgICAgY29uc3QgZXhwcmVzc2lvbiA9IG5ldyBWUk1FeHByZXNzaW9uKG5hbWUpO1xuICAgICAgICBnbHRmLnNjZW5lLmFkZChleHByZXNzaW9uKTtcblxuICAgICAgICB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nZXQgbW9ycGggdGFyZ2V0XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgIXByaW1pdGl2ZXMuZXZlcnkoXG4gICAgICAgICAgICAgICAgICAgIChwcmltaXRpdmUpID0+XG4gICAgICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzKSAmJlxuICAgICAgICAgICAgICAgICAgICAgIG1vcnBoVGFyZ2V0SW5kZXggPCBwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46ICR7c2NoZW1hR3JvdXAubmFtZX0gYXR0ZW1wdHMgdG8gaW5kZXggJHttb3JwaFRhcmdldEluZGV4fXRoIG1vcnBoIGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgICAgICAgd2VpZ2h0OiAwLjAxICogKGJpbmQud2VpZ2h0ID8/IDEwMCksIC8vIG5hcnJvd2luZyB0aGUgcmFuZ2UgZnJvbSBbIDAuMCAtIDEwMC4wIF0gdG8gWyAwLjAgLSAxLjAgXVxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAg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CAtIG9mZnNldC55IC0gc2NhbGUueTtcblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uVGV4dHVyZVRyYW5zZm9ybUJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBNYXRlcmlhbENvbG9yQmluZFxuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbENvbG9yVHlwZSA9IHYwRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JNYXBbbWF0ZXJpYWxQcm9wZXJ0eU5hbWVdO1xuICAgICAgICAgICAgICBpZiAobWF0ZXJpYWxDb2xvclR5cGUpIHtcbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IG1hdGVyaWFsQ29sb3JUeXBlLFxuICAgICAgICAgICAgICAgICAgICB0YXJnZXRWYWx1ZTogbmV3IFRIUkVFLkNvbG9yKCkuZnJvbUFycmF5KG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhKSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0QWxwaGE6IG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzNdLFxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICA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dWRlVHJpYW5nbGVzKHRyaWFuZ2xlczogbnVtYmVyW10sIGJ3czogbnVtYmVyW11bXSwgc2tpbkluZGV4OiBudW1iZXJbXVtdLCBleGNsdWRlOiBudW1iZXJbXSk6IG51bWJlciB7XG4gICAgbGV0IGNvdW50ID0gMDtcbiAgICBpZiAoYndzICE9IG51bGwgJiYgYndzLmxlbmd0aCA+IDApIHtcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJpYW5nbGVzLmxlbmd0aDsgaSArPSAzKSB7XG4gICAgICAgIGNvbnN0IGEgPSB0cmlhbmdsZXNbaV07XG4gICAgICAgIGNvbnN0IGIgPSB0cmlhbmdsZXNbaSArIDFdO1xuICAgICAgICBjb25zdCBjID0gdHJpYW5nbGVzW2kgKyAyXTtcbiAgICAgICAgY29uc3QgYncwID0gYndzW2FdO1xuICAgICAgICBjb25zdCBza2luMCA9IHNraW5JbmRleFthXTtcblxuICAgICAgICBpZiAoYncwWzBdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4wWzBdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzBbMV0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjBbMV0pKSBjb250aW51ZTtcbiAgICAgICAgaWYgKGJ3MFsyXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMFsyXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncwWzNdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4wWzNdKSkgY29udGludWU7XG5cbiAgICAgICAgY29uc3QgYncxID0gYndzW2JdO1xuICAgICAgICBjb25zdCBza2luMSA9IHNraW5JbmRleFtiXTtcbiAgICAgICAgaWYgKGJ3MVswXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMVswXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncxWzFdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4xWzFdKSkgY29udGlud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NsYXRpb24nKSB7XG4gICAgICAgICAgaWYgKGJvbmVOYW1lICE9PSAnaGlwcycpIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgYFRoZSBsb2FkaW5nIGFuaW1hdGlvbiBjb250YWlucyBhIHRyYW5zbGF0aW9uIHRyYWNrIGZvciAke2JvbmVOYW1lfSwgd2hpY2ggaXMgbm90IHBlcm1pdHRlZCBpbiB0aGUgVlJNQ192cm1fYW5pbWF0aW9uIHNwZWMuIGlnbm9yaW5nIHRoZSB0cmFja2AsXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25zdCBoaXBzUGFyZW50V29ybGRNYXRyaXggPSB3b3JsZE1hdHJpeE1hcC5nZXQoJ2hpcHNQYXJlbnQnKSE7XG5cbiAgICAgICAgICAgIGNvbnN0IHRyYWNrVmFsdWVzID0gYXJyYXlDaHVuayhvcmlnVHJhY2sudmFsdWVzLCAzKS5mbGF0TWFwKCh2KSA9PlxuICAgICAgICAgICAgICBfdjNBLmZyb21BcnJheSh2KS5hcHBseU1hdHJpeDQoaGlwc1BhcmVudFdvcmxkTWF0cml4KS50b0FycmF5KCksXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICBjb25zdCB0cmFjayA9IG9yaWdUcmFjay5jbG9uZSgpO1xuICAgICAgICAgICAgdHJhY2sudmFsdWVzID0gbmV3IEZsb2F0MzJBcnJheSh0cmFja1ZhbHVlcyk7XG5cbiAgICAgICAgICAgIHJlc3VsdC5odW1hbm9pZFRyYWNrcy50cmFuc2xhdGlvbi5zZXQoYm9uZU5hbWUsIHRyYWNrKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAocGF0aCA9PT0gJ3JvdGF0aW9uJykge1xuICAgICAgICAgIC8vIGEgID0gcF4tMSAqIGEnICogcCAqIGNcbiAgICAgICAgICAvLyBhJyA9IHAgKiBwXi0xICogYScgKiBwICogYyAqIGNeL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FzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbHMgPSBnbHRmTWF0ZXJpYWxzLmZpbHRlcigobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxJbmRleCA9IHRoaXMucGFyc2VyLmFzc29jaWF0aW9ucy5nZXQobWF0ZXJpYWwpPy5tYXRlcmlhbHM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIG9mZnNldDogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5vZmZzZXQgPz8gWzAuMCwgMC4wXSksXG4gICAgICAgICAgICAgICAgICBzY2FsZTogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5zY2FsZSA/PyBbMS4wLCAxLjBdKSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1hbmFnZXI7XG4gIH1cblxuICBwcml2YXRlIGFzeW5jIF92MEltcG9ydChnbHRmOiBHTFRGKTogUHJvbWlzZTxWUk1FeHByZXNzaW9uTWFuYWdlciB8IG51bGw+IHtcbiAgICB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C5iaW5kcykge1xuICAgICAgICAgIHNjaGVtYUdyb3VwLmJpbmRzLmZvckVhY2goYXN5bmMgKGJpbmQpID0+IHtcbiAgICAgICAgICAgIGlmIChiaW5kLm1lc2ggPT09IHVuZGVmaW5lZCB8fCBiaW5kLmluZGV4ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBub2Rlc1VzaW5nTWVzaDogbnVtYmVyW10gPSBbXTtcbiAgICAgICAgICAgIGpzb24ubm9kZXM/LmZvckVhY2goKG5vZGUsIGkpID0+IHtcbiAgICAgICAgICAgICAgaWYgKG5vZGUubWVzaCA9PT0gYmluZC5tZXNoKSB7XG4gICAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gucHVzaChpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gubWFwKGFzeW5jIChub2RlSW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwcmltaXRpdmVzID0gKGF3YWl0IGdsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlKGdsdGYsIG5vZGVJbmRleCkpITtcblxuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUdyb3VwLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4ICR7bW9ycGhUYXJnZXRJbmRleH10aCBtb3JwaCBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIHdlaWdodDogMC4wMSAqIChiaW5kLndlaWdodCA/PyAxMDApLCAvLyBuYXJyb3dpbmcgdGhlIHJhbmdlIGZyb20gWyAwLjAgLSAxMDAuMCBdIHRvIFsgMC4wIC0gMS4wIF1cbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEJpbmQgTWF0ZXJpYWxDb2xvciBhbmQgVGV4dHVyZVRyYW5zZm9ybVxuICAgICAgICBjb25zdCBtYXRlcmlhbFZhbHVlcyA9IHNjaGVtYUdyb3VwLm1hdGV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yOFx1MzA1OVx1MzA4Qlx1MzAwMlxuICAgICAgICAgICAgICogXHUzMEEyXHUzMEE2XHUzMEM4XHUzMEU5XHUzMEE0XHUzMEYzXHU2M0NGXHU3NTNCXHU3NTI4XHUzMDZFXHUzMERFXHUzMEM2XHUzMEVBXHUzMEEyXHUzMEVCXHUzMDgyXHU1NDBDXHU2NjQyXHUzMDZCXHU5NkM2XHUzMDgxXHUzMDhCXHUzMDAyXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsczogVEhSRUUuTWF0ZXJpYWxbXSA9IFtdO1xuICAgICAgICAgICAgZ2x0Zi5zY2VuZS50cmF2ZXJzZSgob2JqZWN0KSA9PiB7XG4gICAgICAgICAgICAgIGlmICgob2JqZWN0IGFzIGFueSkubWF0ZXJpYWwpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbDogVEhSRUUuTWF0ZXJpYWxbXSB8IFRIUkVFLk1hdGVyaWFsID0gKG9iamVjdCBhcyBhbnkpLm1hdGVyaWFsO1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG1hdGVyaWFsKSkge1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hdGVyaWFsLmZpbHRlcihcbiAgICAgICAgICAgICAgICAgICAgICAobXRsKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgKG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISArICcgKE91dGxpbmUpJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5pbmRleE9mKG10bCkgPT09IC0xLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKTtcbiA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YWwsXG4gICAgICAgICAgICAgICAgICAgIHNjYWxlLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gTWF0ZXJpYWxDb2xvckJpbmRcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxDb2xvclR5cGUgPSB2MEV4cHJlc3Npb25NYXRlcmlhbENvbG9yTWFwW21hdGVyaWFsUHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsQ29sb3JUeXBlKSB7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBtYXRlcmlhbENvbG9yVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlISksXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjb25zb2xlLndhcm4obWF0ZXJpYWxQcm9wZXJ0eU5hbWUgKyAnIGlzIG5vdCBzdXBwb3J0ZWQnKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3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tZSkhO1xuXG4gICAgICAgICAgd29ybGRNYXRyaXguZGVjb21wb3NlKF92M0EsIF9xdWF0QSwgX3YzQSk7XG4gICAgICAgICAgX3F1YXRBLmludmVydCgpO1xuXG4gICAgICAgICAgcGFyZW50V29ybGRNYXRyaXguZGVjb21wb3NlKF92M0EsIF9xdWF0QiwgX3YzQSk7XG5cbiAgICAgICAgICBjb25zdCB0cmFja1ZhbHVlcyA9IGFycmF5Q2h1bmsob3JpZ1RyYWNrLnZhbHVlcywgNCkuZmxhdE1hcCgocSkgPT5cbiAgICAgICAgICAgIF9xdWF0Q1xuICAgICAgICAgICAgICAuZnJvbUFycmF5KHEgYXMgVEhSRUUuUXVhdGVybmlvblR1cGxlKVxuICAgICAgICAgICAgICAucHJlbXVsdGlwbHkoX3F1YXRCKVxuICAgICAgICAgICAgICAubXVsdGlwbHkoX3F1YXRBKVxuICAgICAgICAgICAgICAudG9BcnJheSgpLFxuICAgICAgICAgICk7XG5cbiAgICAgICAgICBjb25zdCB0cmFjayA9IG9yaWdUcmFjay5jbG9uZSgpO1xuICAgICAgICAgIHRyYWNrLnZhbHVlcyA9IG5ldyBGbG9hdDMyQXJyYXkodHJhY2tWYWx1ZXMpO1xuXG4gICAgICAgICAgcmVzdWx0Lmh1bWFub2lkVHJhY2tzLnJvdGF0aW9uLnNldChib25lTmFtZSwgdHJhY2spO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBwYXRoIFwiJHtwYXRofVwiYCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgICAvLyBleHByZXNzaW9uc1xuICAgICAgY29uc3QgZXhwcmVzc2lvbk5hbWUgPSBub2RlTWFwLmV4cHJlc3Npb25zSW5kZXhUb05hbWUuZ2V0KG5vZGUpO1xuICAgICAgaWYgKGV4cHJlc3Npb25OYW1lICE9IG51bGwpIHtcbiAgICAgICAgaWYgKHBhdGggPT09ICd0cmFuc2xhdGlvbicpIHtcbiAgICAgICAgICBjb25zdCB0aW1lcyA9IG9yaWdUcmFjay50aW1lcztcbiAgICAgICAgICBjb25zdCB2YWx1ZXMgPSBuZXcgRmxvYXQzMkFycmF5KG9yaWdUcmFjay52YWx1ZXMubGVuZ3RoIC8gMyk7XG4gICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB2YWx1ZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhbHVlc1tpXSA9IG9yaWdUcmFjay52YWx1ZXNbMyAqIGldO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnN0IG5ld1RyYWNrID0gbmV3IFRIUkVFLk51bWJlcktleWZyYW1lVHJhY2soYCR7ZXhwcmVzc2lvbk5hbWV9LndlaWdodGAsIHRpbWVzIGFzIGFueSwgdmFsdWVzIGFzIGFueSk7XG5cbiAgICAgICAgICBpZiAodnJtRXhwcmVzc2lvblByZXNldE5hbWVTZXQuaGFzKGV4cHJlc3Npb25OYW1lKSkge1xuICAgICAgICAgICAgcmVzdWx0LmV4cHJlc3Npb25UcmFja3MucHJlc2V0LnNldChleHByZXNzaW9uTmFtZSBhcyBWUk1FeHByZXNzaW9uUHJlc2V0TmFtZSwgbmV3VHJhY2spO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQuZXhwcmVzc2lvblRyYWNrcy5jdXN0b20uc2V0KGV4cHJlc3Npb25OYW1lLCBuZXdUcmFjayk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBwYXRoIFwiJHtwYXRofVwiYCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgICAvLyBsb29rQXRcbiAgICAgIGlmIChub2RlID09PSBub2RlTWFwLmxvb2tBdEluZGV4KSB7XG4gICAgICAgIGlmIChwYXRoID09PSAncm90YXRpb24nKSB7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yUGx1Z2luIiwgIl9fYXN5bmMiLCAiX2IiLCAiX1ZSTUZpcnN0UGVyc29uIiwgIl92M0EiLCAiX3F1YXRBIiwgIl92M0EiLCAiX3F1YXRBIiwgIl9xdWF0QSIsICJfdjNBIiwgIl92M0IiLCAiX3YzQSIsICJfdjNCIiwgIl9xdWF0QSIsICJfcXVhdEIiLCAiX1ZSTUxvb2tBdCIsICJWRUMzX1BPU0lUSVZFX1oiLCAiX2V1bGVyQSIsICJUSFJFRSIsICJfZXVsZXJBIiwgIlRIUkVFIiwgIlRIUkVFIiwgIl92M0EiLCAiX3F1YXRBIiwgIl9xdWF0QiIsICJfcXVhdEMiLCAiUE9TU0lCTEVfU1BFQ19WRVJTSU9OUyJdCn0K diff --git a/packages/three-vrm-animation/lib/three-vrm-animation.min.cjs b/packages/three-vrm-animation/lib/three-vrm-animation.min.cjs index fd3d0ac3c..01ba37cfc 100644 --- a/packages/three-vrm-animation/lib/three-vrm-animation.min.cjs +++ b/packages/three-vrm-animation/lib/three-vrm-animation.min.cjs @@ -1,7 +1,7 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -"use strict";var ze=Object.create;var $=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ye=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Ge=(o,e)=>{for(var t in e)$(o,t,{get:e[t],enumerable:!0})},fe=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qe(e))!$e.call(o,r)&&r!==t&&$(o,r,{get:()=>e[r],enumerable:!(n=je(e,r))||n.enumerable});return o};var v=(o,e,t)=>(t=o!=null?ze(Ye(o)):{},fe(e||!o||!o.__esModule?$(t,"default",{value:o,enumerable:!0}):t,o)),Xe=o=>fe($({},"__esModule",{value:!0}),o);var ee=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())});var Mt={};Ge(Mt,{VRMAnimation:()=>z,VRMAnimationLoaderPlugin:()=>J,VRMLookAtQuaternionProxy:()=>S,createVRMAnimationClip:()=>Fe,createVRMAnimationExpressionTracks:()=>de,createVRMAnimationHumanoidTracks:()=>he,createVRMAnimationLookAtTrack:()=>ce});module.exports=Xe(Mt);var Z=v(require("three"),1);var Ae=v(require("three"),1),O=v(require("three"),1),ie=v(require("three"),1),ke=v(require("three"),1),B=v(require("three"),1),D=v(require("three"),1),X=v(require("three"),1),Q=v(require("three"),1),w=v(require("three"),1),Ue=v(require("three"),1),ae=v(require("three"),1),M=v(require("three"),1),le=v(require("three"),1),R=v(require("three"),1),oe=v(require("three"),1),mt=v(require("three"),1);var H=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())}),ge=class extends Ae.Object3D{constructor(o){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${o}`,this.expressionName=o,this.type="VRMExpression",this.visible=!1}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(o){this._binds.push(o)}applyWeight(o){var e;let t=this.outputWeight;t*=(e=o==null?void 0:o.multiplier)!=null?e:1,this.isBinary&&t<1&&(t=0),this._binds.forEach(n=>n.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(o=>o.clearAppliedWeight())}};function Ke(o,e,t){var n,r;let i=o.parser.json,s=(n=i.nodes)==null?void 0:n[e];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let a=s.mesh;if(a==null)return null;let l=(r=i.meshes)==null?void 0:r[a];if(l==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let u=l.primitives.length,d=[];return t.traverse(f=>{d.length{t.has(n)&&(e[n]=r)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(q));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)||(e[n]=r)}),e}copy(e){return this._expressions.concat().forEach(n=>{this.unregisterExpression(n)}),e._expressions.forEach(n=>{this.registerExpression(n)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new Le().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var t;let n=this.getExpression(e);return(t=n==null?void 0:n.weight)!=null?t:null}setValue(e,t){let n=this.getExpression(e);n&&(n.weight=Ze(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let n=1,r=t.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(n*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(n*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(n*=e.mouth),t.applyWeight({multiplier:n})})}_calculateWeightMultipliers(){let e=1,t=1,n=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,t-=r.overrideLookAtAmount,n-=r.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),n=Math.max(0,n),{blink:e,lookAt:t,mouth:n}}},j={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},Je={_Color:j.Color,_EmissionColor:j.EmissionColor,_ShadeColor:j.ShadeColor,_RimColor:j.RimColor,_OutlineColor:j.OutlineColor},et=new ie.Color,Ve=class He{constructor({material:e,type:t,targetValue:n,targetAlpha:r}){this.material=e,this.type=t,this.targetValue=n,this.targetAlpha=r!=null?r:1;let i=this._initColorBindState(),s=this._initAlphaBindState();this._state={color:i,alpha:s}}applyWeight(e){let{color:t,alpha:n}=this._state;if(t!=null){let{propertyName:r,deltaValue:i}=t,s=this.material[r];s!=null&&s.add(et.copy(i).multiplyScalar(e))}if(n!=null){let{propertyName:r,deltaValue:i}=n;this.material[r]!=null&&(this.material[r]+=i*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:n,initialValue:r}=e,i=this.material[n];i!=null&&i.copy(r)}if(t!=null){let{propertyName:n,initialValue:r}=t;this.material[n]!=null&&(this.material[n]=r)}}_initColorBindState(){var e,t,n;let{material:r,type:i,targetValue:s}=this,a=this._getPropertyNameMap(),l=(t=(e=a==null?void 0:a[i])==null?void 0:e[0])!=null?t:null;if(l==null)return console.warn(`Tried to add a material color bind to the material ${(n=r.name)!=null?n:"(no name)"}, the type ${i} but the material or the type is not supported.`),null;let d=r[l].clone(),f=new ie.Color(s.r-d.r,s.g-d.g,s.b-d.b);return{propertyName:l,initialValue:d,deltaValue:f}}_initAlphaBindState(){var e,t,n;let{material:r,type:i,targetAlpha:s}=this,a=this._getPropertyNameMap(),l=(t=(e=a==null?void 0:a[i])==null?void 0:e[1])!=null?t:null;if(l==null&&s!==1)return console.warn(`Tried to add a material alpha bind to the material ${(n=r.name)!=null?n:"(no name)"}, the type ${i} but the material or the type does not support alpha.`),null;if(l==null)return null;let u=r[l],d=s-u;return{propertyName:l,initialValue:u,deltaValue:d}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(He._propertyNameMapMap).find(([n])=>this.material[n]===!0))==null?void 0:e[1])!=null?t:null}};Ve._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var Me=Ve,_e=class{constructor({primitives:o,index:e,weight:t}){this.primitives=o,this.index=e,this.weight=t}applyWeight(o){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*o)})}clearAppliedWeight(){this.primitives.forEach(o=>{var e;((e=o.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(o.morphTargetInfluences[this.index]=0)})}},ye=new ke.Vector2,be=class Be{constructor({material:e,scale:t,offset:n}){var r,i;this.material=e,this.scale=t,this.offset=n;let s=(r=Object.entries(Be._propertyNamesMap).find(([a])=>e[a]===!0))==null?void 0:r[1];s==null?(console.warn(`Tried to add a texture transform bind to the material ${(i=e.name)!=null?i:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],s.forEach(a=>{var l;let u=(l=e[a])==null?void 0:l.clone();if(!u)return null;e[a]=u;let d=u.offset.clone(),f=u.repeat.clone(),m=n.clone().sub(d),p=t.clone().sub(f);this._properties.push({name:a,initialOffset:d,deltaOffset:m,initialScale:f,deltaScale:p})}))}applyWeight(e){this._properties.forEach(t=>{let n=this.material[t.name];n!==void 0&&(n.offset.add(ye.copy(t.deltaOffset).multiplyScalar(e)),n.repeat.add(ye.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};be._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var ve=be,tt=new Set(["1.0","1.0-beta"]),nt=class Ie{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return H(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return H(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let n=yield this._v0Import(e);return n||null})}_v1Import(e){return H(this,null,function*(){var t,n;let r=this.parser.json;if(!(((t=r.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;let s=(n=r.extensions)==null?void 0:n.VRMC_vrm;if(!s)return null;let a=s.specVersion;if(!tt.has(a))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;let l=s.expressions;if(!l)return null;let u=new Set(Object.values(q)),d=new Map;l.preset!=null&&Object.entries(l.preset).forEach(([m,p])=>{if(p!=null){if(!u.has(m)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${m}" detected. Ignoring the expression`);return}d.set(m,p)}}),l.custom!=null&&Object.entries(l.custom).forEach(([m,p])=>{if(u.has(m)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${m}". Ignoring the expression`);return}d.set(m,p)});let f=new Ee;return yield Promise.all(Array.from(d.entries()).map(m=>H(this,[m],function*([p,c]){var h,g,_,E,y,x,P;let T=new ge(p);if(e.scene.add(T),T.isBinary=(h=c.isBinary)!=null?h:!1,T.overrideBlink=(g=c.overrideBlink)!=null?g:"none",T.overrideLookAt=(_=c.overrideLookAt)!=null?_:"none",T.overrideMouth=(E=c.overrideMouth)!=null?E:"none",(y=c.morphTargetBinds)==null||y.forEach(A=>H(this,null,function*(){var L;if(A.node===void 0||A.index===void 0)return;let U=yield Re(e,A.node),k=A.index;if(!U.every(b=>Array.isArray(b.morphTargetInfluences)&&k{let U=L.material;U&&(Array.isArray(U)?A.push(...U):A.push(U))}),(x=c.materialColorBinds)==null||x.forEach(L=>H(this,null,function*(){A.filter(k=>{var b;let C=(b=this.parser.associations.get(k))==null?void 0:b.materials;return L.material===C}).forEach(k=>{T.addBind(new Me({material:k,type:L.type,targetValue:new O.Color().fromArray(L.targetValue),targetAlpha:L.targetValue[3]}))})})),(P=c.textureTransformBinds)==null||P.forEach(L=>H(this,null,function*(){A.filter(k=>{var b;let C=(b=this.parser.associations.get(k))==null?void 0:b.materials;return L.material===C}).forEach(k=>{var b,C;T.addBind(new ve({material:k,offset:new O.Vector2().fromArray((b=L.offset)!=null?b:[0,0]),scale:new O.Vector2().fromArray((C=L.scale)!=null?C:[1,1])}))})}))}f.registerExpression(T)}))),f})}_v0Import(e){return H(this,null,function*(){var t;let n=this.parser.json,r=(t=n.extensions)==null?void 0:t.VRM;if(!r)return null;let i=r.blendShapeMaster;if(!i)return null;let s=new Ee,a=i.blendShapeGroups;if(!a)return s;let l=new Set;return yield Promise.all(a.map(u=>H(this,null,function*(){var d;let f=u.presetName,m=f!=null&&Ie.v0v1PresetNameMap[f]||null,p=m!=null?m:u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(l.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${f} has duplicated entries. Ignoring the expression`);return}l.add(p);let c=new ge(p);e.scene.add(c),c.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(g=>H(this,null,function*(){var _;if(g.mesh===void 0||g.index===void 0)return;let E=[];(_=n.nodes)==null||_.forEach((x,P)=>{x.mesh===g.mesh&&E.push(P)});let y=g.index;yield Promise.all(E.map(x=>H(this,null,function*(){var P;let T=yield Re(e,x);if(!T.every(A=>Array.isArray(A.morphTargetInfluences)&&y{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;let _=[];e.scene.traverse(y=>{if(y.material){let x=y.material;Array.isArray(x)?_.push(...x.filter(P=>(P.name===g.materialName||P.name===g.materialName+" (Outline)")&&_.indexOf(P)===-1)):x.name===g.materialName&&_.indexOf(x)===-1&&_.push(x)}});let E=g.propertyName;_.forEach(y=>{if(E==="_MainTex_ST"){let P=new O.Vector2(g.targetValue[0],g.targetValue[1]),T=new O.Vector2(g.targetValue[2],g.targetValue[3]);T.y=1-T.y-P.y,c.addBind(new ve({material:y,scale:P,offset:T}));return}let x=Je[E];if(x){c.addBind(new Me({material:y,type:x,targetValue:new O.Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(E+" is not supported")})}),s.registerExpression(c)}))),s})}};nt.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var Ne=class W{constructor(e,t){this._firstPersonOnlyLayer=W.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=W.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new W(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=W.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=W.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(n=>{n.meshes.forEach(r=>{n.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(i=>i.layers.set(this._firstPersonOnlyLayer))):n.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(i=>i.layers.set(this._thirdPersonOnlyLayer))):n.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,n,r){let i=0;if(t!=null&&t.length>0)for(let s=0;s0&&r.includes(f[0])||d[1]>0&&r.includes(f[1])||d[2]>0&&r.includes(f[2])||d[3]>0&&r.includes(f[3]))continue;let m=t[l],p=n[l];if(m[0]>0&&r.includes(p[0])||m[1]>0&&r.includes(p[1])||m[2]>0&&r.includes(p[2])||m[3]>0&&r.includes(p[3]))continue;let c=t[u],h=n[u];c[0]>0&&r.includes(h[0])||c[1]>0&&r.includes(h[1])||c[2]>0&&r.includes(h[2])||c[3]>0&&r.includes(h[3])||(e[i++]=a,e[i++]=l,e[i++]=u)}return i}_createErasedMesh(e,t){let n=new B.SkinnedMesh(e.geometry.clone(),e.material);n.name=`${e.name}(erase)`,n.frustumCulled=e.frustumCulled,n.layers.set(this._firstPersonOnlyLayer);let r=n.geometry,i=r.getAttribute("skinIndex"),s=i instanceof B.GLBufferAttribute?[]:i.array,a=[];for(let h=0;h{this._isEraseTarget(i)&&n.push(s)}),!n.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(t,n);e.add(r)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{let t=new B.Group;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(n=>n.type==="SkinnedMesh").forEach(n=>{let r=n;this._createHeadlessModelForSkinnedMesh(t,r)})}else if(e.type==="SkinnedMesh"){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};Ne.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;Ne.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var yt=new D.Vector3,vt=new D.Vector3,xt=new D.Quaternion;var se={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function rt(o){return o.invert?o.invert():o.inverse(),o}var Tt=new X.Vector3,wt=new X.Quaternion;var Pt=new Q.Vector3,At=new Q.Quaternion,Lt=new Q.Vector3;var Vt=new w.Quaternion,Ht=new w.Quaternion,kt=new w.Vector3,bt=new w.Vector3,xe=Math.sqrt(2)/2,Bt=new w.Quaternion(0,0,-xe,xe),It=new w.Vector3(0,1,0);var ot=new le.Vector3,it=new le.Vector3;function re(o,e){return o.matrixWorld.decompose(ot,e,it),e}function G(o){return[Math.atan2(-o.z,o.x),Math.atan2(o.y,Math.sqrt(o.x*o.x+o.z*o.z))]}function Te(o){let e=Math.round(o/2/Math.PI);return o-2*Math.PI*e}var we=new M.Vector3(0,0,1),st=new M.Vector3,at=new M.Vector3,lt=new M.Vector3,ut=new M.Quaternion,te=new M.Quaternion,Pe=new M.Quaternion,ht=new M.Quaternion,ne=new M.Euler,Oe=class De{constructor(e,t){this.offsetFromHeadBone=new M.Vector3,this.autoUpdate=!0,this.faceFront=new M.Vector3(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new M.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new M.Euler)}getEuler(e){return e.set(M.MathUtils.DEG2RAD*this._pitch,M.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new De(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){let t=this.humanoid.getRawBoneNode("head");return re(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(we)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,n]=G(this.faceFront);return ne.set(0,.5*Math.PI+t,n,"YZX"),e.setFromEuler(ne).premultiply(ht.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(te),this.getFaceFrontQuaternion(Pe),e.copy(we).applyQuaternion(te).applyQuaternion(Pe).applyEuler(this.getEuler(ne))}lookAt(e){let t=ut.copy(this._restHeadWorldQuaternion).multiply(rt(this.getLookAtWorldQuaternion(te))),n=this.getLookAtWorldPosition(at),r=lt.copy(e).sub(n).applyQuaternion(t).normalize(),[i,s]=G(this.faceFront),[a,l]=G(r),u=Te(a-i),d=Te(s-l);this._yaw=M.MathUtils.RAD2DEG*u,this._pitch=M.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(st)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Oe.EULER_ORDER="YXZ";var Se=Oe,dt=new R.Vector3(0,0,1),N=new R.Quaternion,F=new R.Quaternion,V=new R.Euler(0,0,0,"YXZ"),ct=class{constructor(o,e,t,n,r){this.humanoid=o,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=n,this.rangeMapVerticalUp=r,this.faceFront=new R.Vector3(0,0,1),this._restQuatLeftEye=new R.Quaternion,this._restQuatRightEye=new R.Quaternion,this._restLeftEyeParentWorldQuat=new R.Quaternion,this._restRightEyeParentWorldQuat=new R.Quaternion;let i=this.humanoid.getRawBoneNode("leftEye"),s=this.humanoid.getRawBoneNode("rightEye");i&&(this._restQuatLeftEye.copy(i.quaternion),re(i.parent,this._restLeftEyeParentWorldQuat)),s&&(this._restQuatRightEye.copy(s.quaternion),re(s.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(o,e){let t=this.humanoid.getRawBoneNode("leftEye"),n=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),i=this.humanoid.getNormalizedBoneNode("rightEye");t&&(e<0?V.x=-R.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):V.x=R.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),o<0?V.y=-R.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-o):V.y=R.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(o),N.setFromEuler(V),this._getWorldFaceFrontQuat(F),r.quaternion.copy(F).multiply(N).multiply(F.invert()),N.copy(this._restLeftEyeParentWorldQuat),t.quaternion.copy(r.quaternion).multiply(N).premultiply(N.invert()).multiply(this._restQuatLeftEye)),n&&(e<0?V.x=-R.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):V.x=R.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),o<0?V.y=-R.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-o):V.y=R.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(o),N.setFromEuler(V),this._getWorldFaceFrontQuat(F),i.quaternion.copy(F).multiply(N).multiply(F.invert()),N.copy(this._restRightEyeParentWorldQuat),n.quaternion.copy(i.quaternion).multiply(N).premultiply(N.invert()).multiply(this._restQuatRightEye))}lookAt(o){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=R.MathUtils.RAD2DEG*o.y,t=R.MathUtils.RAD2DEG*o.x;this.applyYawPitch(e,t)}_getWorldFaceFrontQuat(o){if(this.faceFront.distanceToSquared(dt)<.01)return o.identity();let[e,t]=G(this.faceFront);return V.set(0,.5*Math.PI+e,t,"YZX"),o.setFromEuler(V)}};ct.type="bone";var pt=class{constructor(o,e,t,n,r){this.expressions=o,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=n,this.rangeMapVerticalUp=r}applyYawPitch(o,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),o<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-o))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(o)))}lookAt(o){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=oe.MathUtils.RAD2DEG*o.y,t=oe.MathUtils.RAD2DEG*o.x;this.applyYawPitch(e,t)}};pt.type="expression";var K=v(require("three"),1),Ce=180/Math.PI,ue=new K.Euler,S=class extends K.Object3D{constructor(e){super(),this.vrmLookAt=e,this.type="VRMLookAtQuaternionProxy";let t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});let n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){ue.setFromQuaternion(this.quaternion,Se.EULER_ORDER),this.vrmLookAt.yaw=Ce*ue.y,this.vrmLookAt.pitch=Ce*ue.x}};function he(o,e,t){var i,s;let n=new Map,r=new Map;for(let[a,l]of o.humanoidTracks.rotation.entries()){let u=(i=e.getNormalizedBoneNode(a))==null?void 0:i.name;if(u!=null){let d=new Z.QuaternionKeyframeTrack(`${u}.quaternion`,l.times,l.values.map((f,m)=>t==="0"&&m%2===0?-f:f));r.set(a,d)}}for(let[a,l]of o.humanoidTracks.translation.entries()){let u=(s=e.getNormalizedBoneNode(a))==null?void 0:s.name;if(u!=null){let d=o.restHipsPosition.y,m=e.normalizedRestPose.hips.position[1]/d,p=l.clone();p.values=p.values.map((c,h)=>(t==="0"&&h%3!==1?-c:c)*m),p.name=`${u}.position`,n.set(a,p)}}return{translation:n,rotation:r}}function de(o,e){let t=new Map,n=new Map;for(let[r,i]of o.expressionTracks.preset.entries()){let s=e.getExpressionTrackName(r);if(s!=null){let a=i.clone();a.name=s,t.set(r,a)}}for(let[r,i]of o.expressionTracks.custom.entries()){let s=e.getExpressionTrackName(r);if(s!=null){let a=i.clone();a.name=s,n.set(r,a)}}return{preset:t,custom:n}}function ce(o,e){if(o.lookAtTrack==null)return null;let t=o.lookAtTrack.clone();return t.name=e,t}function Fe(o,e){let t=[],n=he(o,e.humanoid,e.meta.metaVersion);if(t.push(...n.translation.values()),t.push(...n.rotation.values()),e.expressionManager!=null){let r=de(o,e.expressionManager);t.push(...r.preset.values()),t.push(...r.custom.values())}if(e.lookAt!=null){let r=e.scene.children.find(s=>s instanceof S);r==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),r=new S(e.lookAt),r.name="VRMLookAtQuaternionProxy",e.scene.add(r)):r.name==null&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),r.name="VRMLookAtQuaternionProxy");let i=ce(o,`${r.name}.quaternion`);i!=null&&t.push(i)}return new Z.AnimationClip("Clip",o.duration,t)}var We=v(require("three"),1),z=class{constructor(){this.duration=0,this.restHipsPosition=new We.Vector3,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};var I=v(require("three"),1);function pe(o,e){let t=o.length,n=[],r=[],i=0;for(let s=0;s{let E=t.animations[_],y=this._parseAnimation(g,E,s,a);return y.restHipsPosition=d,y});e.userData.vrmAnimations=m})}_createNodeMap(e){var l,u,d,f,m;let t=new Map,n=new Map,r=(l=e.humanoid)==null?void 0:l.humanBones;r&&Object.entries(r).forEach(([p,c])=>{let h=c==null?void 0:c.node;h!=null&&t.set(h,p)});let i=(u=e.expressions)==null?void 0:u.preset;i&&Object.entries(i).forEach(([p,c])=>{let h=c==null?void 0:c.node;h!=null&&n.set(h,p)});let s=(d=e.expressions)==null?void 0:d.custom;s&&Object.entries(s).forEach(([p,c])=>{let{node:h}=c;n.set(h,p)});let a=(m=(f=e.lookAt)==null?void 0:f.node)!=null?m:null;return{humanoidIndexToName:t,expressionsIndexToName:n,lookAtIndex:a}}_createBoneWorldMatrixMap(e,t){return ee(this,null,function*(){var i,s;e.scene.updateWorldMatrix(!1,!0);let n=yield e.parser.getDependencies("node"),r=new Map;if(t.humanoid==null)return r;for(let[a,l]of Object.entries(t.humanoid.humanBones)){let u=l==null?void 0:l.node;if(u!=null){let d=n[u];r.set(a,d.matrixWorld),a==="hips"&&r.set("hipsParent",(s=(i=d.parent)==null?void 0:i.matrixWorld)!=null?s:ft)}}return r})}_parseAnimation(e,t,n,r){let i=e.tracks,s=t.channels,a=new z;return a.duration=e.duration,s.forEach((l,u)=>{let{node:d,path:f}=l.target,m=i[u];if(d==null)return;let p=n.humanoidIndexToName.get(d);if(p!=null){let h=se[p];for(;h!=null&&r.get(h)==null;)h=se[h];if(h!=null||(h="hipsParent"),f==="translation")if(p!=="hips")console.warn(`The loading animation contains a translation track for ${p}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{let g=r.get("hipsParent"),_=pe(m.values,3).flatMap(y=>Y.fromArray(y).applyMatrix4(g).toArray()),E=m.clone();E.values=new Float32Array(_),a.humanoidTracks.translation.set(p,E)}else if(f==="rotation"){let g=r.get(p),_=r.get(h);g.decompose(Y,me,Y),me.invert(),_.decompose(Y,Qe,Y);let E=pe(m.values,4).flatMap(x=>gt.fromArray(x).premultiply(Qe).multiply(me).toArray()),y=m.clone();y.values=new Float32Array(E),a.humanoidTracks.rotation.set(p,y)}else throw new Error(`Invalid path "${f}"`);return}let c=n.expressionsIndexToName.get(d);if(c!=null){if(f==="translation"){let h=m.times,g=new Float32Array(m.values.length/3);for(let E=0;E{for(var t in e)$(o,t,{get:e[t],enumerable:!0})},fe=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qe(e))!$e.call(o,r)&&r!==t&&$(o,r,{get:()=>e[r],enumerable:!(n=je(e,r))||n.enumerable});return o};var v=(o,e,t)=>(t=o!=null?ze(Ye(o)):{},fe(e||!o||!o.__esModule?$(t,"default",{value:o,enumerable:!0}):t,o)),Xe=o=>fe($({},"__esModule",{value:!0}),o);var ee=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())});var Mt={};Ge(Mt,{VRMAnimation:()=>z,VRMAnimationLoaderPlugin:()=>J,VRMLookAtQuaternionProxy:()=>S,createVRMAnimationClip:()=>Fe,createVRMAnimationExpressionTracks:()=>de,createVRMAnimationHumanoidTracks:()=>he,createVRMAnimationLookAtTrack:()=>ce});module.exports=Xe(Mt);var Z=v(require("three"),1);var Ae=v(require("three"),1),O=v(require("three"),1),ie=v(require("three"),1),ke=v(require("three"),1),B=v(require("three"),1),D=v(require("three"),1),X=v(require("three"),1),Q=v(require("three"),1),w=v(require("three"),1),Ue=v(require("three"),1),ae=v(require("three"),1),M=v(require("three"),1),le=v(require("three"),1),R=v(require("three"),1),oe=v(require("three"),1),mt=v(require("three"),1);var H=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())}),ge=class extends Ae.Object3D{constructor(o){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${o}`,this.expressionName=o,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(o){this._binds.push(o)}deleteBind(o){let e=this._binds.indexOf(o);e>=0&&this._binds.splice(e,1)}applyWeight(o){var e;let t=this.outputWeight;t*=(e=o==null?void 0:o.multiplier)!=null?e:1,this.isBinary&&t<1&&(t=0),this._binds.forEach(n=>n.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(o=>o.clearAppliedWeight())}};function Ke(o,e,t){var n,r;let i=o.parser.json,s=(n=i.nodes)==null?void 0:n[e];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let a=s.mesh;if(a==null)return null;let l=(r=i.meshes)==null?void 0:r[a];if(l==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let u=l.primitives.length,d=[];return t.traverse(f=>{d.length{t.has(n)&&(e[n]=r)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(q));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)||(e[n]=r)}),e}copy(e){return this._expressions.concat().forEach(n=>{this.unregisterExpression(n)}),e._expressions.forEach(n=>{this.registerExpression(n)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new Le().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var t;let n=this.getExpression(e);return(t=n==null?void 0:n.weight)!=null?t:null}setValue(e,t){let n=this.getExpression(e);n&&(n.weight=Ze(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let n=1,r=t.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(n*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(n*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(n*=e.mouth),t.applyWeight({multiplier:n})})}_calculateWeightMultipliers(){let e=1,t=1,n=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,t-=r.overrideLookAtAmount,n-=r.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),n=Math.max(0,n),{blink:e,lookAt:t,mouth:n}}},j={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},Je={_Color:j.Color,_EmissionColor:j.EmissionColor,_ShadeColor:j.ShadeColor,_RimColor:j.RimColor,_OutlineColor:j.OutlineColor},et=new ie.Color,Ve=class He{constructor({material:e,type:t,targetValue:n,targetAlpha:r}){this.material=e,this.type=t,this.targetValue=n,this.targetAlpha=r!=null?r:1;let i=this._initColorBindState(),s=this._initAlphaBindState();this._state={color:i,alpha:s}}applyWeight(e){let{color:t,alpha:n}=this._state;if(t!=null){let{propertyName:r,deltaValue:i}=t,s=this.material[r];s!=null&&s.add(et.copy(i).multiplyScalar(e))}if(n!=null){let{propertyName:r,deltaValue:i}=n;this.material[r]!=null&&(this.material[r]+=i*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:n,initialValue:r}=e,i=this.material[n];i!=null&&i.copy(r)}if(t!=null){let{propertyName:n,initialValue:r}=t;this.material[n]!=null&&(this.material[n]=r)}}_initColorBindState(){var e,t,n;let{material:r,type:i,targetValue:s}=this,a=this._getPropertyNameMap(),l=(t=(e=a==null?void 0:a[i])==null?void 0:e[0])!=null?t:null;if(l==null)return console.warn(`Tried to add a material color bind to the material ${(n=r.name)!=null?n:"(no name)"}, the type ${i} but the material or the type is not supported.`),null;let d=r[l].clone(),f=new ie.Color(s.r-d.r,s.g-d.g,s.b-d.b);return{propertyName:l,initialValue:d,deltaValue:f}}_initAlphaBindState(){var e,t,n;let{material:r,type:i,targetAlpha:s}=this,a=this._getPropertyNameMap(),l=(t=(e=a==null?void 0:a[i])==null?void 0:e[1])!=null?t:null;if(l==null&&s!==1)return console.warn(`Tried to add a material alpha bind to the material ${(n=r.name)!=null?n:"(no name)"}, the type ${i} but the material or the type does not support alpha.`),null;if(l==null)return null;let u=r[l],d=s-u;return{propertyName:l,initialValue:u,deltaValue:d}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(He._propertyNameMapMap).find(([n])=>this.material[n]===!0))==null?void 0:e[1])!=null?t:null}};Ve._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var Me=Ve,_e=class{constructor({primitives:o,index:e,weight:t}){this.primitives=o,this.index=e,this.weight=t}applyWeight(o){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*o)})}clearAppliedWeight(){this.primitives.forEach(o=>{var e;((e=o.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(o.morphTargetInfluences[this.index]=0)})}},ye=new ke.Vector2,be=class Be{constructor({material:e,scale:t,offset:n}){var r,i;this.material=e,this.scale=t,this.offset=n;let s=(r=Object.entries(Be._propertyNamesMap).find(([a])=>e[a]===!0))==null?void 0:r[1];s==null?(console.warn(`Tried to add a texture transform bind to the material ${(i=e.name)!=null?i:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],s.forEach(a=>{var l;let u=(l=e[a])==null?void 0:l.clone();if(!u)return null;e[a]=u;let d=u.offset.clone(),f=u.repeat.clone(),m=n.clone().sub(d),p=t.clone().sub(f);this._properties.push({name:a,initialOffset:d,deltaOffset:m,initialScale:f,deltaScale:p})}))}applyWeight(e){this._properties.forEach(t=>{let n=this.material[t.name];n!==void 0&&(n.offset.add(ye.copy(t.deltaOffset).multiplyScalar(e)),n.repeat.add(ye.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};be._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var ve=be,tt=new Set(["1.0","1.0-beta"]),nt=class Ie{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return H(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return H(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let n=yield this._v0Import(e);return n||null})}_v1Import(e){return H(this,null,function*(){var t,n;let r=this.parser.json;if(!(((t=r.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;let s=(n=r.extensions)==null?void 0:n.VRMC_vrm;if(!s)return null;let a=s.specVersion;if(!tt.has(a))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;let l=s.expressions;if(!l)return null;let u=new Set(Object.values(q)),d=new Map;l.preset!=null&&Object.entries(l.preset).forEach(([m,p])=>{if(p!=null){if(!u.has(m)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${m}" detected. Ignoring the expression`);return}d.set(m,p)}}),l.custom!=null&&Object.entries(l.custom).forEach(([m,p])=>{if(u.has(m)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${m}". Ignoring the expression`);return}d.set(m,p)});let f=new Ee;return yield Promise.all(Array.from(d.entries()).map(m=>H(this,[m],function*([p,c]){var h,g,_,E,y,x,P;let T=new ge(p);if(e.scene.add(T),T.isBinary=(h=c.isBinary)!=null?h:!1,T.overrideBlink=(g=c.overrideBlink)!=null?g:"none",T.overrideLookAt=(_=c.overrideLookAt)!=null?_:"none",T.overrideMouth=(E=c.overrideMouth)!=null?E:"none",(y=c.morphTargetBinds)==null||y.forEach(A=>H(this,null,function*(){var L;if(A.node===void 0||A.index===void 0)return;let U=yield Re(e,A.node),k=A.index;if(!U.every(b=>Array.isArray(b.morphTargetInfluences)&&k{let U=L.material;U&&(Array.isArray(U)?A.push(...U):A.push(U))}),(x=c.materialColorBinds)==null||x.forEach(L=>H(this,null,function*(){A.filter(k=>{var b;let C=(b=this.parser.associations.get(k))==null?void 0:b.materials;return L.material===C}).forEach(k=>{T.addBind(new Me({material:k,type:L.type,targetValue:new O.Color().fromArray(L.targetValue),targetAlpha:L.targetValue[3]}))})})),(P=c.textureTransformBinds)==null||P.forEach(L=>H(this,null,function*(){A.filter(k=>{var b;let C=(b=this.parser.associations.get(k))==null?void 0:b.materials;return L.material===C}).forEach(k=>{var b,C;T.addBind(new ve({material:k,offset:new O.Vector2().fromArray((b=L.offset)!=null?b:[0,0]),scale:new O.Vector2().fromArray((C=L.scale)!=null?C:[1,1])}))})}))}f.registerExpression(T)}))),f})}_v0Import(e){return H(this,null,function*(){var t;let n=this.parser.json,r=(t=n.extensions)==null?void 0:t.VRM;if(!r)return null;let i=r.blendShapeMaster;if(!i)return null;let s=new Ee,a=i.blendShapeGroups;if(!a)return s;let l=new Set;return yield Promise.all(a.map(u=>H(this,null,function*(){var d;let f=u.presetName,m=f!=null&&Ie.v0v1PresetNameMap[f]||null,p=m!=null?m:u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(l.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${f} has duplicated entries. Ignoring the expression`);return}l.add(p);let c=new ge(p);e.scene.add(c),c.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(g=>H(this,null,function*(){var _;if(g.mesh===void 0||g.index===void 0)return;let E=[];(_=n.nodes)==null||_.forEach((x,P)=>{x.mesh===g.mesh&&E.push(P)});let y=g.index;yield Promise.all(E.map(x=>H(this,null,function*(){var P;let T=yield Re(e,x);if(!T.every(A=>Array.isArray(A.morphTargetInfluences)&&y{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;let _=[];e.scene.traverse(y=>{if(y.material){let x=y.material;Array.isArray(x)?_.push(...x.filter(P=>(P.name===g.materialName||P.name===g.materialName+" (Outline)")&&_.indexOf(P)===-1)):x.name===g.materialName&&_.indexOf(x)===-1&&_.push(x)}});let E=g.propertyName;_.forEach(y=>{if(E==="_MainTex_ST"){let P=new O.Vector2(g.targetValue[0],g.targetValue[1]),T=new O.Vector2(g.targetValue[2],g.targetValue[3]);T.y=1-T.y-P.y,c.addBind(new ve({material:y,scale:P,offset:T}));return}let x=Je[E];if(x){c.addBind(new Me({material:y,type:x,targetValue:new O.Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(E+" is not supported")})}),s.registerExpression(c)}))),s})}};nt.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var Ne=class W{constructor(e,t){this._firstPersonOnlyLayer=W.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=W.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new W(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=W.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=W.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(n=>{n.meshes.forEach(r=>{n.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(i=>i.layers.set(this._firstPersonOnlyLayer))):n.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(i=>i.layers.set(this._thirdPersonOnlyLayer))):n.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,n,r){let i=0;if(t!=null&&t.length>0)for(let s=0;s0&&r.includes(f[0])||d[1]>0&&r.includes(f[1])||d[2]>0&&r.includes(f[2])||d[3]>0&&r.includes(f[3]))continue;let m=t[l],p=n[l];if(m[0]>0&&r.includes(p[0])||m[1]>0&&r.includes(p[1])||m[2]>0&&r.includes(p[2])||m[3]>0&&r.includes(p[3]))continue;let c=t[u],h=n[u];c[0]>0&&r.includes(h[0])||c[1]>0&&r.includes(h[1])||c[2]>0&&r.includes(h[2])||c[3]>0&&r.includes(h[3])||(e[i++]=a,e[i++]=l,e[i++]=u)}return i}_createErasedMesh(e,t){let n=new B.SkinnedMesh(e.geometry.clone(),e.material);n.name=`${e.name}(erase)`,n.frustumCulled=e.frustumCulled,n.layers.set(this._firstPersonOnlyLayer);let r=n.geometry,i=r.getAttribute("skinIndex"),s=i instanceof B.GLBufferAttribute?[]:i.array,a=[];for(let h=0;h{this._isEraseTarget(i)&&n.push(s)}),!n.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(t,n);e.add(r)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{let t=new B.Group;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(n=>n.type==="SkinnedMesh").forEach(n=>{let r=n;this._createHeadlessModelForSkinnedMesh(t,r)})}else if(e.type==="SkinnedMesh"){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};Ne.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;Ne.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var yt=new D.Vector3,vt=new D.Vector3,xt=new D.Quaternion;var se={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function rt(o){return o.invert?o.invert():o.inverse(),o}var Tt=new X.Vector3,wt=new X.Quaternion;var Pt=new Q.Vector3,At=new Q.Quaternion,Lt=new Q.Vector3;var Vt=new w.Quaternion,Ht=new w.Quaternion,kt=new w.Vector3,bt=new w.Vector3,xe=Math.sqrt(2)/2,Bt=new w.Quaternion(0,0,-xe,xe),It=new w.Vector3(0,1,0);var ot=new le.Vector3,it=new le.Vector3;function re(o,e){return o.matrixWorld.decompose(ot,e,it),e}function G(o){return[Math.atan2(-o.z,o.x),Math.atan2(o.y,Math.sqrt(o.x*o.x+o.z*o.z))]}function Te(o){let e=Math.round(o/2/Math.PI);return o-2*Math.PI*e}var we=new M.Vector3(0,0,1),st=new M.Vector3,at=new M.Vector3,lt=new M.Vector3,ut=new M.Quaternion,te=new M.Quaternion,Pe=new M.Quaternion,ht=new M.Quaternion,ne=new M.Euler,Oe=class De{constructor(e,t){this.offsetFromHeadBone=new M.Vector3,this.autoUpdate=!0,this.faceFront=new M.Vector3(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new M.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new M.Euler)}getEuler(e){return e.set(M.MathUtils.DEG2RAD*this._pitch,M.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new De(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){let t=this.humanoid.getRawBoneNode("head");return re(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(we)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,n]=G(this.faceFront);return ne.set(0,.5*Math.PI+t,n,"YZX"),e.setFromEuler(ne).premultiply(ht.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(te),this.getFaceFrontQuaternion(Pe),e.copy(we).applyQuaternion(te).applyQuaternion(Pe).applyEuler(this.getEuler(ne))}lookAt(e){let t=ut.copy(this._restHeadWorldQuaternion).multiply(rt(this.getLookAtWorldQuaternion(te))),n=this.getLookAtWorldPosition(at),r=lt.copy(e).sub(n).applyQuaternion(t).normalize(),[i,s]=G(this.faceFront),[a,l]=G(r),u=Te(a-i),d=Te(s-l);this._yaw=M.MathUtils.RAD2DEG*u,this._pitch=M.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(st)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Oe.EULER_ORDER="YXZ";var Se=Oe,dt=new R.Vector3(0,0,1),N=new R.Quaternion,F=new R.Quaternion,V=new R.Euler(0,0,0,"YXZ"),ct=class{constructor(o,e,t,n,r){this.humanoid=o,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=n,this.rangeMapVerticalUp=r,this.faceFront=new R.Vector3(0,0,1),this._restQuatLeftEye=new R.Quaternion,this._restQuatRightEye=new R.Quaternion,this._restLeftEyeParentWorldQuat=new R.Quaternion,this._restRightEyeParentWorldQuat=new R.Quaternion;let i=this.humanoid.getRawBoneNode("leftEye"),s=this.humanoid.getRawBoneNode("rightEye");i&&(this._restQuatLeftEye.copy(i.quaternion),re(i.parent,this._restLeftEyeParentWorldQuat)),s&&(this._restQuatRightEye.copy(s.quaternion),re(s.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(o,e){let t=this.humanoid.getRawBoneNode("leftEye"),n=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),i=this.humanoid.getNormalizedBoneNode("rightEye");t&&(e<0?V.x=-R.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):V.x=R.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),o<0?V.y=-R.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-o):V.y=R.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(o),N.setFromEuler(V),this._getWorldFaceFrontQuat(F),r.quaternion.copy(F).multiply(N).multiply(F.invert()),N.copy(this._restLeftEyeParentWorldQuat),t.quaternion.copy(r.quaternion).multiply(N).premultiply(N.invert()).multiply(this._restQuatLeftEye)),n&&(e<0?V.x=-R.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):V.x=R.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),o<0?V.y=-R.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-o):V.y=R.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(o),N.setFromEuler(V),this._getWorldFaceFrontQuat(F),i.quaternion.copy(F).multiply(N).multiply(F.invert()),N.copy(this._restRightEyeParentWorldQuat),n.quaternion.copy(i.quaternion).multiply(N).premultiply(N.invert()).multiply(this._restQuatRightEye))}lookAt(o){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=R.MathUtils.RAD2DEG*o.y,t=R.MathUtils.RAD2DEG*o.x;this.applyYawPitch(e,t)}_getWorldFaceFrontQuat(o){if(this.faceFront.distanceToSquared(dt)<.01)return o.identity();let[e,t]=G(this.faceFront);return V.set(0,.5*Math.PI+e,t,"YZX"),o.setFromEuler(V)}};ct.type="bone";var pt=class{constructor(o,e,t,n,r){this.expressions=o,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=n,this.rangeMapVerticalUp=r}applyYawPitch(o,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),o<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-o))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(o)))}lookAt(o){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=oe.MathUtils.RAD2DEG*o.y,t=oe.MathUtils.RAD2DEG*o.x;this.applyYawPitch(e,t)}};pt.type="expression";var K=v(require("three"),1),Ce=180/Math.PI,ue=new K.Euler,S=class extends K.Object3D{constructor(e){super(),this.vrmLookAt=e,this.type="VRMLookAtQuaternionProxy";let t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});let n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){ue.setFromQuaternion(this.quaternion,Se.EULER_ORDER),this.vrmLookAt.yaw=Ce*ue.y,this.vrmLookAt.pitch=Ce*ue.x}};function he(o,e,t){var i,s;let n=new Map,r=new Map;for(let[a,l]of o.humanoidTracks.rotation.entries()){let u=(i=e.getNormalizedBoneNode(a))==null?void 0:i.name;if(u!=null){let d=new Z.QuaternionKeyframeTrack(`${u}.quaternion`,l.times,l.values.map((f,m)=>t==="0"&&m%2===0?-f:f));r.set(a,d)}}for(let[a,l]of o.humanoidTracks.translation.entries()){let u=(s=e.getNormalizedBoneNode(a))==null?void 0:s.name;if(u!=null){let d=o.restHipsPosition.y,m=e.normalizedRestPose.hips.position[1]/d,p=l.clone();p.values=p.values.map((c,h)=>(t==="0"&&h%3!==1?-c:c)*m),p.name=`${u}.position`,n.set(a,p)}}return{translation:n,rotation:r}}function de(o,e){let t=new Map,n=new Map;for(let[r,i]of o.expressionTracks.preset.entries()){let s=e.getExpressionTrackName(r);if(s!=null){let a=i.clone();a.name=s,t.set(r,a)}}for(let[r,i]of o.expressionTracks.custom.entries()){let s=e.getExpressionTrackName(r);if(s!=null){let a=i.clone();a.name=s,n.set(r,a)}}return{preset:t,custom:n}}function ce(o,e){if(o.lookAtTrack==null)return null;let t=o.lookAtTrack.clone();return t.name=e,t}function Fe(o,e){let t=[],n=he(o,e.humanoid,e.meta.metaVersion);if(t.push(...n.translation.values()),t.push(...n.rotation.values()),e.expressionManager!=null){let r=de(o,e.expressionManager);t.push(...r.preset.values()),t.push(...r.custom.values())}if(e.lookAt!=null){let r=e.scene.children.find(s=>s instanceof S);r==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),r=new S(e.lookAt),r.name="VRMLookAtQuaternionProxy",e.scene.add(r)):r.name==null&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),r.name="VRMLookAtQuaternionProxy");let i=ce(o,`${r.name}.quaternion`);i!=null&&t.push(i)}return new Z.AnimationClip("Clip",o.duration,t)}var We=v(require("three"),1),z=class{constructor(){this.duration=0,this.restHipsPosition=new We.Vector3,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};var I=v(require("three"),1);function pe(o,e){let t=o.length,n=[],r=[],i=0;for(let s=0;s{let E=t.animations[_],y=this._parseAnimation(g,E,s,a);return y.restHipsPosition=d,y});e.userData.vrmAnimations=m})}_createNodeMap(e){var l,u,d,f,m;let t=new Map,n=new Map,r=(l=e.humanoid)==null?void 0:l.humanBones;r&&Object.entries(r).forEach(([p,c])=>{let h=c==null?void 0:c.node;h!=null&&t.set(h,p)});let i=(u=e.expressions)==null?void 0:u.preset;i&&Object.entries(i).forEach(([p,c])=>{let h=c==null?void 0:c.node;h!=null&&n.set(h,p)});let s=(d=e.expressions)==null?void 0:d.custom;s&&Object.entries(s).forEach(([p,c])=>{let{node:h}=c;n.set(h,p)});let a=(m=(f=e.lookAt)==null?void 0:f.node)!=null?m:null;return{humanoidIndexToName:t,expressionsIndexToName:n,lookAtIndex:a}}_createBoneWorldMatrixMap(e,t){return ee(this,null,function*(){var i,s;e.scene.updateWorldMatrix(!1,!0);let n=yield e.parser.getDependencies("node"),r=new Map;if(t.humanoid==null)return r;for(let[a,l]of Object.entries(t.humanoid.humanBones)){let u=l==null?void 0:l.node;if(u!=null){let d=n[u];r.set(a,d.matrixWorld),a==="hips"&&r.set("hipsParent",(s=(i=d.parent)==null?void 0:i.matrixWorld)!=null?s:ft)}}return r})}_parseAnimation(e,t,n,r){let i=e.tracks,s=t.channels,a=new z;return a.duration=e.duration,s.forEach((l,u)=>{let{node:d,path:f}=l.target,m=i[u];if(d==null)return;let p=n.humanoidIndexToName.get(d);if(p!=null){let h=se[p];for(;h!=null&&r.get(h)==null;)h=se[h];if(h!=null||(h="hipsParent"),f==="translation")if(p!=="hips")console.warn(`The loading animation contains a translation track for ${p}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{let g=r.get("hipsParent"),_=pe(m.values,3).flatMap(y=>Y.fromArray(y).applyMatrix4(g).toArray()),E=m.clone();E.values=new Float32Array(_),a.humanoidTracks.translation.set(p,E)}else if(f==="rotation"){let g=r.get(p),_=r.get(h);g.decompose(Y,me,Y),me.invert(),_.decompose(Y,Qe,Y);let E=pe(m.values,4).flatMap(x=>gt.fromArray(x).premultiply(Qe).multiply(me).toArray()),y=m.clone();y.values=new Float32Array(E),a.humanoidTracks.rotation.set(p,y)}else throw new Error(`Invalid path "${f}"`);return}let c=n.expressionsIndexToName.get(d);if(c!=null){if(f==="translation"){let h=m.times,g=new Float32Array(m.values.length/3);for(let E=0;E= 0) { + this._binds.splice(index, 1); + } + } /** * Apply weight to every assigned blend shapes. * Should be called every frame. @@ -1991,11 +2013,11 @@ export { createVRMAnimationLookAtTrack }; /*! - * @pixiv/three-vrm-core v3.2.0 + * @pixiv/three-vrm-core v3.3.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. * @pixiv/three-vrm-core is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2NyZWF0ZVZSTUFuaW1hdGlvbkNsaXAudHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb24udHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW4udHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL3V0aWxzL2dsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlL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FsdWVbM10sXG4gICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNjaGVtYUV4cHJlc3Npb24udGV4dHVyZVRyYW5zZm9ybUJpbmRzPy5mb3JFYWNoKGFzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbHMgPSBnbHRmTWF0ZXJpYWxzLmZpbHRlcigobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxJbmRleCA9IHRoaXMucGFyc2VyLmFzc29jaWF0aW9ucy5nZXQobWF0ZXJpYWwpPy5tYXRlcmlhbHM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIG9mZnNldDogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5vZmZzZXQgPz8gWzAuMCwgMC4wXSksXG4gICAgICAgICAgICAgICAgICBzY2FsZTogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5zY2FsZSA/PyBbMS4wLCAxLjBdKSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7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NjaGVtYUdyb3VwLmlzQmluYXJ5ID8/IGZhbHNlO1xuICAgICAgICAvLyB2MCBkb2Vzbid0IGhhdmUgaWdub3JlIHByb3BlcnRpZXNcblxuICAgICAgICAvLyBCaW5kIG1vcnBoVGFyZ2V0XG4gICAgICAgIGlmIChzY2hlbWFHcm91cC5iaW5kcykge1xuICAgICAgICAgIHNjaGVtYUdyb3VwLmJpbmRzLmZvckVhY2goYXN5bmMgKGJpbmQpID0+IHtcbiAgICAgICAgICAgIGlmIChiaW5kLm1lc2ggPT09IHVuZGVmaW5lZCB8fCBiaW5kLmluZGV4ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBub2Rlc1VzaW5nTWVzaDogbnVtYmVyW10gPSBbXTtcbiAgICAgICAgICAgIGpzb24ubm9kZXM/LmZvckVhY2goKG5vZGUsIGkpID0+IHtcbiAgICAgICAgICAgICAgaWYgKG5vZGUubWVzaCA9PT0gYmluZC5tZXNoKSB7XG4gICAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gucHVzaChpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gubWFwKGFzeW5jIChub2RlSW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwcmltaXRpdmVzID0gKGF3YWl0IGdsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlKGdsdGYsIG5vZGVJbmRleCkpITtcblxuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUdyb3VwLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4ICR7bW9ycGhUYXJnZXRJbmRleH10aCBtb3JwaCBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIHdlaWdodDogMC4wMSAqIChiaW5kLndlaWdodCA/PyAxMDApLCAvLyBuYXJyb3dpbmcgdGhlIHJhbmdlIGZyb20gWyAwLjAgLSAxMDAuMCBdIHRvIFsgMC4wIC0gMS4wIF1cbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgK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AtIHNjYWxlLnk7XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHNjYWxlLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gTWF0ZXJpYWxDb2xvckJpbmRcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxDb2xvclR5cGUgPSB2MEV4cHJlc3Npb25NYXRlcmlhbENvbG9yTWFwW21hdGVyaWFsUHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsQ29sb3JUeXBlKSB7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBtYXRlcmlhbENvbG9yVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlISksXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAg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B7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgIGBUaGUgbG9hZGluZyBhbmltYXRpb24gY29udGFpbnMgYSB0cmFuc2xhdGlvbiB0cmFjayBmb3IgJHtib25lTmFtZX0sIHdoaWNoIGlzIG5vdCBwZXJtaXR0ZWQgaW4gdGhlIFZSTUNfdnJtX2FuaW1hdGlvbiBzcGVjLiBpZ25vcmluZyB0aGUgdHJhY2tgLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uc3QgaGlwc1BhcmVudFdvcmxkTWF0cml4ID0gd29ybGRNYXRyaXhNYXAuZ2V0KCdoaXBzUGFyZW50JykhO1xuXG4gICAgICAgICAgICBjb25zdCB0cmFja1ZhbHVlcyA9IGFycmF5Q2h1bmsob3JpZ1RyYWNrLnZhbHVlcywgMykuZmxhdE1hcCgodikgPT5cbiAgICAgICAgICAgICAgX3YzQS5mcm9tQXJyYXkodikuYXBwbHlNYXRyaXg0KGhpcHNQYXJlbnRXb3JsZE1hdHJpeCkudG9BcnJheSgpLFxuICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgY29uc3QgdHJhY2sgPSBvcmlnVHJhY2suY2xvbmUoKTtcbiAgICAgICAgICAgIHRyYWNrLnZhbHVlcyA9IG5ldyBGbG9hdDMyQXJyYXkodHJhY2tWYWx1ZXMpO1xuXG4gICAgICAgICAgICByZXN1bHQuaHVtYW5vaWRUcmFja3MudHJhbnNsYXRpb24uc2V0KGJvbmVOYW1lLCB0cmFjayk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHBhdGggPT09ICdyb3RhdGlvbicpIHtcbiAgICAgICAgICAvLyBhICA9IHBeLTEgKiBhJyAqIHAgKiBjXG4gICAgICAgICAgLy8gYScgPSBwICogcF4tMSAqIGEnICogcCAqIGMgKiBjXi0xICogcF4tMVxuICAgICAgICAgIC8vICAgID0gcCAqIGEgKiBjXi0xICogcF4tMVxuXG4gICAgICAgICAgY29uc3Qgd29ybGRNYXRyaXggPSB3b3JsZE1hdHJpeE1hcC5nZXQoYm9uZU5hbWUpITtcbiAgICAgICAgICBjb25zdCBwYXJlbnRXb3JsZE1hdHJpeCA9IHdvcmxkTWF0cml4TWFwLmdldChwYXJlbnRCb25lTmFtZSkhO1xuXG4gICAgICAgICAgd29ybGRNYXRyaXguZGVjb21wb3NlKF92M0EsIF9xdWF0QSwgX3YzQSk7XG4gICAgICAgICAgX3F1YXRBLmludmVydCgpO1xuXG4gICAgICAgICAgcGFyZW50V29ybGRNYXRyaXguZGVjb21wb3NlKF92M0EsIF9xdWF0QiwgX3YzQSk7XG5cbiAgICAgICAgICBjb25zdCB0cmFja1ZhbHVlcyA9IGFycmF5Q2h1bmsob3JpZ1RyYWNrLnZhbHVlcywgNCkuZmxhdE1hcCgocSkgPT5cbiAgICAgICAgICAgIF9xdWF0Q1xuICAgICAgICAgICAgICAuZnJvbUFycmF5KHEgYXMgVEhSRUUuUXVhdGVybmlvblR1cGxlKVxuICAgICAgICAgICAgICAucHJlbXVsdGlwbHkoX3F1YXRCKVxuICAgICAgICAgICAgICAubXVsdGlwbHkoX3F1YXRBKVxuICAgICAgICAgICAgICAudG9BcnJheSgpLFxuICAgICAgICAgICk7XG5cbiAgICAgICAgICBjb25zdCB0cmFjayA9IG9yaWdUcmFjay5jbG9uZSgpO1xuICAgICAgICAgIHRyYWNrLnZhbHVlcyA9IG5ldyBGbG9hdDMyQXJyYXkodHJhY2tWYWx1ZXMpO1xuXG4gICAgICAgICAgcmVzdWx0Lmh1bWFub2lkVHJhY2tzLnJvdGF0aW9uLnNldChib25lTmFtZSwgdHJhY2spO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBwYXRoIFwiJHtwYXRofVwiYCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgICAvLyBleHByZXNzaW9uc1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0IG1vcnBoIHRhcmdldFxuICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICApXG4gICAgICAgICAgKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUV4cHJlc3Npb24ubmFtZX0gYXR0ZW1wdHMgdG8gaW5kZXggbW9ycGggIyR7bW9ycGhUYXJnZXRJbmRleH0gYnV0IG5vdCBmb3VuZC5gLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1vcnBoVGFyZ2V0QmluZCh7XG4gICAgICAgICAgICAgIHByaW1pdGl2ZXMsXG4gICAgICAgICAgICAgIGluZGV4OiBtb3JwaFRhcmdldEluZGV4LFxuICAgICAgICAgICAgICB3ZWlnaHQ6IGJpbmQud2VpZ2h0ID8/IDEuMCxcbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmIChzY2hlbWFFeHByZXNzaW9uLm1hdGVyaWFsQ29sb3JCaW5kcyB8fCBzY2hlbWFFeHByZXNzaW9uLnRleHR1cmVUcmFuc2Zvcm1CaW5kcykge1xuICAgICAgICAgIC8vIGxpc3QgdXAgZXZlcnkgbWF0ZXJpYWwgaW4gYG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WRkQmluZChcbiAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JCaW5kKHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgdHlwZTogYmluZC50eXBlLFxuICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShiaW5kLnRhcmdldFZhbHVlKSxcbiAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBiaW5kLnRhcmdldFZhbHVlWzNdLFxuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBzY2hlbWFFeHByZXNzaW9uLnRleHR1cmVUcmFuc2Zvcm1CaW5kcz8uZm9yRWFjaChhc3luYyAoYmluZCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxzID0gZ2x0Zk1hdGVyaWFscy5maWx0ZXIoKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsSW5kZXggPSB0aGlzLnBhcnNlci5hc3NvY2lhdGlvbnMuZ2V0KG1hdGVyaWFsKT8ubWF0ZXJpYWxzO1xuICAgICAgICAgICAgICByZXR1cm4gYmluZC5tYXRlcmlhbCA9PT0gbWF0ZXJpYWxJbmRleDtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBtYXRlcmlhbHMuZm9yRWFjaCgobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uVGV4dHVyZVRyYW5zZm9ybUJpbmQoe1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICBvZmZzZXQ6IG5ldyBUSFJFRS5WZWN0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XMuIElnbm9yaW5nIHRoZSBleHByZXNzaW9uYCxcbiAgICAgICAgICApO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGJsZW5kU2hhcGVOYW1lU2V0LmFkZChuYW1lKTtcblxuICAgICAgICBjb25zdCBleHByZXNzaW9uID0gbmV3IFZSTUV4cHJlc3Npb24obmFtZSk7XG4gICAgICAgIGdsdGYuc2NlbmUuYWRkKGV4cHJlc3Npb24pO1xuXG4gICAgICAgIGV4cHJlc3Npb24uaXNCaW5hcnkgPSBzY2hlbWFHcm91cC5pc0JpbmFyeSA/PyBmYWxzZTtcbiAgICAgICAgLy8gdjAgZG9lc24ndCBoYXZlIGlnbm9yZSBwcm9wZXJ0aWVzXG5cbiAgICAgICAgLy8gQmluZCBtb3JwaFRhcmdldFxuICAgICAgICBpZiAoc2NoZW1hR3JvdXAuYmluZHMpIHtcbiAgICAgICAgICBzY2hlbWFHcm91cC5iaW5kcy5mb3JFYWNoKGFzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBpZiAoYmluZC5tZXNoID09PSB1bmRlZmluZWQgfHwgYmluZC5pbmRleCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3Qgbm9kZXNVc2luZ01lc2g6IG51bWJlcltdID0gW107XG4gICAgICAgICAgICBqc29uLm5vZGVzPy5mb3JFYWNoKChub2RlLCBpKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChub2RlLm1lc2ggPT09IGJpbmQubWVzaCkge1xuICAgICAgICAgICAgICAgIG5vZGVzVXNpbmdNZXNoLnB1c2goaSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjb25zdCBtb3JwaFRhcmdldEluZGV4ID0gYmluZC5pbmRleDtcblxuICAgICAgICAgICAgYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICAgICAgICAgIG5vZGVzVXNpbmdNZXNoLm1hcChhc3luYyAobm9kZUluZGV4KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgcHJpbWl0aXZlcyA9IChhd2FpdCBnbHRmRXh0cmFjdFByaW1pdGl2ZXNGcm9tTm9kZShnbHRmLCBub2RlSW5kZXgpKSE7XG5cbiAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiB0aGUgbWVzaCBoYXMgdGhlIHRhcmdldCBtb3JwaCB0YXJnZXRcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAhcHJpbWl0aXZlcy5ldmVyeShcbiAgICAgICAgICAgICAgICAgICAgKHByaW1pdGl2ZSkgPT5cbiAgICAgICAgICAgICAgICAgICAgICBBcnJheS5pc0FycmF5KHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMpICYmXG4gICAgICAgICAgICAgICAgICAgICAgbW9ycGhUYXJnZXRJbmRleCA8IHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICBgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogJHtzY2hlbWFHcm91cC5uYW1lfSBhdHRlbXB0cyB0byBpbmRleCAke21vcnBoVGFyZ2V0SW5kZXh9dGggbW9ycGggYnV0IG5vdCBmb3VuZC5gLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1vcnBoVGFyZ2V0QmluZCh7XG4gICAgICAgICAgICAgICAgICAgIHByaW1pdGl2ZXMsXG4gICAgICAgIC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ICAgICAgIG1hdGVyaWFscy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAuLi5tYXRlcmlhbC5maWx0ZXIoXG4gICAgICAgICAgICAgICAgICAgICAgKG10bCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgIChtdGwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUhIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgIG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgKyAnIChPdXRsaW5lKScpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbHMuaW5kZXhPZihtdGwpID09PSAtMSxcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRlcmlhbC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSAmJiBtYXRlcmlhbHMuaW5kZXhPZihtYXRlcmlhbCkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbHMucHVzaChtYXRlcmlhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxQcm9wZXJ0eU5hbWUgPSBtYXRlcmlhbFZhbHVlLnByb3BlcnR5TmFtZTtcbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICAvLyBUZXh0dXJlVHJhbnNmb3JtQmluZFxuICAgICAgICAgICAgICBpZiAobWF0ZXJpYWxQcm9wZXJ0eU5hbWUgPT09ICdfTWFpblRleF9TVCcpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBzY2FsZSA9IG5ldyBUSFJFRS5WZWN0b3IyKG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzBdLCBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVsxXSk7XG4gICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2V0ID0gbmV3IFRIUkVFLlZlY3RvcjIobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMl0sIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzNdKTtcblxuICAgICAgICAgICAgICAgIG9mZnNldC55ID0gMS4wIC0gb2Zmc2V0LnkgLSBzY2FsZS55O1xuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICBzY2FsZSxcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vIE1hdGVyaWFsQ29sb3JCaW5kXG4gICAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsQ29sb3JUeXBlID0gdjBFeHByZXNzaW9uTWF0ZXJpYWxDb2xvck1hcFttYXRlcmlhbFByb3BlcnR5TmFtZV07XG4gICAgICAgICAgICAgIGlmIChtYXRlcmlhbENvbG9yVHlwZSkge1xuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTWF0ZXJpYWxDb2xvckJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogbWF0ZXJpYWxDb2xvclR5cGUsXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldFZhbHVlOiBuZXcgV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pb24pO1xuXG4gICAgICAgIGlmIChyZXN0U3RhdGUucG9zaXRpb24pIHtcbiAgICAgICAgICBub2RlLnBvc2l0aW9uLmFkZChfdjNBLmZyb21BcnJheShyZXN0U3RhdGUucG9zaXRpb24pKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoc3RhdGU/LnJvdGF0aW9uKSB7XG4gICAgICAgIG5vZGUucXVhdGVybmlvbi5mcm9tQXJyYXkoc3RhdGUucm90YXRpb24pO1xuXG4gICAgICAgIGlmIChyZXN0U3RhdGUucm90YXRpb24pIHtcbiAgICAgICAgICBub2RlLnF1YXRlcm5pb24ubXVsdGlwbHkoX3F1YXRBLmZyb21BcnJheShyZXN0U3RhdGUucm90YXRpb24pKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuICB9XG5cbiAgLyoqXG4gICAqIFJlc2V0IHRoZSBodW1hbm9pZCB0byBpdHMgcmVzdCBwb3NlLlxuICAgKi9cbiAgcHVibGljIHJlc2V0UG9zZSgpOiB2b2lkIHtcbiAgICBPYmplY3QuZW50cmllcyh0aGlzLnJlc3RQb3NlKS5mb3JFYWNoKChbYm9uZU5hbWUsIHJlc3RdKSA9PiB7XG4gICAgICBjb25zdCBub2RlID0gdGhpcy5nZXRCb25lTm9kZShib25lTmFtZSBhcyBWUk1IdW1hbkJvbmVOYW1lKTtcblxuICAgICAgaWYgKCFub2RlKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgaWYgKHJlc3Q/LnBvc2l0aW9uKSB7XG4gICAgICAgIG5vZGUucG9zaXRpb24uZnJvbUFycmF5KHJlc3QucG9zaXRpb24pO1xuICAgICAgfVxuXG4gICAgICBpZiAocmVzdD8ucm90YXRpb24pIHtcbiAgICAgICAgbm9kZS5xdWF0ZXJuaW9uLmZyb21BcnJheShyZXN0LnJvdGF0aW9uKTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxuXG4gIC8qKlxuICAgKiBSZXR1cm4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Lkh1bWFub2lkSHVtYW5Cb25lTmFtZTtcbiAgICAgICAgICBjb25zdCBpbmRleCA9IHNjaGVtYUh1bWFuQm9uZS5ub2RlO1xuXG4gICAgICAgICAgLy8gY29tcGF0OiAxLjAtYmV0YSBwcmV2aW91cyB0aHVtYiBib25lIG5hbWVzXG4gICAgICAgICAgaWYgKGV4aXN0c1ByZXZpb3VzVGh1bWJOYW1lKSB7XG4gICAgICAgICAgICBjb25zdCB0aHVtYkJvbmVOYW1lID0gdGh1bWJCb25lTmFtZU1hcFtib25lTmFtZV07XG4gICAgICAgICAgICBpZiAodGh1bWJCb25lTmFtZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgIGJvbmVOYW1lID0gdGh1bWJCb25lTmFtZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb25zdCBub2RlID0gYXdhaXQgdGhpcy5wYXJzZXIuZ2V0RGVwZW5kZW5jeSgnbm9kZScsIGluZGV4KTtcblxuICAgICAgICAgIC8vIGlmIHRoZSBzcGVjaWZpZWQgbm9kZSBkb2VzIG5vdCBleGlzdCwgZW1pdCBhIHdhcm5pbmdcbiAgICAgICAgICBpZiAobm9kZSA9PSBudWxsKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oYEEgZ2xURiBub2RlIGJvdW5kIHRvIHRoZSBodW1hbm9pZCBib25lICR7Ym9uZU5hbWV9IChpbmRleCA9ICR7aW5kZXh9KSBkb2VzIG5vdCBleGlzdGApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIHNldCB0byB0aGUgYGh1bWFuQm9uZXNgXG4gICAgICAgICAgaHVtYW5Cb25lc1tib25lTmFtZV0gPSB7IG5vZGUgfTtcbiAgICAgICAgfSksXG4gICAgICApO1xuICAgIH1cblxuICAgIGNvbnN0IGh1bWFub2lkID0gbmV3IFZSTUh1bWFub2lkKHRoaXMuX2Vuc3VyZVJlcXVpcmVkQm9uZ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oaXBzUGFyZW50V29ybGRNYXRyaXgpLnRvQXJyYXkoKSxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIGNvbnN0IHRyYWNrID0gb3JpZ1RyYWNrLmNsb25lKCk7XG4gICAgICAgICAgICB0cmFjay52YWx1ZXMgPSBuZXcgRmxvYXQzMkFycmF5KHRyYWNrVmFsdWVzKTtcblxuICAgICAgICAgICAgcmVzdWx0Lmh1bWFub2lkVHJhY2tzLnRyYW5zbGF0aW9uLnNldChib25lTmFtZSwgdHJhY2spO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChwYXRoID09PSAncm90YXRpb24nKSB7XG4gICAgICAgICAgLy8gYSAgPSBwXi0xICogYScgKiBwICogY1xuICAgICAgICAgIC8vIGEnID0gcCAqIHBeLTEgKiBhJyAqIHAgKiBjICogY14tMSAqIHBeLTFcbiAgICAgICAgICAvLyAgICA9IHAgKiBhICogY14tMSAqIHBeLTFcblxuICAgICAgICAgIGNvbnN0IHdvcmxkTWF0cml4ID0gd29ybGRNYXRyaXhNYXAuZ2V0KGJvbmVOYW1lKSE7XG4gICAgICAgICAgY29uc3QgcGFyZW50V29ybGRNYXRyaXggPSB3b3JsZE1hdHJpeE1hcC5nZXQocGFyZW50Qm9uZU5hbWUpITtcblxuICAgICAgICAgIHdvcmxkTWF0cml4LmRlY29tcG9zZShfdjNBLCBfcXVhdEEsIF92M0EpO1xuICAgICAgICAgIF9xdWF0QS5pbnZlcnQoKTtcblxuICAgICAgICAgIHBhcmVudFdvcmxkTWF0cml4LmRlY29tcG9zZShfdjNBLCBfcXVhdEIsIF92M0EpO1xuXG4gICAgICAgICAgY29uc3QgdHJhY2tWYWx1ZXMgPSBhcnJheUNodW5rKG9yaWdUcmFjay52YWx1ZXMsIDQpLmZsYXRNYXAoKHEpID0+XG4gICAgICAgICAgICBfcXVhdENcbiAgICAgICAgICAgICAgLmZyb21BcnJheShxIGFzIFRIUkVFLlF1YXRlcm5pb25UdXBsZSlcbiAgICAgICAgICAgICAgLnByZW11bHRpcGx5KF9xdWF0QilcbiAgICAgICAgICAgICAgLm11bHRpcGx5KF9xdWF0QSlcbiAgICAgICAgICAgICAgLnRvQXJyYXkoKSxcbiAgICAgICAgICApO1xuXG4gICAgICAgICAgY29uc3QgdHJhY2sgPSBvcmlnVHJhY2suY2xvbmUoKTtcbiAgICAgICAgICB0cmFjay52YWx1ZXMgPSBuZXcgRmxvYXQzMkFycmF5KHRyYWNrVmFsdWVzKTtcblxuICAgICAgICAgIHJlc3VsdC5odW1hbm9pZFRyYWNrcy5yb3RhdGlvbi5zZXQoYm9uZU5hbWUsIHRyYWNrKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgcGF0aCBcIiR7cGF0aH1cImApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgLy8gZXhwcmVzc2lvbnNcbiAgICAgIGNvbnN0IGV4cHJlc3Npb25OYW1lID0gbm9kZU1hcC5leHByZXNzaW9uc0luZGV4VG9OYW1lLmdldChub2RlKTtcbiAgICAgIGlmIChleHByZXNzaW9uTmFtZSAhPSBudWxsKSB7XG4gICAgICAgIGlmIChwYXRoID09PSAndHJhbnNsYXRpb24nKSB7XG4gICAgICAgICAgY29uc3QgdGltZXMgPSBvcmlnVHJhY2sudGltZXM7XG4gICAgICAgICAgY29uc3QgdmFsdWVzID0gbmV3IEZsb2F0MzJBcnJheShvcmlnVHJhY2sudmFsdWVzLmxlbmd0aCAvIDMpO1xuICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdmFsdWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICB2YWx1ZXNbaV0gPSBvcmlnVHJhY2sudmFsdWVzWzMgKiBpXTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb25zdCBuZXdUcmFjayA9IG5ldyBUSFJFRS5OdW1iZXJLZXlmcmFtZVRyYWNrKGAke2V4cHJlc3Npb25OYW1lfS53ZWlnaHRgLCB0aW1lcyBhcyBhbnksIHZhbHVlcyBhcyBhbnkpO1xuXG4gICAgICAgICAgaWYgKHZybUV4cHJlc3Npb25QcmVzZXROYW1lU2V0LmhhcyhleHByZXNzaW9uTmFtZSkpIHtcbiAgICAgICAgICAgIHJlc3VsdC5leHByZXNzaW9uVHJhY2tzLnByZXNldC5zZXQoZXhwcmVzc2lvbk5hbWUgYXMgVlJNRXhwcmVzc2lvblByZXNldE5hbWUsIG5ld1RyYWNrKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0LmV4cHJlc3Npb25UcmFja3MuY3VzdG9tLnNldChleHByZXNzaW9uTmFtZSwgbmV3VHJhY2spO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgcGF0aCBcIiR7cGF0aH1cImApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgLy8gbG9va0F0XG4gICAgICBpZiAobm9kZSA9PT0gbm9kZU1hcC5sb29rQXRJbmRleCkge1xuICAgICAgICBpZiAocGF0aCA9PT0gJ3JvdGF0aW9uJykge1xuICAgICAgICAgIHJlc3VsdC5sb29rQXRUcmFjayA9IG9yaWdUcmFjaztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgcGF0aCBcIiR7cGF0aH1cImApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9XG59XG4iLCAiLyoqXG4gKiBgYGBqc1xuICogYXJyYXlDaHVuayggWyAxLCAyLCAzLCA0LCA1LCA2IF0sIDIgKVxuICogLy8gd2lsbCBiZVxuICogWyBbIDEsIDIgXSwgWyAzLCA0IF0sIFsgNSwgNiBdIF1cbiAqIGBgYFx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min.js b/packages/three-vrm-animation/lib/three-vrm-animation.module.min.js index 176bc2e78..f6b2cbd6a 100644 --- a/packages/three-vrm-animation/lib/three-vrm-animation.module.min.js +++ b/packages/three-vrm-animation/lib/three-vrm-animation.module.min.js @@ -1,7 +1,7 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -var K=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())});import*as X from"three";import*as ye from"three";import*as U from"three";import*as ne from"three";import*as we from"three";import*as b from"three";import*as O from"three";import*as $ from"three";import*as F from"three";import*as T from"three";import*as He from"three";import*as oe from"three";import*as M from"three";import*as ie from"three";import*as R from"three";import*as te from"three";import*as rt from"three";var V=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())}),he=class extends ye.Object3D{constructor(o){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${o}`,this.expressionName=o,this.type="VRMExpression",this.visible=!1}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(o){this._binds.push(o)}applyWeight(o){var e;let t=this.outputWeight;t*=(e=o==null?void 0:o.multiplier)!=null?e:1,this.isBinary&&t<1&&(t=0),this._binds.forEach(n=>n.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(o=>o.clearAppliedWeight())}};function Ce(o,e,t){var n,r;let i=o.parser.json,s=(n=i.nodes)==null?void 0:n[e];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let a=s.mesh;if(a==null)return null;let l=(r=i.meshes)==null?void 0:r[a];if(l==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let u=l.primitives.length,d=[];return t.traverse(f=>{d.length{t.has(n)&&(e[n]=r)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(z));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)||(e[n]=r)}),e}copy(e){return this._expressions.concat().forEach(n=>{this.unregisterExpression(n)}),e._expressions.forEach(n=>{this.registerExpression(n)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new ve().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var t;let n=this.getExpression(e);return(t=n==null?void 0:n.weight)!=null?t:null}setValue(e,t){let n=this.getExpression(e);n&&(n.weight=Fe(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let n=1,r=t.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(n*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(n*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(n*=e.mouth),t.applyWeight({multiplier:n})})}_calculateWeightMultipliers(){let e=1,t=1,n=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,t-=r.overrideLookAtAmount,n-=r.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),n=Math.max(0,n),{blink:e,lookAt:t,mouth:n}}},Q={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},We={_Color:Q.Color,_EmissionColor:Q.EmissionColor,_ShadeColor:Q.ShadeColor,_RimColor:Q.RimColor,_OutlineColor:Q.OutlineColor},Qe=new ne.Color,xe=class Te{constructor({material:e,type:t,targetValue:n,targetAlpha:r}){this.material=e,this.type=t,this.targetValue=n,this.targetAlpha=r!=null?r:1;let i=this._initColorBindState(),s=this._initAlphaBindState();this._state={color:i,alpha:s}}applyWeight(e){let{color:t,alpha:n}=this._state;if(t!=null){let{propertyName:r,deltaValue:i}=t,s=this.material[r];s!=null&&s.add(Qe.copy(i).multiplyScalar(e))}if(n!=null){let{propertyName:r,deltaValue:i}=n;this.material[r]!=null&&(this.material[r]+=i*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:n,initialValue:r}=e,i=this.material[n];i!=null&&i.copy(r)}if(t!=null){let{propertyName:n,initialValue:r}=t;this.material[n]!=null&&(this.material[n]=r)}}_initColorBindState(){var e,t,n;let{material:r,type:i,targetValue:s}=this,a=this._getPropertyNameMap(),l=(t=(e=a==null?void 0:a[i])==null?void 0:e[0])!=null?t:null;if(l==null)return console.warn(`Tried to add a material color bind to the material ${(n=r.name)!=null?n:"(no name)"}, the type ${i} but the material or the type is not supported.`),null;let d=r[l].clone(),f=new ne.Color(s.r-d.r,s.g-d.g,s.b-d.b);return{propertyName:l,initialValue:d,deltaValue:f}}_initAlphaBindState(){var e,t,n;let{material:r,type:i,targetAlpha:s}=this,a=this._getPropertyNameMap(),l=(t=(e=a==null?void 0:a[i])==null?void 0:e[1])!=null?t:null;if(l==null&&s!==1)return console.warn(`Tried to add a material alpha bind to the material ${(n=r.name)!=null?n:"(no name)"}, the type ${i} but the material or the type does not support alpha.`),null;if(l==null)return null;let u=r[l],d=s-u;return{propertyName:l,initialValue:u,deltaValue:d}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(Te._propertyNameMapMap).find(([n])=>this.material[n]===!0))==null?void 0:e[1])!=null?t:null}};xe._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var pe=xe,me=class{constructor({primitives:o,index:e,weight:t}){this.primitives=o,this.index=e,this.weight=t}applyWeight(o){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*o)})}clearAppliedWeight(){this.primitives.forEach(o=>{var e;((e=o.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(o.morphTargetInfluences[this.index]=0)})}},fe=new we.Vector2,Pe=class Ae{constructor({material:e,scale:t,offset:n}){var r,i;this.material=e,this.scale=t,this.offset=n;let s=(r=Object.entries(Ae._propertyNamesMap).find(([a])=>e[a]===!0))==null?void 0:r[1];s==null?(console.warn(`Tried to add a texture transform bind to the material ${(i=e.name)!=null?i:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],s.forEach(a=>{var l;let u=(l=e[a])==null?void 0:l.clone();if(!u)return null;e[a]=u;let d=u.offset.clone(),f=u.repeat.clone(),m=n.clone().sub(d),p=t.clone().sub(f);this._properties.push({name:a,initialOffset:d,deltaOffset:m,initialScale:f,deltaScale:p})}))}applyWeight(e){this._properties.forEach(t=>{let n=this.material[t.name];n!==void 0&&(n.offset.add(fe.copy(t.deltaOffset).multiplyScalar(e)),n.repeat.add(fe.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};Pe._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var ge=Pe,ze=new Set(["1.0","1.0-beta"]),je=class Le{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return V(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return V(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let n=yield this._v0Import(e);return n||null})}_v1Import(e){return V(this,null,function*(){var t,n;let r=this.parser.json;if(!(((t=r.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;let s=(n=r.extensions)==null?void 0:n.VRMC_vrm;if(!s)return null;let a=s.specVersion;if(!ze.has(a))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;let l=s.expressions;if(!l)return null;let u=new Set(Object.values(z)),d=new Map;l.preset!=null&&Object.entries(l.preset).forEach(([m,p])=>{if(p!=null){if(!u.has(m)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${m}" detected. Ignoring the expression`);return}d.set(m,p)}}),l.custom!=null&&Object.entries(l.custom).forEach(([m,p])=>{if(u.has(m)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${m}". Ignoring the expression`);return}d.set(m,p)});let f=new ce;return yield Promise.all(Array.from(d.entries()).map(m=>V(this,[m],function*([p,c]){var h,g,_,E,y,v,w;let x=new he(p);if(e.scene.add(x),x.isBinary=(h=c.isBinary)!=null?h:!1,x.overrideBlink=(g=c.overrideBlink)!=null?g:"none",x.overrideLookAt=(_=c.overrideLookAt)!=null?_:"none",x.overrideMouth=(E=c.overrideMouth)!=null?E:"none",(y=c.morphTargetBinds)==null||y.forEach(P=>V(this,null,function*(){var A;if(P.node===void 0||P.index===void 0)return;let N=yield de(e,P.node),H=P.index;if(!N.every(k=>Array.isArray(k.morphTargetInfluences)&&H{let N=A.material;N&&(Array.isArray(N)?P.push(...N):P.push(N))}),(v=c.materialColorBinds)==null||v.forEach(A=>V(this,null,function*(){P.filter(H=>{var k;let D=(k=this.parser.associations.get(H))==null?void 0:k.materials;return A.material===D}).forEach(H=>{x.addBind(new pe({material:H,type:A.type,targetValue:new U.Color().fromArray(A.targetValue),targetAlpha:A.targetValue[3]}))})})),(w=c.textureTransformBinds)==null||w.forEach(A=>V(this,null,function*(){P.filter(H=>{var k;let D=(k=this.parser.associations.get(H))==null?void 0:k.materials;return A.material===D}).forEach(H=>{var k,D;x.addBind(new ge({material:H,offset:new U.Vector2().fromArray((k=A.offset)!=null?k:[0,0]),scale:new U.Vector2().fromArray((D=A.scale)!=null?D:[1,1])}))})}))}f.registerExpression(x)}))),f})}_v0Import(e){return V(this,null,function*(){var t;let n=this.parser.json,r=(t=n.extensions)==null?void 0:t.VRM;if(!r)return null;let i=r.blendShapeMaster;if(!i)return null;let s=new ce,a=i.blendShapeGroups;if(!a)return s;let l=new Set;return yield Promise.all(a.map(u=>V(this,null,function*(){var d;let f=u.presetName,m=f!=null&&Le.v0v1PresetNameMap[f]||null,p=m!=null?m:u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(l.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${f} has duplicated entries. Ignoring the expression`);return}l.add(p);let c=new he(p);e.scene.add(c),c.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(g=>V(this,null,function*(){var _;if(g.mesh===void 0||g.index===void 0)return;let E=[];(_=n.nodes)==null||_.forEach((v,w)=>{v.mesh===g.mesh&&E.push(w)});let y=g.index;yield Promise.all(E.map(v=>V(this,null,function*(){var w;let x=yield de(e,v);if(!x.every(P=>Array.isArray(P.morphTargetInfluences)&&y{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;let _=[];e.scene.traverse(y=>{if(y.material){let v=y.material;Array.isArray(v)?_.push(...v.filter(w=>(w.name===g.materialName||w.name===g.materialName+" (Outline)")&&_.indexOf(w)===-1)):v.name===g.materialName&&_.indexOf(v)===-1&&_.push(v)}});let E=g.propertyName;_.forEach(y=>{if(E==="_MainTex_ST"){let w=new U.Vector2(g.targetValue[0],g.targetValue[1]),x=new U.Vector2(g.targetValue[2],g.targetValue[3]);x.y=1-x.y-w.y,c.addBind(new ge({material:y,scale:w,offset:x}));return}let v=We[E];if(v){c.addBind(new pe({material:y,type:v,targetValue:new U.Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(E+" is not supported")})}),s.registerExpression(c)}))),s})}};je.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var Ve=class C{constructor(e,t){this._firstPersonOnlyLayer=C.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=C.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new C(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=C.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=C.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(n=>{n.meshes.forEach(r=>{n.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(i=>i.layers.set(this._firstPersonOnlyLayer))):n.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(i=>i.layers.set(this._thirdPersonOnlyLayer))):n.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,n,r){let i=0;if(t!=null&&t.length>0)for(let s=0;s0&&r.includes(f[0])||d[1]>0&&r.includes(f[1])||d[2]>0&&r.includes(f[2])||d[3]>0&&r.includes(f[3]))continue;let m=t[l],p=n[l];if(m[0]>0&&r.includes(p[0])||m[1]>0&&r.includes(p[1])||m[2]>0&&r.includes(p[2])||m[3]>0&&r.includes(p[3]))continue;let c=t[u],h=n[u];c[0]>0&&r.includes(h[0])||c[1]>0&&r.includes(h[1])||c[2]>0&&r.includes(h[2])||c[3]>0&&r.includes(h[3])||(e[i++]=a,e[i++]=l,e[i++]=u)}return i}_createErasedMesh(e,t){let n=new b.SkinnedMesh(e.geometry.clone(),e.material);n.name=`${e.name}(erase)`,n.frustumCulled=e.frustumCulled,n.layers.set(this._firstPersonOnlyLayer);let r=n.geometry,i=r.getAttribute("skinIndex"),s=i instanceof b.GLBufferAttribute?[]:i.array,a=[];for(let h=0;h{this._isEraseTarget(i)&&n.push(s)}),!n.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(t,n);e.add(r)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{let t=new b.Group;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(n=>n.type==="SkinnedMesh").forEach(n=>{let r=n;this._createHeadlessModelForSkinnedMesh(t,r)})}else if(e.type==="SkinnedMesh"){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};Ve.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;Ve.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var ht=new O.Vector3,dt=new O.Vector3,ct=new O.Quaternion;var re={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function qe(o){return o.invert?o.invert():o.inverse(),o}var pt=new $.Vector3,mt=new $.Quaternion;var ft=new F.Vector3,gt=new F.Quaternion,Rt=new F.Vector3;var Et=new T.Quaternion,Mt=new T.Quaternion,_t=new T.Vector3,yt=new T.Vector3,Re=Math.sqrt(2)/2,vt=new T.Quaternion(0,0,-Re,Re),xt=new T.Vector3(0,1,0);var Ye=new ie.Vector3,$e=new ie.Vector3;function ee(o,e){return o.matrixWorld.decompose(Ye,e,$e),e}function Y(o){return[Math.atan2(-o.z,o.x),Math.atan2(o.y,Math.sqrt(o.x*o.x+o.z*o.z))]}function Ee(o){let e=Math.round(o/2/Math.PI);return o-2*Math.PI*e}var Me=new M.Vector3(0,0,1),Ge=new M.Vector3,Xe=new M.Vector3,Ke=new M.Vector3,Ze=new M.Quaternion,Z=new M.Quaternion,_e=new M.Quaternion,Je=new M.Quaternion,J=new M.Euler,ke=class be{constructor(e,t){this.offsetFromHeadBone=new M.Vector3,this.autoUpdate=!0,this.faceFront=new M.Vector3(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new M.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new M.Euler)}getEuler(e){return e.set(M.MathUtils.DEG2RAD*this._pitch,M.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new be(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){let t=this.humanoid.getRawBoneNode("head");return ee(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Me)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,n]=Y(this.faceFront);return J.set(0,.5*Math.PI+t,n,"YZX"),e.setFromEuler(J).premultiply(Je.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(Z),this.getFaceFrontQuaternion(_e),e.copy(Me).applyQuaternion(Z).applyQuaternion(_e).applyEuler(this.getEuler(J))}lookAt(e){let t=Ze.copy(this._restHeadWorldQuaternion).multiply(qe(this.getLookAtWorldQuaternion(Z))),n=this.getLookAtWorldPosition(Xe),r=Ke.copy(e).sub(n).applyQuaternion(t).normalize(),[i,s]=Y(this.faceFront),[a,l]=Y(r),u=Ee(a-i),d=Ee(s-l);this._yaw=M.MathUtils.RAD2DEG*u,this._pitch=M.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Ge)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};ke.EULER_ORDER="YXZ";var Be=ke,et=new R.Vector3(0,0,1),I=new R.Quaternion,S=new R.Quaternion,L=new R.Euler(0,0,0,"YXZ"),tt=class{constructor(o,e,t,n,r){this.humanoid=o,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=n,this.rangeMapVerticalUp=r,this.faceFront=new R.Vector3(0,0,1),this._restQuatLeftEye=new R.Quaternion,this._restQuatRightEye=new R.Quaternion,this._restLeftEyeParentWorldQuat=new R.Quaternion,this._restRightEyeParentWorldQuat=new R.Quaternion;let i=this.humanoid.getRawBoneNode("leftEye"),s=this.humanoid.getRawBoneNode("rightEye");i&&(this._restQuatLeftEye.copy(i.quaternion),ee(i.parent,this._restLeftEyeParentWorldQuat)),s&&(this._restQuatRightEye.copy(s.quaternion),ee(s.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(o,e){let t=this.humanoid.getRawBoneNode("leftEye"),n=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),i=this.humanoid.getNormalizedBoneNode("rightEye");t&&(e<0?L.x=-R.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):L.x=R.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),o<0?L.y=-R.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-o):L.y=R.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(o),I.setFromEuler(L),this._getWorldFaceFrontQuat(S),r.quaternion.copy(S).multiply(I).multiply(S.invert()),I.copy(this._restLeftEyeParentWorldQuat),t.quaternion.copy(r.quaternion).multiply(I).premultiply(I.invert()).multiply(this._restQuatLeftEye)),n&&(e<0?L.x=-R.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):L.x=R.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),o<0?L.y=-R.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-o):L.y=R.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(o),I.setFromEuler(L),this._getWorldFaceFrontQuat(S),i.quaternion.copy(S).multiply(I).multiply(S.invert()),I.copy(this._restRightEyeParentWorldQuat),n.quaternion.copy(i.quaternion).multiply(I).premultiply(I.invert()).multiply(this._restQuatRightEye))}lookAt(o){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=R.MathUtils.RAD2DEG*o.y,t=R.MathUtils.RAD2DEG*o.x;this.applyYawPitch(e,t)}_getWorldFaceFrontQuat(o){if(this.faceFront.distanceToSquared(et)<.01)return o.identity();let[e,t]=Y(this.faceFront);return L.set(0,.5*Math.PI+e,t,"YZX"),o.setFromEuler(L)}};tt.type="bone";var nt=class{constructor(o,e,t,n,r){this.expressions=o,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=n,this.rangeMapVerticalUp=r}applyYawPitch(o,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),o<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-o))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(o)))}lookAt(o){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=te.MathUtils.RAD2DEG*o.y,t=te.MathUtils.RAD2DEG*o.x;this.applyYawPitch(e,t)}};nt.type="expression";import*as G from"three";var Ie=180/Math.PI,se=new G.Euler,W=class extends G.Object3D{constructor(e){super(),this.vrmLookAt=e,this.type="VRMLookAtQuaternionProxy";let t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});let n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){se.setFromQuaternion(this.quaternion,Be.EULER_ORDER),this.vrmLookAt.yaw=Ie*se.y,this.vrmLookAt.pitch=Ie*se.x}};function Ne(o,e,t){var i,s;let n=new Map,r=new Map;for(let[a,l]of o.humanoidTracks.rotation.entries()){let u=(i=e.getNormalizedBoneNode(a))==null?void 0:i.name;if(u!=null){let d=new X.QuaternionKeyframeTrack(`${u}.quaternion`,l.times,l.values.map((f,m)=>t==="0"&&m%2===0?-f:f));r.set(a,d)}}for(let[a,l]of o.humanoidTracks.translation.entries()){let u=(s=e.getNormalizedBoneNode(a))==null?void 0:s.name;if(u!=null){let d=o.restHipsPosition.y,m=e.normalizedRestPose.hips.position[1]/d,p=l.clone();p.values=p.values.map((c,h)=>(t==="0"&&h%3!==1?-c:c)*m),p.name=`${u}.position`,n.set(a,p)}}return{translation:n,rotation:r}}function Ue(o,e){let t=new Map,n=new Map;for(let[r,i]of o.expressionTracks.preset.entries()){let s=e.getExpressionTrackName(r);if(s!=null){let a=i.clone();a.name=s,t.set(r,a)}}for(let[r,i]of o.expressionTracks.custom.entries()){let s=e.getExpressionTrackName(r);if(s!=null){let a=i.clone();a.name=s,n.set(r,a)}}return{preset:t,custom:n}}function Oe(o,e){if(o.lookAtTrack==null)return null;let t=o.lookAtTrack.clone();return t.name=e,t}function ot(o,e){let t=[],n=Ne(o,e.humanoid,e.meta.metaVersion);if(t.push(...n.translation.values()),t.push(...n.rotation.values()),e.expressionManager!=null){let r=Ue(o,e.expressionManager);t.push(...r.preset.values()),t.push(...r.custom.values())}if(e.lookAt!=null){let r=e.scene.children.find(s=>s instanceof W);r==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),r=new W(e.lookAt),r.name="VRMLookAtQuaternionProxy",e.scene.add(r)):r.name==null&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),r.name="VRMLookAtQuaternionProxy");let i=Oe(o,`${r.name}.quaternion`);i!=null&&t.push(i)}return new X.AnimationClip("Clip",o.duration,t)}import*as De from"three";var j=class{constructor(){this.duration=0,this.restHipsPosition=new De.Vector3,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};import*as B from"three";function ae(o,e){let t=o.length,n=[],r=[],i=0;for(let s=0;s{let E=t.animations[_],y=this._parseAnimation(g,E,s,a);return y.restHipsPosition=d,y});e.userData.vrmAnimations=m})}_createNodeMap(e){var l,u,d,f,m;let t=new Map,n=new Map,r=(l=e.humanoid)==null?void 0:l.humanBones;r&&Object.entries(r).forEach(([p,c])=>{let h=c==null?void 0:c.node;h!=null&&t.set(h,p)});let i=(u=e.expressions)==null?void 0:u.preset;i&&Object.entries(i).forEach(([p,c])=>{let h=c==null?void 0:c.node;h!=null&&n.set(h,p)});let s=(d=e.expressions)==null?void 0:d.custom;s&&Object.entries(s).forEach(([p,c])=>{let{node:h}=c;n.set(h,p)});let a=(m=(f=e.lookAt)==null?void 0:f.node)!=null?m:null;return{humanoidIndexToName:t,expressionsIndexToName:n,lookAtIndex:a}}_createBoneWorldMatrixMap(e,t){return K(this,null,function*(){var i,s;e.scene.updateWorldMatrix(!1,!0);let n=yield e.parser.getDependencies("node"),r=new Map;if(t.humanoid==null)return r;for(let[a,l]of Object.entries(t.humanoid.humanBones)){let u=l==null?void 0:l.node;if(u!=null){let d=n[u];r.set(a,d.matrixWorld),a==="hips"&&r.set("hipsParent",(s=(i=d.parent)==null?void 0:i.matrixWorld)!=null?s:it)}}return r})}_parseAnimation(e,t,n,r){let i=e.tracks,s=t.channels,a=new j;return a.duration=e.duration,s.forEach((l,u)=>{let{node:d,path:f}=l.target,m=i[u];if(d==null)return;let p=n.humanoidIndexToName.get(d);if(p!=null){let h=re[p];for(;h!=null&&r.get(h)==null;)h=re[h];if(h!=null||(h="hipsParent"),f==="translation")if(p!=="hips")console.warn(`The loading animation contains a translation track for ${p}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{let g=r.get("hipsParent"),_=ae(m.values,3).flatMap(y=>q.fromArray(y).applyMatrix4(g).toArray()),E=m.clone();E.values=new Float32Array(_),a.humanoidTracks.translation.set(p,E)}else if(f==="rotation"){let g=r.get(p),_=r.get(h);g.decompose(q,le,q),le.invert(),_.decompose(q,Se,q);let E=ae(m.values,4).flatMap(v=>st.fromArray(v).premultiply(Se).multiply(le).toArray()),y=m.clone();y.values=new Float32Array(E),a.humanoidTracks.rotation.set(p,y)}else throw new Error(`Invalid path "${f}"`);return}let c=n.expressionsIndexToName.get(d);if(c!=null){if(f==="translation"){let h=m.times,g=new Float32Array(m.values.length/3);for(let E=0;Enew Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())});import*as X from"three";import*as ye from"three";import*as U from"three";import*as ne from"three";import*as we from"three";import*as b from"three";import*as O from"three";import*as $ from"three";import*as F from"three";import*as T from"three";import*as He from"three";import*as oe from"three";import*as M from"three";import*as ie from"three";import*as R from"three";import*as te from"three";import*as rt from"three";var V=(o,e,t)=>new Promise((n,r)=>{var i=l=>{try{a(t.next(l))}catch(u){r(u)}},s=l=>{try{a(t.throw(l))}catch(u){r(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((t=t.apply(o,e)).next())}),he=class extends ye.Object3D{constructor(o){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${o}`,this.expressionName=o,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(o){this._binds.push(o)}deleteBind(o){let e=this._binds.indexOf(o);e>=0&&this._binds.splice(e,1)}applyWeight(o){var e;let t=this.outputWeight;t*=(e=o==null?void 0:o.multiplier)!=null?e:1,this.isBinary&&t<1&&(t=0),this._binds.forEach(n=>n.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(o=>o.clearAppliedWeight())}};function Ce(o,e,t){var n,r;let i=o.parser.json,s=(n=i.nodes)==null?void 0:n[e];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let a=s.mesh;if(a==null)return null;let l=(r=i.meshes)==null?void 0:r[a];if(l==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let u=l.primitives.length,d=[];return t.traverse(f=>{d.length{t.has(n)&&(e[n]=r)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(z));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)||(e[n]=r)}),e}copy(e){return this._expressions.concat().forEach(n=>{this.unregisterExpression(n)}),e._expressions.forEach(n=>{this.registerExpression(n)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new ve().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var t;let n=this.getExpression(e);return(t=n==null?void 0:n.weight)!=null?t:null}setValue(e,t){let n=this.getExpression(e);n&&(n.weight=Fe(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let n=1,r=t.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(n*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(n*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(n*=e.mouth),t.applyWeight({multiplier:n})})}_calculateWeightMultipliers(){let e=1,t=1,n=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,t-=r.overrideLookAtAmount,n-=r.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),n=Math.max(0,n),{blink:e,lookAt:t,mouth:n}}},Q={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},We={_Color:Q.Color,_EmissionColor:Q.EmissionColor,_ShadeColor:Q.ShadeColor,_RimColor:Q.RimColor,_OutlineColor:Q.OutlineColor},Qe=new ne.Color,xe=class Te{constructor({material:e,type:t,targetValue:n,targetAlpha:r}){this.material=e,this.type=t,this.targetValue=n,this.targetAlpha=r!=null?r:1;let i=this._initColorBindState(),s=this._initAlphaBindState();this._state={color:i,alpha:s}}applyWeight(e){let{color:t,alpha:n}=this._state;if(t!=null){let{propertyName:r,deltaValue:i}=t,s=this.material[r];s!=null&&s.add(Qe.copy(i).multiplyScalar(e))}if(n!=null){let{propertyName:r,deltaValue:i}=n;this.material[r]!=null&&(this.material[r]+=i*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:n,initialValue:r}=e,i=this.material[n];i!=null&&i.copy(r)}if(t!=null){let{propertyName:n,initialValue:r}=t;this.material[n]!=null&&(this.material[n]=r)}}_initColorBindState(){var e,t,n;let{material:r,type:i,targetValue:s}=this,a=this._getPropertyNameMap(),l=(t=(e=a==null?void 0:a[i])==null?void 0:e[0])!=null?t:null;if(l==null)return console.warn(`Tried to add a material color bind to the material ${(n=r.name)!=null?n:"(no name)"}, the type ${i} but the material or the type is not supported.`),null;let d=r[l].clone(),f=new ne.Color(s.r-d.r,s.g-d.g,s.b-d.b);return{propertyName:l,initialValue:d,deltaValue:f}}_initAlphaBindState(){var e,t,n;let{material:r,type:i,targetAlpha:s}=this,a=this._getPropertyNameMap(),l=(t=(e=a==null?void 0:a[i])==null?void 0:e[1])!=null?t:null;if(l==null&&s!==1)return console.warn(`Tried to add a material alpha bind to the material ${(n=r.name)!=null?n:"(no name)"}, the type ${i} but the material or the type does not support alpha.`),null;if(l==null)return null;let u=r[l],d=s-u;return{propertyName:l,initialValue:u,deltaValue:d}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(Te._propertyNameMapMap).find(([n])=>this.material[n]===!0))==null?void 0:e[1])!=null?t:null}};xe._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var pe=xe,me=class{constructor({primitives:o,index:e,weight:t}){this.primitives=o,this.index=e,this.weight=t}applyWeight(o){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*o)})}clearAppliedWeight(){this.primitives.forEach(o=>{var e;((e=o.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(o.morphTargetInfluences[this.index]=0)})}},fe=new we.Vector2,Pe=class Ae{constructor({material:e,scale:t,offset:n}){var r,i;this.material=e,this.scale=t,this.offset=n;let s=(r=Object.entries(Ae._propertyNamesMap).find(([a])=>e[a]===!0))==null?void 0:r[1];s==null?(console.warn(`Tried to add a texture transform bind to the material ${(i=e.name)!=null?i:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],s.forEach(a=>{var l;let u=(l=e[a])==null?void 0:l.clone();if(!u)return null;e[a]=u;let d=u.offset.clone(),f=u.repeat.clone(),m=n.clone().sub(d),p=t.clone().sub(f);this._properties.push({name:a,initialOffset:d,deltaOffset:m,initialScale:f,deltaScale:p})}))}applyWeight(e){this._properties.forEach(t=>{let n=this.material[t.name];n!==void 0&&(n.offset.add(fe.copy(t.deltaOffset).multiplyScalar(e)),n.repeat.add(fe.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};Pe._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var ge=Pe,ze=new Set(["1.0","1.0-beta"]),je=class Le{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return V(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return V(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let n=yield this._v0Import(e);return n||null})}_v1Import(e){return V(this,null,function*(){var t,n;let r=this.parser.json;if(!(((t=r.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;let s=(n=r.extensions)==null?void 0:n.VRMC_vrm;if(!s)return null;let a=s.specVersion;if(!ze.has(a))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;let l=s.expressions;if(!l)return null;let u=new Set(Object.values(z)),d=new Map;l.preset!=null&&Object.entries(l.preset).forEach(([m,p])=>{if(p!=null){if(!u.has(m)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${m}" detected. Ignoring the expression`);return}d.set(m,p)}}),l.custom!=null&&Object.entries(l.custom).forEach(([m,p])=>{if(u.has(m)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${m}". Ignoring the expression`);return}d.set(m,p)});let f=new ce;return yield Promise.all(Array.from(d.entries()).map(m=>V(this,[m],function*([p,c]){var h,g,_,E,y,v,w;let x=new he(p);if(e.scene.add(x),x.isBinary=(h=c.isBinary)!=null?h:!1,x.overrideBlink=(g=c.overrideBlink)!=null?g:"none",x.overrideLookAt=(_=c.overrideLookAt)!=null?_:"none",x.overrideMouth=(E=c.overrideMouth)!=null?E:"none",(y=c.morphTargetBinds)==null||y.forEach(P=>V(this,null,function*(){var A;if(P.node===void 0||P.index===void 0)return;let N=yield de(e,P.node),H=P.index;if(!N.every(k=>Array.isArray(k.morphTargetInfluences)&&H{let N=A.material;N&&(Array.isArray(N)?P.push(...N):P.push(N))}),(v=c.materialColorBinds)==null||v.forEach(A=>V(this,null,function*(){P.filter(H=>{var k;let D=(k=this.parser.associations.get(H))==null?void 0:k.materials;return A.material===D}).forEach(H=>{x.addBind(new pe({material:H,type:A.type,targetValue:new U.Color().fromArray(A.targetValue),targetAlpha:A.targetValue[3]}))})})),(w=c.textureTransformBinds)==null||w.forEach(A=>V(this,null,function*(){P.filter(H=>{var k;let D=(k=this.parser.associations.get(H))==null?void 0:k.materials;return A.material===D}).forEach(H=>{var k,D;x.addBind(new ge({material:H,offset:new U.Vector2().fromArray((k=A.offset)!=null?k:[0,0]),scale:new U.Vector2().fromArray((D=A.scale)!=null?D:[1,1])}))})}))}f.registerExpression(x)}))),f})}_v0Import(e){return V(this,null,function*(){var t;let n=this.parser.json,r=(t=n.extensions)==null?void 0:t.VRM;if(!r)return null;let i=r.blendShapeMaster;if(!i)return null;let s=new ce,a=i.blendShapeGroups;if(!a)return s;let l=new Set;return yield Promise.all(a.map(u=>V(this,null,function*(){var d;let f=u.presetName,m=f!=null&&Le.v0v1PresetNameMap[f]||null,p=m!=null?m:u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(l.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${f} has duplicated entries. Ignoring the expression`);return}l.add(p);let c=new he(p);e.scene.add(c),c.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(g=>V(this,null,function*(){var _;if(g.mesh===void 0||g.index===void 0)return;let E=[];(_=n.nodes)==null||_.forEach((v,w)=>{v.mesh===g.mesh&&E.push(w)});let y=g.index;yield Promise.all(E.map(v=>V(this,null,function*(){var w;let x=yield de(e,v);if(!x.every(P=>Array.isArray(P.morphTargetInfluences)&&y{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;let _=[];e.scene.traverse(y=>{if(y.material){let v=y.material;Array.isArray(v)?_.push(...v.filter(w=>(w.name===g.materialName||w.name===g.materialName+" (Outline)")&&_.indexOf(w)===-1)):v.name===g.materialName&&_.indexOf(v)===-1&&_.push(v)}});let E=g.propertyName;_.forEach(y=>{if(E==="_MainTex_ST"){let w=new U.Vector2(g.targetValue[0],g.targetValue[1]),x=new U.Vector2(g.targetValue[2],g.targetValue[3]);x.y=1-x.y-w.y,c.addBind(new ge({material:y,scale:w,offset:x}));return}let v=We[E];if(v){c.addBind(new pe({material:y,type:v,targetValue:new U.Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(E+" is not supported")})}),s.registerExpression(c)}))),s})}};je.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var Ve=class C{constructor(e,t){this._firstPersonOnlyLayer=C.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=C.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new C(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=C.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=C.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(n=>{n.meshes.forEach(r=>{n.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(i=>i.layers.set(this._firstPersonOnlyLayer))):n.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(i=>i.layers.set(this._thirdPersonOnlyLayer))):n.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,n,r){let i=0;if(t!=null&&t.length>0)for(let s=0;s0&&r.includes(f[0])||d[1]>0&&r.includes(f[1])||d[2]>0&&r.includes(f[2])||d[3]>0&&r.includes(f[3]))continue;let m=t[l],p=n[l];if(m[0]>0&&r.includes(p[0])||m[1]>0&&r.includes(p[1])||m[2]>0&&r.includes(p[2])||m[3]>0&&r.includes(p[3]))continue;let c=t[u],h=n[u];c[0]>0&&r.includes(h[0])||c[1]>0&&r.includes(h[1])||c[2]>0&&r.includes(h[2])||c[3]>0&&r.includes(h[3])||(e[i++]=a,e[i++]=l,e[i++]=u)}return i}_createErasedMesh(e,t){let n=new b.SkinnedMesh(e.geometry.clone(),e.material);n.name=`${e.name}(erase)`,n.frustumCulled=e.frustumCulled,n.layers.set(this._firstPersonOnlyLayer);let r=n.geometry,i=r.getAttribute("skinIndex"),s=i instanceof b.GLBufferAttribute?[]:i.array,a=[];for(let h=0;h{this._isEraseTarget(i)&&n.push(s)}),!n.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(t,n);e.add(r)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{let t=new b.Group;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(n=>n.type==="SkinnedMesh").forEach(n=>{let r=n;this._createHeadlessModelForSkinnedMesh(t,r)})}else if(e.type==="SkinnedMesh"){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};Ve.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;Ve.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var ht=new O.Vector3,dt=new O.Vector3,ct=new O.Quaternion;var re={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function qe(o){return o.invert?o.invert():o.inverse(),o}var pt=new $.Vector3,mt=new $.Quaternion;var ft=new F.Vector3,gt=new F.Quaternion,Rt=new F.Vector3;var Et=new T.Quaternion,Mt=new T.Quaternion,_t=new T.Vector3,yt=new T.Vector3,Re=Math.sqrt(2)/2,vt=new T.Quaternion(0,0,-Re,Re),xt=new T.Vector3(0,1,0);var Ye=new ie.Vector3,$e=new ie.Vector3;function ee(o,e){return o.matrixWorld.decompose(Ye,e,$e),e}function Y(o){return[Math.atan2(-o.z,o.x),Math.atan2(o.y,Math.sqrt(o.x*o.x+o.z*o.z))]}function Ee(o){let e=Math.round(o/2/Math.PI);return o-2*Math.PI*e}var Me=new M.Vector3(0,0,1),Ge=new M.Vector3,Xe=new M.Vector3,Ke=new M.Vector3,Ze=new M.Quaternion,Z=new M.Quaternion,_e=new M.Quaternion,Je=new M.Quaternion,J=new M.Euler,ke=class be{constructor(e,t){this.offsetFromHeadBone=new M.Vector3,this.autoUpdate=!0,this.faceFront=new M.Vector3(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new M.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new M.Euler)}getEuler(e){return e.set(M.MathUtils.DEG2RAD*this._pitch,M.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new be(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){let t=this.humanoid.getRawBoneNode("head");return ee(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Me)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,n]=Y(this.faceFront);return J.set(0,.5*Math.PI+t,n,"YZX"),e.setFromEuler(J).premultiply(Je.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(Z),this.getFaceFrontQuaternion(_e),e.copy(Me).applyQuaternion(Z).applyQuaternion(_e).applyEuler(this.getEuler(J))}lookAt(e){let t=Ze.copy(this._restHeadWorldQuaternion).multiply(qe(this.getLookAtWorldQuaternion(Z))),n=this.getLookAtWorldPosition(Xe),r=Ke.copy(e).sub(n).applyQuaternion(t).normalize(),[i,s]=Y(this.faceFront),[a,l]=Y(r),u=Ee(a-i),d=Ee(s-l);this._yaw=M.MathUtils.RAD2DEG*u,this._pitch=M.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Ge)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};ke.EULER_ORDER="YXZ";var Be=ke,et=new R.Vector3(0,0,1),I=new R.Quaternion,S=new R.Quaternion,L=new R.Euler(0,0,0,"YXZ"),tt=class{constructor(o,e,t,n,r){this.humanoid=o,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=n,this.rangeMapVerticalUp=r,this.faceFront=new R.Vector3(0,0,1),this._restQuatLeftEye=new R.Quaternion,this._restQuatRightEye=new R.Quaternion,this._restLeftEyeParentWorldQuat=new R.Quaternion,this._restRightEyeParentWorldQuat=new R.Quaternion;let i=this.humanoid.getRawBoneNode("leftEye"),s=this.humanoid.getRawBoneNode("rightEye");i&&(this._restQuatLeftEye.copy(i.quaternion),ee(i.parent,this._restLeftEyeParentWorldQuat)),s&&(this._restQuatRightEye.copy(s.quaternion),ee(s.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(o,e){let t=this.humanoid.getRawBoneNode("leftEye"),n=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),i=this.humanoid.getNormalizedBoneNode("rightEye");t&&(e<0?L.x=-R.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):L.x=R.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),o<0?L.y=-R.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-o):L.y=R.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(o),I.setFromEuler(L),this._getWorldFaceFrontQuat(S),r.quaternion.copy(S).multiply(I).multiply(S.invert()),I.copy(this._restLeftEyeParentWorldQuat),t.quaternion.copy(r.quaternion).multiply(I).premultiply(I.invert()).multiply(this._restQuatLeftEye)),n&&(e<0?L.x=-R.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):L.x=R.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),o<0?L.y=-R.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-o):L.y=R.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(o),I.setFromEuler(L),this._getWorldFaceFrontQuat(S),i.quaternion.copy(S).multiply(I).multiply(S.invert()),I.copy(this._restRightEyeParentWorldQuat),n.quaternion.copy(i.quaternion).multiply(I).premultiply(I.invert()).multiply(this._restQuatRightEye))}lookAt(o){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=R.MathUtils.RAD2DEG*o.y,t=R.MathUtils.RAD2DEG*o.x;this.applyYawPitch(e,t)}_getWorldFaceFrontQuat(o){if(this.faceFront.distanceToSquared(et)<.01)return o.identity();let[e,t]=Y(this.faceFront);return L.set(0,.5*Math.PI+e,t,"YZX"),o.setFromEuler(L)}};tt.type="bone";var nt=class{constructor(o,e,t,n,r){this.expressions=o,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=t,this.rangeMapVerticalDown=n,this.rangeMapVerticalUp=r}applyYawPitch(o,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),o<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-o))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(o)))}lookAt(o){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=te.MathUtils.RAD2DEG*o.y,t=te.MathUtils.RAD2DEG*o.x;this.applyYawPitch(e,t)}};nt.type="expression";import*as G from"three";var Ie=180/Math.PI,se=new G.Euler,W=class extends G.Object3D{constructor(e){super(),this.vrmLookAt=e,this.type="VRMLookAtQuaternionProxy";let t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});let n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){se.setFromQuaternion(this.quaternion,Be.EULER_ORDER),this.vrmLookAt.yaw=Ie*se.y,this.vrmLookAt.pitch=Ie*se.x}};function Ne(o,e,t){var i,s;let n=new Map,r=new Map;for(let[a,l]of o.humanoidTracks.rotation.entries()){let u=(i=e.getNormalizedBoneNode(a))==null?void 0:i.name;if(u!=null){let d=new X.QuaternionKeyframeTrack(`${u}.quaternion`,l.times,l.values.map((f,m)=>t==="0"&&m%2===0?-f:f));r.set(a,d)}}for(let[a,l]of o.humanoidTracks.translation.entries()){let u=(s=e.getNormalizedBoneNode(a))==null?void 0:s.name;if(u!=null){let d=o.restHipsPosition.y,m=e.normalizedRestPose.hips.position[1]/d,p=l.clone();p.values=p.values.map((c,h)=>(t==="0"&&h%3!==1?-c:c)*m),p.name=`${u}.position`,n.set(a,p)}}return{translation:n,rotation:r}}function Ue(o,e){let t=new Map,n=new Map;for(let[r,i]of o.expressionTracks.preset.entries()){let s=e.getExpressionTrackName(r);if(s!=null){let a=i.clone();a.name=s,t.set(r,a)}}for(let[r,i]of o.expressionTracks.custom.entries()){let s=e.getExpressionTrackName(r);if(s!=null){let a=i.clone();a.name=s,n.set(r,a)}}return{preset:t,custom:n}}function Oe(o,e){if(o.lookAtTrack==null)return null;let t=o.lookAtTrack.clone();return t.name=e,t}function ot(o,e){let t=[],n=Ne(o,e.humanoid,e.meta.metaVersion);if(t.push(...n.translation.values()),t.push(...n.rotation.values()),e.expressionManager!=null){let r=Ue(o,e.expressionManager);t.push(...r.preset.values()),t.push(...r.custom.values())}if(e.lookAt!=null){let r=e.scene.children.find(s=>s instanceof W);r==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),r=new W(e.lookAt),r.name="VRMLookAtQuaternionProxy",e.scene.add(r)):r.name==null&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),r.name="VRMLookAtQuaternionProxy");let i=Oe(o,`${r.name}.quaternion`);i!=null&&t.push(i)}return new X.AnimationClip("Clip",o.duration,t)}import*as De from"three";var j=class{constructor(){this.duration=0,this.restHipsPosition=new De.Vector3,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};import*as B from"three";function ae(o,e){let t=o.length,n=[],r=[],i=0;for(let s=0;s{let E=t.animations[_],y=this._parseAnimation(g,E,s,a);return y.restHipsPosition=d,y});e.userData.vrmAnimations=m})}_createNodeMap(e){var l,u,d,f,m;let t=new Map,n=new Map,r=(l=e.humanoid)==null?void 0:l.humanBones;r&&Object.entries(r).forEach(([p,c])=>{let h=c==null?void 0:c.node;h!=null&&t.set(h,p)});let i=(u=e.expressions)==null?void 0:u.preset;i&&Object.entries(i).forEach(([p,c])=>{let h=c==null?void 0:c.node;h!=null&&n.set(h,p)});let s=(d=e.expressions)==null?void 0:d.custom;s&&Object.entries(s).forEach(([p,c])=>{let{node:h}=c;n.set(h,p)});let a=(m=(f=e.lookAt)==null?void 0:f.node)!=null?m:null;return{humanoidIndexToName:t,expressionsIndexToName:n,lookAtIndex:a}}_createBoneWorldMatrixMap(e,t){return K(this,null,function*(){var i,s;e.scene.updateWorldMatrix(!1,!0);let n=yield e.parser.getDependencies("node"),r=new Map;if(t.humanoid==null)return r;for(let[a,l]of Object.entries(t.humanoid.humanBones)){let u=l==null?void 0:l.node;if(u!=null){let d=n[u];r.set(a,d.matrixWorld),a==="hips"&&r.set("hipsParent",(s=(i=d.parent)==null?void 0:i.matrixWorld)!=null?s:it)}}return r})}_parseAnimation(e,t,n,r){let i=e.tracks,s=t.channels,a=new j;return a.duration=e.duration,s.forEach((l,u)=>{let{node:d,path:f}=l.target,m=i[u];if(d==null)return;let p=n.humanoidIndexToName.get(d);if(p!=null){let h=re[p];for(;h!=null&&r.get(h)==null;)h=re[h];if(h!=null||(h="hipsParent"),f==="translation")if(p!=="hips")console.warn(`The loading animation contains a translation track for ${p}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{let g=r.get("hipsParent"),_=ae(m.values,3).flatMap(y=>q.fromArray(y).applyMatrix4(g).toArray()),E=m.clone();E.values=new Float32Array(_),a.humanoidTracks.translation.set(p,E)}else if(f==="rotation"){let g=r.get(p),_=r.get(h);g.decompose(q,le,q),le.invert(),_.decompose(q,Se,q);let E=ae(m.values,4).flatMap(v=>st.fromArray(v).premultiply(Se).multiply(le).toArray()),y=m.clone();y.values=new Float32Array(E),a.humanoidTracks.rotation.set(p,y)}else throw new Error(`Invalid path "${f}"`);return}let c=n.expressionsIndexToName.get(d);if(c!=null){if(f==="translation"){let h=m.times,g=new Float32Array(m.values.length/3);for(let E=0;EVRMCore | @pixiv/three-vrm-core

A class that represents a single VRM model. This class only includes core spec of the VRM (VRMC_vrm).

-

Constructors

Constructors

Properties

Methods

Constructors

Properties

expressionManager?: VRMExpressionManager

Contains VRMExpressionManager of the VRM. +

Returns VRMCore

Properties

expressionManager?: VRMExpressionManager

Contains VRMExpressionManager of the VRM. You might want to control these facial expressions via VRMExpressionManager.setValue.

-
firstPerson?: VRMFirstPerson

Contains VRMFirstPerson of the VRM. +

firstPerson?: VRMFirstPerson

Contains VRMFirstPerson of the VRM. VRMFirstPerson is mostly used for mesh culling for first person view.

-
humanoid: VRMHumanoid

Contains VRMHumanoid of the VRM. +

humanoid: VRMHumanoid

Contains VRMHumanoid of the VRM. You can control each bones using VRMHumanoid.getNormalizedBoneNode or VRMHumanoid.getRawBoneNode.

Add a link to VRM spec

-
lookAt?: VRMLookAt

Contains VRMLookAt of the VRM. +

lookAt?: VRMLookAt

Contains VRMLookAt of the VRM. You might want to use VRMLookAt.target to control the eye direction of your VRMs.

-
meta: VRMMeta

Contains meta fields of the VRM. +

meta: VRMMeta

Contains meta fields of the VRM. You might want to refer these license fields before use your VRMs.

-
scene: Group<Object3DEventMap>

THREE.Group that contains the entire VRM.

-

Methods

scene: Group<Object3DEventMap>

THREE.Group that contains the entire VRM.

+

Methods

+

Returns void

diff --git a/packages/three-vrm-core/docs/classes/VRMCoreLoaderPlugin.html b/packages/three-vrm-core/docs/classes/VRMCoreLoaderPlugin.html index 5d4e01a2e..b7e3b556c 100644 --- a/packages/three-vrm-core/docs/classes/VRMCoreLoaderPlugin.html +++ b/packages/three-vrm-core/docs/classes/VRMCoreLoaderPlugin.html @@ -1,4 +1,4 @@ -VRMCoreLoaderPlugin | @pixiv/three-vrm-core

Implements

  • GLTFLoaderPlugin

Constructors

constructor +VRMCoreLoaderPlugin | @pixiv/three-vrm-core

Implements

  • GLTFLoaderPlugin

Constructors

Properties

Accessors

Methods

Constructors

Properties

expressionPlugin: VRMExpressionLoaderPlugin
firstPersonPlugin: VRMFirstPersonLoaderPlugin
humanoidPlugin: VRMHumanoidLoaderPlugin
lookAtPlugin: VRMLookAtLoaderPlugin
parser: GLTFParser

Accessors

Methods

+

Constructors

Properties

expressionPlugin: VRMExpressionLoaderPlugin
firstPersonPlugin: VRMFirstPersonLoaderPlugin
humanoidPlugin: VRMHumanoidLoaderPlugin
lookAtPlugin: VRMLookAtLoaderPlugin
parser: GLTFParser

Accessors

Methods

diff --git a/packages/three-vrm-core/docs/classes/VRMExpression.html b/packages/three-vrm-core/docs/classes/VRMExpression.html index 600de8c8b..ce440af7f 100644 --- a/packages/three-vrm-core/docs/classes/VRMExpression.html +++ b/packages/three-vrm-core/docs/classes/VRMExpression.html @@ -1,4 +1,4 @@ -VRMExpression | @pixiv/three-vrm-core

Hierarchy

  • Object3D
    • VRMExpression

Constructors

constructor +VRMExpression | @pixiv/three-vrm-core

Hierarchy

  • Object3D
    • VRMExpression

Constructors

Properties

animations: AnimationClip[]

Array with object's animation clips.

+

Constructors

Properties

animations: AnimationClip[]

Array with object's animation clips.

[]

castShadow: boolean

Whether the object gets rendered into shadow map.

false

@@ -109,14 +111,14 @@

undefined

expressionName: string

Name of this expression. Distinguished with name since name will be conflicted with Object3D.

-
frustumCulled: boolean

When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. +

frustumCulled: boolean

When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to false the object gets rendered every frame even if it is not in the frustum of the camera.

true

id: number

Unique number for this Object3D instance.

Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. Expects a Integer

isBinary: boolean = false

Interpret values greater than 0.5 as 1.0, ortherwise 0.0.

-
isObject3D

Flag to check if a given object is of type Object3D.

+
isObject3D

Flag to check if a given object is of type Object3D.

This is a constant value

true

layers: Layers

The layer membership of the object.

@@ -142,9 +144,9 @@

""

normalMatrix: Matrix3

new THREE.Matrix3()

overrideBlink: VRMExpressionOverrideType = 'none'

Specify how the expression overrides blink expressions.

-
overrideLookAt: VRMExpressionOverrideType = 'none'

Specify how the expression overrides lookAt expressions.

-
overrideMouth: VRMExpressionOverrideType = 'none'

Specify how the expression overrides mouth expressions.

-
parent: null | Object3D<Object3DEventMap>

Object's parent in the scene graph.

+
overrideLookAt: VRMExpressionOverrideType = 'none'

Specify how the expression overrides lookAt expressions.

+
overrideMouth: VRMExpressionOverrideType = 'none'

Specify how the expression overrides mouth expressions.

+
parent: null | Object3D<Object3DEventMap>

Object's parent in the scene graph.

An object can have at most one parent.

null

position: Vector3

Object's local position.

@@ -166,7 +168,7 @@

This can be used to find a specific type of Object3D in a scene. Sub-classes will update this value.

Object3D

-
up: Vector3

This is used by the lookAt method, for example, to determine the orientation of the result.

+
up: Vector3

This is used by the lookAt method, for example, to determine the orientation of the result.

Object3D.DEFAULT_UP - that is (0, 1, 0).

userData: Record<string, any>

An object that can be used to store custom data about the Object3D.

It should not hold references to functions as these will not be cloned.

@@ -178,28 +180,31 @@
weight: number = 0.0

The current weight of the expression.

You usually want to set the weight via VRMExpressionManager.setValue.

It might also be controlled by the Three.js animation system.

-
DEFAULT_MATRIX_AUTO_UPDATE: boolean

The default setting for matrixAutoUpdate for newly created Object3Ds.

+
DEFAULT_MATRIX_AUTO_UPDATE: boolean

The default setting for matrixAutoUpdate for newly created Object3Ds.

true

DEFAULT_MATRIX_WORLD_AUTO_UPDATE: boolean

The default setting for matrixWorldAutoUpdate for newly created Object3Ds.

true

DEFAULT_UP: Vector3

The default up direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down).

new THREE.Vector3( 0, 1, 0)

-

Accessors

  • get overrideBlinkAmount(): number
  • A value represents how much it should override blink expressions. +

Accessors

Methods

Methods

  • Adds another Object3D as child of this Object3D.

    Parameters

    • Rest...object: Object3D<Object3DEventMap>[]

    Returns this

    An arbitrary number of objects may be added Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent.

    • attach
    • THREE.Group | Group for info on manually grouping objects.
    -
  • Adds a listener to an event type.

    +
  • Adds a listener to an event type.

    Type Parameters

    • T extends keyof Object3DEventMap

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<Object3DEventMap[T], T, VRMExpression>

      The function that gets called when the event is fired.

    Returns void

  • Adds a Object3D as a child of this, while maintaining the object's world transform.

    +

Returns void

  • Adds a Object3D as a child of this, while maintaining the object's world transform.

    Parameters

    • object: Object3D<Object3DEventMap>

    Returns this

    Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).

    add

  • Removes all child objects.

    Returns this

  • Returns a clone of this object and optionally all descendants.

    Parameters

    • Optionalrecursive: boolean

      If true, descendants of the object are also cloned. Default true

    Returns this

  • Copies the given object into this object.

    Parameters

    • object: Object3D<Object3DEventMap>
    • Optionalrecursive: boolean

      If set to true, descendants of the object are copied next to the existing ones. If set to false, descendants are left unchanged. Default is true.

    Returns this

    Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

    -
  • Fire an event type.

    +
  • Fire an event type.

    Type Parameters

    • T extends keyof Object3DEventMap

    Parameters

    • event: BaseEvent<T> & Object3DEventMap[T]

      The event that gets fired.

    Returns void

  • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

    Parameters

    • id: number

      Unique number of the object instance. Expects a Integer

      @@ -352,4 +359,4 @@
    • updateChildren: boolean

      Recursively updates global transform of descendants.

    Returns void

  • Converts the vector from world space to this object's local space.

    Parameters

    • vector: Vector3

      A vector representing a position in world space.

      -

    Returns Vector3

+

Returns Vector3

diff --git a/packages/three-vrm-core/docs/classes/VRMExpressionLoaderPlugin.html b/packages/three-vrm-core/docs/classes/VRMExpressionLoaderPlugin.html index 97e107c4a..edcf61d55 100644 --- a/packages/three-vrm-core/docs/classes/VRMExpressionLoaderPlugin.html +++ b/packages/three-vrm-core/docs/classes/VRMExpressionLoaderPlugin.html @@ -1,7 +1,7 @@ VRMExpressionLoaderPlugin | @pixiv/three-vrm-core

Class VRMExpressionLoaderPlugin

A plugin of GLTFLoader that imports a VRMExpressionManager from a VRM extension of a GLTF.

-

Implements

  • GLTFLoaderPlugin

Constructors

Implements

  • GLTFLoaderPlugin

Constructors

Properties

Accessors

Methods

Constructors

Properties

parser: GLTFParser
v0v1PresetNameMap: {
    a: undefined | VRMExpressionPresetName;
    angry: undefined | VRMExpressionPresetName;
    blink: undefined | VRMExpressionPresetName;
    blink_l: undefined | VRMExpressionPresetName;
    blink_r: undefined | VRMExpressionPresetName;
    e: undefined | VRMExpressionPresetName;
    fun: undefined | VRMExpressionPresetName;
    i: undefined | VRMExpressionPresetName;
    joy: undefined | VRMExpressionPresetName;
    lookdown: undefined | VRMExpressionPresetName;
    lookleft: undefined | VRMExpressionPresetName;
    lookright: undefined | VRMExpressionPresetName;
    lookup: undefined | VRMExpressionPresetName;
    neutral: undefined | VRMExpressionPresetName;
    o: undefined | VRMExpressionPresetName;
    sorrow: undefined | VRMExpressionPresetName;
    u: undefined | VRMExpressionPresetName;
    unknown: undefined | VRMExpressionPresetName;
} = ...

Accessors

Methods

+

Constructors

Properties

parser: GLTFParser
v0v1PresetNameMap: {
    a: undefined | VRMExpressionPresetName;
    angry: undefined | VRMExpressionPresetName;
    blink: undefined | VRMExpressionPresetName;
    blink_l: undefined | VRMExpressionPresetName;
    blink_r: undefined | VRMExpressionPresetName;
    e: undefined | VRMExpressionPresetName;
    fun: undefined | VRMExpressionPresetName;
    i: undefined | VRMExpressionPresetName;
    joy: undefined | VRMExpressionPresetName;
    lookdown: undefined | VRMExpressionPresetName;
    lookleft: undefined | VRMExpressionPresetName;
    lookright: undefined | VRMExpressionPresetName;
    lookup: undefined | VRMExpressionPresetName;
    neutral: undefined | VRMExpressionPresetName;
    o: undefined | VRMExpressionPresetName;
    sorrow: undefined | VRMExpressionPresetName;
    u: undefined | VRMExpressionPresetName;
    unknown: undefined | VRMExpressionPresetName;
} = ...

Accessors

Methods

diff --git a/packages/three-vrm-core/docs/classes/VRMExpressionManager.html b/packages/three-vrm-core/docs/classes/VRMExpressionManager.html index 092b2f26d..23159d090 100644 --- a/packages/three-vrm-core/docs/classes/VRMExpressionManager.html +++ b/packages/three-vrm-core/docs/classes/VRMExpressionManager.html @@ -1,4 +1,4 @@ -VRMExpressionManager | @pixiv/three-vrm-core

Constructors

constructor +VRMExpressionManager | @pixiv/three-vrm-core

Constructors

Properties

blinkExpressionNames: string[] = ...

A set of name or preset name of expressions that will be overridden by VRMExpression.overrideBlink.

-
lookAtExpressionNames: string[] = ...

A set of name or preset name of expressions that will be overridden by VRMExpression.overrideLookAt.

-
mouthExpressionNames: string[] = ...

A set of name or preset name of expressions that will be overridden by VRMExpression.overrideMouth.

-

Accessors

Methods

Properties

blinkExpressionNames: string[] = ...

A set of name or preset name of expressions that will be overridden by VRMExpression.overrideBlink.

+
lookAtExpressionNames: string[] = ...

A set of name or preset name of expressions that will be overridden by VRMExpression.overrideLookAt.

+
mouthExpressionNames: string[] = ...

A set of name or preset name of expressions that will be overridden by VRMExpression.overrideMouth.

+

Accessors

Methods

  • Get a track name of specified expression. +

Returns null | VRMExpression

  • Get a track name of specified expression. This track name is needed to manipulate its expression via keyframe animations.

    Parameters

    • name: string

      Name of the expression

    Returns null | string

    const trackName = vrm.expressionManager.getExpressionTrackName( 'blink' );
    const track = new THREE.NumberKeyframeTrack(
    name,
    [ 0.0, 0.5, 1.0 ], // times
    [ 0.0, 1.0, 0.0 ] // values
    );

    const clip = new THREE.AnimationClip(
    'blink', // name
    1.0, // duration
    [ track ] // tracks
    );

    const mixer = new THREE.AnimationMixer( vrm.scene );
    const action = mixer.clipAction( clip );
    action.play();
    -
  • Get the current weight of the specified expression. +

  • Register an expression.

    +

Returns null | number

  • Set a weight to the specified expression.

    +

Returns void

  • Unregister an expression.

    +

Returns void

+

Returns void

diff --git a/packages/three-vrm-core/docs/classes/VRMExpressionMaterialColorBind.html b/packages/three-vrm-core/docs/classes/VRMExpressionMaterialColorBind.html index b448e5e90..648c1ee21 100644 --- a/packages/three-vrm-core/docs/classes/VRMExpressionMaterialColorBind.html +++ b/packages/three-vrm-core/docs/classes/VRMExpressionMaterialColorBind.html @@ -1,5 +1,5 @@ VRMExpressionMaterialColorBind | @pixiv/three-vrm-core

Class VRMExpressionMaterialColorBind

A bind of expression influences to a material color.

-

Implements

Constructors

Implements

Constructors

Properties

material targetAlpha targetValue @@ -10,11 +10,11 @@
  • OptionaltargetAlpha?: number

    The target alpha.

  • targetValue: Color

    The target color.

  • type: VRMExpressionMaterialColorType

    The type of the target property of the material.

    -
  • Returns VRMExpressionMaterialColorBind

    Properties

    material: Material

    The target material.

    -
    targetAlpha: number

    The target alpha.

    -
    targetValue: Color

    The target color.

    -

    The type of the target property of the material.

    -

    Methods

    • Apply a weight to this bind. +

    Returns VRMExpressionMaterialColorBind

    Properties

    material: Material

    The target material.

    +
    targetAlpha: number

    The target alpha.

    +
    targetValue: Color

    The target color.

    +

    The type of the target property of the material.

    +

    Methods

    +

    Parameters

    • weight: number

    Returns void

    diff --git a/packages/three-vrm-core/docs/classes/VRMExpressionMorphTargetBind.html b/packages/three-vrm-core/docs/classes/VRMExpressionMorphTargetBind.html index 31cb4f85a..f1d3635ad 100644 --- a/packages/three-vrm-core/docs/classes/VRMExpressionMorphTargetBind.html +++ b/packages/three-vrm-core/docs/classes/VRMExpressionMorphTargetBind.html @@ -1,5 +1,5 @@ VRMExpressionMorphTargetBind | @pixiv/three-vrm-core

    Class VRMExpressionMorphTargetBind

    A bind of VRMExpression influences to morph targets.

    -

    Implements

    Constructors

    Implements

    Constructors

    Properties

    index primitives weight @@ -8,10 +8,10 @@

    Constructors

    • Parameters

      • __namedParameters: {
            index: number;
            primitives: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[];
            weight: number;
        }
        • index: number

          The index of the morph target in the mesh.

        • primitives: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[]

          The mesh primitives that attached to target mesh.

        • weight: number

          The weight value of target morph target. Ranging in [0.0 - 1.0].

          -

      Returns VRMExpressionMorphTargetBind

    Properties

    index: number

    The index of the morph target in the mesh.

    -
    primitives: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[]

    The mesh primitives that attached to target mesh.

    -
    weight: number

    The weight value of target morph target. Ranging in [0.0 - 1.0].

    -

    Methods

    • Apply a weight to this bind. +

    Returns VRMExpressionMorphTargetBind

    Properties

    index: number

    The index of the morph target in the mesh.

    +
    primitives: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[]

    The mesh primitives that attached to target mesh.

    +
    weight: number

    The weight value of target morph target. Ranging in [0.0 - 1.0].

    +

    Methods

    +

    Parameters

    • weight: number

    Returns void

    diff --git a/packages/three-vrm-core/docs/classes/VRMExpressionTextureTransformBind.html b/packages/three-vrm-core/docs/classes/VRMExpressionTextureTransformBind.html index e306c2056..f5166d9aa 100644 --- a/packages/three-vrm-core/docs/classes/VRMExpressionTextureTransformBind.html +++ b/packages/three-vrm-core/docs/classes/VRMExpressionTextureTransformBind.html @@ -1,5 +1,5 @@ VRMExpressionTextureTransformBind | @pixiv/three-vrm-core

    Class VRMExpressionTextureTransformBind

    A bind of expression influences to texture transforms.

    -

    Implements

    Constructors

    Implements

    Constructors

    Properties

    material offset scale @@ -8,10 +8,10 @@

    Constructors

    Properties

    material: Material

    The target material.

    -
    offset: Vector2

    The uv offset of the texture.

    -
    scale: Vector2

    The uv scale of the texture.

    -

    Methods

    • Apply a weight to this bind. +

    Returns VRMExpressionTextureTransformBind

    Properties

    material: Material

    The target material.

    +
    offset: Vector2

    The uv offset of the texture.

    +
    scale: Vector2

    The uv scale of the texture.

    +

    Methods

    +

    Parameters

    • weight: number

    Returns void

    diff --git a/packages/three-vrm-core/docs/classes/VRMFirstPerson.html b/packages/three-vrm-core/docs/classes/VRMFirstPerson.html index fac8de67d..0c6dc69e5 100644 --- a/packages/three-vrm-core/docs/classes/VRMFirstPerson.html +++ b/packages/three-vrm-core/docs/classes/VRMFirstPerson.html @@ -1,4 +1,4 @@ -VRMFirstPerson | @pixiv/three-vrm-core

    Constructors

    constructor +VRMFirstPerson | @pixiv/three-vrm-core

    Constructors

    Properties

    Constructors

    Properties

    humanoid: VRMHumanoid

    Its associated VRMHumanoid.

    -
    meshAnnotations: VRMFirstPersonMeshAnnotation[]
    DEFAULT_FIRSTPERSON_ONLY_LAYER = 9

    A default camera layer for FirstPersonOnly layer.

    +

    Returns VRMFirstPerson

    Properties

    humanoid: VRMHumanoid

    Its associated VRMHumanoid.

    +
    meshAnnotations: VRMFirstPersonMeshAnnotation[]
    DEFAULT_FIRSTPERSON_ONLY_LAYER = 9

    A default camera layer for FirstPersonOnly layer.

    [[getFirstPersonOnlyLayer]]

    -
    DEFAULT_THIRDPERSON_ONLY_LAYER = 10

    A default camera layer for ThirdPersonOnly layer.

    +
    DEFAULT_THIRDPERSON_ONLY_LAYER = 10

    A default camera layer for ThirdPersonOnly layer.

    [[getThirdPersonOnlyLayer]]

    -

    Accessors

    • get firstPersonOnlyLayer(): number
    • A camera layer represents FirstPersonOnly layer. +

    Accessors

    Methods

    Methods

    • In this method, it assigns layers for every meshes based on mesh annotations. You must call this method first before you use the layer feature.

      This is an equivalent of VRMFirstPerson.Setup of the UniVRM.

      The cameraLayer parameter specifies which layer will be assigned for FirstPersonOnly / ThirdPersonOnly. In UniVRM, we specified those by naming each desired layer as FIRSTPERSON_ONLY_LAYER / THIRDPERSON_ONLY_LAYER but we are going to specify these layers at here since we are unable to name layers in Three.js.

      Parameters

      • cameraLayer: {
            firstPersonOnlyLayer: undefined | number;
            thirdPersonOnlyLayer: undefined | number;
        } = {}

        Specify which layer will be for FirstPersonOnly / ThirdPersonOnly.

        -
        • firstPersonOnlyLayer: undefined | number
        • thirdPersonOnlyLayer: undefined | number

      Returns void

    +
    • firstPersonOnlyLayer: undefined | number
    • thirdPersonOnlyLayer: undefined | number

    Returns void

    diff --git a/packages/three-vrm-core/docs/classes/VRMFirstPersonLoaderPlugin.html b/packages/three-vrm-core/docs/classes/VRMFirstPersonLoaderPlugin.html index 911713d79..de36df6db 100644 --- a/packages/three-vrm-core/docs/classes/VRMFirstPersonLoaderPlugin.html +++ b/packages/three-vrm-core/docs/classes/VRMFirstPersonLoaderPlugin.html @@ -1,6 +1,6 @@ VRMFirstPersonLoaderPlugin | @pixiv/three-vrm-core

    Class VRMFirstPersonLoaderPlugin

    A plugin of GLTFLoader that imports a VRMFirstPerson from a VRM extension of a GLTF.

    -

    Implements

    • GLTFLoaderPlugin

    Constructors

    Implements

    • GLTFLoaderPlugin

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    parser: GLTFParser

    Accessors

    Methods

    +

    Constructors

    Properties

    parser: GLTFParser

    Accessors

    Methods

    diff --git a/packages/three-vrm-core/docs/classes/VRMHumanoid.html b/packages/three-vrm-core/docs/classes/VRMHumanoid.html index d29c9fde7..fcb16a3c3 100644 --- a/packages/three-vrm-core/docs/classes/VRMHumanoid.html +++ b/packages/three-vrm-core/docs/classes/VRMHumanoid.html @@ -1,5 +1,5 @@ VRMHumanoid | @pixiv/three-vrm-core

    A class represents a humanoid of a VRM.

    -

    Constructors

    Constructors

    Properties

    Accessors

    Constructors

    Properties

    autoUpdateHumanBones: boolean

    Whether it copies pose from normalizedHumanBones to rawHumanBones on update. +

  • Optionaloptions: {
        autoUpdateHumanBones?: boolean;
    }
    • OptionalautoUpdateHumanBones?: boolean
  • Returns VRMHumanoid

    Properties

    autoUpdateHumanBones: boolean

    Whether it copies pose from normalizedHumanBones to rawHumanBones on update. true by default.

    true
     
    -

    Accessors

    • get normalizedRestPose(): VRMPose
    • A VRMPose of its normalized human bones that is its default state. +

    Accessors

    Methods

    Methods

    • Return a normalized bone as a THREE.Object3D bound to a specified VRMHumanBoneName.

      +

    Returns undefined | VRMHumanBone

    • Return the current pose of normalized human bones as a VRMPose.

      +

    Returns null | Object3D<Object3DEventMap>

    • Return a raw bone as a THREE.Object3D bound to a specified VRMHumanBoneName.

      +

    Returns undefined | VRMHumanBone

    • Return the current pose of raw human bones as a VRMPose.

      +

    Returns null | Object3D<Object3DEventMap>

    • Let the raw human bones do a specified pose.

      +

    Returns void

    • Update the humanoid component.

      +

    Returns void

    +

    Returns void

    diff --git a/packages/three-vrm-core/docs/classes/VRMHumanoidHelper.html b/packages/three-vrm-core/docs/classes/VRMHumanoidHelper.html index 3767cb723..45611eb68 100644 --- a/packages/three-vrm-core/docs/classes/VRMHumanoidHelper.html +++ b/packages/three-vrm-core/docs/classes/VRMHumanoidHelper.html @@ -1,4 +1,4 @@ -VRMHumanoidHelper | @pixiv/three-vrm-core

    Hierarchy

    • Group
      • VRMHumanoidHelper

    Constructors

    constructor +VRMHumanoidHelper | @pixiv/three-vrm-core

    Hierarchy

    • Group
      • VRMHumanoidHelper

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    +

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    []

    castShadow: boolean

    Whether the object gets rendered into shadow map.

    false

    @@ -162,7 +162,7 @@

    This gets automatically assigned and shouldn't be edited.

    visible: boolean

    Object gets rendered if true.

    true

    -
    vrmHumanoid: VRMHumanoid
    DEFAULT_MATRIX_AUTO_UPDATE: boolean

    The default setting for matrixAutoUpdate for newly created Object3Ds.

    +
    vrmHumanoid: VRMHumanoid
    DEFAULT_MATRIX_AUTO_UPDATE: boolean

    The default setting for matrixAutoUpdate for newly created Object3Ds.

    true

    DEFAULT_MATRIX_WORLD_AUTO_UPDATE: boolean

    The default setting for matrixWorldAutoUpdate for newly created Object3Ds.

    true

    @@ -193,7 +193,7 @@

    Returns this

    Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

    • Fire an event type.

      Type Parameters

      • T extends keyof Object3DEventMap

      Parameters

      • event: BaseEvent<T> & Object3DEventMap[T]

        The event that gets fired.

        -

      Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      +

    Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      Parameters

      • id: number

        Unique number of the object instance. Expects a Integer

      Returns undefined | Object3D<Object3DEventMap>

      Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

      id

      @@ -318,7 +318,7 @@ And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.

      Parameters

      • force: boolean

        A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame. Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.

        -

      Returns void

    • Updates the global transform of the object.

      +

    Returns void

    • Updates the global transform of the object.

      Parameters

      • updateParents: boolean

        Recursively updates global transform of ancestors.

      • updateChildren: boolean

        Recursively updates global transform of descendants.

      Returns void

    parser: GLTFParser

    Accessors

    Methods

    diff --git a/packages/three-vrm-core/docs/classes/VRMLookAt.html b/packages/three-vrm-core/docs/classes/VRMLookAt.html index 49f2e883c..ded156339 100644 --- a/packages/three-vrm-core/docs/classes/VRMLookAt.html +++ b/packages/three-vrm-core/docs/classes/VRMLookAt.html @@ -1,5 +1,5 @@ VRMLookAt | @pixiv/three-vrm-core

    A class controls eye gaze movements of a VRM.

    -

    Constructors

    Constructors

    Properties

    _needsUpdate _pitch _yaw @@ -26,52 +26,52 @@

    Constructors

    Properties

    _needsUpdate: boolean

    Specifies that angles need to be applied to its [@link applier].

    -
    _pitch: number

    Its current angle around X axis, in degree.

    -
    _yaw: number

    Its current angle around Y axis, in degree.

    -

    The VRMLookAtApplier of the LookAt.

    -
    autoUpdate: boolean = true

    If this is true, the LookAt will be updated automatically by calling update, towarding the direction to the target. +

    Returns VRMLookAt

    Properties

    _needsUpdate: boolean

    Specifies that angles need to be applied to its [@link applier].

    +
    _pitch: number

    Its current angle around X axis, in degree.

    +
    _yaw: number

    Its current angle around Y axis, in degree.

    +

    The VRMLookAtApplier of the LookAt.

    +
    autoUpdate: boolean = true

    If this is true, the LookAt will be updated automatically by calling update, towarding the direction to the target. true by default.

    See also: target

    -
    faceFront: Vector3 = ...

    The front direction of the face. +

    faceFront: Vector3 = ...

    The front direction of the face. Intended to be used for VRM 0.0 compat (VRM 0.0 models are facing Z- instead of Z+). You usually don't want to touch this.

    -
    humanoid: VRMHumanoid

    Its associated VRMHumanoid.

    -
    offsetFromHeadBone: Vector3 = ...

    The origin of LookAt. Position offset from the head bone.

    -
    target?: null | Object3D<Object3DEventMap>

    The target object of the LookAt. +

    humanoid: VRMHumanoid

    Its associated VRMHumanoid.

    +
    offsetFromHeadBone: Vector3 = ...

    The origin of LookAt. Position offset from the head bone.

    +
    target?: null | Object3D<Object3DEventMap>

    The target object of the LookAt. Note that it does not make any sense if autoUpdate is disabled.

    See also: autoUpdate

    -
    EULER_ORDER: "YXZ" = 'YXZ'

    Accessors

    Methods

    EULER_ORDER: "YXZ" = 'YXZ'

    Accessors

    Methods

    • Get a quaternion that rotates the +Z unit vector of the humanoid Head to the faceFront direction.

      +

    Returns Euler

    • Get its LookAt direction in world coordinate.

      +

    Returns Quaternion

    • Get its lookAt position in world coordinate.

      +

    Returns Vector3

    • Get its lookAt rotation in world coordinate. +

    Returns Vector3

    • Set its lookAt target position.

      +

    Returns Quaternion

    • Set its lookAt target position.

      Note that its result will be instantly overwritten if VRMLookAtHead.autoUpdate is enabled.

      If you want to track an object continuously, you might want to use target instead.

      Parameters

      • position: Vector3

        A target position, in world space

        -

      Returns void

    • Update the VRMLookAtHead. +

    Returns void

    +

    Returns void

    diff --git a/packages/three-vrm-core/docs/classes/VRMLookAtBoneApplier.html b/packages/three-vrm-core/docs/classes/VRMLookAtBoneApplier.html index 4a8158fd5..047f56b28 100644 --- a/packages/three-vrm-core/docs/classes/VRMLookAtBoneApplier.html +++ b/packages/three-vrm-core/docs/classes/VRMLookAtBoneApplier.html @@ -1,6 +1,6 @@ VRMLookAtBoneApplier | @pixiv/three-vrm-core

    A class that applies eye gaze directions to a VRM. It will be used by VRMLookAt.

    -

    Implements

    Constructors

    Implements

    Constructors

    Properties

  • rangeMapHorizontalOuter: VRMLookAtRangeMap

    A VRMLookAtRangeMap used for outer transverse direction

  • rangeMapVerticalDown: VRMLookAtRangeMap

    A VRMLookAtRangeMap used for down direction

  • rangeMapVerticalUp: VRMLookAtRangeMap

    A VRMLookAtRangeMap used for up direction

    -
  • Returns VRMLookAtBoneApplier

    Properties

    faceFront: Vector3

    The front direction of the face. +

    Returns VRMLookAtBoneApplier

    Properties

    faceFront: Vector3

    The front direction of the face. Intended to be used for VRM 0.0 compat (VRM 0.0 models are facing Z- instead of Z+). You usually don't want to touch this.

    -
    humanoid: VRMHumanoid

    Its associated VRMHumanoid.

    -
    rangeMapHorizontalInner: VRMLookAtRangeMap

    A VRMLookAtRangeMap for horizontal inward movement. The left eye moves right. The right eye moves left.

    -
    rangeMapHorizontalOuter: VRMLookAtRangeMap

    A VRMLookAtRangeMap for horizontal outward movement. The left eye moves left. The right eye moves right.

    -
    rangeMapVerticalDown: VRMLookAtRangeMap

    A VRMLookAtRangeMap for vertical downward movement. Both eyes move upwards.

    -
    rangeMapVerticalUp: VRMLookAtRangeMap

    A VRMLookAtRangeMap for vertical upward movement. Both eyes move downwards.

    -
    type: "bone" = 'bone'

    Represent its type of applier.

    -

    Methods

    humanoid: VRMHumanoid

    Its associated VRMHumanoid.

    +
    rangeMapHorizontalInner: VRMLookAtRangeMap

    A VRMLookAtRangeMap for horizontal inward movement. The left eye moves right. The right eye moves left.

    +
    rangeMapHorizontalOuter: VRMLookAtRangeMap

    A VRMLookAtRangeMap for horizontal outward movement. The left eye moves left. The right eye moves right.

    +
    rangeMapVerticalDown: VRMLookAtRangeMap

    A VRMLookAtRangeMap for vertical downward movement. Both eyes move upwards.

    +
    rangeMapVerticalUp: VRMLookAtRangeMap

    A VRMLookAtRangeMap for vertical upward movement. Both eyes move downwards.

    +
    type: "bone" = 'bone'

    Represent its type of applier.

    +

    Methods

    +

    Returns void

    diff --git a/packages/three-vrm-core/docs/classes/VRMLookAtExpressionApplier.html b/packages/three-vrm-core/docs/classes/VRMLookAtExpressionApplier.html index d59196291..c9e3c773d 100644 --- a/packages/three-vrm-core/docs/classes/VRMLookAtExpressionApplier.html +++ b/packages/three-vrm-core/docs/classes/VRMLookAtExpressionApplier.html @@ -1,6 +1,6 @@ VRMLookAtExpressionApplier | @pixiv/three-vrm-core

    Class VRMLookAtExpressionApplier

    A class that applies eye gaze directions to a VRM. It will be used by VRMLookAt.

    -

    Implements

    Constructors

    Implements

    Constructors

    Properties

  • rangeMapHorizontalOuter: VRMLookAtRangeMap

    A VRMLookAtRangeMap used for outer transverse direction

  • rangeMapVerticalDown: VRMLookAtRangeMap

    A VRMLookAtRangeMap used for down direction

  • rangeMapVerticalUp: VRMLookAtRangeMap

    A VRMLookAtRangeMap used for up direction

    -
  • Returns VRMLookAtExpressionApplier

    Properties

    Its associated VRMExpressionManager.

    -
    rangeMapHorizontalInner: VRMLookAtRangeMap

    It won't be used in expression applier. +

    Returns VRMLookAtExpressionApplier

    Properties

    Its associated VRMExpressionManager.

    +
    rangeMapHorizontalInner: VRMLookAtRangeMap

    It won't be used in expression applier. See also: rangeMapHorizontalOuter

    -
    rangeMapHorizontalOuter: VRMLookAtRangeMap

    A VRMLookAtRangeMap for horizontal movement. Both eyes move left or right.

    -
    rangeMapVerticalDown: VRMLookAtRangeMap

    A VRMLookAtRangeMap for vertical downward movement. Both eyes move upwards.

    -
    rangeMapVerticalUp: VRMLookAtRangeMap

    A VRMLookAtRangeMap for vertical upward movement. Both eyes move downwards.

    -
    type: "expression" = 'expression'

    Represent its type of applier.

    -

    Methods

    rangeMapHorizontalOuter: VRMLookAtRangeMap

    A VRMLookAtRangeMap for horizontal movement. Both eyes move left or right.

    +
    rangeMapVerticalDown: VRMLookAtRangeMap

    A VRMLookAtRangeMap for vertical downward movement. Both eyes move upwards.

    +
    rangeMapVerticalUp: VRMLookAtRangeMap

    A VRMLookAtRangeMap for vertical upward movement. Both eyes move downwards.

    +
    type: "expression" = 'expression'

    Represent its type of applier.

    +

    Methods

    +

    Returns void

    diff --git a/packages/three-vrm-core/docs/classes/VRMLookAtHelper.html b/packages/three-vrm-core/docs/classes/VRMLookAtHelper.html index 34aa1b34a..c4c7a25c4 100644 --- a/packages/three-vrm-core/docs/classes/VRMLookAtHelper.html +++ b/packages/three-vrm-core/docs/classes/VRMLookAtHelper.html @@ -1,4 +1,4 @@ -VRMLookAtHelper | @pixiv/three-vrm-core

    Hierarchy

    • Group
      • VRMLookAtHelper

    Constructors

    constructor +VRMLookAtHelper | @pixiv/three-vrm-core

    Hierarchy

    • Group
      • VRMLookAtHelper

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    +

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    []

    castShadow: boolean

    Whether the object gets rendered into shadow map.

    false

    @@ -162,7 +162,7 @@

    This gets automatically assigned and shouldn't be edited.

    visible: boolean

    Object gets rendered if true.

    true

    -
    vrmLookAt: VRMLookAt
    DEFAULT_MATRIX_AUTO_UPDATE: boolean

    The default setting for matrixAutoUpdate for newly created Object3Ds.

    +
    vrmLookAt: VRMLookAt
    DEFAULT_MATRIX_AUTO_UPDATE: boolean

    The default setting for matrixAutoUpdate for newly created Object3Ds.

    true

    DEFAULT_MATRIX_WORLD_AUTO_UPDATE: boolean

    The default setting for matrixWorldAutoUpdate for newly created Object3Ds.

    true

    @@ -193,7 +193,7 @@

    Returns this

    Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

    • Fire an event type.

      Type Parameters

      • T extends keyof Object3DEventMap

      Parameters

      • event: BaseEvent<T> & Object3DEventMap[T]

        The event that gets fired.

        -

      Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      +

    Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      Parameters

      • id: number

        Unique number of the object instance. Expects a Integer

      Returns undefined | Object3D<Object3DEventMap>

      Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

      id

      @@ -318,7 +318,7 @@ And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.

      Parameters

      • force: boolean

        A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame. Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.

        -

      Returns void

    • Updates the global transform of the object.

      +

    Returns void

    • Updates the global transform of the object.

      Parameters

      • updateParents: boolean

        Recursively updates global transform of ancestors.

      • updateChildren: boolean

        Recursively updates global transform of descendants.

      Returns void

    parser: GLTFParser

    Accessors

    Methods

    diff --git a/packages/three-vrm-core/docs/classes/VRMLookAtRangeMap.html b/packages/three-vrm-core/docs/classes/VRMLookAtRangeMap.html index 16ffe83f4..f90fc610a 100644 --- a/packages/three-vrm-core/docs/classes/VRMLookAtRangeMap.html +++ b/packages/three-vrm-core/docs/classes/VRMLookAtRangeMap.html @@ -1,13 +1,13 @@ -VRMLookAtRangeMap | @pixiv/three-vrm-core

    Constructors

    constructor +VRMLookAtRangeMap | @pixiv/three-vrm-core

    Constructors

    Properties

    Methods

    Constructors

    Properties

    inputMaxValue: number

    Limits the maximum angle of the input angle of the LookAt vector from the front of the head (the positive z axis).

    -
    outputScale: number

    Represents an angle (in degrees) for bone type of LookAt appliers, or a weight for expression type of LookAt appliers. +

    Returns VRMLookAtRangeMap

    Properties

    inputMaxValue: number

    Limits the maximum angle of the input angle of the LookAt vector from the front of the head (the positive z axis).

    +
    outputScale: number

    Represents an angle (in degrees) for bone type of LookAt appliers, or a weight for expression type of LookAt appliers. The input value will take 1.0 when the input angle equals (or greater) to inputMaxValue.

    -

    Methods

    Methods

    +

    Returns number

    diff --git a/packages/three-vrm-core/docs/classes/VRMMetaLoaderPlugin.html b/packages/three-vrm-core/docs/classes/VRMMetaLoaderPlugin.html index 062541662..2d80f15e8 100644 --- a/packages/three-vrm-core/docs/classes/VRMMetaLoaderPlugin.html +++ b/packages/three-vrm-core/docs/classes/VRMMetaLoaderPlugin.html @@ -1,17 +1,17 @@ VRMMetaLoaderPlugin | @pixiv/three-vrm-core

    A plugin of GLTFLoader that imports a VRM1Meta from a VRM extension of a GLTF.

    -

    Implements

    • GLTFLoaderPlugin

    Constructors

    Implements

    • GLTFLoaderPlugin

    Constructors

    Properties

    acceptLicenseUrls: string[]

    A list of license urls. +

    Constructors

    Properties

    acceptLicenseUrls: string[]

    A list of license urls. This meta loader will accept these licenseUrls. Otherwise it won't be loaded.

    -
    acceptV0Meta: boolean

    Whether it should accept VRM0.0 meta or not. +

    acceptV0Meta: boolean

    Whether it should accept VRM0.0 meta or not. Note that it might load VRM0Meta instead of VRM1Meta when this is true. true by default.

    -
    needThumbnailImage: boolean

    If false, it won't load its thumbnail image (VRM1Meta.thumbnailImage). +

    needThumbnailImage: boolean

    If false, it won't load its thumbnail image (VRM1Meta.thumbnailImage). false by default.

    -
    parser: GLTFParser

    Accessors

    Methods

    +
    parser: GLTFParser

    Accessors

    Methods

    diff --git a/packages/three-vrm-core/docs/interfaces/VRM0Meta.html b/packages/three-vrm-core/docs/interfaces/VRM0Meta.html index 9d3870256..5115d7953 100644 --- a/packages/three-vrm-core/docs/interfaces/VRM0Meta.html +++ b/packages/three-vrm-core/docs/interfaces/VRM0Meta.html @@ -1,5 +1,5 @@ VRM0Meta | @pixiv/three-vrm-core

    Interface represents metadata of a VRM 0.0 model.

    -
    interface VRM0Meta {
        allowedUserName?: "OnlyAuthor" | "ExplicitlyLicensedPerson" | "Everyone";
        author?: string;
        commercialUssageName?: "Disallow" | "Allow";
        contactInformation?: string;
        licenseName?:
            | "Redistribution_Prohibited"
            | "CC0"
            | "CC_BY"
            | "CC_BY_NC"
            | "CC_BY_SA"
            | "CC_BY_NC_SA"
            | "CC_BY_ND"
            | "CC_BY_NC_ND"
            | "Other";
        metaVersion: "0";
        otherLicenseUrl?: string;
        otherPermissionUrl?: string;
        reference?: string;
        sexualUssageName?: "Disallow" | "Allow";
        texture?: Texture;
        title?: string;
        version?: string;
        violentUssageName?: "Disallow" | "Allow";
    }

    Properties

    interface VRM0Meta {
        allowedUserName?: "OnlyAuthor" | "ExplicitlyLicensedPerson" | "Everyone";
        author?: string;
        commercialUssageName?: "Disallow" | "Allow";
        contactInformation?: string;
        licenseName?:
            | "Redistribution_Prohibited"
            | "CC0"
            | "CC_BY"
            | "CC_BY_NC"
            | "CC_BY_SA"
            | "CC_BY_NC_SA"
            | "CC_BY_ND"
            | "CC_BY_NC_ND"
            | "Other";
        metaVersion: "0";
        otherLicenseUrl?: string;
        otherPermissionUrl?: string;
        reference?: string;
        sexualUssageName?: "Disallow" | "Allow";
        texture?: Texture;
        title?: string;
        version?: string;
        violentUssageName?: "Disallow" | "Allow";
    }

    Properties

    allowedUserName?: "OnlyAuthor" | "ExplicitlyLicensedPerson" | "Everyone"

    Enum indicates a condition who can perform with this avatar.

    -
    author?: string

    Author of the model.

    -
    commercialUssageName?: "Disallow" | "Allow"

    Enum indicates allow or disallow commercial use.

    -
    contactInformation?: string

    Contact Information of its author.

    -
    licenseName?:
        | "Redistribution_Prohibited"
        | "CC0"
        | "CC_BY"
        | "CC_BY_NC"
        | "CC_BY_SA"
        | "CC_BY_NC_SA"
        | "CC_BY_ND"
        | "CC_BY_NC_ND"
        | "Other"

    Enum indicates a license type.

    -
    metaVersion

    The version of meta.

    -
    otherLicenseUrl?: string

    If Other is selected for licenseName, put the URL link of the license document here.

    -
    otherPermissionUrl?: string

    If there are any conditions not mentioned in licenseName or otherLicenseUrl, put the URL link of the license document here.

    -
    reference?: string

    Reference of the model.

    -
    sexualUssageName?: "Disallow" | "Allow"

    Enum indicates allow or disallow sexual expressions.

    -
    texture?: Texture

    Thumbnail of the model.

    -
    title?: string

    Title of the model.

    -
    version?: string

    Version of the model.

    -
    violentUssageName?: "Disallow" | "Allow"

    Enum indicates allow or disallow violent expressions.

    -
    +
    author?: string

    Author of the model.

    +
    commercialUssageName?: "Disallow" | "Allow"

    Enum indicates allow or disallow commercial use.

    +
    contactInformation?: string

    Contact Information of its author.

    +
    licenseName?:
        | "Redistribution_Prohibited"
        | "CC0"
        | "CC_BY"
        | "CC_BY_NC"
        | "CC_BY_SA"
        | "CC_BY_NC_SA"
        | "CC_BY_ND"
        | "CC_BY_NC_ND"
        | "Other"

    Enum indicates a license type.

    +
    metaVersion

    The version of meta.

    +
    otherLicenseUrl?: string

    If Other is selected for licenseName, put the URL link of the license document here.

    +
    otherPermissionUrl?: string

    If there are any conditions not mentioned in licenseName or otherLicenseUrl, put the URL link of the license document here.

    +
    reference?: string

    Reference of the model.

    +
    sexualUssageName?: "Disallow" | "Allow"

    Enum indicates allow or disallow sexual expressions.

    +
    texture?: Texture

    Thumbnail of the model.

    +
    title?: string

    Title of the model.

    +
    version?: string

    Version of the model.

    +
    violentUssageName?: "Disallow" | "Allow"

    Enum indicates allow or disallow violent expressions.

    +
    diff --git a/packages/three-vrm-core/docs/interfaces/VRM1Meta.html b/packages/three-vrm-core/docs/interfaces/VRM1Meta.html index 7dbc5dec7..acf967efa 100644 --- a/packages/three-vrm-core/docs/interfaces/VRM1Meta.html +++ b/packages/three-vrm-core/docs/interfaces/VRM1Meta.html @@ -1,5 +1,5 @@ VRM1Meta | @pixiv/three-vrm-core

    Interface represents metadata of a VRM 1.0 model.

    -
    interface VRM1Meta {
        allowAntisocialOrHateUsage?: boolean;
        allowExcessivelySexualUsage?: boolean;
        allowExcessivelyViolentUsage?: boolean;
        allowPoliticalOrReligiousUsage?: boolean;
        allowRedistribution?: boolean;
        authors: string[];
        avatarPermission?: "onlyAuthor" | "onlySeparatelyLicensedPerson" | "everyone";
        commercialUsage?: "personalNonProfit" | "personalProfit" | "corporation";
        contactInformation?: string;
        copyrightInformation?: string;
        creditNotation?: "required" | "unnecessary";
        licenseUrl: string;
        metaVersion: "1";
        modification?: "prohibited" | "allowModification" | "allowModificationRedistribution";
        name: string;
        otherLicenseUrl?: string;
        references?: string[];
        thirdPartyLicenses?: string;
        thumbnailImage?: HTMLImageElement;
        version?: string;
    }

    Properties

    interface VRM1Meta {
        allowAntisocialOrHateUsage?: boolean;
        allowExcessivelySexualUsage?: boolean;
        allowExcessivelyViolentUsage?: boolean;
        allowPoliticalOrReligiousUsage?: boolean;
        allowRedistribution?: boolean;
        authors: string[];
        avatarPermission?: "onlyAuthor" | "onlySeparatelyLicensedPerson" | "everyone";
        commercialUsage?: "personalNonProfit" | "personalProfit" | "corporation";
        contactInformation?: string;
        copyrightInformation?: string;
        creditNotation?: "required" | "unnecessary";
        licenseUrl: string;
        metaVersion: "1";
        modification?: "prohibited" | "allowModification" | "allowModificationRedistribution";
        name: string;
        otherLicenseUrl?: string;
        references?: string[];
        thirdPartyLicenses?: string;
        thumbnailImage?: HTMLImageElement;
        version?: string;
    }

    Properties

    allowAntisocialOrHateUsage?: boolean

    A flag that permits to use this model in contents contain anti-social activities or hate speeches.

    -
    allowExcessivelySexualUsage?: boolean

    A flag that permits to use this model in excessively sexual contents.

    -
    allowExcessivelyViolentUsage?: boolean

    A flag that permits to use this model in excessively violent contents.

    -
    allowPoliticalOrReligiousUsage?: boolean

    A flag that permits to use this model in political or religious contents.

    -
    allowRedistribution?: boolean

    A flag that permits to redistribute this model.

    -
    authors: string[]

    Authors of the model.

    -
    avatarPermission?: "onlyAuthor" | "onlySeparatelyLicensedPerson" | "everyone"

    A person who can perform as an avatar with this model.

    -
    commercialUsage?: "personalNonProfit" | "personalProfit" | "corporation"

    An option that permits to use this model in commercial products.

    -
    contactInformation?: string

    An information that describes the contact information of the author.

    -
    copyrightInformation?: string

    An information that describes the copyright of the model.

    -
    creditNotation?: "required" | "unnecessary"

    An option that forces or abandons to display the credit of this model.

    -
    licenseUrl: string

    A URL towards the license document this model refers to

    -
    metaVersion

    The version of meta.

    -
    modification?: "prohibited" | "allowModification" | "allowModificationRedistribution"

    An option that controls the condition to modify this model.

    -
    name: string

    The name of the model.

    -
    otherLicenseUrl?: string

    Describe the URL links of other license.

    -
    references?: string[]

    References / original works of the model.

    -
    thirdPartyLicenses?: string

    Third party licenses of the model, if required. You can use line breaks.

    -
    thumbnailImage?: HTMLImageElement

    An image of the thumbnail image of the model. +

    allowExcessivelySexualUsage?: boolean

    A flag that permits to use this model in excessively sexual contents.

    +
    allowExcessivelyViolentUsage?: boolean

    A flag that permits to use this model in excessively violent contents.

    +
    allowPoliticalOrReligiousUsage?: boolean

    A flag that permits to use this model in political or religious contents.

    +
    allowRedistribution?: boolean

    A flag that permits to redistribute this model.

    +
    authors: string[]

    Authors of the model.

    +
    avatarPermission?: "onlyAuthor" | "onlySeparatelyLicensedPerson" | "everyone"

    A person who can perform as an avatar with this model.

    +
    commercialUsage?: "personalNonProfit" | "personalProfit" | "corporation"

    An option that permits to use this model in commercial products.

    +
    contactInformation?: string

    An information that describes the contact information of the author.

    +
    copyrightInformation?: string

    An information that describes the copyright of the model.

    +
    creditNotation?: "required" | "unnecessary"

    An option that forces or abandons to display the credit of this model.

    +
    licenseUrl: string

    A URL towards the license document this model refers to

    +
    metaVersion

    The version of meta.

    +
    modification?: "prohibited" | "allowModification" | "allowModificationRedistribution"

    An option that controls the condition to modify this model.

    +
    name: string

    The name of the model.

    +
    otherLicenseUrl?: string

    Describe the URL links of other license.

    +
    references?: string[]

    References / original works of the model.

    +
    thirdPartyLicenses?: string

    Third party licenses of the model, if required. You can use line breaks.

    +
    thumbnailImage?: HTMLImageElement

    An image of the thumbnail image of the model. This is for the application to use as an icon.

    -
    version?: string

    The version of the model.

    -
    +
    version?: string

    The version of the model.

    +
    diff --git a/packages/three-vrm-core/docs/interfaces/VRMCoreLoaderPluginOptions.html b/packages/three-vrm-core/docs/interfaces/VRMCoreLoaderPluginOptions.html index 2136f7617..1bfa6457b 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMCoreLoaderPluginOptions.html +++ b/packages/three-vrm-core/docs/interfaces/VRMCoreLoaderPluginOptions.html @@ -1,11 +1,11 @@ -VRMCoreLoaderPluginOptions | @pixiv/three-vrm-core

    Interface VRMCoreLoaderPluginOptions

    interface VRMCoreLoaderPluginOptions {
        autoUpdateHumanBones?: boolean;
        expressionPlugin?: VRMExpressionLoaderPlugin;
        firstPersonPlugin?: VRMFirstPersonLoaderPlugin;
        helperRoot?: Object3D<Object3DEventMap>;
        humanoidPlugin?: VRMHumanoidLoaderPlugin;
        lookAtPlugin?: VRMLookAtLoaderPlugin;
        metaPlugin?: VRMMetaLoaderPlugin;
    }

    Properties

    autoUpdateHumanBones? +VRMCoreLoaderPluginOptions | @pixiv/three-vrm-core

    Interface VRMCoreLoaderPluginOptions

    interface VRMCoreLoaderPluginOptions {
        autoUpdateHumanBones?: boolean;
        expressionPlugin?: VRMExpressionLoaderPlugin;
        firstPersonPlugin?: VRMFirstPersonLoaderPlugin;
        helperRoot?: Object3D<Object3DEventMap>;
        humanoidPlugin?: VRMHumanoidLoaderPlugin;
        lookAtPlugin?: VRMLookAtLoaderPlugin;
        metaPlugin?: VRMMetaLoaderPlugin;
    }

    Properties

    autoUpdateHumanBones?: boolean
    expressionPlugin?: VRMExpressionLoaderPlugin
    firstPersonPlugin?: VRMFirstPersonLoaderPlugin
    helperRoot?: Object3D<Object3DEventMap>

    If assigned, the object will be used as a helper root of every component. +

    Properties

    autoUpdateHumanBones?: boolean
    expressionPlugin?: VRMExpressionLoaderPlugin
    firstPersonPlugin?: VRMFirstPersonLoaderPlugin
    helperRoot?: Object3D<Object3DEventMap>

    If assigned, the object will be used as a helper root of every component. Useful for debug. Will be overwritten if you use custom loader plugins for each components.

    -
    humanoidPlugin?: VRMHumanoidLoaderPlugin
    lookAtPlugin?: VRMLookAtLoaderPlugin
    metaPlugin?: VRMMetaLoaderPlugin
    +
    humanoidPlugin?: VRMHumanoidLoaderPlugin
    lookAtPlugin?: VRMLookAtLoaderPlugin
    metaPlugin?: VRMMetaLoaderPlugin
    diff --git a/packages/three-vrm-core/docs/interfaces/VRMCoreParameters.html b/packages/three-vrm-core/docs/interfaces/VRMCoreParameters.html index 275a1399a..bfbf1dcdd 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMCoreParameters.html +++ b/packages/three-vrm-core/docs/interfaces/VRMCoreParameters.html @@ -1,8 +1,8 @@ VRMCoreParameters | @pixiv/three-vrm-core

    Interface VRMCoreParameters

    Parameters for a VRMCore class.

    -
    interface VRMCoreParameters {
        expressionManager?: VRMExpressionManager;
        firstPerson?: VRMFirstPerson;
        humanoid: VRMHumanoid;
        lookAt?: VRMLookAt;
        meta: VRMMeta;
        scene: Group<Object3DEventMap>;
    }

    Properties

    interface VRMCoreParameters {
        expressionManager?: VRMExpressionManager;
        firstPerson?: VRMFirstPerson;
        humanoid: VRMHumanoid;
        lookAt?: VRMLookAt;
        meta: VRMMeta;
        scene: Group<Object3DEventMap>;
    }

    Properties

    expressionManager?: VRMExpressionManager
    firstPerson?: VRMFirstPerson
    humanoid: VRMHumanoid
    lookAt?: VRMLookAt
    meta: VRMMeta
    scene: Group<Object3DEventMap>
    +

    Properties

    expressionManager?: VRMExpressionManager
    firstPerson?: VRMFirstPerson
    humanoid: VRMHumanoid
    lookAt?: VRMLookAt
    meta: VRMMeta
    scene: Group<Object3DEventMap>
    diff --git a/packages/three-vrm-core/docs/interfaces/VRMExpressionBind.html b/packages/three-vrm-core/docs/interfaces/VRMExpressionBind.html index 31be62f7a..24c9272dd 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMExpressionBind.html +++ b/packages/three-vrm-core/docs/interfaces/VRMExpressionBind.html @@ -1,6 +1,6 @@ -VRMExpressionBind | @pixiv/three-vrm-core

    Interface VRMExpressionBind

    interface VRMExpressionBind {
        applyWeight(weight: number): void;
        clearAppliedWeight(): void;
    }

    Implemented by

    Methods

    applyWeight +VRMExpressionBind | @pixiv/three-vrm-core

    Interface VRMExpressionBind

    interface VRMExpressionBind {
        applyWeight(weight: number): void;
        clearAppliedWeight(): void;
    }

    Implemented by

    Methods

    +

    Parameters

    • weight: number

    Returns void

    diff --git a/packages/three-vrm-core/docs/interfaces/VRMFirstPersonMeshAnnotation.html b/packages/three-vrm-core/docs/interfaces/VRMFirstPersonMeshAnnotation.html index 62e511005..1ed9b78fa 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMFirstPersonMeshAnnotation.html +++ b/packages/three-vrm-core/docs/interfaces/VRMFirstPersonMeshAnnotation.html @@ -1,3 +1,3 @@ -VRMFirstPersonMeshAnnotation | @pixiv/three-vrm-core

    Interface VRMFirstPersonMeshAnnotation

    interface VRMFirstPersonMeshAnnotation {
        meshes: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[];
        type: VRMFirstPersonMeshAnnotationType;
    }

    Properties

    meshes +VRMFirstPersonMeshAnnotation | @pixiv/three-vrm-core

    Interface VRMFirstPersonMeshAnnotation

    interface VRMFirstPersonMeshAnnotation {
        meshes: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[];
        type: VRMFirstPersonMeshAnnotationType;
    }

    Properties

    Properties

    meshes: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[]
    +

    Properties

    meshes: Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[]
    diff --git a/packages/three-vrm-core/docs/interfaces/VRMHumanBone.html b/packages/three-vrm-core/docs/interfaces/VRMHumanBone.html index 591779019..db5035bc6 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMHumanBone.html +++ b/packages/three-vrm-core/docs/interfaces/VRMHumanBone.html @@ -1,4 +1,4 @@ VRMHumanBone | @pixiv/three-vrm-core

    Interface VRMHumanBone

    An interface represents a single human bone of a VRM.

    -
    interface VRMHumanBone {
        node: Object3D<Object3DEventMap>;
    }

    Properties

    interface VRMHumanBone {
        node: Object3D<Object3DEventMap>;
    }

    Properties

    Properties

    node: Object3D<Object3DEventMap>

    A glTF node (that actually is a THREE.Object3D) that represents the bone.

    -
    +
    diff --git a/packages/three-vrm-core/docs/interfaces/VRMHumanoidLoaderPluginOptions.html b/packages/three-vrm-core/docs/interfaces/VRMHumanoidLoaderPluginOptions.html index dac4ce1cc..96d86e973 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMHumanoidLoaderPluginOptions.html +++ b/packages/three-vrm-core/docs/interfaces/VRMHumanoidLoaderPluginOptions.html @@ -1,11 +1,11 @@ -VRMHumanoidLoaderPluginOptions | @pixiv/three-vrm-core

    Interface VRMHumanoidLoaderPluginOptions

    interface VRMHumanoidLoaderPluginOptions {
        autoUpdateHumanBones?: boolean;
        helperRoot?: Object3D<Object3DEventMap>;
    }

    Properties

    autoUpdateHumanBones? +VRMHumanoidLoaderPluginOptions | @pixiv/three-vrm-core

    Interface VRMHumanoidLoaderPluginOptions

    interface VRMHumanoidLoaderPluginOptions {
        autoUpdateHumanBones?: boolean;
        helperRoot?: Object3D<Object3DEventMap>;
    }

    Properties

    autoUpdateHumanBones?: boolean

    Whether it copies pose from normalizedHumanBones to rawHumanBones on update. true by default.

    true
     
    -
    helperRoot?: Object3D<Object3DEventMap>

    Specify an Object3D to add VRMHumanoidHelper. +

    helperRoot?: Object3D<Object3DEventMap>

    Specify an Object3D to add VRMHumanoidHelper. If not specified, helper will not be created. If renderOrder is set to the root, helpers will copy the same renderOrder .

    -
    +
    diff --git a/packages/three-vrm-core/docs/interfaces/VRMLookAtApplier.html b/packages/three-vrm-core/docs/interfaces/VRMLookAtApplier.html index f07ff59ae..21b1adf8e 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMLookAtApplier.html +++ b/packages/three-vrm-core/docs/interfaces/VRMLookAtApplier.html @@ -1,9 +1,9 @@ VRMLookAtApplier | @pixiv/three-vrm-core

    Interface VRMLookAtApplier

    This class is used by VRMLookAt, applies look at direction. There are currently two variant of applier: VRMLookAtBoneApplier and VRMLookAtExpressionApplier.

    -
    interface VRMLookAtApplier {
        applyYawPitch: ((yaw: number, pitch: number) => void);
        lookAt: ((euler: Euler) => void);
    }

    Implemented by

    Properties

    interface VRMLookAtApplier {
        applyYawPitch: ((yaw: number, pitch: number) => void);
        lookAt: ((euler: Euler) => void);
    }

    Implemented by

    Properties

    applyYawPitch: ((yaw: number, pitch: number) => void)

    Apply look at direction to its associated VRM model.

    Type declaration

      • (yaw, pitch): void
      • Parameters

        • yaw: number

          Rotation around Y axis, in degree

        • pitch: number

          Rotation around X axis, in degree

          -

        Returns void

    lookAt: ((euler: Euler) => void)

    Use applyYawPitch instead.

    -
    +

    Returns void

    lookAt: ((euler: Euler) => void)

    Use applyYawPitch instead.

    +
    diff --git a/packages/three-vrm-core/docs/interfaces/VRMMetaImporterOptions.html b/packages/three-vrm-core/docs/interfaces/VRMMetaImporterOptions.html index 1c38c4c63..6b4fcb69c 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMMetaImporterOptions.html +++ b/packages/three-vrm-core/docs/interfaces/VRMMetaImporterOptions.html @@ -1,13 +1,13 @@ VRMMetaImporterOptions | @pixiv/three-vrm-core

    Interface VRMMetaImporterOptions

    A set of options for a VRMMetaLoaderPlugin instance.

    -
    interface VRMMetaImporterOptions {
        acceptLicenseUrls?: string[];
        acceptV0Meta?: boolean;
        needThumbnailImage?: boolean;
    }

    Properties

    interface VRMMetaImporterOptions {
        acceptLicenseUrls?: string[];
        acceptV0Meta?: boolean;
        needThumbnailImage?: boolean;
    }

    Properties

    acceptLicenseUrls?: string[]

    A list of license urls. This meta loader will accept these licenseUrls. Otherwise it will throw an error.

    -
    acceptV0Meta?: boolean

    Whether it should accept VRM0.0 meta or not. +

    acceptV0Meta?: boolean

    Whether it should accept VRM0.0 meta or not. Note that it might load VRM0Meta instead of VRM1Meta when this is true. true by default.

    -
    needThumbnailImage?: boolean

    If false, it won't load its thumbnail image (VRM1Meta.thumbnailImage). +

    needThumbnailImage?: boolean

    If false, it won't load its thumbnail image (VRM1Meta.thumbnailImage). false by default.

    -
    +
    diff --git a/packages/three-vrm-core/docs/interfaces/VRMPoseTransform.html b/packages/three-vrm-core/docs/interfaces/VRMPoseTransform.html index c1f03f173..9d51928d0 100644 --- a/packages/three-vrm-core/docs/interfaces/VRMPoseTransform.html +++ b/packages/three-vrm-core/docs/interfaces/VRMPoseTransform.html @@ -1,8 +1,8 @@ VRMPoseTransform | @pixiv/three-vrm-core

    Interface VRMPoseTransform

    Represents a transform of a single bone of [[VRMPose]]. Both position and rotation are optional.

    -
    interface VRMPoseTransform {
        position?: [number, number, number];
        rotation?: [number, number, number, number];
    }

    Properties

    interface VRMPoseTransform {
        position?: [number, number, number];
        rotation?: [number, number, number, number];
    }

    Properties

    Properties

    position?: [number, number, number]

    Position of the transform.

    -
    rotation?: [number, number, number, number]

    Rotation of the transform. +

    rotation?: [number, number, number, number]

    Rotation of the transform. Note that it's a quaternion.

    -
    +
    diff --git a/packages/three-vrm-core/docs/types/VRMExpressionMaterialColorType.html b/packages/three-vrm-core/docs/types/VRMExpressionMaterialColorType.html index 1e1407bbe..3d869728c 100644 --- a/packages/three-vrm-core/docs/types/VRMExpressionMaterialColorType.html +++ b/packages/three-vrm-core/docs/types/VRMExpressionMaterialColorType.html @@ -1 +1 @@ -VRMExpressionMaterialColorType | @pixiv/three-vrm-core
    +VRMExpressionMaterialColorType | @pixiv/three-vrm-core
    diff --git a/packages/three-vrm-core/docs/types/VRMExpressionOverrideType.html b/packages/three-vrm-core/docs/types/VRMExpressionOverrideType.html index d63a73c45..bd660a88a 100644 --- a/packages/three-vrm-core/docs/types/VRMExpressionOverrideType.html +++ b/packages/three-vrm-core/docs/types/VRMExpressionOverrideType.html @@ -1 +1 @@ -VRMExpressionOverrideType | @pixiv/three-vrm-core
    +VRMExpressionOverrideType | @pixiv/three-vrm-core
    diff --git a/packages/three-vrm-core/docs/types/VRMExpressionPresetName.html b/packages/three-vrm-core/docs/types/VRMExpressionPresetName.html index 764fef0da..38f0c5505 100644 --- a/packages/three-vrm-core/docs/types/VRMExpressionPresetName.html +++ b/packages/three-vrm-core/docs/types/VRMExpressionPresetName.html @@ -1 +1 @@ -VRMExpressionPresetName | @pixiv/three-vrm-core
    +VRMExpressionPresetName | @pixiv/three-vrm-core
    diff --git a/packages/three-vrm-core/docs/types/VRMFirstPersonMeshAnnotationType.html b/packages/three-vrm-core/docs/types/VRMFirstPersonMeshAnnotationType.html index e1934f6b6..51495ffdd 100644 --- a/packages/three-vrm-core/docs/types/VRMFirstPersonMeshAnnotationType.html +++ b/packages/three-vrm-core/docs/types/VRMFirstPersonMeshAnnotationType.html @@ -1 +1 @@ -VRMFirstPersonMeshAnnotationType | @pixiv/three-vrm-core
    +VRMFirstPersonMeshAnnotationType | @pixiv/three-vrm-core
    diff --git a/packages/three-vrm-core/docs/types/VRMHumanBoneName.html b/packages/three-vrm-core/docs/types/VRMHumanBoneName.html index 60fdfc780..1c4b0f148 100644 --- a/packages/three-vrm-core/docs/types/VRMHumanBoneName.html +++ b/packages/three-vrm-core/docs/types/VRMHumanBoneName.html @@ -1 +1 @@ -VRMHumanBoneName | @pixiv/three-vrm-core
    +VRMHumanBoneName | @pixiv/three-vrm-core
    diff --git a/packages/three-vrm-core/docs/types/VRMHumanBones.html b/packages/three-vrm-core/docs/types/VRMHumanBones.html index cb91f0f36..029468213 100644 --- a/packages/three-vrm-core/docs/types/VRMHumanBones.html +++ b/packages/three-vrm-core/docs/types/VRMHumanBones.html @@ -1,2 +1,2 @@ VRMHumanBones | @pixiv/three-vrm-core
    +
    diff --git a/packages/three-vrm-core/docs/types/VRMLookAtTypeName.html b/packages/three-vrm-core/docs/types/VRMLookAtTypeName.html index 49133fa99..26bf18112 100644 --- a/packages/three-vrm-core/docs/types/VRMLookAtTypeName.html +++ b/packages/three-vrm-core/docs/types/VRMLookAtTypeName.html @@ -1 +1 @@ -VRMLookAtTypeName | @pixiv/three-vrm-core
    +VRMLookAtTypeName | @pixiv/three-vrm-core
    diff --git a/packages/three-vrm-core/docs/types/VRMMeta.html b/packages/three-vrm-core/docs/types/VRMMeta.html index 768a280ec..97fb4307d 100644 --- a/packages/three-vrm-core/docs/types/VRMMeta.html +++ b/packages/three-vrm-core/docs/types/VRMMeta.html @@ -1,2 +1,2 @@ VRMMeta | @pixiv/three-vrm-core
    VRMMeta: VRM0Meta | VRM1Meta

    VRMMeta can be either VRM0Meta or VRM1Meta.

    -
    +
    diff --git a/packages/three-vrm-core/docs/types/VRMPose.html b/packages/three-vrm-core/docs/types/VRMPose.html index 1d064d784..647bd5a44 100644 --- a/packages/three-vrm-core/docs/types/VRMPose.html +++ b/packages/three-vrm-core/docs/types/VRMPose.html @@ -4,4 +4,4 @@
    {
    [HumanBone.LeftUpperLeg] : {
    rotation: [ 0.000, 0.000, -0.454, 0.891 ],
    position: [ 0.000, 0.000, 0.000 ] // position is not required though
    },
    [HumanBone.LeftLowerLeg] : {
    rotation: [ -0.454, 0.000, 0.000, 0.891 ]
    },
    }
    -
    +
    diff --git a/packages/three-vrm-core/docs/types/VRMRequiredHumanBoneName.html b/packages/three-vrm-core/docs/types/VRMRequiredHumanBoneName.html index fbacec3e8..e9ea54d35 100644 --- a/packages/three-vrm-core/docs/types/VRMRequiredHumanBoneName.html +++ b/packages/three-vrm-core/docs/types/VRMRequiredHumanBoneName.html @@ -1 +1 @@ -VRMRequiredHumanBoneName | @pixiv/three-vrm-core
    +VRMRequiredHumanBoneName | @pixiv/three-vrm-core
    diff --git a/packages/three-vrm-core/docs/variables/VRMExpressionMaterialColorType-1.html b/packages/three-vrm-core/docs/variables/VRMExpressionMaterialColorType-1.html index a077e4bbd..7f2ea8fbc 100644 --- a/packages/three-vrm-core/docs/variables/VRMExpressionMaterialColorType-1.html +++ b/packages/three-vrm-core/docs/variables/VRMExpressionMaterialColorType-1.html @@ -1 +1 @@ -VRMExpressionMaterialColorType | @pixiv/three-vrm-core

    Variable VRMExpressionMaterialColorTypeConst

    VRMExpressionMaterialColorType: {
        Color: "color";
        EmissionColor: "emissionColor";
        MatcapColor: "matcapColor";
        OutlineColor: "outlineColor";
        RimColor: "rimColor";
        ShadeColor: "shadeColor";
    } = ...
    +VRMExpressionMaterialColorType | @pixiv/three-vrm-core

    Variable VRMExpressionMaterialColorTypeConst

    VRMExpressionMaterialColorType: {
        Color: "color";
        EmissionColor: "emissionColor";
        MatcapColor: "matcapColor";
        OutlineColor: "outlineColor";
        RimColor: "rimColor";
        ShadeColor: "shadeColor";
    } = ...
    diff --git a/packages/three-vrm-core/docs/variables/VRMExpressionOverrideType-1.html b/packages/three-vrm-core/docs/variables/VRMExpressionOverrideType-1.html index 91b6ff76f..4dc9574c8 100644 --- a/packages/three-vrm-core/docs/variables/VRMExpressionOverrideType-1.html +++ b/packages/three-vrm-core/docs/variables/VRMExpressionOverrideType-1.html @@ -1 +1 @@ -VRMExpressionOverrideType | @pixiv/three-vrm-core

    Variable VRMExpressionOverrideTypeConst

    VRMExpressionOverrideType: {
        Blend: "blend";
        Block: "block";
        None: "none";
    } = ...
    +VRMExpressionOverrideType | @pixiv/three-vrm-core

    Variable VRMExpressionOverrideTypeConst

    VRMExpressionOverrideType: {
        Blend: "blend";
        Block: "block";
        None: "none";
    } = ...
    diff --git a/packages/three-vrm-core/docs/variables/VRMExpressionPresetName-1.html b/packages/three-vrm-core/docs/variables/VRMExpressionPresetName-1.html index 5ea21d6f2..8582bb4cd 100644 --- a/packages/three-vrm-core/docs/variables/VRMExpressionPresetName-1.html +++ b/packages/three-vrm-core/docs/variables/VRMExpressionPresetName-1.html @@ -1 +1 @@ -VRMExpressionPresetName | @pixiv/three-vrm-core

    Variable VRMExpressionPresetNameConst

    VRMExpressionPresetName: {
        Aa: "aa";
        Angry: "angry";
        Blink: "blink";
        BlinkLeft: "blinkLeft";
        BlinkRight: "blinkRight";
        Ee: "ee";
        Happy: "happy";
        Ih: "ih";
        LookDown: "lookDown";
        LookLeft: "lookLeft";
        LookRight: "lookRight";
        LookUp: "lookUp";
        Neutral: "neutral";
        Oh: "oh";
        Ou: "ou";
        Relaxed: "relaxed";
        Sad: "sad";
        Surprised: "surprised";
    } = ...
    +VRMExpressionPresetName | @pixiv/three-vrm-core

    Variable VRMExpressionPresetNameConst

    VRMExpressionPresetName: {
        Aa: "aa";
        Angry: "angry";
        Blink: "blink";
        BlinkLeft: "blinkLeft";
        BlinkRight: "blinkRight";
        Ee: "ee";
        Happy: "happy";
        Ih: "ih";
        LookDown: "lookDown";
        LookLeft: "lookLeft";
        LookRight: "lookRight";
        LookUp: "lookUp";
        Neutral: "neutral";
        Oh: "oh";
        Ou: "ou";
        Relaxed: "relaxed";
        Sad: "sad";
        Surprised: "surprised";
    } = ...
    diff --git a/packages/three-vrm-core/docs/variables/VRMFirstPersonMeshAnnotationType-1.html b/packages/three-vrm-core/docs/variables/VRMFirstPersonMeshAnnotationType-1.html index 98c631592..03060e986 100644 --- a/packages/three-vrm-core/docs/variables/VRMFirstPersonMeshAnnotationType-1.html +++ b/packages/three-vrm-core/docs/variables/VRMFirstPersonMeshAnnotationType-1.html @@ -1 +1 @@ -VRMFirstPersonMeshAnnotationType | @pixiv/three-vrm-core

    Variable VRMFirstPersonMeshAnnotationTypeConst

    VRMFirstPersonMeshAnnotationType: {
        Auto: "auto";
        Both: "both";
        FirstPersonOnly: "firstPersonOnly";
        ThirdPersonOnly: "thirdPersonOnly";
    } = ...
    +VRMFirstPersonMeshAnnotationType | @pixiv/three-vrm-core

    Variable VRMFirstPersonMeshAnnotationTypeConst

    VRMFirstPersonMeshAnnotationType: {
        Auto: "auto";
        Both: "both";
        FirstPersonOnly: "firstPersonOnly";
        ThirdPersonOnly: "thirdPersonOnly";
    } = ...
    diff --git a/packages/three-vrm-core/docs/variables/VRMHumanBoneList.html b/packages/three-vrm-core/docs/variables/VRMHumanBoneList.html index e724bc305..ad342973c 100644 --- a/packages/three-vrm-core/docs/variables/VRMHumanBoneList.html +++ b/packages/three-vrm-core/docs/variables/VRMHumanBoneList.html @@ -1,2 +1,2 @@ VRMHumanBoneList | @pixiv/three-vrm-core

    Variable VRMHumanBoneListConst

    VRMHumanBoneList: VRMHumanBoneName[] = ...

    The list of VRMHumanBoneName. Dependency aware.

    -
    +
    diff --git a/packages/three-vrm-core/docs/variables/VRMHumanBoneName-1.html b/packages/three-vrm-core/docs/variables/VRMHumanBoneName-1.html index 744761ab7..d2c2dcf5e 100644 --- a/packages/three-vrm-core/docs/variables/VRMHumanBoneName-1.html +++ b/packages/three-vrm-core/docs/variables/VRMHumanBoneName-1.html @@ -1,3 +1,3 @@ VRMHumanBoneName | @pixiv/three-vrm-core

    Variable VRMHumanBoneNameConst

    VRMHumanBoneName: {
        Chest: "chest";
        Head: "head";
        Hips: "hips";
        Jaw: "jaw";
        LeftEye: "leftEye";
        LeftFoot: "leftFoot";
        LeftHand: "leftHand";
        LeftIndexDistal: "leftIndexDistal";
        LeftIndexIntermediate: "leftIndexIntermediate";
        LeftIndexProximal: "leftIndexProximal";
        LeftLittleDistal: "leftLittleDistal";
        LeftLittleIntermediate: "leftLittleIntermediate";
        LeftLittleProximal: "leftLittleProximal";
        LeftLowerArm: "leftLowerArm";
        LeftLowerLeg: "leftLowerLeg";
        LeftMiddleDistal: "leftMiddleDistal";
        LeftMiddleIntermediate: "leftMiddleIntermediate";
        LeftMiddleProximal: "leftMiddleProximal";
        LeftRingDistal: "leftRingDistal";
        LeftRingIntermediate: "leftRingIntermediate";
        LeftRingProximal: "leftRingProximal";
        LeftShoulder: "leftShoulder";
        LeftThumbDistal: "leftThumbDistal";
        LeftThumbMetacarpal: "leftThumbMetacarpal";
        LeftThumbProximal: "leftThumbProximal";
        LeftToes: "leftToes";
        LeftUpperArm: "leftUpperArm";
        LeftUpperLeg: "leftUpperLeg";
        Neck: "neck";
        RightEye: "rightEye";
        RightFoot: "rightFoot";
        RightHand: "rightHand";
        RightIndexDistal: "rightIndexDistal";
        RightIndexIntermediate: "rightIndexIntermediate";
        RightIndexProximal: "rightIndexProximal";
        RightLittleDistal: "rightLittleDistal";
        RightLittleIntermediate: "rightLittleIntermediate";
        RightLittleProximal: "rightLittleProximal";
        RightLowerArm: "rightLowerArm";
        RightLowerLeg: "rightLowerLeg";
        RightMiddleDistal: "rightMiddleDistal";
        RightMiddleIntermediate: "rightMiddleIntermediate";
        RightMiddleProximal: "rightMiddleProximal";
        RightRingDistal: "rightRingDistal";
        RightRingIntermediate: "rightRingIntermediate";
        RightRingProximal: "rightRingProximal";
        RightShoulder: "rightShoulder";
        RightThumbDistal: "rightThumbDistal";
        RightThumbMetacarpal: "rightThumbMetacarpal";
        RightThumbProximal: "rightThumbProximal";
        RightToes: "rightToes";
        RightUpperArm: "rightUpperArm";
        RightUpperLeg: "rightUpperLeg";
        Spine: "spine";
        UpperChest: "upperChest";
    } = ...
    +
    diff --git a/packages/three-vrm-core/docs/variables/VRMHumanBoneParentMap.html b/packages/three-vrm-core/docs/variables/VRMHumanBoneParentMap.html index 1cc5c84f8..777bde25a 100644 --- a/packages/three-vrm-core/docs/variables/VRMHumanBoneParentMap.html +++ b/packages/three-vrm-core/docs/variables/VRMHumanBoneParentMap.html @@ -1,3 +1,3 @@ VRMHumanBoneParentMap | @pixiv/three-vrm-core
    +
    diff --git a/packages/three-vrm-core/docs/variables/VRMLookAtTypeName-1.html b/packages/three-vrm-core/docs/variables/VRMLookAtTypeName-1.html index 7b75a7c81..66cd5500f 100644 --- a/packages/three-vrm-core/docs/variables/VRMLookAtTypeName-1.html +++ b/packages/three-vrm-core/docs/variables/VRMLookAtTypeName-1.html @@ -1,2 +1,2 @@ VRMLookAtTypeName | @pixiv/three-vrm-core

    Variable VRMLookAtTypeNameConst

    VRMLookAtTypeName: {
        Bone: string;
        Expression: string;
    } = ...

    Represents a type of applier.

    -
    +
    diff --git a/packages/three-vrm-core/docs/variables/VRMRequiredHumanBoneName-1.html b/packages/three-vrm-core/docs/variables/VRMRequiredHumanBoneName-1.html index 511e1b2d5..eea13da42 100644 --- a/packages/three-vrm-core/docs/variables/VRMRequiredHumanBoneName-1.html +++ b/packages/three-vrm-core/docs/variables/VRMRequiredHumanBoneName-1.html @@ -1 +1 @@ -VRMRequiredHumanBoneName | @pixiv/three-vrm-core

    Variable VRMRequiredHumanBoneNameConst

    VRMRequiredHumanBoneName: {
        Head: "head";
        Hips: "hips";
        LeftFoot: "leftFoot";
        LeftHand: "leftHand";
        LeftLowerArm: "leftLowerArm";
        LeftLowerLeg: "leftLowerLeg";
        LeftUpperArm: "leftUpperArm";
        LeftUpperLeg: "leftUpperLeg";
        RightFoot: "rightFoot";
        RightHand: "rightHand";
        RightLowerArm: "rightLowerArm";
        RightLowerLeg: "rightLowerLeg";
        RightUpperArm: "rightUpperArm";
        RightUpperLeg: "rightUpperLeg";
        Spine: "spine";
    } = ...
    +VRMRequiredHumanBoneName | @pixiv/three-vrm-core

    Variable VRMRequiredHumanBoneNameConst

    VRMRequiredHumanBoneName: {
        Head: "head";
        Hips: "hips";
        LeftFoot: "leftFoot";
        LeftHand: "leftHand";
        LeftLowerArm: "leftLowerArm";
        LeftLowerLeg: "leftLowerLeg";
        LeftUpperArm: "leftUpperArm";
        LeftUpperLeg: "leftUpperLeg";
        RightFoot: "rightFoot";
        RightHand: "rightHand";
        RightLowerArm: "rightLowerArm";
        RightLowerLeg: "rightLowerLeg";
        RightUpperArm: "rightUpperArm";
        RightUpperLeg: "rightUpperLeg";
        Spine: "spine";
    } = ...
    diff --git a/packages/three-vrm-core/lib/three-vrm-core.cjs b/packages/three-vrm-core/lib/three-vrm-core.cjs index 7915d92ff..e5476935e 100644 --- a/packages/three-vrm-core/lib/three-vrm-core.cjs +++ b/packages/three-vrm-core/lib/three-vrm-core.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-core v3.2.0 + * @pixiv/three-vrm-core v3.3.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -119,12 +119,21 @@ var VRMExpression = class extends THREE.Object3D { * Specify how the expression overrides mouth expressions. */ this.overrideMouth = "none"; + /** + * Binds that this expression influences. + */ this._binds = []; this.name = `VRMExpression_${expressionName}`; this.expressionName = expressionName; this.type = "VRMExpression"; this.visible = false; } + /** + * Binds that this expression influences. + */ + get binds() { + return this._binds; + } /** * A value represents how much it should override blink expressions. * `0.0` == no override at all, `1.0` == completely block the expressions. @@ -173,9 +182,25 @@ var VRMExpression = class extends THREE.Object3D { } return this.weight; } + /** + * Add an expression bind to the expression. + * + * @param bind A bind to add + */ addBind(bind) { this._binds.push(bind); } + /** + * Delete an expression bind from the expression. + * + * @param bind A bind to delete + */ + deleteBind(bind) { + const index = this._binds.indexOf(bind); + if (index >= 0) { + this._binds.splice(index, 1); + } + } /** * Apply weight to every assigned blend shapes. * Should be called every frame. @@ -3341,4 +3366,4 @@ var VRMCoreLoaderPlugin = class { }); } }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uLnRzIiwgIi4uL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luLnRzIiwgIi4uL3NyYy91dGlscy9nbHRmRXh0cmFjdFByaW1pdGl2ZXNGcm9tTm9kZS50cyIsICIuLi9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvblByZXNldE5hbWUudHMiLCAiLi4vc3JjL3V0aWxzL3NhdHVyYXRlLnRzIiwgIi4uL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTWFuYWdlci50cyIsICIuLi9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JUeXBlLnRzIiwgIi4uL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTWF0ZXJpYWxDb2xvckJpbmQudHMiLCAiLi4vc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQudHMiLCAiLi4vc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZC50cyIsICIuLi9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvbk92ZXJyaWRlVHlwZS50cyIsICIuLi9zcmMvZmlyc3RQZXJzb24vVlJNRmlyc3RQZXJzb24udHMiLCAiLi4vc3JjL2ZpcnN0UGVyc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lc0Zyb21Ob2RlKGdsdGYsIGJpbmQubm9kZSkpITtcbiAgICAgICAgICBjb25zdCBtb3JwaFRhcmdldEluZGV4ID0gYmluZC5pbmRleDtcblxuICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICApXG4gICAgICAgICAgKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUV4cHJlc3Npb24ubmFtZX0gYXR0ZW1wdHMgdG8gaW5kZXggbW9ycGggIyR7bW9ycGhUYXJnZXRJbmRleH0gYnV0IG5vdCBmb3VuZC5gLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1vcnBoVGFyZ2V0QmluZCh7XG4gICAgICAgICAgICAgIHByaW1pdGl2ZXMsXG4gICAgICAgICAgICAgIGluZGV4OiBtb3JwaFRhcmdldEluZGV4LFxuICAgICAgICAgICAgICB3ZWlnaHQ6IGJpbmQud2VpZ2h0ID8/IDEuMCxcbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmIChz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XJuIGJpbmQubWF0ZXJpYWwgPT09IG1hdGVyaWFsSW5kZXg7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JCaW5kKHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgdHlwZTogYmluZC50eXBlLFxuICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShiaW5kLnRhcmdldFZhbHVlKSxcbiAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBiaW5kLnRhcmdldFZhbHVlWzNdLFxuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBzY2hlbWFFeHByZXNzaW9uLnRleHR1cmVUcmFuc2Zvcm1CaW5kcz8uZm9yRWFjaChhc3luYyAoYmluZCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxzID0gZ2x0Zk1hdGVyaWFscy5maWx0ZXIoKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsSW5kZXggPSB0aGlzLnBhcnNlci5hc3NvY2lhdGlvbnMuZ2V0KG1hdGVyaWFsKT8ubWF0ZXJpYWxzO1xuICAgICAgICAgICAgICByZXR1cm4gYmluZC5tYXRlcmlhbCA9PT0gbWF0ZXJpYWxJbmRleDtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBtYXRlcmlhbHMuZm9yRWFjaCgobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5k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pIHtcbiAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICBgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogQW4gZXhwcmVzc2lvbiBwcmVzZXQgJHt2MFByZXNldE5hbWV9IGhhcyBkdXBsaWNhdGVkIGVudHJpZXMuIElnbm9yaW5nIHRoZSBleHByZXNzaW9uYCxcbiAgICAgICAgICApO1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGJsZW5kU2hhcGVOYW1lU2V0LmFkZChuYW1lKTtcblxuICAgICAgICBjb25zdCBleHByZXNzaW9uID0gbmV3IFZSTUV4cHJlc3Npb24obmFtZSk7XG4gICAgICAgIGdsdGYuc2NlbmUuYWRkKGV4cHJlc3Npb24pO1xuXG4gICAgICAgIGV4cHJlc3Npb24uaXNCaW5hcnkgPSBzY2hlbWFHcm91cC5pc0JpbmFyeSA/PyBmYWxzZTtcbiAgICAgICAgLy8gdjAgZG9lc24ndCBoYXZlIGlnbm9yZSBwcm9wZXJ0aWVzXG5cbiAgICAgICAgLy8gQmluZCBtb3JwaFRhcmdldFxuICAgICAgICBpZiAoc2NoZW1hR3JvdXAuYmluZHMpIHtcbiAgICAgICAgICBzY2hlbWFHcm91cC5iaW5kcy5mb3JFYWNoKGFzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBpZiAoYmluZC5tZXNoID09PSB1bmRlZmluZWQgfHwgYmluZC5pbmRleCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3Qgbm9kZXNVc2luZ01lc2g6IG51bWJlcltdID0gW107XG4gICAgICAgICAgICBqc29uLm5vZGVzPy5mb3JFYWNoKChub2RlLCBpKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChub2RlLm1lc2ggPT09IGJpbmQubWVzaCkge1xuICAgICAgICAgICAgICAgIG5vZGVzVXNpbmdNZXNoLnB1c2goaSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjb25zdCBtb3JwaFRhcmdldEluZGV4ID0gYmluZC5pbmRleDtcblxuICAgICAgICAgICAgYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICAgICAgICAgIG5vZGVzVXNpbmdNZXNoLm1hcChhc3luYyAobm9kZUluZGV4KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgcHJpbWl0aXZlcyA9IChhd2FpdCBnbHRmRXh0cmFjdFByaW1pdGl2ZXNGcm9tTm9kZShnbHRmLCBub2RlSW5kZXgpKSE7XG5cbiAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiB0aGUgbWVzaCBoYXMgdGhlIHRhcmdldCBtb3JwaCB0YXJnZXRcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAhcHJpbWl0aXZlcy5ldmVyeShcbiAgICAgICAgICAgICAgICAgICAgKHByaW1pdGl2ZSkgPT5cbiAgICAgICAgICAgICAgICAgICAgICBBcnJheS5pc0FycmF5KHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMpICYmXG4gICAgICAgICAgICAgICAgICAgICAgbW9ycGhUYXJnZXRJbmRleCA8IHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICBgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogJHtzY2hlbWFHcm91cC5uYW1lfSBhdHRlbXB0cyB0byBpbmRleCAke21vcnBoVGFyZ2V0SW5kZXh9dGggbW9ycGggYnV0IG5vdCBmb3VuZC5gLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1vcnBoVGFyZ2V0QmluZCh7XG4gICAgICAgICAgICAgICAgICAgIHByaW1pdGl2ZXMsXG4gICAgICAgICAgICAgICAgICAgIGluZGV4OiBtb3JwaFRhcmdldEluZGV4LFxuICAgICAgICAgICAgICAgICAgICB3ZWlnaHQ6IDAuMDEgKiAoYmluZC53ZWlnaHQgPz8gMTAwKSwgLy8gbmFycm93aW5nIHRoZSByYW5nZSBmcm9tIFsgMC4wIC0gMTAwLjAgXSB0byBbIDAuMCAtIDEuMCBdXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBCaW5kIE1hdGVyaWFsQ29sb3IgYW5kIFRleHR1cmVUcmFuc2Zvcm1cbiAgICAgICAgY29uc3QgbWF0ZXJpYWxWYWx1ZXMgPSBzY2hlbWFHcm91cC5tYXRlcmlhbFZhbHVlcztcbiAgICAgICAgaWYgKG1hdGVyaWFsVmFsdWVzICYmIG1hdGVyaWFsVmFsdWVzLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgIG1hdGVyaWFsVmFsdWVzLmZvckVhY2goKG1hdGVyaWFsVmFsdWUpID0+IHtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUgPT09IHVuZGVmaW5lZCB8fFxuICAgICAgICAgICAgICBtYXRlcmlhbFZhbHVlLnByb3BlcnR5TmFtZSA9PT0gdW5kZWZpbmVkIHx8XG4gICAgICAgICAgICAgIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgIHJ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JpYWw6IFRIUkVFLk1hdGVyaWFsW10gfCBUSFJFRS5NYXRlcmlhbCA9IChvYmplY3QgYXMgYW55KS5tYXRlcmlhbDtcbiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShtYXRlcmlhbCkpIHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICAuLi5tYXRlcmlhbC5maWx0ZXIoXG4gICAgICAgICAgICAgICAgICAgICAgKG10bCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgIChtdGwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUhIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgIG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgKyAnIChPdXRsaW5lKScpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbHMuaW5kZXhPZihtdGwpID09PSAtMSxcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRlcmlhbC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSAmJiBtYXRlcmlhbHMuaW5kZXhPZihtYXRlcmlhbCkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbHMucHVzaChtYXRlcmlhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxQcm9wZXJ0eU5hbWUgPSBtYXRlcmlhbFZhbHVlLnByb3BlcnR5TmFtZTtcbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICAvLyBUZXh0dXJlVHJhbnNmb3JtQmluZFxuICAgICAgICAgICAgICBpZiAobWF0ZXJpYWxQcm9wZXJ0eU5hbWUgPT09ICdfTWFpblRleF9TVCcpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBzY2FsZSA9IG5ldyBUSFJFRS5WZWN0b3IyKG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzBdLCBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVsxXSk7XG4gICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2V0ID0gbmV3IFRIUkVFLlZlY3RvcjIobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMl0sIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzNdKTtcblxuICAgICAgICAgICAgICAgIG9mZnNldC55ID0gMS4wIC0gb2Zmc2V0LnkgLSBzY2FsZS55O1xuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICBzY2FsZSxcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vIE1hdGVyaWFsQ29sb3JCaW5kXG4gICAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsQ29sb3JUeXBlID0gdjBFeHByZXNzaW9uTWF0ZXJpYWxDb2xvck1hcFttYXRlcmlhbFByb3BlcnR5TmFtZV07XG4gICAgICAgICAgICAgIGlmIChtYXRlcmlhbENvbG9yVHlwZSkge1xuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTWF0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oYncwWzJdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4wWzJdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzBbM10gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjBbM10pKSBjb250aW51ZTtcblxuICAgICAgICBjb25zdCBidzEgPSBid3NbYl07XG4gICAgICAgIGNvbnN0IHNraW4xID0gc2tpbkluZGV4W2JdO1xuICAgICAgICBpZiAoYncxWzBdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4xWzBdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzFbMV0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjFbMV0pKSBjb250aW51ZTtcbiAgICAgICAgaWYgKGJ3MVsyXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMVsyXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncxWzNdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4xWzNdKSkgY29udGludWU7XG5cbiAgICAgICAgY29uc3QgYncyID0gYndzW2NdO1xuICAgICAgICBjb25zdCBza2luMiA9IHNraW5JbmRleFtjXTtcbiAgICAgICAgaWYgKGJ3MlswXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMlswXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncyWzFdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4yWzFdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzJbMl0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjJbMl0pKSBjb250aW51ZTtcbiAgICAgICAgaWYgKGJ3MlszXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMlszXSkpIGNvbnRpbnVlO1xuXG4gICAgICAgIHRyaWFuZ2xlc1tjb3VudCsrXSA9IGE7XG4gICAgICAgIHRyaWFuZ2xlc1tjb3VudCsrXSA9IGI7XG4gIC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W1hbm9pZC5odW1hbkJvbmVzKS5tYXAoYXN5bmMgKFtib25lTmFtZVN0cmluZywgc2NoZW1hSHVtYW5Cb25lXSkgPT4ge1xuICAgICAgICAgIGxldCBib25lTmFtZSA9IGJvbmVOYW1lU3RyaW5nIGFzIFYxVlJNU2NoZW1hLkh1bWFub2lkSHVtYW5Cb25lTmFtZTtcbiAgICAgICAgICBjb25zdCBpbmRleCA9IHNjaGVtYUh1bWFuQm9uZS5ub2RlO1xuXG4gICAgICAgICAgLy8gY29tcGF0OiAxLjAtYmV0YSBwcmV2aW91cyB0aHVtYiBib25lIG5hbWVzXG4gICAgICAgICAgaWYgKGV4aXN0c1ByZXZpb3VzVGh1bWJOYW1lKSB7XG4gICAgICAgICAgICBjb25zdCB0aHVtYkJvbmVOYW1lID0gdGh1bWJCb25lTmFtZU1hcFtib25lTmFtZV07XG4gICAgICAgICAgICBpZiAodGh1bWJCb25lTmFtZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgIGJvbmVOYW1lID0gdGh1bWJCb25lTmFtZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb25zdCBub2RlID0gYXdhaXQgdGhpcy5wYXJzZXIuZ2V0RGVwZW5kZW5jeSgnbm9kZScsIGluZGV4KTtcblxuICAgICAgICAgIC8vIGlmIHRoZSBzcGVjaWZpZWQgbm9kZSBkb2VzIG5vdCBleGlzdCwgZW1pdCBhIHdhcm5pbmdcbiAgICAgICAgICBpZiAobm9kZSA9PSBudWxsKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oYEEgZ2xURiBub2RlIGJvdW5kIHRvIHRoZSBodW1hbm9pZCBib25lICR7Ym9uZU5hbWV9IChpbmRleCA9ICR7aW5kZXh9KSBkb2VzIG5vdCBleGlzdGApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIHNldCB0byB0aGUgYGh1bWFuQm9uZXNgXG4gICAgICAgICAg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ZShnbHRmLCBiaW5kLm5vZGUpKSE7XG4gICAgICAgICAgY29uc3QgbW9ycGhUYXJnZXRJbmRleCA9IGJpbmQuaW5kZXg7XG5cbiAgICAgICAgICAvLyBjaGVjayBpZiB0aGUgbWVzaCBoYXMgdGhlIHRhcmdldCBtb3JwaCB0YXJnZXRcbiAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAhcHJpbWl0aXZlcy5ldmVyeShcbiAgICAgICAgICAgICAgKHByaW1pdGl2ZSkgPT5cbiAgICAgICAgICAgICAgICBBcnJheS5pc0FycmF5KHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMpICYmXG4gICAgICAgICAgICAgICAgbW9ycGhUYXJnZXRJbmRleCA8IHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMubGVuZ3RoLFxuICAgICAgICAgICAgKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICBgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogJHtzY2hlbWFFeHByZXNzaW9uLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4IG1vcnBoICMke21vcnBoVGFyZ2V0SW5kZXh9IGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgd2VpZ2h0OiBiaW5kLndlaWdodCA/PyAxLjAsXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICApO1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAoc2NoZW1hRXhwcmVzc2lvbi5tYX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ID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIHR5cGU6IGJpbmQudHlwZSxcbiAgICAgICAgICAgICAgICAgIHRhcmdldFZhbHVlOiBuZXcgVEhSRUUuQ29sb3IoKS5mcm9tQXJyYXkoYmluZC50YXJnZXRWYWx1ZSksXG4gICAgICAgICAgICAgICAgICB0YXJnZXRBbHBoYTogYmluZC50YXJnZXRWYWx1ZVszXSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgc2NoZW1hRXhwcmVzc2lvbi50ZXh0dXJlVHJhbnNmb3JtQmluZHM/LmZvckVhY2goYXN5bmMgKGJpbmQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFscyA9IGdsdGZNYXRlcmlhbHMuZmlsdGVyKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbEluZGV4ID0gdGhpcy5wYXJzZXIuYXNzb2NpYXRpb25zLmdldChtYXRlcmlhbCk/Lm1hdGVyaWFscztcbiAgICAgICAgICAgICAgcmV0dXJuIGJpbmQubWF0ZXJpYWwgPT09IG1hdGVyaWFsSW5kZXg7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICBuZXcgVlJNR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ICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY29uc3QgbW9ycGhUYXJnZXRJbmRleCA9IGJpbmQuaW5kZXg7XG5cbiAgICAgICAgICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAgICAgICAgICBub2Rlc1VzaW5nTWVzaC5tYXAoYXN5bmMgKG5vZGVJbmRleCkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IHByaW1pdGl2ZXMgPSAoYXdhaXQgZ2x0ZkV4dHJhY3RQcmltaXRpdmVzRnJvbU5vZGUoZ2x0Ziwgbm9kZUluZGV4KSkhO1xuXG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIG1lc2ggaGFzIHRoZSB0YXJnZXQgbW9ycGggdGFyZ2V0XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgIXByaW1pdGl2ZXMuZXZlcnkoXG4gICAgICAgICAgICAgICAgICAgIChwcmltaXRpdmUpID0+XG4gICAgICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzKSAmJlxuICAgICAgICAgICAgICAgICAgICAgIG1vcnBoVGFyZ2V0SW5kZXggPCBwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46ICR7c2NoZW1hR3JvdXAubmFtZX0gYXR0ZW1wdHMgdG8gaW5kZXggJHttb3JwaFRhcmdldEluZGV4fXRoIG1vcnBoIGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgICAgICAgd2VpZ2h0OiAwLjAxICogKGJpbmQud2VpZ2h0ID8/IDEwMCksIC8vIG5hcnJvd2luZyB0aGUgcmFuZ2UgZnJvbSBbIDAuMCAtIDEwMC4wIF0gdG8gWyAwLjAgLSAxLjAgXVxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmluZCBNYXRlcmlhbENvbG9yIGFuZCBUZXh0dXJlVHJhbnNmb3JtXG4gICAgICAgIGNvbnN0IG1hdGVyaWFsVmFsdWVzID0gc2NoZW1hR3JvdXAubWF0ZXJpYWxWYWx1ZXM7XG4gICAgICAgIGlmIChtYXRlcmlhbFZhbHVlcyAmJiBtYXRlcmlhbFZhbHVlcy5sZW5ndGggIT09IDApIHtcbiAgICAgICAgICBtYXRlcmlhbFZhbHVlcy5mb3JFYWNoKChtYXRlcmlhbFZhbHVlKSA9PiB7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgIG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAgICAgbWF0ZXJpYWxWYWx1ZS5wcm9wZXJ0eU5hbWUgPT09IHVuZGVmaW5lZCB8fFxuICAgICAgICAgICAgICBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlID09PSB1bmRlZmluZWRcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICByZXR1cm47XG4g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FRS5NYXRlcmlhbFtdIHwgVEhSRUUuTWF0ZXJpYWwgPSAob2JqZWN0IGFzIGFueSkubWF0ZXJpYWw7XG4gICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobWF0ZXJpYWwpKSB7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgLi4ubWF0ZXJpYWwuZmlsdGVyKFxuICAgICAgICAgICAgICAgICAgICAgIChtdGwpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAobXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICBtdGwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUhICsgJyAoT3V0bGluZSknKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLmluZGV4T2YobXRsKSA9PT0gLTEsXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0ZXJpYWwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUgJiYgbWF0ZXJpYWxzLmluZGV4T2YobWF0ZXJpYWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLnB1c2gobWF0ZXJpYWwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsUHJvcGVydHlOYW1lID0gbWF0ZXJpYWxWYWx1ZS5wcm9wZXJ0eU5hbWU7XG4gICAgICAgICAgICBtYXRlcmlhbHMuZm9yRWFjaCgobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgLy8gVGV4dHVyZVRyYW5zZm9ybUJpbmRcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsUHJvcGVydHlOYW1lID09PSAnX01haW5UZXhfU1QnKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qgc2NhbGUgPSBuZXcgVEhSRUUuVmVjdG9yMihtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVswXSwgbWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMV0pO1xuICAgICAgICAgICAgICAgIGNvbnN0IG9mZnNldCA9IG5ldyBUSFJFRS5WZWN0b3IyKG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzJdLCBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSk7XG5cbiAgICAgICAgICAgICAgICBvZmZzZXQueSA9IDEuMCAtIG9mZnNldC55IC0gc2NhbGUueTtcblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uVGV4dHVyZVRyYW5zZm9ybUJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBNYXRlcmlhbENvbG9yQmluZFxuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbENvbG9yVHlwZSA9IHYwRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JNYXBbbWF0ZXJpYWxQcm9wZXJ0eU5hbWVdO1xuICAgICAgICAgICAgICBpZiAobWF0ZXJpYWxDb2xvclR5cGUpIHtcbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1hdGVyaWF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ICAgICAgICAgbWVzaC5sYXllcnMuc2V0KHRoaXMuX3RoaXJkUGVyc29uT25seUxheWVyKTtcbiAgICAgICAgICBtZXNoLnRyYXZlcnNlKChjaGlsZCkgPT4gY2hpbGQubGF5ZXJzLnNldCh0aGlzLl90aGlyZFBlcnNvbk9ubHlMYXllcikpO1xuICAgICAgICB9IGVsc2UgaWYgKGl0ZW0udHlwZSA9PT0gJ2F1dG8nKSB7XG4gICAgICAgICAgdGhpcy5fY3JlYXRlSGVhZGxlc3NNb2RlbChtZXNoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG5cbiAgICB0aGlzLl9pbml0aWFsaXplZExheWVycyA9IHRydWU7XG4gIH1cblxuICBwcml2YXRlIF9leGNsdWRlVHJpYW5nbGVzKHRyaWFuZ2xlczogbnVtYmVyW10sIGJ3czogbnVtYmVyW11bXSwgc2tpbkluZGV4OiBudW1iZXJbXVtdLCBleGNsdWRlOiBudW1iZXJbXSk6IG51bWJlciB7XG4gICAgbGV0IGNvdW50ID0gMDtcbiAgICBpZiAoYndzICE9IG51bGwgJiYgYndzLmxlbmd0aCA+IDApIHtcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJpYW5nbGVzLmxlbmd0aDsgaSArPSAzKSB7XG4gICAgICAgIGNvbnN0IGEgPSB0cmlhbmdsZXNbaV07XG4gICAgICAgIGNvbnN0IGIgPSB0cmlhbmdsZXNbaSArIDFdO1xuICAgICAgICBjb25zdCBjID0gdHJpYW5nbGVzW2kgKyAyXTtcbiAgICAgICAgY29uc3QgYncwID0gYndzW2FdO1xuICAgICAgICBjb25zdCBza2luMCA9IHNraW5JbmRleFthXTtcblxuICAgICAgICBpZiAoYncwWzBdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4wWzBdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzBbMV0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjBbMV0pKSBjb250aW51ZTtcbiA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HNjaGVtYUh1bWFuQm9uZV0pID0+IHtcbiAgICAgICAgICBsZXQgYm9uZU5hbWUgPSBib25lTmFtZVN0cmluZyBhcyBWMVZSTVNjaGVtYS5IdW1hbm9pZEh1bWFuQm9uZU5hbWU7XG4gICAgICAgICAgY29uc3QgaW5kZXggPSBzY2hlbWFIdW1hbkJvbmUubm9kZTtcblxuICAgICAgICAgIC8vIGNvbXBhdDogMS4wLWJldGEgcHJldmlvdXMgdGh1bWIgYm9uZSBuYW1lc1xuICAgICAgICAgIGlmIChleGlzdHNQcmV2aW91c1RodW1iTmFtZSkge1xuICAgICAgICAgICAgY29uc3QgdGh1bWJCb25lTmFtZSA9IHRodW1iQm9uZU5hbWVNYXBbYm9uZU5hbWVdO1xuICAgICAgICAgICAgaWYgKHRodW1iQm9uZU5hbWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICBib25lTmFtZSA9IHRodW1iQm9uZU5hbWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29uc3Qgbm9kZSA9IGF3YWl0IHRoaXMucGFyc2VyLmdldERlcGVuZGVuY3koJ25vZGUnLCBpbmRleCk7XG5cbiAgICAgICAgICAvLyBpZiB0aGUgc3BlY2lmaWVkIG5vZGUgZG9lcyBub3QgZXhpc3QsIGVtaXQgYSB3YXJuaW5nXG4gICAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKGBBIGdsVEYgbm9kZSBib3VuZCB0byB0aGUgaHVtYW5vaWQgYm9uZSAke2JvbmVOYW1lfSAoaW5kZXggPSAke2luZGV4fSkgZG9lcyBub3QgZXhpc3RgKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyBzZXQgdG8gdGhlIGBodW1hbkJvbmVzYFxuICAgICAgICAgIGh1bWFuQm9uZXNbYm9uZU5hbWVdID0geyBub2RlIH07XG4gICAgICAgIH0pLFxuICAgIC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UFDO0FBRUQsYUFBSyxTQUFTLFVBQVU7QUFBQSxNQUMxQjtBQUFBLElBQ0Y7QUFBQTtBQUNGOyIsCiAgIm5hbWVzIjogWyJUSFJFRSIsICJUSFJFRSIsICJUSFJFRSIsICJfYSIsICJfYSIsICJfYiIsICJUSFJFRSIsICJQT1NTSUJMRV9TUEVDX1ZFUlNJT05TIiwgIl9hIiwgIl9iIiwgIlRIUkVFIiwgIlRIUkVFIiwgIl92M0EiLCAiX3F1YXRBIiwgIlRIUkVFIiwgIl92M0EiLCAiX3F1YXRBIiwgIlBPU1NJQkxFX1NQRUNfVkVSU0lPTlMiLCAiVEhSRUUiLCAiVEhSRUUiLCAiVEhSRUUiLCAiX3F1YXRBIiwgIl92M0EiLCAiX3YzQiIsICJUSFJFRSIsICJUSFJFRSIsICJfdjNBIiwgIl92M0IiLCAiX3F1YXRBIiwgIl9xdWF0QiIsICJUSFJFRSIsICJWRUMzX1BPU0lUSVZFX1oiLCAiX3F1YXRBIiwgIl9xdWF0QiIsICJfZXVsZXJBIiwgIlRIUkVFIiwgIlBPU1NJQkxFX1NQRUNfVkVSU0lPTlMiLCAiVEhSRUUiLCAiUE9TU0lCTEVfU1BFQ19WRVJTSU9OUyJdCn0K diff --git a/packages/three-vrm-core/lib/three-vrm-core.min.cjs b/packages/three-vrm-core/lib/three-vrm-core.min.cjs index 5f4ee0708..a7c332c11 100644 --- a/packages/three-vrm-core/lib/three-vrm-core.min.cjs +++ b/packages/three-vrm-core/lib/three-vrm-core.min.cjs @@ -1,2 +1,2 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -"use strict";var ut=Object.create;var Ve=Object.defineProperty;var pt=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var ct=(a,e)=>{for(var t in e)Ve(a,t,{get:e[t],enumerable:!0})},We=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mt(e))!ht.call(a,o)&&o!==t&&Ve(a,o,{get:()=>e[o],enumerable:!(r=pt(e,o))||r.enumerable});return a};var T=(a,e,t)=>(t=a!=null?ut(dt(a)):{},We(e||!a||!a.__esModule?Ve(t,"default",{value:a,enumerable:!0}):t,a)),Rt=a=>We(Ve({},"__esModule",{value:!0}),a);var R=(a,e,t)=>new Promise((r,o)=>{var i=s=>{try{u(t.next(s))}catch(l){o(l)}},n=s=>{try{u(t.throw(s))}catch(l){o(l)}},u=s=>s.done?r(s.value):Promise.resolve(s.value).then(i,n);u((t=t.apply(a,e)).next())});var It={};ct(It,{VRMCore:()=>ce,VRMCoreLoaderPlugin:()=>ke,VRMExpression:()=>j,VRMExpressionLoaderPlugin:()=>ne,VRMExpressionManager:()=>z,VRMExpressionMaterialColorBind:()=>Y,VRMExpressionMaterialColorType:()=>q,VRMExpressionMorphTargetBind:()=>$,VRMExpressionOverrideType:()=>$e,VRMExpressionPresetName:()=>Q,VRMExpressionTextureTransformBind:()=>X,VRMFirstPerson:()=>Z,VRMFirstPersonLoaderPlugin:()=>ie,VRMFirstPersonMeshAnnotationType:()=>Xe,VRMHumanBoneList:()=>se,VRMHumanBoneName:()=>Ke,VRMHumanBoneParentMap:()=>He,VRMHumanoid:()=>re,VRMHumanoidHelper:()=>J,VRMHumanoidLoaderPlugin:()=>ae,VRMLookAt:()=>pe,VRMLookAtBoneApplier:()=>S,VRMLookAtExpressionApplier:()=>W,VRMLookAtHelper:()=>le,VRMLookAtLoaderPlugin:()=>de,VRMLookAtRangeMap:()=>oe,VRMLookAtTypeName:()=>st,VRMMetaLoaderPlugin:()=>he,VRMRequiredHumanBoneName:()=>_e});module.exports=Rt(It);var je=T(require("three"),1),j=class extends je.Object3D{constructor(t){super();this.weight=0;this.isBinary=!1;this.overrideBlink="none";this.overrideLookAt="none";this.overrideMouth="none";this._binds=[];this.name=`VRMExpression_${t}`,this.expressionName=t,this.type="VRMExpression",this.visible=!1}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(t){this._binds.push(t)}applyWeight(t){var o;let r=this.outputWeight;r*=(o=t==null?void 0:t.multiplier)!=null?o:1,this.isBinary&&r<1&&(r=0),this._binds.forEach(i=>i.applyWeight(r))}clearAppliedWeight(){this._binds.forEach(t=>t.clearAppliedWeight())}};var G=T(require("three"),1);function Qe(a,e,t){var l,d;let r=a.parser.json,o=(l=r.nodes)==null?void 0:l[e];if(o==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let i=o.mesh;if(i==null)return null;let n=(d=r.meshes)==null?void 0:d[i];if(n==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${i}] of glTF but the mesh doesn't exist`),null;let u=n.primitives.length,s=[];return t.traverse(c=>{s.length{let i=Qe(a,o,r);i!=null&&t.set(o,i)}),t})}var Q={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function ye(a){return Math.max(Math.min(a,1),0)}var z=class a{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"];this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"];this.mouthExpressionNames=["aa","ee","ih","oh","ou"];this._expressions=[];this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},t=new Set(Object.values(Q));return Object.entries(this._expressionMap).forEach(([r,o])=>{t.has(r)&&(e[r]=o)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(Q));return Object.entries(this._expressionMap).forEach(([r,o])=>{t.has(r)||(e[r]=o)}),e}copy(e){return this._expressions.concat().forEach(r=>{this.unregisterExpression(r)}),e._expressions.forEach(r=>{this.registerExpression(r)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new a().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var r;let t=this.getExpression(e);return(r=t==null?void 0:t.weight)!=null?r:null}setValue(e,t){let r=this.getExpression(e);r&&(r.weight=ye(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let r=1,o=t.expressionName;this.blinkExpressionNames.indexOf(o)!==-1&&(r*=e.blink),this.lookAtExpressionNames.indexOf(o)!==-1&&(r*=e.lookAt),this.mouthExpressionNames.indexOf(o)!==-1&&(r*=e.mouth),t.applyWeight({multiplier:r})})}_calculateWeightMultipliers(){let e=1,t=1,r=1;return this._expressions.forEach(o=>{e-=o.overrideBlinkAmount,t-=o.overrideLookAtAmount,r-=o.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),r=Math.max(0,r),{blink:e,lookAt:t,mouth:r}}};var q={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},ze={_Color:q.Color,_EmissionColor:q.EmissionColor,_ShadeColor:q.ShadeColor,_RimColor:q.RimColor,_OutlineColor:q.OutlineColor};var Ne=T(require("three"),1),ft=new Ne.Color,xe=class xe{constructor({material:e,type:t,targetValue:r,targetAlpha:o}){this.material=e,this.type=t,this.targetValue=r,this.targetAlpha=o!=null?o:1;let i=this._initColorBindState(),n=this._initAlphaBindState();this._state={color:i,alpha:n}}applyWeight(e){let{color:t,alpha:r}=this._state;if(t!=null){let{propertyName:o,deltaValue:i}=t,n=this.material[o];n!=null&&n.add(ft.copy(i).multiplyScalar(e))}if(r!=null){let{propertyName:o,deltaValue:i}=r;this.material[o]!=null&&(this.material[o]+=i*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:r,initialValue:o}=e,i=this.material[r];i!=null&&i.copy(o)}if(t!=null){let{propertyName:r,initialValue:o}=t;this.material[r]!=null&&(this.material[r]=o)}}_initColorBindState(){var l,d,c;let{material:e,type:t,targetValue:r}=this,o=this._getPropertyNameMap(),i=(d=(l=o==null?void 0:o[t])==null?void 0:l[0])!=null?d:null;if(i==null)return console.warn(`Tried to add a material color bind to the material ${(c=e.name)!=null?c:"(no name)"}, the type ${t} but the material or the type is not supported.`),null;let u=e[i].clone(),s=new Ne.Color(r.r-u.r,r.g-u.g,r.b-u.b);return{propertyName:i,initialValue:u,deltaValue:s}}_initAlphaBindState(){var s,l,d;let{material:e,type:t,targetAlpha:r}=this,o=this._getPropertyNameMap(),i=(l=(s=o==null?void 0:o[t])==null?void 0:s[1])!=null?l:null;if(i==null&&r!==1)return console.warn(`Tried to add a material alpha bind to the material ${(d=e.name)!=null?d:"(no name)"}, the type ${t} but the material or the type does not support alpha.`),null;if(i==null)return null;let n=e[i],u=r-n;return{propertyName:i,initialValue:n,deltaValue:u}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(xe._propertyNameMapMap).find(([r])=>this.material[r]===!0))==null?void 0:e[1])!=null?t:null}};xe._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var Y=xe;var $=class{constructor({primitives:e,index:t,weight:r}){this.primitives=e,this.index=t,this.weight=r}applyWeight(e){this.primitives.forEach(t=>{var r;((r=t.morphTargetInfluences)==null?void 0:r[this.index])!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]=0)})}};var Ye=T(require("three"),1),qe=new Ye.Vector2,Te=class Te{constructor({material:e,scale:t,offset:r}){var i,n;this.material=e,this.scale=t,this.offset=r;let o=(i=Object.entries(Te._propertyNamesMap).find(([u])=>e[u]===!0))==null?void 0:i[1];o==null?(console.warn(`Tried to add a texture transform bind to the material ${(n=e.name)!=null?n:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],o.forEach(u=>{var m;let s=(m=e[u])==null?void 0:m.clone();if(!s)return null;e[u]=s;let l=s.offset.clone(),d=s.repeat.clone(),c=r.clone().sub(l),p=t.clone().sub(d);this._properties.push({name:u,initialOffset:l,deltaOffset:c,initialScale:d,deltaScale:p})}))}applyWeight(e){this._properties.forEach(t=>{let r=this.material[t.name];r!==void 0&&(r.offset.add(qe.copy(t.deltaOffset).multiplyScalar(e)),r.repeat.add(qe.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};Te._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var X=Te;var Mt=new Set(["1.0","1.0-beta"]),be=class be{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return R(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let r=yield this._v0Import(e);return r||null})}_v1Import(e){return R(this,null,function*(){var d,c;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(!o)return null;let i=o.specVersion;if(!Mt.has(i))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.expressions;if(!n)return null;let u=new Set(Object.values(Q)),s=new Map;n.preset!=null&&Object.entries(n.preset).forEach(([p,m])=>{if(m!=null){if(!u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${p}" detected. Ignoring the expression`);return}s.set(p,m)}}),n.custom!=null&&Object.entries(n.custom).forEach(([p,m])=>{if(u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${p}". Ignoring the expression`);return}s.set(p,m)});let l=new z;return yield Promise.all(Array.from(s.entries()).map(M=>R(this,[M],function*([p,m]){var f,V,x,A,b,H,I;let h=new j(p);if(e.scene.add(h),h.isBinary=(f=m.isBinary)!=null?f:!1,h.overrideBlink=(V=m.overrideBlink)!=null?V:"none",h.overrideLookAt=(x=m.overrideLookAt)!=null?x:"none",h.overrideMouth=(A=m.overrideMouth)!=null?A:"none",(b=m.morphTargetBinds)==null||b.forEach(L=>R(this,null,function*(){var k;if(L.node===void 0||L.index===void 0)return;let P=yield Fe(e,L.node),B=L.index;if(!P.every(N=>Array.isArray(N.morphTargetInfluences)&&B{let B=P.material;B&&(Array.isArray(B)?L.push(...B):L.push(B))}),(H=m.materialColorBinds)==null||H.forEach(P=>R(this,null,function*(){L.filter(k=>{var D;let N=(D=this.parser.associations.get(k))==null?void 0:D.materials;return P.material===N}).forEach(k=>{h.addBind(new Y({material:k,type:P.type,targetValue:new G.Color().fromArray(P.targetValue),targetAlpha:P.targetValue[3]}))})})),(I=m.textureTransformBinds)==null||I.forEach(P=>R(this,null,function*(){L.filter(k=>{var D;let N=(D=this.parser.associations.get(k))==null?void 0:D.materials;return P.material===N}).forEach(k=>{var N,D;h.addBind(new X({material:k,offset:new G.Vector2().fromArray((N=P.offset)!=null?N:[0,0]),scale:new G.Vector2().fromArray((D=P.scale)!=null?D:[1,1])}))})}))}l.registerExpression(h)}))),l})}_v0Import(e){return R(this,null,function*(){var s;let t=this.parser.json,r=(s=t.extensions)==null?void 0:s.VRM;if(!r)return null;let o=r.blendShapeMaster;if(!o)return null;let i=new z,n=o.blendShapeGroups;if(!n)return i;let u=new Set;return yield Promise.all(n.map(l=>R(this,null,function*(){var h;let d=l.presetName,c=d!=null&&be.v0v1PresetNameMap[d]||null,p=c!=null?c:l.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(u.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}u.add(p);let m=new j(p);e.scene.add(m),m.isBinary=(h=l.isBinary)!=null?h:!1,l.binds&&l.binds.forEach(f=>R(this,null,function*(){var A;if(f.mesh===void 0||f.index===void 0)return;let V=[];(A=t.nodes)==null||A.forEach((b,H)=>{b.mesh===f.mesh&&V.push(H)});let x=f.index;yield Promise.all(V.map(b=>R(this,null,function*(){var I;let H=yield Fe(e,b);if(!H.every(L=>Array.isArray(L.morphTargetInfluences)&&x{if(f.materialName===void 0||f.propertyName===void 0||f.targetValue===void 0)return;let V=[];e.scene.traverse(A=>{if(A.material){let b=A.material;Array.isArray(b)?V.push(...b.filter(H=>(H.name===f.materialName||H.name===f.materialName+" (Outline)")&&V.indexOf(H)===-1)):b.name===f.materialName&&V.indexOf(b)===-1&&V.push(b)}});let x=f.propertyName;V.forEach(A=>{if(x==="_MainTex_ST"){let H=new G.Vector2(f.targetValue[0],f.targetValue[1]),I=new G.Vector2(f.targetValue[2],f.targetValue[3]);I.y=1-I.y-H.y,m.addBind(new X({material:A,scale:H,offset:I}));return}let b=ze[x];if(b){m.addBind(new Y({material:A,type:b,targetValue:new G.Color().fromArray(f.targetValue),targetAlpha:f.targetValue[3]}));return}console.warn(x+" is not supported")})}),i.registerExpression(m)}))),i})}};be.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var ne=be;var $e={None:"none",Block:"block",Blend:"blend"};var w=T(require("three"),1),U=class U{constructor(e,t){this._firstPersonOnlyLayer=U.DEFAULT_FIRSTPERSON_ONLY_LAYER;this._thirdPersonOnlyLayer=U.DEFAULT_THIRDPERSON_ONLY_LAYER;this._initializedLayers=!1;this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new U(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=U.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=U.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(r=>{r.meshes.forEach(o=>{r.type==="firstPersonOnly"?(o.layers.set(this._firstPersonOnlyLayer),o.traverse(i=>i.layers.set(this._firstPersonOnlyLayer))):r.type==="thirdPersonOnly"?(o.layers.set(this._thirdPersonOnlyLayer),o.traverse(i=>i.layers.set(this._thirdPersonOnlyLayer))):r.type==="auto"&&this._createHeadlessModel(o)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,r,o){let i=0;if(t!=null&&t.length>0)for(let n=0;n0&&o.includes(c[0])||d[1]>0&&o.includes(c[1])||d[2]>0&&o.includes(c[2])||d[3]>0&&o.includes(c[3]))continue;let p=t[s],m=r[s];if(p[0]>0&&o.includes(m[0])||p[1]>0&&o.includes(m[1])||p[2]>0&&o.includes(m[2])||p[3]>0&&o.includes(m[3]))continue;let M=t[l],h=r[l];M[0]>0&&o.includes(h[0])||M[1]>0&&o.includes(h[1])||M[2]>0&&o.includes(h[2])||M[3]>0&&o.includes(h[3])||(e[i++]=u,e[i++]=s,e[i++]=l)}return i}_createErasedMesh(e,t){let r=new w.SkinnedMesh(e.geometry.clone(),e.material);r.name=`${e.name}(erase)`,r.frustumCulled=e.frustumCulled,r.layers.set(this._firstPersonOnlyLayer);let o=r.geometry,i=o.getAttribute("skinIndex"),n=i instanceof w.GLBufferAttribute?[]:i.array,u=[];for(let h=0;h{this._isEraseTarget(i)&&r.push(n)}),!r.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let o=this._createErasedMesh(t,r);e.add(o)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{let t=new w.Group;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(r=>r.type==="SkinnedMesh").forEach(r=>{let o=r;this._createHeadlessModelForSkinnedMesh(t,o)})}else if(e.type==="SkinnedMesh"){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};U.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,U.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var Z=U;var Et=new Set(["1.0","1.0-beta"]),ie=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return R(this,null,function*(){let t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return R(this,null,function*(){if(t==null)return null;let r=yield this._v1Import(e,t);if(r)return r;let o=yield this._v0Import(e,t);return o||null})}_v1Import(e,t){return R(this,null,function*(){var d,c;let r=this.parser.json;if(!(((d=r.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let i=(c=r.extensions)==null?void 0:c.VRMC_vrm;if(!i)return null;let n=i.specVersion;if(!Et.has(n))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${n}"`),null;let u=i.firstPerson,s=[],l=yield Ie(e);return Array.from(l.entries()).forEach(([p,m])=>{var h,f;let M=(h=u==null?void 0:u.meshAnnotations)==null?void 0:h.find(V=>V.node===p);s.push({meshes:m,type:(f=M==null?void 0:M.type)!=null?f:"auto"})}),new Z(t,s)})}_v0Import(e,t){return R(this,null,function*(){var s;let r=this.parser.json,o=(s=r.extensions)==null?void 0:s.VRM;if(!o)return null;let i=o.firstPerson;if(!i)return null;let n=[],u=yield Ie(e);return Array.from(u.entries()).forEach(([l,d])=>{let c=r.nodes[l],p=i.meshAnnotations?i.meshAnnotations.find(m=>m.mesh===c.mesh):void 0;n.push({meshes:d,type:this._convertV0FlagToV1Type(p==null?void 0:p.firstPersonFlag)})}),new Z(t,n)})}_convertV0FlagToV1Type(e){return e==="FirstPersonOnly"?"firstPersonOnly":e==="ThirdPersonOnly"?"thirdPersonOnly":e==="Both"?"both":"auto"}};var Xe={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"};var O=T(require("three"),1),Ze=new O.Vector3,Je=new O.Vector3,gt=new O.Quaternion,J=class extends O.Group{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(t=>{let r=new O.AxesHelper(1);r.matrixAutoUpdate=!1,r.material.depthTest=!1,r.material.depthWrite=!1,this.add(r),this._boneAxesMap.set(t,r)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([t,r])=>{t.node.updateWorldMatrix(!0,!1),t.node.matrixWorld.decompose(Ze,gt,Je);let o=Ze.set(.1,.1,.1).divide(Je);r.matrix.copy(t.node.matrixWorld).scale(o)}),super.updateMatrixWorld(e)}};var se=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"];var Ke={Hips:"hips",Spine:"spine",Chest:"chest",UpperChest:"upperChest",Neck:"neck",Head:"head",LeftEye:"leftEye",RightEye:"rightEye",Jaw:"jaw",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",LeftToes:"leftToes",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",RightToes:"rightToes",LeftShoulder:"leftShoulder",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightShoulder:"rightShoulder",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand",LeftThumbMetacarpal:"leftThumbMetacarpal",LeftThumbProximal:"leftThumbProximal",LeftThumbDistal:"leftThumbDistal",LeftIndexProximal:"leftIndexProximal",LeftIndexIntermediate:"leftIndexIntermediate",LeftIndexDistal:"leftIndexDistal",LeftMiddleProximal:"leftMiddleProximal",LeftMiddleIntermediate:"leftMiddleIntermediate",LeftMiddleDistal:"leftMiddleDistal",LeftRingProximal:"leftRingProximal",LeftRingIntermediate:"leftRingIntermediate",LeftRingDistal:"leftRingDistal",LeftLittleProximal:"leftLittleProximal",LeftLittleIntermediate:"leftLittleIntermediate",LeftLittleDistal:"leftLittleDistal",RightThumbMetacarpal:"rightThumbMetacarpal",RightThumbProximal:"rightThumbProximal",RightThumbDistal:"rightThumbDistal",RightIndexProximal:"rightIndexProximal",RightIndexIntermediate:"rightIndexIntermediate",RightIndexDistal:"rightIndexDistal",RightMiddleProximal:"rightMiddleProximal",RightMiddleIntermediate:"rightMiddleIntermediate",RightMiddleDistal:"rightMiddleDistal",RightRingProximal:"rightRingProximal",RightRingIntermediate:"rightRingIntermediate",RightRingDistal:"rightRingDistal",RightLittleProximal:"rightLittleProximal",RightLittleIntermediate:"rightLittleIntermediate",RightLittleDistal:"rightLittleDistal"};var He={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};var Pe=T(require("three"),1);function Le(a){return a.invert?a.invert():a.inverse(),a}var K=new Pe.Vector3,ee=new Pe.Quaternion,te=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let r=t,o=this.getBoneNode(r);o&&(K.copy(o.position),ee.copy(o.quaternion),e[r]={position:K.toArray(),rotation:ee.toArray()})}),e}getPose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let r=t,o=this.getBoneNode(r);if(!o)return;K.set(0,0,0),ee.identity();let i=this.restPose[r];i!=null&&i.position&&K.fromArray(i.position).negate(),i!=null&&i.rotation&&Le(ee.fromArray(i.rotation)),K.add(o.position),ee.premultiply(o.quaternion),e[r]={position:K.toArray(),rotation:ee.toArray()}}),e}setPose(e){Object.entries(e).forEach(([t,r])=>{let o=t,i=this.getBoneNode(o);if(!i)return;let n=this.restPose[o];n&&(r!=null&&r.position&&(i.position.fromArray(r.position),n.position&&i.position.add(K.fromArray(n.position))),r!=null&&r.rotation&&(i.quaternion.fromArray(r.rotation),n.rotation&&i.quaternion.multiply(ee.fromArray(n.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{let r=this.getBoneNode(e);r&&(t!=null&&t.position&&r.position.fromArray(t.position),t!=null&&t.rotation&&r.quaternion.fromArray(t.rotation))})}getBone(e){var t;return(t=this.humanBones[e])!=null?t:void 0}getBoneNode(e){var t,r;return(r=(t=this.humanBones[e])==null?void 0:t.node)!=null?r:null}};var v=T(require("three"),1);var Ue=new v.Vector3,Vt=new v.Quaternion,yt=new v.Vector3,Re=class a extends te{static _setupTransforms(e){let t=new v.Object3D;t.name="VRMHumanoidRig";let r={},o={},i={},n={};se.forEach(s=>{var d;let l=e.getBoneNode(s);if(l){let c=new v.Vector3,p=new v.Quaternion;l.updateWorldMatrix(!0,!1),l.matrixWorld.decompose(c,p,Ue),r[s]=c,o[s]=p,i[s]=l.quaternion.clone();let m=new v.Quaternion;(d=l.parent)==null||d.matrixWorld.decompose(Ue,m,Ue),n[s]=m}});let u={};return se.forEach(s=>{var d;let l=e.getBoneNode(s);if(l){let c=r[s],p=s,m;for(;m==null&&(p=He[p],p!=null);)m=r[p];let M=new v.Object3D;M.name="Normalized_"+l.name,(p?(d=u[p])==null?void 0:d.node:t).add(M),M.position.copy(c),m&&M.position.sub(m),u[s]={node:M}}}),{rigBones:u,root:t,parentWorldRotations:n,boneRotations:i}}constructor(e){let{rigBones:t,root:r,parentWorldRotations:o,boneRotations:i}=a._setupTransforms(e);super(t),this.original=e,this.root=r,this._parentWorldRotations=o,this._boneRotations=i}update(){se.forEach(e=>{let t=this.original.getBoneNode(e);if(t!=null){let r=this.getBoneNode(e),o=this._parentWorldRotations[e],i=Vt.copy(o).invert(),n=this._boneRotations[e];if(t.quaternion.copy(r.quaternion).multiply(o).premultiply(i).multiply(n),e==="hips"){let u=r.getWorldPosition(yt);t.parent.updateWorldMatrix(!0,!1);let s=t.parent.matrixWorld,l=u.applyMatrix4(s.invert());t.position.copy(l)}}})}};var re=class a{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,t){var r;this.autoUpdateHumanBones=(r=t==null?void 0:t.autoUpdateHumanBones)!=null?r:!0,this._rawHumanBones=new te(e),this._normalizedHumanBones=new Re(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new te(e.humanBones),this._normalizedHumanBones=new Re(this._rawHumanBones),this}clone(){return new a(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}};var _e={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"};var xt=new Set(["1.0","1.0-beta"]),et={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},ae=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot,this.autoUpdateHumanBones=t==null?void 0:t.autoUpdateHumanBones}afterRoot(e){return R(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let r=yield this._v0Import(e);return r||null})}_v1Import(e){return R(this,null,function*(){var d,c;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(!o)return null;let i=o.specVersion;if(!xt.has(i))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.humanoid;if(!n)return null;let u=n.humanBones.leftThumbIntermediate!=null||n.humanBones.rightThumbIntermediate!=null,s={};n.humanBones!=null&&(yield Promise.all(Object.entries(n.humanBones).map(M=>R(this,[M],function*([p,m]){let h=p,f=m.node;if(u){let x=et[h];x!=null&&(h=x)}let V=yield this.parser.getDependency("node",f);if(V==null){console.warn(`A glTF node bound to the humanoid bone ${h} (index = ${f}) does not exist`);return}s[h]={node:V}}))));let l=new re(this._ensureRequiredBonesExist(s),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(l.normalizedHumanBonesRoot),this.helperRoot){let p=new J(l);this.helperRoot.add(p),p.renderOrder=this.helperRoot.renderOrder}return l})}_v0Import(e){return R(this,null,function*(){var u;let r=(u=this.parser.json.extensions)==null?void 0:u.VRM;if(!r)return null;let o=r.humanoid;if(!o)return null;let i={};o.humanBones!=null&&(yield Promise.all(o.humanBones.map(s=>R(this,null,function*(){let l=s.bone,d=s.node;if(l==null||d==null)return;let c=yield this.parser.getDependency("node",d);if(c==null){console.warn(`A glTF node bound to the humanoid bone ${l} (index = ${d}) does not exist`);return}let p=et[l],m=p!=null?p:l;if(i[m]!=null){console.warn(`Multiple bone entries for ${m} detected (index = ${d}), ignoring duplicated entries.`);return}i[m]={node:c}}))));let n=new re(this._ensureRequiredBonesExist(i),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(n.normalizedHumanBonesRoot),this.helperRoot){let s=new J(n);this.helperRoot.add(s),s.renderOrder=this.helperRoot.renderOrder}return n})}_ensureRequiredBonesExist(e){let t=Object.values(_e).filter(r=>e[r]==null);if(t.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(", ")}`);return e}};var E=T(require("three"),1);var fe=T(require("three"),1),Me=class extends fe.BufferGeometry{constructor(){super();this._currentTheta=0;this._currentRadius=0;this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new fe.BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new fe.BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,t=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let t=0;t<64;t++){let r=t/63*this._currentTheta;this._attrPos.setXYZ(t+1,this._currentRadius*Math.sin(r),0,this._currentRadius*Math.cos(r))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<63;t++)this._attrIndex.setXYZ(t*3,0,t+1,t+2);this._attrIndex.needsUpdate=!0}};var C=T(require("three"),1),Ae=class extends C.BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new C.Vector3,this._currentTail=new C.Vector3,this._attrPos=new C.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new C.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}};var we=new E.Quaternion,tt=new E.Quaternion,Ee=new E.Vector3,rt=new E.Vector3,ot=Math.sqrt(2)/2,Tt=new E.Quaternion(0,0,-ot,ot),bt=new E.Vector3(0,1,0),le=class extends E.Group{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{let t=new Me;t.radius=.5;let r=new E.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:E.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new E.Mesh(t,r),this.add(this._meshPitch)}{let t=new Me;t.radius=.5;let r=new E.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:E.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new E.Mesh(t,r),this.add(this._meshYaw)}{let t=new Ae;t.radius=.1;let r=new E.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new E.LineSegments(t,r),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(e){let t=E.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();let r=E.MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=r,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(Ee),this.vrmLookAt.getLookAtWorldQuaternion(we),we.multiply(this.vrmLookAt.getFaceFrontQuaternion(tt)),this._meshYaw.position.copy(Ee),this._meshYaw.quaternion.copy(we),this._meshPitch.position.copy(Ee),this._meshPitch.quaternion.copy(we),this._meshPitch.quaternion.multiply(tt.setFromAxisAngle(bt,t)),this._meshPitch.quaternion.multiply(Tt);let{target:o,autoUpdate:i}=this.vrmLookAt;o!=null&&i&&(o.getWorldPosition(rt).sub(Ee),this._lineTarget.geometry.tail.copy(rt),this._lineTarget.geometry.update(),this._lineTarget.position.copy(Ee)),super.updateMatrixWorld(e)}};var y=T(require("three"),1);var Oe=T(require("three"),1),Ht=new Oe.Vector3,Lt=new Oe.Vector3;function ge(a,e){return a.matrixWorld.decompose(Ht,e,Lt),e}function ue(a){return[Math.atan2(-a.z,a.x),Math.atan2(a.y,Math.sqrt(a.x*a.x+a.z*a.z))]}function Se(a){let e=Math.round(a/2/Math.PI);return a-2*Math.PI*e}var nt=new y.Vector3(0,0,1),Pt=new y.Vector3,_t=new y.Vector3,At=new y.Vector3,wt=new y.Quaternion,De=new y.Quaternion,it=new y.Quaternion,vt=new y.Quaternion,Ge=new y.Euler,ve=class ve{constructor(e,t){this.offsetFromHeadBone=new y.Vector3;this.autoUpdate=!0;this.faceFront=new y.Vector3(0,0,1);this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new y.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new y.Euler)}getEuler(e){return e.set(y.MathUtils.DEG2RAD*this._pitch,y.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new ve(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){let t=this.humanoid.getRawBoneNode("head");return ge(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(nt)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,r]=ue(this.faceFront);return Ge.set(0,.5*Math.PI+t,r,"YZX"),e.setFromEuler(Ge).premultiply(vt.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(De),this.getFaceFrontQuaternion(it),e.copy(nt).applyQuaternion(De).applyQuaternion(it).applyEuler(this.getEuler(Ge))}lookAt(e){let t=wt.copy(this._restHeadWorldQuaternion).multiply(Le(this.getLookAtWorldQuaternion(De))),r=this.getLookAtWorldPosition(_t),o=At.copy(e).sub(r).applyQuaternion(t).normalize(),[i,n]=ue(this.faceFront),[u,s]=ue(o),l=Se(u-i),d=Se(n-s);this._yaw=y.MathUtils.RAD2DEG*l,this._pitch=y.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Pt)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};ve.EULER_ORDER="YXZ";var pe=ve;var g=T(require("three"),1);var Bt=new g.Vector3(0,0,1),F=new g.Quaternion,me=new g.Quaternion,_=new g.Euler(0,0,0,"YXZ"),S=class{constructor(e,t,r,o,i){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=r,this.rangeMapVerticalDown=o,this.rangeMapVerticalUp=i,this.faceFront=new g.Vector3(0,0,1),this._restQuatLeftEye=new g.Quaternion,this._restQuatRightEye=new g.Quaternion,this._restLeftEyeParentWorldQuat=new g.Quaternion,this._restRightEyeParentWorldQuat=new g.Quaternion;let n=this.humanoid.getRawBoneNode("leftEye"),u=this.humanoid.getRawBoneNode("rightEye");n&&(this._restQuatLeftEye.copy(n.quaternion),ge(n.parent,this._restLeftEyeParentWorldQuat)),u&&(this._restQuatRightEye.copy(u.quaternion),ge(u.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){let r=this.humanoid.getRawBoneNode("leftEye"),o=this.humanoid.getRawBoneNode("rightEye"),i=this.humanoid.getNormalizedBoneNode("leftEye"),n=this.humanoid.getNormalizedBoneNode("rightEye");r&&(t<0?_.x=-g.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-t):_.x=g.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?_.y=-g.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-e):_.y=g.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(e),F.setFromEuler(_),this._getWorldFaceFrontQuat(me),i.quaternion.copy(me).multiply(F).multiply(me.invert()),F.copy(this._restLeftEyeParentWorldQuat),r.quaternion.copy(i.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatLeftEye)),o&&(t<0?_.x=-g.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-t):_.x=g.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?_.y=-g.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):_.y=g.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(e),F.setFromEuler(_),this._getWorldFaceFrontQuat(me),n.quaternion.copy(me).multiply(F).multiply(me.invert()),F.copy(this._restRightEyeParentWorldQuat),o.quaternion.copy(n.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let t=g.MathUtils.RAD2DEG*e.y,r=g.MathUtils.RAD2DEG*e.x;this.applyYawPitch(t,r)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(Bt)<.01)return e.identity();let[t,r]=ue(this.faceFront);return _.set(0,.5*Math.PI+t,r,"YZX"),e.setFromEuler(_)}};S.type="bone";var Ce=T(require("three"),1),W=class{constructor(e,t,r,o,i){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=r,this.rangeMapVerticalDown=o,this.rangeMapVerticalUp=i}applyYawPitch(e,t){t<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let t=Ce.MathUtils.RAD2DEG*e.y,r=Ce.MathUtils.RAD2DEG*e.x;this.applyYawPitch(t,r)}};W.type="expression";var oe=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*ye(e/this.inputMaxValue)}};var kt=new Set(["1.0","1.0-beta"]),Be=.01,de=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return R(this,null,function*(){let t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");let r=e.userData.vrmExpressionManager;if(r!==null){if(r===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");e.userData.vrmLookAt=yield this._import(e,t,r)}})}_import(e,t,r){return R(this,null,function*(){if(t==null||r==null)return null;let o=yield this._v1Import(e,t,r);if(o)return o;let i=yield this._v0Import(e,t,r);return i||null})}_v1Import(e,t,r){return R(this,null,function*(){var f,V,x;let o=this.parser.json;if(!(((f=o.extensionsUsed)==null?void 0:f.indexOf("VRMC_vrm"))!==-1))return null;let n=(V=o.extensions)==null?void 0:V.VRMC_vrm;if(!n)return null;let u=n.specVersion;if(!kt.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;let s=n.lookAt;if(!s)return null;let l=s.type==="expression"?1:10,d=this._v1ImportRangeMap(s.rangeMapHorizontalInner,l),c=this._v1ImportRangeMap(s.rangeMapHorizontalOuter,l),p=this._v1ImportRangeMap(s.rangeMapVerticalDown,l),m=this._v1ImportRangeMap(s.rangeMapVerticalUp,l),M;s.type==="expression"?M=new W(r,d,c,p,m):M=new S(t,d,c,p,m);let h=this._importLookAt(t,M);return h.offsetFromHeadBone.fromArray((x=s.offsetFromHeadBone)!=null?x:[0,.06,0]),h})}_v1ImportRangeMap(e,t){var i,n;let r=(i=e==null?void 0:e.inputMaxValue)!=null?i:90,o=(n=e==null?void 0:e.outputScale)!=null?n:t;return r(console.error(u),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}};var ce=class{constructor(e){this.scene=e.scene,this.meta=e.meta,this.humanoid=e.humanoid,this.expressionManager=e.expressionManager,this.firstPerson=e.firstPerson,this.lookAt=e.lookAt}update(e){this.humanoid.update(),this.lookAt&&this.lookAt.update(e),this.expressionManager&&this.expressionManager.update()}};var ke=class{get name(){return"VRMC_vrm"}constructor(e,t){var i,n,u,s,l;this.parser=e;let r=t==null?void 0:t.helperRoot,o=t==null?void 0:t.autoUpdateHumanBones;this.expressionPlugin=(i=t==null?void 0:t.expressionPlugin)!=null?i:new ne(e),this.firstPersonPlugin=(n=t==null?void 0:t.firstPersonPlugin)!=null?n:new ie(e),this.humanoidPlugin=(u=t==null?void 0:t.humanoidPlugin)!=null?u:new ae(e,{helperRoot:r,autoUpdateHumanBones:o}),this.lookAtPlugin=(s=t==null?void 0:t.lookAtPlugin)!=null?s:new de(e,{helperRoot:r}),this.metaPlugin=(l=t==null?void 0:t.metaPlugin)!=null?l:new he(e)}afterRoot(e){return R(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e);let t=e.userData.vrmMeta,r=e.userData.vrmHumanoid;if(t&&r){let o=new ce({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:r,lookAt:e.userData.vrmLookAt,meta:t});e.userData.vrmCore=o}})}}; +"use strict";var ut=Object.create;var Ve=Object.defineProperty;var pt=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var ct=(a,e)=>{for(var t in e)Ve(a,t,{get:e[t],enumerable:!0})},We=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mt(e))!ht.call(a,o)&&o!==t&&Ve(a,o,{get:()=>e[o],enumerable:!(r=pt(e,o))||r.enumerable});return a};var T=(a,e,t)=>(t=a!=null?ut(dt(a)):{},We(e||!a||!a.__esModule?Ve(t,"default",{value:a,enumerable:!0}):t,a)),Rt=a=>We(Ve({},"__esModule",{value:!0}),a);var R=(a,e,t)=>new Promise((r,o)=>{var i=s=>{try{u(t.next(s))}catch(l){o(l)}},n=s=>{try{u(t.throw(s))}catch(l){o(l)}},u=s=>s.done?r(s.value):Promise.resolve(s.value).then(i,n);u((t=t.apply(a,e)).next())});var It={};ct(It,{VRMCore:()=>ce,VRMCoreLoaderPlugin:()=>ke,VRMExpression:()=>j,VRMExpressionLoaderPlugin:()=>ne,VRMExpressionManager:()=>z,VRMExpressionMaterialColorBind:()=>Y,VRMExpressionMaterialColorType:()=>q,VRMExpressionMorphTargetBind:()=>$,VRMExpressionOverrideType:()=>$e,VRMExpressionPresetName:()=>Q,VRMExpressionTextureTransformBind:()=>X,VRMFirstPerson:()=>Z,VRMFirstPersonLoaderPlugin:()=>ie,VRMFirstPersonMeshAnnotationType:()=>Xe,VRMHumanBoneList:()=>se,VRMHumanBoneName:()=>Ke,VRMHumanBoneParentMap:()=>He,VRMHumanoid:()=>re,VRMHumanoidHelper:()=>J,VRMHumanoidLoaderPlugin:()=>ae,VRMLookAt:()=>pe,VRMLookAtBoneApplier:()=>S,VRMLookAtExpressionApplier:()=>W,VRMLookAtHelper:()=>le,VRMLookAtLoaderPlugin:()=>de,VRMLookAtRangeMap:()=>oe,VRMLookAtTypeName:()=>st,VRMMetaLoaderPlugin:()=>he,VRMRequiredHumanBoneName:()=>_e});module.exports=Rt(It);var je=T(require("three"),1),j=class extends je.Object3D{constructor(t){super();this.weight=0;this.isBinary=!1;this.overrideBlink="none";this.overrideLookAt="none";this.overrideMouth="none";this._binds=[];this.name=`VRMExpression_${t}`,this.expressionName=t,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(t){this._binds.push(t)}deleteBind(t){let r=this._binds.indexOf(t);r>=0&&this._binds.splice(r,1)}applyWeight(t){var o;let r=this.outputWeight;r*=(o=t==null?void 0:t.multiplier)!=null?o:1,this.isBinary&&r<1&&(r=0),this._binds.forEach(i=>i.applyWeight(r))}clearAppliedWeight(){this._binds.forEach(t=>t.clearAppliedWeight())}};var G=T(require("three"),1);function Qe(a,e,t){var l,d;let r=a.parser.json,o=(l=r.nodes)==null?void 0:l[e];if(o==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let i=o.mesh;if(i==null)return null;let n=(d=r.meshes)==null?void 0:d[i];if(n==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${i}] of glTF but the mesh doesn't exist`),null;let u=n.primitives.length,s=[];return t.traverse(c=>{s.length{let i=Qe(a,o,r);i!=null&&t.set(o,i)}),t})}var Q={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function ye(a){return Math.max(Math.min(a,1),0)}var z=class a{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"];this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"];this.mouthExpressionNames=["aa","ee","ih","oh","ou"];this._expressions=[];this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},t=new Set(Object.values(Q));return Object.entries(this._expressionMap).forEach(([r,o])=>{t.has(r)&&(e[r]=o)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(Q));return Object.entries(this._expressionMap).forEach(([r,o])=>{t.has(r)||(e[r]=o)}),e}copy(e){return this._expressions.concat().forEach(r=>{this.unregisterExpression(r)}),e._expressions.forEach(r=>{this.registerExpression(r)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new a().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var r;let t=this.getExpression(e);return(r=t==null?void 0:t.weight)!=null?r:null}setValue(e,t){let r=this.getExpression(e);r&&(r.weight=ye(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let r=1,o=t.expressionName;this.blinkExpressionNames.indexOf(o)!==-1&&(r*=e.blink),this.lookAtExpressionNames.indexOf(o)!==-1&&(r*=e.lookAt),this.mouthExpressionNames.indexOf(o)!==-1&&(r*=e.mouth),t.applyWeight({multiplier:r})})}_calculateWeightMultipliers(){let e=1,t=1,r=1;return this._expressions.forEach(o=>{e-=o.overrideBlinkAmount,t-=o.overrideLookAtAmount,r-=o.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),r=Math.max(0,r),{blink:e,lookAt:t,mouth:r}}};var q={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},ze={_Color:q.Color,_EmissionColor:q.EmissionColor,_ShadeColor:q.ShadeColor,_RimColor:q.RimColor,_OutlineColor:q.OutlineColor};var Ne=T(require("three"),1),ft=new Ne.Color,xe=class xe{constructor({material:e,type:t,targetValue:r,targetAlpha:o}){this.material=e,this.type=t,this.targetValue=r,this.targetAlpha=o!=null?o:1;let i=this._initColorBindState(),n=this._initAlphaBindState();this._state={color:i,alpha:n}}applyWeight(e){let{color:t,alpha:r}=this._state;if(t!=null){let{propertyName:o,deltaValue:i}=t,n=this.material[o];n!=null&&n.add(ft.copy(i).multiplyScalar(e))}if(r!=null){let{propertyName:o,deltaValue:i}=r;this.material[o]!=null&&(this.material[o]+=i*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:r,initialValue:o}=e,i=this.material[r];i!=null&&i.copy(o)}if(t!=null){let{propertyName:r,initialValue:o}=t;this.material[r]!=null&&(this.material[r]=o)}}_initColorBindState(){var l,d,c;let{material:e,type:t,targetValue:r}=this,o=this._getPropertyNameMap(),i=(d=(l=o==null?void 0:o[t])==null?void 0:l[0])!=null?d:null;if(i==null)return console.warn(`Tried to add a material color bind to the material ${(c=e.name)!=null?c:"(no name)"}, the type ${t} but the material or the type is not supported.`),null;let u=e[i].clone(),s=new Ne.Color(r.r-u.r,r.g-u.g,r.b-u.b);return{propertyName:i,initialValue:u,deltaValue:s}}_initAlphaBindState(){var s,l,d;let{material:e,type:t,targetAlpha:r}=this,o=this._getPropertyNameMap(),i=(l=(s=o==null?void 0:o[t])==null?void 0:s[1])!=null?l:null;if(i==null&&r!==1)return console.warn(`Tried to add a material alpha bind to the material ${(d=e.name)!=null?d:"(no name)"}, the type ${t} but the material or the type does not support alpha.`),null;if(i==null)return null;let n=e[i],u=r-n;return{propertyName:i,initialValue:n,deltaValue:u}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(xe._propertyNameMapMap).find(([r])=>this.material[r]===!0))==null?void 0:e[1])!=null?t:null}};xe._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var Y=xe;var $=class{constructor({primitives:e,index:t,weight:r}){this.primitives=e,this.index=t,this.weight=r}applyWeight(e){this.primitives.forEach(t=>{var r;((r=t.morphTargetInfluences)==null?void 0:r[this.index])!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]=0)})}};var Ye=T(require("three"),1),qe=new Ye.Vector2,Te=class Te{constructor({material:e,scale:t,offset:r}){var i,n;this.material=e,this.scale=t,this.offset=r;let o=(i=Object.entries(Te._propertyNamesMap).find(([u])=>e[u]===!0))==null?void 0:i[1];o==null?(console.warn(`Tried to add a texture transform bind to the material ${(n=e.name)!=null?n:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],o.forEach(u=>{var m;let s=(m=e[u])==null?void 0:m.clone();if(!s)return null;e[u]=s;let l=s.offset.clone(),d=s.repeat.clone(),c=r.clone().sub(l),p=t.clone().sub(d);this._properties.push({name:u,initialOffset:l,deltaOffset:c,initialScale:d,deltaScale:p})}))}applyWeight(e){this._properties.forEach(t=>{let r=this.material[t.name];r!==void 0&&(r.offset.add(qe.copy(t.deltaOffset).multiplyScalar(e)),r.repeat.add(qe.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};Te._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var X=Te;var Mt=new Set(["1.0","1.0-beta"]),be=class be{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return R(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let r=yield this._v0Import(e);return r||null})}_v1Import(e){return R(this,null,function*(){var d,c;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(!o)return null;let i=o.specVersion;if(!Mt.has(i))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.expressions;if(!n)return null;let u=new Set(Object.values(Q)),s=new Map;n.preset!=null&&Object.entries(n.preset).forEach(([p,m])=>{if(m!=null){if(!u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${p}" detected. Ignoring the expression`);return}s.set(p,m)}}),n.custom!=null&&Object.entries(n.custom).forEach(([p,m])=>{if(u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${p}". Ignoring the expression`);return}s.set(p,m)});let l=new z;return yield Promise.all(Array.from(s.entries()).map(M=>R(this,[M],function*([p,m]){var f,V,x,A,b,H,I;let h=new j(p);if(e.scene.add(h),h.isBinary=(f=m.isBinary)!=null?f:!1,h.overrideBlink=(V=m.overrideBlink)!=null?V:"none",h.overrideLookAt=(x=m.overrideLookAt)!=null?x:"none",h.overrideMouth=(A=m.overrideMouth)!=null?A:"none",(b=m.morphTargetBinds)==null||b.forEach(L=>R(this,null,function*(){var k;if(L.node===void 0||L.index===void 0)return;let P=yield Fe(e,L.node),B=L.index;if(!P.every(N=>Array.isArray(N.morphTargetInfluences)&&B{let B=P.material;B&&(Array.isArray(B)?L.push(...B):L.push(B))}),(H=m.materialColorBinds)==null||H.forEach(P=>R(this,null,function*(){L.filter(k=>{var D;let N=(D=this.parser.associations.get(k))==null?void 0:D.materials;return P.material===N}).forEach(k=>{h.addBind(new Y({material:k,type:P.type,targetValue:new G.Color().fromArray(P.targetValue),targetAlpha:P.targetValue[3]}))})})),(I=m.textureTransformBinds)==null||I.forEach(P=>R(this,null,function*(){L.filter(k=>{var D;let N=(D=this.parser.associations.get(k))==null?void 0:D.materials;return P.material===N}).forEach(k=>{var N,D;h.addBind(new X({material:k,offset:new G.Vector2().fromArray((N=P.offset)!=null?N:[0,0]),scale:new G.Vector2().fromArray((D=P.scale)!=null?D:[1,1])}))})}))}l.registerExpression(h)}))),l})}_v0Import(e){return R(this,null,function*(){var s;let t=this.parser.json,r=(s=t.extensions)==null?void 0:s.VRM;if(!r)return null;let o=r.blendShapeMaster;if(!o)return null;let i=new z,n=o.blendShapeGroups;if(!n)return i;let u=new Set;return yield Promise.all(n.map(l=>R(this,null,function*(){var h;let d=l.presetName,c=d!=null&&be.v0v1PresetNameMap[d]||null,p=c!=null?c:l.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(u.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}u.add(p);let m=new j(p);e.scene.add(m),m.isBinary=(h=l.isBinary)!=null?h:!1,l.binds&&l.binds.forEach(f=>R(this,null,function*(){var A;if(f.mesh===void 0||f.index===void 0)return;let V=[];(A=t.nodes)==null||A.forEach((b,H)=>{b.mesh===f.mesh&&V.push(H)});let x=f.index;yield Promise.all(V.map(b=>R(this,null,function*(){var I;let H=yield Fe(e,b);if(!H.every(L=>Array.isArray(L.morphTargetInfluences)&&x{if(f.materialName===void 0||f.propertyName===void 0||f.targetValue===void 0)return;let V=[];e.scene.traverse(A=>{if(A.material){let b=A.material;Array.isArray(b)?V.push(...b.filter(H=>(H.name===f.materialName||H.name===f.materialName+" (Outline)")&&V.indexOf(H)===-1)):b.name===f.materialName&&V.indexOf(b)===-1&&V.push(b)}});let x=f.propertyName;V.forEach(A=>{if(x==="_MainTex_ST"){let H=new G.Vector2(f.targetValue[0],f.targetValue[1]),I=new G.Vector2(f.targetValue[2],f.targetValue[3]);I.y=1-I.y-H.y,m.addBind(new X({material:A,scale:H,offset:I}));return}let b=ze[x];if(b){m.addBind(new Y({material:A,type:b,targetValue:new G.Color().fromArray(f.targetValue),targetAlpha:f.targetValue[3]}));return}console.warn(x+" is not supported")})}),i.registerExpression(m)}))),i})}};be.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var ne=be;var $e={None:"none",Block:"block",Blend:"blend"};var w=T(require("three"),1),U=class U{constructor(e,t){this._firstPersonOnlyLayer=U.DEFAULT_FIRSTPERSON_ONLY_LAYER;this._thirdPersonOnlyLayer=U.DEFAULT_THIRDPERSON_ONLY_LAYER;this._initializedLayers=!1;this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new U(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=U.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=U.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(r=>{r.meshes.forEach(o=>{r.type==="firstPersonOnly"?(o.layers.set(this._firstPersonOnlyLayer),o.traverse(i=>i.layers.set(this._firstPersonOnlyLayer))):r.type==="thirdPersonOnly"?(o.layers.set(this._thirdPersonOnlyLayer),o.traverse(i=>i.layers.set(this._thirdPersonOnlyLayer))):r.type==="auto"&&this._createHeadlessModel(o)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,r,o){let i=0;if(t!=null&&t.length>0)for(let n=0;n0&&o.includes(c[0])||d[1]>0&&o.includes(c[1])||d[2]>0&&o.includes(c[2])||d[3]>0&&o.includes(c[3]))continue;let p=t[s],m=r[s];if(p[0]>0&&o.includes(m[0])||p[1]>0&&o.includes(m[1])||p[2]>0&&o.includes(m[2])||p[3]>0&&o.includes(m[3]))continue;let M=t[l],h=r[l];M[0]>0&&o.includes(h[0])||M[1]>0&&o.includes(h[1])||M[2]>0&&o.includes(h[2])||M[3]>0&&o.includes(h[3])||(e[i++]=u,e[i++]=s,e[i++]=l)}return i}_createErasedMesh(e,t){let r=new w.SkinnedMesh(e.geometry.clone(),e.material);r.name=`${e.name}(erase)`,r.frustumCulled=e.frustumCulled,r.layers.set(this._firstPersonOnlyLayer);let o=r.geometry,i=o.getAttribute("skinIndex"),n=i instanceof w.GLBufferAttribute?[]:i.array,u=[];for(let h=0;h{this._isEraseTarget(i)&&r.push(n)}),!r.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let o=this._createErasedMesh(t,r);e.add(o)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{let t=new w.Group;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(r=>r.type==="SkinnedMesh").forEach(r=>{let o=r;this._createHeadlessModelForSkinnedMesh(t,o)})}else if(e.type==="SkinnedMesh"){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};U.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,U.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var Z=U;var Et=new Set(["1.0","1.0-beta"]),ie=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return R(this,null,function*(){let t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return R(this,null,function*(){if(t==null)return null;let r=yield this._v1Import(e,t);if(r)return r;let o=yield this._v0Import(e,t);return o||null})}_v1Import(e,t){return R(this,null,function*(){var d,c;let r=this.parser.json;if(!(((d=r.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let i=(c=r.extensions)==null?void 0:c.VRMC_vrm;if(!i)return null;let n=i.specVersion;if(!Et.has(n))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${n}"`),null;let u=i.firstPerson,s=[],l=yield Ie(e);return Array.from(l.entries()).forEach(([p,m])=>{var h,f;let M=(h=u==null?void 0:u.meshAnnotations)==null?void 0:h.find(V=>V.node===p);s.push({meshes:m,type:(f=M==null?void 0:M.type)!=null?f:"auto"})}),new Z(t,s)})}_v0Import(e,t){return R(this,null,function*(){var s;let r=this.parser.json,o=(s=r.extensions)==null?void 0:s.VRM;if(!o)return null;let i=o.firstPerson;if(!i)return null;let n=[],u=yield Ie(e);return Array.from(u.entries()).forEach(([l,d])=>{let c=r.nodes[l],p=i.meshAnnotations?i.meshAnnotations.find(m=>m.mesh===c.mesh):void 0;n.push({meshes:d,type:this._convertV0FlagToV1Type(p==null?void 0:p.firstPersonFlag)})}),new Z(t,n)})}_convertV0FlagToV1Type(e){return e==="FirstPersonOnly"?"firstPersonOnly":e==="ThirdPersonOnly"?"thirdPersonOnly":e==="Both"?"both":"auto"}};var Xe={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"};var O=T(require("three"),1),Ze=new O.Vector3,Je=new O.Vector3,gt=new O.Quaternion,J=class extends O.Group{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(t=>{let r=new O.AxesHelper(1);r.matrixAutoUpdate=!1,r.material.depthTest=!1,r.material.depthWrite=!1,this.add(r),this._boneAxesMap.set(t,r)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([t,r])=>{t.node.updateWorldMatrix(!0,!1),t.node.matrixWorld.decompose(Ze,gt,Je);let o=Ze.set(.1,.1,.1).divide(Je);r.matrix.copy(t.node.matrixWorld).scale(o)}),super.updateMatrixWorld(e)}};var se=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"];var Ke={Hips:"hips",Spine:"spine",Chest:"chest",UpperChest:"upperChest",Neck:"neck",Head:"head",LeftEye:"leftEye",RightEye:"rightEye",Jaw:"jaw",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",LeftToes:"leftToes",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",RightToes:"rightToes",LeftShoulder:"leftShoulder",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightShoulder:"rightShoulder",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand",LeftThumbMetacarpal:"leftThumbMetacarpal",LeftThumbProximal:"leftThumbProximal",LeftThumbDistal:"leftThumbDistal",LeftIndexProximal:"leftIndexProximal",LeftIndexIntermediate:"leftIndexIntermediate",LeftIndexDistal:"leftIndexDistal",LeftMiddleProximal:"leftMiddleProximal",LeftMiddleIntermediate:"leftMiddleIntermediate",LeftMiddleDistal:"leftMiddleDistal",LeftRingProximal:"leftRingProximal",LeftRingIntermediate:"leftRingIntermediate",LeftRingDistal:"leftRingDistal",LeftLittleProximal:"leftLittleProximal",LeftLittleIntermediate:"leftLittleIntermediate",LeftLittleDistal:"leftLittleDistal",RightThumbMetacarpal:"rightThumbMetacarpal",RightThumbProximal:"rightThumbProximal",RightThumbDistal:"rightThumbDistal",RightIndexProximal:"rightIndexProximal",RightIndexIntermediate:"rightIndexIntermediate",RightIndexDistal:"rightIndexDistal",RightMiddleProximal:"rightMiddleProximal",RightMiddleIntermediate:"rightMiddleIntermediate",RightMiddleDistal:"rightMiddleDistal",RightRingProximal:"rightRingProximal",RightRingIntermediate:"rightRingIntermediate",RightRingDistal:"rightRingDistal",RightLittleProximal:"rightLittleProximal",RightLittleIntermediate:"rightLittleIntermediate",RightLittleDistal:"rightLittleDistal"};var He={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};var Pe=T(require("three"),1);function Le(a){return a.invert?a.invert():a.inverse(),a}var K=new Pe.Vector3,ee=new Pe.Quaternion,te=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let r=t,o=this.getBoneNode(r);o&&(K.copy(o.position),ee.copy(o.quaternion),e[r]={position:K.toArray(),rotation:ee.toArray()})}),e}getPose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let r=t,o=this.getBoneNode(r);if(!o)return;K.set(0,0,0),ee.identity();let i=this.restPose[r];i!=null&&i.position&&K.fromArray(i.position).negate(),i!=null&&i.rotation&&Le(ee.fromArray(i.rotation)),K.add(o.position),ee.premultiply(o.quaternion),e[r]={position:K.toArray(),rotation:ee.toArray()}}),e}setPose(e){Object.entries(e).forEach(([t,r])=>{let o=t,i=this.getBoneNode(o);if(!i)return;let n=this.restPose[o];n&&(r!=null&&r.position&&(i.position.fromArray(r.position),n.position&&i.position.add(K.fromArray(n.position))),r!=null&&r.rotation&&(i.quaternion.fromArray(r.rotation),n.rotation&&i.quaternion.multiply(ee.fromArray(n.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{let r=this.getBoneNode(e);r&&(t!=null&&t.position&&r.position.fromArray(t.position),t!=null&&t.rotation&&r.quaternion.fromArray(t.rotation))})}getBone(e){var t;return(t=this.humanBones[e])!=null?t:void 0}getBoneNode(e){var t,r;return(r=(t=this.humanBones[e])==null?void 0:t.node)!=null?r:null}};var v=T(require("three"),1);var Ue=new v.Vector3,Vt=new v.Quaternion,yt=new v.Vector3,Re=class a extends te{static _setupTransforms(e){let t=new v.Object3D;t.name="VRMHumanoidRig";let r={},o={},i={},n={};se.forEach(s=>{var d;let l=e.getBoneNode(s);if(l){let c=new v.Vector3,p=new v.Quaternion;l.updateWorldMatrix(!0,!1),l.matrixWorld.decompose(c,p,Ue),r[s]=c,o[s]=p,i[s]=l.quaternion.clone();let m=new v.Quaternion;(d=l.parent)==null||d.matrixWorld.decompose(Ue,m,Ue),n[s]=m}});let u={};return se.forEach(s=>{var d;let l=e.getBoneNode(s);if(l){let c=r[s],p=s,m;for(;m==null&&(p=He[p],p!=null);)m=r[p];let M=new v.Object3D;M.name="Normalized_"+l.name,(p?(d=u[p])==null?void 0:d.node:t).add(M),M.position.copy(c),m&&M.position.sub(m),u[s]={node:M}}}),{rigBones:u,root:t,parentWorldRotations:n,boneRotations:i}}constructor(e){let{rigBones:t,root:r,parentWorldRotations:o,boneRotations:i}=a._setupTransforms(e);super(t),this.original=e,this.root=r,this._parentWorldRotations=o,this._boneRotations=i}update(){se.forEach(e=>{let t=this.original.getBoneNode(e);if(t!=null){let r=this.getBoneNode(e),o=this._parentWorldRotations[e],i=Vt.copy(o).invert(),n=this._boneRotations[e];if(t.quaternion.copy(r.quaternion).multiply(o).premultiply(i).multiply(n),e==="hips"){let u=r.getWorldPosition(yt);t.parent.updateWorldMatrix(!0,!1);let s=t.parent.matrixWorld,l=u.applyMatrix4(s.invert());t.position.copy(l)}}})}};var re=class a{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,t){var r;this.autoUpdateHumanBones=(r=t==null?void 0:t.autoUpdateHumanBones)!=null?r:!0,this._rawHumanBones=new te(e),this._normalizedHumanBones=new Re(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new te(e.humanBones),this._normalizedHumanBones=new Re(this._rawHumanBones),this}clone(){return new a(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}};var _e={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"};var xt=new Set(["1.0","1.0-beta"]),et={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},ae=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot,this.autoUpdateHumanBones=t==null?void 0:t.autoUpdateHumanBones}afterRoot(e){return R(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let r=yield this._v0Import(e);return r||null})}_v1Import(e){return R(this,null,function*(){var d,c;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(!o)return null;let i=o.specVersion;if(!xt.has(i))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.humanoid;if(!n)return null;let u=n.humanBones.leftThumbIntermediate!=null||n.humanBones.rightThumbIntermediate!=null,s={};n.humanBones!=null&&(yield Promise.all(Object.entries(n.humanBones).map(M=>R(this,[M],function*([p,m]){let h=p,f=m.node;if(u){let x=et[h];x!=null&&(h=x)}let V=yield this.parser.getDependency("node",f);if(V==null){console.warn(`A glTF node bound to the humanoid bone ${h} (index = ${f}) does not exist`);return}s[h]={node:V}}))));let l=new re(this._ensureRequiredBonesExist(s),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(l.normalizedHumanBonesRoot),this.helperRoot){let p=new J(l);this.helperRoot.add(p),p.renderOrder=this.helperRoot.renderOrder}return l})}_v0Import(e){return R(this,null,function*(){var u;let r=(u=this.parser.json.extensions)==null?void 0:u.VRM;if(!r)return null;let o=r.humanoid;if(!o)return null;let i={};o.humanBones!=null&&(yield Promise.all(o.humanBones.map(s=>R(this,null,function*(){let l=s.bone,d=s.node;if(l==null||d==null)return;let c=yield this.parser.getDependency("node",d);if(c==null){console.warn(`A glTF node bound to the humanoid bone ${l} (index = ${d}) does not exist`);return}let p=et[l],m=p!=null?p:l;if(i[m]!=null){console.warn(`Multiple bone entries for ${m} detected (index = ${d}), ignoring duplicated entries.`);return}i[m]={node:c}}))));let n=new re(this._ensureRequiredBonesExist(i),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(n.normalizedHumanBonesRoot),this.helperRoot){let s=new J(n);this.helperRoot.add(s),s.renderOrder=this.helperRoot.renderOrder}return n})}_ensureRequiredBonesExist(e){let t=Object.values(_e).filter(r=>e[r]==null);if(t.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(", ")}`);return e}};var E=T(require("three"),1);var fe=T(require("three"),1),Me=class extends fe.BufferGeometry{constructor(){super();this._currentTheta=0;this._currentRadius=0;this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new fe.BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new fe.BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,t=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let t=0;t<64;t++){let r=t/63*this._currentTheta;this._attrPos.setXYZ(t+1,this._currentRadius*Math.sin(r),0,this._currentRadius*Math.cos(r))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<63;t++)this._attrIndex.setXYZ(t*3,0,t+1,t+2);this._attrIndex.needsUpdate=!0}};var C=T(require("three"),1),Ae=class extends C.BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new C.Vector3,this._currentTail=new C.Vector3,this._attrPos=new C.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new C.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}};var we=new E.Quaternion,tt=new E.Quaternion,Ee=new E.Vector3,rt=new E.Vector3,ot=Math.sqrt(2)/2,Tt=new E.Quaternion(0,0,-ot,ot),bt=new E.Vector3(0,1,0),le=class extends E.Group{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{let t=new Me;t.radius=.5;let r=new E.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:E.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new E.Mesh(t,r),this.add(this._meshPitch)}{let t=new Me;t.radius=.5;let r=new E.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:E.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new E.Mesh(t,r),this.add(this._meshYaw)}{let t=new Ae;t.radius=.1;let r=new E.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new E.LineSegments(t,r),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(e){let t=E.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();let r=E.MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=r,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(Ee),this.vrmLookAt.getLookAtWorldQuaternion(we),we.multiply(this.vrmLookAt.getFaceFrontQuaternion(tt)),this._meshYaw.position.copy(Ee),this._meshYaw.quaternion.copy(we),this._meshPitch.position.copy(Ee),this._meshPitch.quaternion.copy(we),this._meshPitch.quaternion.multiply(tt.setFromAxisAngle(bt,t)),this._meshPitch.quaternion.multiply(Tt);let{target:o,autoUpdate:i}=this.vrmLookAt;o!=null&&i&&(o.getWorldPosition(rt).sub(Ee),this._lineTarget.geometry.tail.copy(rt),this._lineTarget.geometry.update(),this._lineTarget.position.copy(Ee)),super.updateMatrixWorld(e)}};var y=T(require("three"),1);var Oe=T(require("three"),1),Ht=new Oe.Vector3,Lt=new Oe.Vector3;function ge(a,e){return a.matrixWorld.decompose(Ht,e,Lt),e}function ue(a){return[Math.atan2(-a.z,a.x),Math.atan2(a.y,Math.sqrt(a.x*a.x+a.z*a.z))]}function Se(a){let e=Math.round(a/2/Math.PI);return a-2*Math.PI*e}var nt=new y.Vector3(0,0,1),Pt=new y.Vector3,_t=new y.Vector3,At=new y.Vector3,wt=new y.Quaternion,De=new y.Quaternion,it=new y.Quaternion,vt=new y.Quaternion,Ge=new y.Euler,ve=class ve{constructor(e,t){this.offsetFromHeadBone=new y.Vector3;this.autoUpdate=!0;this.faceFront=new y.Vector3(0,0,1);this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new y.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new y.Euler)}getEuler(e){return e.set(y.MathUtils.DEG2RAD*this._pitch,y.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new ve(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){let t=this.humanoid.getRawBoneNode("head");return ge(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(nt)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,r]=ue(this.faceFront);return Ge.set(0,.5*Math.PI+t,r,"YZX"),e.setFromEuler(Ge).premultiply(vt.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(De),this.getFaceFrontQuaternion(it),e.copy(nt).applyQuaternion(De).applyQuaternion(it).applyEuler(this.getEuler(Ge))}lookAt(e){let t=wt.copy(this._restHeadWorldQuaternion).multiply(Le(this.getLookAtWorldQuaternion(De))),r=this.getLookAtWorldPosition(_t),o=At.copy(e).sub(r).applyQuaternion(t).normalize(),[i,n]=ue(this.faceFront),[u,s]=ue(o),l=Se(u-i),d=Se(n-s);this._yaw=y.MathUtils.RAD2DEG*l,this._pitch=y.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Pt)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};ve.EULER_ORDER="YXZ";var pe=ve;var g=T(require("three"),1);var Bt=new g.Vector3(0,0,1),F=new g.Quaternion,me=new g.Quaternion,_=new g.Euler(0,0,0,"YXZ"),S=class{constructor(e,t,r,o,i){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=r,this.rangeMapVerticalDown=o,this.rangeMapVerticalUp=i,this.faceFront=new g.Vector3(0,0,1),this._restQuatLeftEye=new g.Quaternion,this._restQuatRightEye=new g.Quaternion,this._restLeftEyeParentWorldQuat=new g.Quaternion,this._restRightEyeParentWorldQuat=new g.Quaternion;let n=this.humanoid.getRawBoneNode("leftEye"),u=this.humanoid.getRawBoneNode("rightEye");n&&(this._restQuatLeftEye.copy(n.quaternion),ge(n.parent,this._restLeftEyeParentWorldQuat)),u&&(this._restQuatRightEye.copy(u.quaternion),ge(u.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){let r=this.humanoid.getRawBoneNode("leftEye"),o=this.humanoid.getRawBoneNode("rightEye"),i=this.humanoid.getNormalizedBoneNode("leftEye"),n=this.humanoid.getNormalizedBoneNode("rightEye");r&&(t<0?_.x=-g.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-t):_.x=g.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?_.y=-g.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-e):_.y=g.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(e),F.setFromEuler(_),this._getWorldFaceFrontQuat(me),i.quaternion.copy(me).multiply(F).multiply(me.invert()),F.copy(this._restLeftEyeParentWorldQuat),r.quaternion.copy(i.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatLeftEye)),o&&(t<0?_.x=-g.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-t):_.x=g.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?_.y=-g.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):_.y=g.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(e),F.setFromEuler(_),this._getWorldFaceFrontQuat(me),n.quaternion.copy(me).multiply(F).multiply(me.invert()),F.copy(this._restRightEyeParentWorldQuat),o.quaternion.copy(n.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let t=g.MathUtils.RAD2DEG*e.y,r=g.MathUtils.RAD2DEG*e.x;this.applyYawPitch(t,r)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(Bt)<.01)return e.identity();let[t,r]=ue(this.faceFront);return _.set(0,.5*Math.PI+t,r,"YZX"),e.setFromEuler(_)}};S.type="bone";var Ce=T(require("three"),1),W=class{constructor(e,t,r,o,i){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=r,this.rangeMapVerticalDown=o,this.rangeMapVerticalUp=i}applyYawPitch(e,t){t<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let t=Ce.MathUtils.RAD2DEG*e.y,r=Ce.MathUtils.RAD2DEG*e.x;this.applyYawPitch(t,r)}};W.type="expression";var oe=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*ye(e/this.inputMaxValue)}};var kt=new Set(["1.0","1.0-beta"]),Be=.01,de=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return R(this,null,function*(){let t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");let r=e.userData.vrmExpressionManager;if(r!==null){if(r===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");e.userData.vrmLookAt=yield this._import(e,t,r)}})}_import(e,t,r){return R(this,null,function*(){if(t==null||r==null)return null;let o=yield this._v1Import(e,t,r);if(o)return o;let i=yield this._v0Import(e,t,r);return i||null})}_v1Import(e,t,r){return R(this,null,function*(){var f,V,x;let o=this.parser.json;if(!(((f=o.extensionsUsed)==null?void 0:f.indexOf("VRMC_vrm"))!==-1))return null;let n=(V=o.extensions)==null?void 0:V.VRMC_vrm;if(!n)return null;let u=n.specVersion;if(!kt.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;let s=n.lookAt;if(!s)return null;let l=s.type==="expression"?1:10,d=this._v1ImportRangeMap(s.rangeMapHorizontalInner,l),c=this._v1ImportRangeMap(s.rangeMapHorizontalOuter,l),p=this._v1ImportRangeMap(s.rangeMapVerticalDown,l),m=this._v1ImportRangeMap(s.rangeMapVerticalUp,l),M;s.type==="expression"?M=new W(r,d,c,p,m):M=new S(t,d,c,p,m);let h=this._importLookAt(t,M);return h.offsetFromHeadBone.fromArray((x=s.offsetFromHeadBone)!=null?x:[0,.06,0]),h})}_v1ImportRangeMap(e,t){var i,n;let r=(i=e==null?void 0:e.inputMaxValue)!=null?i:90,o=(n=e==null?void 0:e.outputScale)!=null?n:t;return r(console.error(u),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}};var ce=class{constructor(e){this.scene=e.scene,this.meta=e.meta,this.humanoid=e.humanoid,this.expressionManager=e.expressionManager,this.firstPerson=e.firstPerson,this.lookAt=e.lookAt}update(e){this.humanoid.update(),this.lookAt&&this.lookAt.update(e),this.expressionManager&&this.expressionManager.update()}};var ke=class{get name(){return"VRMC_vrm"}constructor(e,t){var i,n,u,s,l;this.parser=e;let r=t==null?void 0:t.helperRoot,o=t==null?void 0:t.autoUpdateHumanBones;this.expressionPlugin=(i=t==null?void 0:t.expressionPlugin)!=null?i:new ne(e),this.firstPersonPlugin=(n=t==null?void 0:t.firstPersonPlugin)!=null?n:new ie(e),this.humanoidPlugin=(u=t==null?void 0:t.humanoidPlugin)!=null?u:new ae(e,{helperRoot:r,autoUpdateHumanBones:o}),this.lookAtPlugin=(s=t==null?void 0:t.lookAtPlugin)!=null?s:new de(e,{helperRoot:r}),this.metaPlugin=(l=t==null?void 0:t.metaPlugin)!=null?l:new he(e)}afterRoot(e){return R(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e);let t=e.userData.vrmMeta,r=e.userData.vrmHumanoid;if(t&&r){let o=new ce({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:r,lookAt:e.userData.vrmLookAt,meta:t});e.userData.vrmCore=o}})}}; diff --git a/packages/three-vrm-core/lib/three-vrm-core.module.js b/packages/three-vrm-core/lib/three-vrm-core.module.js index 9df36d8b0..02409692c 100644 --- a/packages/three-vrm-core/lib/three-vrm-core.module.js +++ b/packages/three-vrm-core/lib/three-vrm-core.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-core v3.2.0 + * @pixiv/three-vrm-core v3.3.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -56,12 +56,21 @@ var VRMExpression = class extends THREE.Object3D { * Specify how the expression overrides mouth expressions. */ this.overrideMouth = "none"; + /** + * Binds that this expression influences. + */ this._binds = []; this.name = `VRMExpression_${expressionName}`; this.expressionName = expressionName; this.type = "VRMExpression"; this.visible = false; } + /** + * Binds that this expression influences. + */ + get binds() { + return this._binds; + } /** * A value represents how much it should override blink expressions. * `0.0` == no override at all, `1.0` == completely block the expressions. @@ -110,9 +119,25 @@ var VRMExpression = class extends THREE.Object3D { } return this.weight; } + /** + * Add an expression bind to the expression. + * + * @param bind A bind to add + */ addBind(bind) { this._binds.push(bind); } + /** + * Delete an expression bind from the expression. + * + * @param bind A bind to delete + */ + deleteBind(bind) { + const index = this._binds.indexOf(bind); + if (index >= 0) { + this._binds.splice(index, 1); + } + } /** * Apply weight to every assigned blend shapes. * Should be called every frame. @@ -3309,4 +3334,4 @@ export { VRMMetaLoaderPlugin, VRMRequiredHumanBoneName }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb24udHMiLCAiLi4vc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW4udHMiLCAiLi4vc3JjL3V0aWxzL2dsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlLnRzIiwgIi4uL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uUHJlc2V0TmFtZS50cyIsICIuLi9zcmMvdXRpbHMvc2F0dXJhdGUudHMiLCAiLi4vc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25NYW5hZ2VyLnRzIiwgIi4uL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTWF0ZXJpYWxDb2xvclR5cGUudHMiLCAiLi4vc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZC50cyIsICIuLi9zcm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b3JCaW5kKHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgdHlwZTogYmluZC50eXBlLFxuICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShiaW5kLnRhcmdldFZhbHVlKSxcbiAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBiaW5kLnRhcmdldFZhbHVlWzNdLFxuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBzY2hlbWFFeHByZXNzaW9uLnRleHR1cmVUcmFuc2Zvcm1CaW5kcz8uZm9yRWFjaChhc3luYyAoYmluZCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxzID0gZ2x0Zk1hdGVyaWFscy5maWx0ZXIoKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsSW5kZXggPSB0aGlzLnBhcnNlci5hc3NvY2lhdGlvbnMuZ2V0KG1hdGVyaWFsKT8ubWF0ZXJpYWxzO1xuICAgICAgICAgICAgICByZXR1cm4gYmluZC5tYXRlcmlhbCA9PT0gbWF0ZXJpYWxJbmRleDtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBtYXRlcmlhbHMuZm9yRWFjaCgobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uVGV4dHVyZVRyYW5zZm9ybUJpbmQoe1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICBvZmZzZXQ6IG5ldyBUSFJFRS5WZWN0b3IyKCkuZnJvbUFycmF5KGJpbmQub2Zmc2V0ID8/IFswLjAsIDAuMF0pLFxuICAgICAg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ldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGJsZW5kU2hhcGVOYW1lU2V0LmFkZChuYW1lKTtcblxuICAgICAgICBjb25zdCBleHByZXNzaW9uID0gbmV3IFZSTUV4cHJlc3Npb24obmFtZSk7XG4gICAgICAgIGdsdGYuc2NlbmUuYWRkKGV4cHJlc3Npb24pO1xuXG4gICAgICAgIGV4cHJlc3Npb24uaXNCaW5hcnkgPSBzY2hlbWFHcm91cC5pc0JpbmFyeSA/PyBmYWxzZTtcbiAgICAgICAgLy8gdjAgZG9lc24ndCBoYXZlIGlnbm9yZSBwcm9wZXJ0aWVzXG5cbiAgICAgICAgLy8gQmluZCBtb3JwaFRhcmdldFxuICAgICAgICBpZiAoc2NoZW1hR3JvdXAuYmluZHMpIHtcbiAgICAgICAgICBzY2hlbWFHcm91cC5iaW5kcy5mb3JFYWNoKGFzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBpZiAoYmluZC5tZXNoID09PSB1bmRlZmluZWQgfHwgYmluZC5pbmRleCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3Qgbm9kZXNVc2luZ01lc2g6IG51bWJlcltdID0gW107XG4gICAgICAgICAgICBqc29uLm5vZGVzPy5mb3JFYWNoKChub2RlLCBpKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChub2RlLm1lc2ggPT09IGJpbmQubWVzaCkge1xuICAgICAgICAgICAgICAgIG5vZGVzVXNpbmdNZXNoLnB1c2goaSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjb25zdCBtb3JwaFRhcmdldEluZGV4ID0gYmluZC5pbmRleDtcblxuICAgICAgICAgICAgYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICAgICAgICAgIG5vZGVzVXNpbmdNZXNoLm1hcChhc3luYyAobm9kZUluZGV4KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgcHJpbWl0aXZlcyA9IChhd2FpdCBnbHRmRXh0cmFjdFByaW1pdGl2ZXNGcm9tTm9kZShnbHRmLCBub2RlSW5kZXgpKSE7XG5cbiAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiB0aGUgbWVzaCBoYXMgdGhlIHRhcmdldCBtb3JwaCB0YXJnZXRcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAhcHJpbWl0aXZlcy5ldmVyeShcbiAgICAgICAgICAgICAgICAgICAgKHByaW1pdGl2ZSkgPT5cbiAgICAgICAgICAgICAgICAgICAgICBBcnJheS5pc0FycmF5KHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMpICYmXG4gICAgICAgICAgICAgICAgICAgICAgbW9ycGhUYXJnZXRJbmRleCA8IHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAgICAgICBgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogJHtzY2hlbWFHcm91cC5uYW1lfSBhdHRlbXB0cyB0byBpbmRleCAke21vcnBoVGFyZ2V0SW5kZXh9dGggbW9ycGggYnV0IG5vdCBmb3VuZC5gLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1vcnBoVGFyZ2V0QmluZCh7XG4gICAgICAgICAgICAgICAgICAgIHByaW1pdGl2ZXMsXG4gICAgICAgICAgICAgICAgICAgIGluZGV4OiBtb3JwaFRhcmdldEluZGV4LFxuICAgICAgICAgICAgICAgICAgICB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5maWx0ZXIoXG4gICAgICAgICAgICAgICAgICAgICAgKG10bCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgIChtdGwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUhIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgIG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgKyAnIChPdXRsaW5lKScpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbHMuaW5kZXhPZihtdGwpID09PSAtMSxcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXRlcmlhbC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSAmJiBtYXRlcmlhbHMuaW5kZXhPZihtYXRlcmlhbCkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbHMucHVzaChtYXRlcmlhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxQcm9wZXJ0eU5hbWUgPSBtYXRlcmlhbFZhbHVlLnByb3BlcnR5TmFtZTtcbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICAvLyBUZXh0dXJlVHJhbnNmb3JtQmluZFxuICAgICAgICAgICAgICBpZiAobWF0ZXJpYWxQcm9wZXJ0eU5hbWUgPT09ICdfTWFpblRleF9TVCcpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBzY2FsZSA9IG5ldyBUSFJFRS5WZWN0b3IyKG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzBdLCBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVsxXSk7XG4gICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2V0ID0gbmV3IFRIUkVFLlZlY3RvcjIobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMl0sIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzNdKTtcblxuICAgICAgICAgICAgICAgIG9mZnNldC55ID0gMS4wIC0gb2Zmc2V0LnkgLSBzY2FsZS55O1xuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICBzY2FsZSxcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vIE1hdGVyaWFsQ29sb3JCaW5kXG4gICAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsQ29sb3JUeXBlID0gdjBFeHByZXNzaW9uTWF0ZXJpYWxDb2xvck1hcFttYXRlcmlhbFByb3BlcnR5TmFtZV07XG4gICAgICAgICAgICAgIGlmIChtYXRlcmlhbENvbG9yVHlwZSkge1xuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTWF0ZXJpYWxDb2xvckJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogbWF0ZXJpYWxDb2xvclR5cGUsXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldFZhbHVlOiBuZXcgVEhSRUUuQ29sb3IoKS5mcm9tQXJyYXkobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1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VtYUh1bWFuQm9uZS5ub2RlO1xuXG4gICAgICAgICAgLy8gY29tcGF0OiAxLjAtYmV0YSBwcmV2aW91cyB0aHVtYiBib25lIG5hbWVzXG4gICAgICAgICAgaWYgKGV4aXN0c1ByZXZpb3VzVGh1bWJOYW1lKSB7XG4gICAgICAgICAgICBjb25zdCB0aHVtYkJvbmVOYW1lID0gdGh1bWJCb25lTmFtZU1hcFtib25lTmFtZV07XG4gICAgICAgICAgICBpZiAodGh1bWJCb25lTmFtZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgIGJvbmVOYW1lID0gdGh1bWJCb25lTmFtZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb25zdCBub2RlID0gYXdhaXQgdGhpcy5wYXJzZXIuZ2V0RGVwZW5kZW5jeSgnbm9kZScsIGluZGV4KTtcblxuICAgICAgICAgIC8vIGlmIHRoZSBzcGVjaWZpZWQgbm9kZSBkb2VzIG5vdCBleGlzdCwgZW1pdCBhIHdhcm5pbmdcbiAgICAgICAgICBpZiAobm9kZSA9PSBudWxsKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oYEEgZ2xURiBub2RlIGJvdW5kIHRvIHRoZSBodW1hbm9pZCBib25lICR7Ym9uZU5hbWV9IChpbmRleCA9ICR7aW5kZXh9KSBkb2VzIG5vdCBleGlzdGApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIHNldCB0byB0aGUgYGh1bWFuQm9uZXNgXG4gICAgICAgICAgaHVtYW5Cb25lc1tib25lTmFtZV0gPSB7IG5vZGUgfTtcbiAgICAgICAgfSksXG4gICAgICApO1xuICAgIH1cblxuICAgIGNvbnN0IGh1bWFub2lkID0gbmV3IFZSTUh1bWFub2lkKHRoaXMuX2Vuc3VyZVJlcXVpcmVkQm9uZXNFeGlzdChodW1hbkJvbmVzKSwge1xuICAgICAgYXV0b1VwZGF0ZUh1bWFuQm9uZXM6I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nZXRJbmRleCA9IGJpbmQuaW5kZXg7XG5cbiAgICAgICAgICAvLyBjaGVjayBpZiB0aGUgbWVzaCBoYXMgdGhlIHRhcmdldCBtb3JwaCB0YXJnZXRcbiAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAhcHJpbWl0aXZlcy5ldmVyeShcbiAgICAgICAgICAgICAgKHByaW1pdGl2ZSkgPT5cbiAgICAgICAgICAgICAgICBBcnJheS5pc0FycmF5KHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMpICYmXG4gICAgICAgICAgICAgICAgbW9ycGhUYXJnZXRJbmRleCA8IHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMubGVuZ3RoLFxuICAgICAgICAgICAgKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICBgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogJHtzY2hlbWFFeHByZXNzaW9uLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4IG1vcnBoICMke21vcnBoVGFyZ2V0SW5kZXh9IGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgd2VpZ2h0OiBiaW5kLndlaWdodCA/PyAxLjAsXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICApO1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAoc2NoZW1hRXhwcmVzc2lvbi5tYXRlcmlhbENvbG9yQmluZHMgfHwgc2NoZW1hRXhwcmVzc2lvbi50ZXh0dXJlVH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IG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIHR5cGU6IGJpbmQudHlwZSxcbiAgICAgICAgICAgICAgICAgIHRhcmdldFZhbHVlOiBuZXcgVEhSRUUuQ29sb3IoKS5mcm9tQXJyYXkoYmluZC50YXJnZXRWYWx1ZSksXG4gICAgICAgICAgICAgICAgICB0YXJnZXRBbHBoYTogYmluZC50YXJnZXRWYWx1ZVszXSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgc2NoZW1hRXhwcmVzc2lvbi50ZXh0dXJlVHJhbnNmb3JtQmluZHM/LmZvckVhY2goYXN5bmMgKGJpbmQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFscyA9IGdsdGZNYXRlcmlhbHMuZmlsdGVyKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbEluZGV4ID0gdGhpcy5wYXJzZXIuYXNzb2NpYXRpb25zLmdldChtYXRlcmlhbCk/Lm1hdGVyaWFscztcbiAgICAgICAgICAgICAgcmV0dXJuIGJpbmQubWF0ZXJpYWwgPT09IG1hdGVyaWFsSW5kZXg7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAg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uIGV4cHJlc3Npb24gcHJlc2V0ICR7djBQcmVzZXROYW1lfSBoYXMgZHVwbGljYXRlZCBlbnRyaWVzLiBJZ25vcmluZyB0aGUgZXhwcmVzc2lvbmAsXG4gICAgICAgICAgKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBibGVuZFNoYXBlTmFtZVNldC5hZGQobmFtZSk7XG5cbiAgICAgICAgY29uc3QgZXhwcmVzc2lvbiA9IG5ldyBWUk1FeHByZXNzaW9uKG5hbWUpO1xuICAgICAgICBnbHRmLnNjZW5lLmFkZChleHByZXNzaW9uKTtcblxuICAgICAgICBleHByZXNzaW9uLmlzQmluYXJ5ID0gc2NoZW1hR3JvdXAuaXNCaW5hcnkgPz8gZmFsc2U7XG4gICAgICAgIC8vIHYwIGRvZXNuJ3QgaGF2ZSBpZ25vcmUgcHJvcGVydGllc1xuXG4gICAgICAgIC8vIEJpbmQgbW9ycGhUYXJnZXRcbiAgICAgICAgaWYgKHNjaGVtYUdyb3VwLmJpbmRzKSB7XG4gICAgICAgICAgc2NoZW1hR3JvdXAuYmluZHMuZm9yRWFjaChhc3luYyAoYmluZCkgPT4ge1xuICAgICAgICAgICAgaWYgKGJpbmQubWVzaCA9PT0gdW5kZWZpbmVkIHx8IGJpbmQuaW5kZXggPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IG5vZGVzVXNpbmdNZXNoOiBudW1iZXJbXSA9IFtdO1xuICAgICAgICAgICAganNvbi5ub2Rlcz8uZm9yRWFjaCgobm9kZSwgaSkgPT4ge1xuICAgICAgICAgICAgICBpZiAobm9kZS5tZXNoID09PSBiaW5kLm1lc2gpIHtcbiAgICAgICAgICAgICAgICBub2Rlc1VzaW5nTWVzaC5wdXNoKGkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY29uc3QgbW9ycGhUYXJnZXRJbmRleCA9IGJpbmQuaW5kZXg7XG5cbiAgICAgICAgICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAgICAgICAgICBub2Rlc1VzaW5nTWVzaC5tYXAoYXN5bmMgKG5vZGVJbmRleCkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IHByaW1pdGl2ZXMgPSAoYXdhaXQgZ2x0ZkV4dHJhY3RQcmltaXRpdmVzRnJvbU5vZGUoZ2x0Ziwgbm9kZUluZGV4KSkhO1xuXG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIG1lc2ggaGFzIHRoZSB0YXJnZXQgbW9ycGggdGFyZ2V0XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgIXByaW1pdGl2ZXMuZXZlcnkoXG4gICAgICAgICAgICAgICAgICAgIChwcmltaXRpdmUpID0+XG4gICAgICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzKSAmJlxuICAgICAgICAgICAgICAgICAgICAgIG1vcnBoVGFyZ2V0SW5kZXggPCBwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46ICR7c2NoZW1hR3JvdXAubmFtZX0gYXR0ZW1wdHMgdG8gaW5kZXggJHttb3JwaFRhcmdldEluZGV4fXRoIG1vcnBoIGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgICAgICAgd2VpZ2h0OiAwLjAxICogKGJpbmQud2VpZ2h0ID8/IDEwMCksIC8vIG5hcnJvd2luZyB0aGUgcmFuZ2UgZnJvbSBbIDAuMCAtIDEwMC4wIF0gdG8gWyAwLjAgLSAxLjAgXVxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmluZCBNYXRlcmlhbENvbG9yIGFuZCBUZXh0dXJlVHJhbnNmb3JtXG4gICAgICAgIGNvbnN0IG1hdGVyaWFsVmFsdWVzID0gc2NoZW1hR3JvdXAubWF0ZXJpYWxWYWx1ZXM7XG4gICAgICAgIGlmIChtYXRlcmlhbFZhbHVlcyAmJiBtYXRlcmlhbFZhbHVlcy5sZW5ndGggIT09IDApIHtcbiAgICAgICAgICBtYXRlcmlhbFZhbHVlcy5mb3JFYWNoKChtYXRlcmlhbFZhbHVlKSA9PiB7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgIG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAgICAgbWF0ZXJpYWxWYWx1ZS5wcm9wZXJ0eU5hbWUgPT09IHVuZGVmaW5lZCB8fFxuICAgICAgICAgICAgICBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlID09PSB1bmRlZmluZWRcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogXHUzMEE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GFueSkubWF0ZXJpYWw7XG4gICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobWF0ZXJpYWwpKSB7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgLi4ubWF0ZXJpYWwuZmlsdGVyKFxuICAgICAgICAgICAgICAgICAgICAgIChtdGwpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAobXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICBtdGwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUhICsgJyAoT3V0bGluZSknKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLmluZGV4T2YobXRsKSA9PT0gLTEsXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0ZXJpYWwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUgJiYgbWF0ZXJpYWxzLmluZGV4T2YobWF0ZXJpYWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLnB1c2gobWF0ZXJpYWwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsUHJvcGVydHlOYW1lID0gbWF0ZXJpYWxWYWx1ZS5wcm9wZXJ0eU5hbWU7XG4gICAgICAgICAgICBtYXRlcmlhbHMuZm9yRWFjaCgobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgLy8gVGV4dHVyZVRyYW5zZm9ybUJpbmRcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsUHJvcGVydHlOYW1lID09PSAnX01haW5UZXhfU1QnKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qgc2NhbGUgPSBuZXcgVEhSRUUuVmVjdG9yMihtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVswXSwgbWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMV0pO1xuICAgICAgICAgICAgICAgIGNvbnN0IG9mZnNldCA9IG5ldyBUSFJFRS5WZWN0b3IyKG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzJdLCBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSk7XG5cbiAgICAgICAgICAgICAgICBvZmZzZXQueSA9IDEuMCAtIG9mZnNldC55IC0gc2NhbGUueTtcblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uVGV4dHVyZVRyYW5zZm9ybUJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBNYXRlcmlhbENvbG9yQmluZFxuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbENvbG9yVHlwZSA9IHYwRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JNYXBbbWF0ZXJpYWxQcm9wZXJ0eU5hbWVdO1xuICAgICAgICAgICAgICBpZiAobWF0ZXJpYWxDb2xvclR5cGUpIHtcbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICA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MFsyXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncwWzNdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4wWzNdKSkgY29udGludWU7XG5cbiAgICAgICAgY29uc3QgYncxID0gYndzW2JdO1xuICAgICAgICBjb25zdCBza2luMSA9IHNraW5JbmRleFtiXTtcbiAgICAgICAgaWYgKGJ3MVswXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMVswXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncxWzFdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4xWzFdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzFbMl0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjFbMl0pKSBjb250aW51ZTtcbiAgICAgICAgaWYgKGJ3MVszXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMVszXSkpIGNvbnRpbnVlO1xuXG4gICAgICAgIGNvbnN0IGJ3MiA9IGJ3c1tjXTtcbiAgICAgICAgY29uc3Qgc2tpbjIgPSBza2luSW5kZXhbY107XG4gICAgICAgIGlmIChidzJbMF0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjJbMF0pKSBjb250aW51ZTtcbiAgICAgICAgaWYgKGJ3MlsxXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMlsxXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncyWzJdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4yWzJdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzJbM10gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjJbM10pKSBjb250aW51ZTtcblxuICAgICAgICB0cmlhbmdsZXNbY291bnQrK10gPSBhO1xuICAgICAgICB0cmlhbmdsZXNbY291bnQrK10gPSBiO1xuICAgICAgICB0cmlhbmdsZXNbY291bnQrK10gPSBjO1xuICAgICAg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gPSBib25lTmFtZVN0cmluZyBhcyBWMVZSTVNjaGVtYS5IdW1hbm9pZEh1bWFuQm9uZU5hbWU7XG4gICAgICAgICAgY29uc3QgaW5kZXggPSBzY2hlbWFIdW1hbkJvbmUubm9kZTtcblxuICAgICAgICAgIC8vIGNvbXBhdDogMS4wLWJldGEgcHJldmlvdXMgdGh1bWIgYm9uZSBuYW1lc1xuICAgICAgICAgIGlmIChleGlzdHNQcmV2aW91c1RodW1iTmFtZSkge1xuICAgICAgICAgICAgY29uc3QgdGh1bWJCb25lTmFtZSA9IHRodW1iQm9uZU5hbWVNYXBbYm9uZU5hbWVdO1xuICAgICAgICAgICAgaWYgKHRodW1iQm9uZU5hbWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICBib25lTmFtZSA9IHRodW1iQm9uZU5hbWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29uc3Qgbm9kZSA9IGF3YWl0IHRoaXMucGFyc2VyLmdldERlcGVuZGVuY3koJ25vZGUnLCBpbmRleCk7XG5cbiAgICAgICAgICAvLyBpZiB0aGUgc3BlY2lmaWVkIG5vZGUgZG9lcyBub3QgZXhpc3QsIGVtaXQgYSB3YXJuaW5nXG4gICAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKGBBIGdsVEYgbm9kZSBib3VuZCB0byB0aGUgaHVtYW5vaWQgYm9uZSAke2JvbmVOYW1lfSAoaW5kZXggPSAke2luZGV4fSkgZG9lcyBub3QgZXhpc3RgKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyBzZXQgdG8gdGhlIGBodW1hbkJvbmVzYFxuICAgICAgICAgIGh1bWFuQm9uZXNbYm9uZU5hbWVdID0geyBub2RlIH07XG4gICAgICAgIH0pLFxuICAgICAgKTtcbiAgICB9XG5cbiAgICBjb25zdCBodW1hbm9pZCA9IG5ldyBWUk1IdW1h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RIUkVFIiwgIl9xdWF0QSIsICJfdjNBIiwgIl92M0IiLCAiVEhSRUUiLCAiVEhSRUUiLCAiX3YzQSIsICJfdjNCIiwgIl9xdWF0QSIsICJfcXVhdEIiLCAiVEhSRUUiLCAiVkVDM19QT1NJVElWRV9aIiwgIl9xdWF0QSIsICJfcXVhdEIiLCAiX2V1bGVyQSIsICJUSFJFRSIsICJQT1NTSUJMRV9TUEVDX1ZFUlNJT05TIiwgIlRIUkVFIiwgIlBPU1NJQkxFX1NQRUNfVkVSU0lPTlMiXQp9Cg== diff --git a/packages/three-vrm-core/lib/three-vrm-core.module.min.js b/packages/three-vrm-core/lib/three-vrm-core.module.min.js index 0c0e73785..0ace7cff9 100644 --- a/packages/three-vrm-core/lib/three-vrm-core.module.min.js +++ b/packages/three-vrm-core/lib/three-vrm-core.module.min.js @@ -1,2 +1,2 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -var R=(u,e,t)=>new Promise((r,o)=>{var i=s=>{try{l(t.next(s))}catch(a){o(a)}},n=s=>{try{l(t.throw(s))}catch(a){o(a)}},l=s=>s.done?r(s.value):Promise.resolve(s.value).then(i,n);l((t=t.apply(u,e)).next())});import*as Ge from"three";var z=class extends Ge.Object3D{constructor(t){super();this.weight=0;this.isBinary=!1;this.overrideBlink="none";this.overrideLookAt="none";this.overrideMouth="none";this._binds=[];this.name=`VRMExpression_${t}`,this.expressionName=t,this.type="VRMExpression",this.visible=!1}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(t){this._binds.push(t)}applyWeight(t){var o;let r=this.outputWeight;r*=(o=t==null?void 0:t.multiplier)!=null?o:1,this.isBinary&&r<1&&(r=0),this._binds.forEach(i=>i.applyWeight(r))}clearAppliedWeight(){this._binds.forEach(t=>t.clearAppliedWeight())}};import*as S from"three";function Ce(u,e,t){var a,d;let r=u.parser.json,o=(a=r.nodes)==null?void 0:a[e];if(o==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let i=o.mesh;if(i==null)return null;let n=(d=r.meshes)==null?void 0:d[i];if(n==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${i}] of glTF but the mesh doesn't exist`),null;let l=n.primitives.length,s=[];return t.traverse(c=>{s.length{let i=Ce(u,o,r);i!=null&&t.set(o,i)}),t})}var q={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function ge(u){return Math.max(Math.min(u,1),0)}var Y=class u{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"];this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"];this.mouthExpressionNames=["aa","ee","ih","oh","ou"];this._expressions=[];this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},t=new Set(Object.values(q));return Object.entries(this._expressionMap).forEach(([r,o])=>{t.has(r)&&(e[r]=o)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(q));return Object.entries(this._expressionMap).forEach(([r,o])=>{t.has(r)||(e[r]=o)}),e}copy(e){return this._expressions.concat().forEach(r=>{this.unregisterExpression(r)}),e._expressions.forEach(r=>{this.registerExpression(r)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new u().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var r;let t=this.getExpression(e);return(r=t==null?void 0:t.weight)!=null?r:null}setValue(e,t){let r=this.getExpression(e);r&&(r.weight=ge(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let r=1,o=t.expressionName;this.blinkExpressionNames.indexOf(o)!==-1&&(r*=e.blink),this.lookAtExpressionNames.indexOf(o)!==-1&&(r*=e.lookAt),this.mouthExpressionNames.indexOf(o)!==-1&&(r*=e.mouth),t.applyWeight({multiplier:r})})}_calculateWeightMultipliers(){let e=1,t=1,r=1;return this._expressions.forEach(o=>{e-=o.overrideBlinkAmount,t-=o.overrideLookAtAmount,r-=o.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),r=Math.max(0,r),{blink:e,lookAt:t,mouth:r}}};var $={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},We={_Color:$.Color,_EmissionColor:$.EmissionColor,_ShadeColor:$.ShadeColor,_RimColor:$.RimColor,_OutlineColor:$.OutlineColor};import*as ve from"three";var rt=new ve.Color,Ve=class Ve{constructor({material:e,type:t,targetValue:r,targetAlpha:o}){this.material=e,this.type=t,this.targetValue=r,this.targetAlpha=o!=null?o:1;let i=this._initColorBindState(),n=this._initAlphaBindState();this._state={color:i,alpha:n}}applyWeight(e){let{color:t,alpha:r}=this._state;if(t!=null){let{propertyName:o,deltaValue:i}=t,n=this.material[o];n!=null&&n.add(rt.copy(i).multiplyScalar(e))}if(r!=null){let{propertyName:o,deltaValue:i}=r;this.material[o]!=null&&(this.material[o]+=i*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:r,initialValue:o}=e,i=this.material[r];i!=null&&i.copy(o)}if(t!=null){let{propertyName:r,initialValue:o}=t;this.material[r]!=null&&(this.material[r]=o)}}_initColorBindState(){var a,d,c;let{material:e,type:t,targetValue:r}=this,o=this._getPropertyNameMap(),i=(d=(a=o==null?void 0:o[t])==null?void 0:a[0])!=null?d:null;if(i==null)return console.warn(`Tried to add a material color bind to the material ${(c=e.name)!=null?c:"(no name)"}, the type ${t} but the material or the type is not supported.`),null;let l=e[i].clone(),s=new ve.Color(r.r-l.r,r.g-l.g,r.b-l.b);return{propertyName:i,initialValue:l,deltaValue:s}}_initAlphaBindState(){var s,a,d;let{material:e,type:t,targetAlpha:r}=this,o=this._getPropertyNameMap(),i=(a=(s=o==null?void 0:o[t])==null?void 0:s[1])!=null?a:null;if(i==null&&r!==1)return console.warn(`Tried to add a material alpha bind to the material ${(d=e.name)!=null?d:"(no name)"}, the type ${t} but the material or the type does not support alpha.`),null;if(i==null)return null;let n=e[i],l=r-n;return{propertyName:i,initialValue:n,deltaValue:l}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(Ve._propertyNameMapMap).find(([r])=>this.material[r]===!0))==null?void 0:e[1])!=null?t:null}};Ve._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var X=Ve;var Z=class{constructor({primitives:e,index:t,weight:r}){this.primitives=e,this.index=t,this.weight=r}applyWeight(e){this.primitives.forEach(t=>{var r;((r=t.morphTargetInfluences)==null?void 0:r[this.index])!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]=0)})}};import*as Qe from"three";var je=new Qe.Vector2,ye=class ye{constructor({material:e,scale:t,offset:r}){var i,n;this.material=e,this.scale=t,this.offset=r;let o=(i=Object.entries(ye._propertyNamesMap).find(([l])=>e[l]===!0))==null?void 0:i[1];o==null?(console.warn(`Tried to add a texture transform bind to the material ${(n=e.name)!=null?n:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],o.forEach(l=>{var m;let s=(m=e[l])==null?void 0:m.clone();if(!s)return null;e[l]=s;let a=s.offset.clone(),d=s.repeat.clone(),c=r.clone().sub(a),p=t.clone().sub(d);this._properties.push({name:l,initialOffset:a,deltaOffset:c,initialScale:d,deltaScale:p})}))}applyWeight(e){this._properties.forEach(t=>{let r=this.material[t.name];r!==void 0&&(r.offset.add(je.copy(t.deltaOffset).multiplyScalar(e)),r.repeat.add(je.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};ye._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var J=ye;var ot=new Set(["1.0","1.0-beta"]),xe=class xe{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return R(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let r=yield this._v0Import(e);return r||null})}_v1Import(e){return R(this,null,function*(){var d,c;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(!o)return null;let i=o.specVersion;if(!ot.has(i))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.expressions;if(!n)return null;let l=new Set(Object.values(q)),s=new Map;n.preset!=null&&Object.entries(n.preset).forEach(([p,m])=>{if(m!=null){if(!l.has(p)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${p}" detected. Ignoring the expression`);return}s.set(p,m)}}),n.custom!=null&&Object.entries(n.custom).forEach(([p,m])=>{if(l.has(p)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${p}". Ignoring the expression`);return}s.set(p,m)});let a=new Y;return yield Promise.all(Array.from(s.entries()).map(M=>R(this,[M],function*([p,m]){var f,V,x,_,T,b,F;let h=new z(p);if(e.scene.add(h),h.isBinary=(f=m.isBinary)!=null?f:!1,h.overrideBlink=(V=m.overrideBlink)!=null?V:"none",h.overrideLookAt=(x=m.overrideLookAt)!=null?x:"none",h.overrideMouth=(_=m.overrideMouth)!=null?_:"none",(T=m.morphTargetBinds)==null||T.forEach(H=>R(this,null,function*(){var B;if(H.node===void 0||H.index===void 0)return;let L=yield Ae(e,H.node),v=H.index;if(!L.every(I=>Array.isArray(I.morphTargetInfluences)&&v{let v=L.material;v&&(Array.isArray(v)?H.push(...v):H.push(v))}),(b=m.materialColorBinds)==null||b.forEach(L=>R(this,null,function*(){H.filter(B=>{var O;let I=(O=this.parser.associations.get(B))==null?void 0:O.materials;return L.material===I}).forEach(B=>{h.addBind(new X({material:B,type:L.type,targetValue:new S.Color().fromArray(L.targetValue),targetAlpha:L.targetValue[3]}))})})),(F=m.textureTransformBinds)==null||F.forEach(L=>R(this,null,function*(){H.filter(B=>{var O;let I=(O=this.parser.associations.get(B))==null?void 0:O.materials;return L.material===I}).forEach(B=>{var I,O;h.addBind(new J({material:B,offset:new S.Vector2().fromArray((I=L.offset)!=null?I:[0,0]),scale:new S.Vector2().fromArray((O=L.scale)!=null?O:[1,1])}))})}))}a.registerExpression(h)}))),a})}_v0Import(e){return R(this,null,function*(){var s;let t=this.parser.json,r=(s=t.extensions)==null?void 0:s.VRM;if(!r)return null;let o=r.blendShapeMaster;if(!o)return null;let i=new Y,n=o.blendShapeGroups;if(!n)return i;let l=new Set;return yield Promise.all(n.map(a=>R(this,null,function*(){var h;let d=a.presetName,c=d!=null&&xe.v0v1PresetNameMap[d]||null,p=c!=null?c:a.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(l.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}l.add(p);let m=new z(p);e.scene.add(m),m.isBinary=(h=a.isBinary)!=null?h:!1,a.binds&&a.binds.forEach(f=>R(this,null,function*(){var _;if(f.mesh===void 0||f.index===void 0)return;let V=[];(_=t.nodes)==null||_.forEach((T,b)=>{T.mesh===f.mesh&&V.push(b)});let x=f.index;yield Promise.all(V.map(T=>R(this,null,function*(){var F;let b=yield Ae(e,T);if(!b.every(H=>Array.isArray(H.morphTargetInfluences)&&x{if(f.materialName===void 0||f.propertyName===void 0||f.targetValue===void 0)return;let V=[];e.scene.traverse(_=>{if(_.material){let T=_.material;Array.isArray(T)?V.push(...T.filter(b=>(b.name===f.materialName||b.name===f.materialName+" (Outline)")&&V.indexOf(b)===-1)):T.name===f.materialName&&V.indexOf(T)===-1&&V.push(T)}});let x=f.propertyName;V.forEach(_=>{if(x==="_MainTex_ST"){let b=new S.Vector2(f.targetValue[0],f.targetValue[1]),F=new S.Vector2(f.targetValue[2],f.targetValue[3]);F.y=1-F.y-b.y,m.addBind(new J({material:_,scale:b,offset:F}));return}let T=We[x];if(T){m.addBind(new X({material:_,type:T,targetValue:new S.Color().fromArray(f.targetValue),targetAlpha:f.targetValue[3]}));return}console.warn(x+" is not supported")})}),i.registerExpression(m)}))),i})}};xe.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var ie=xe;var nt={None:"none",Block:"block",Blend:"blend"};import*as A from"three";var N=class N{constructor(e,t){this._firstPersonOnlyLayer=N.DEFAULT_FIRSTPERSON_ONLY_LAYER;this._thirdPersonOnlyLayer=N.DEFAULT_THIRDPERSON_ONLY_LAYER;this._initializedLayers=!1;this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new N(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=N.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=N.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(r=>{r.meshes.forEach(o=>{r.type==="firstPersonOnly"?(o.layers.set(this._firstPersonOnlyLayer),o.traverse(i=>i.layers.set(this._firstPersonOnlyLayer))):r.type==="thirdPersonOnly"?(o.layers.set(this._thirdPersonOnlyLayer),o.traverse(i=>i.layers.set(this._thirdPersonOnlyLayer))):r.type==="auto"&&this._createHeadlessModel(o)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,r,o){let i=0;if(t!=null&&t.length>0)for(let n=0;n0&&o.includes(c[0])||d[1]>0&&o.includes(c[1])||d[2]>0&&o.includes(c[2])||d[3]>0&&o.includes(c[3]))continue;let p=t[s],m=r[s];if(p[0]>0&&o.includes(m[0])||p[1]>0&&o.includes(m[1])||p[2]>0&&o.includes(m[2])||p[3]>0&&o.includes(m[3]))continue;let M=t[a],h=r[a];M[0]>0&&o.includes(h[0])||M[1]>0&&o.includes(h[1])||M[2]>0&&o.includes(h[2])||M[3]>0&&o.includes(h[3])||(e[i++]=l,e[i++]=s,e[i++]=a)}return i}_createErasedMesh(e,t){let r=new A.SkinnedMesh(e.geometry.clone(),e.material);r.name=`${e.name}(erase)`,r.frustumCulled=e.frustumCulled,r.layers.set(this._firstPersonOnlyLayer);let o=r.geometry,i=o.getAttribute("skinIndex"),n=i instanceof A.GLBufferAttribute?[]:i.array,l=[];for(let h=0;h{this._isEraseTarget(i)&&r.push(n)}),!r.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let o=this._createErasedMesh(t,r);e.add(o)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{let t=new A.Group;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(r=>r.type==="SkinnedMesh").forEach(r=>{let o=r;this._createHeadlessModelForSkinnedMesh(t,o)})}else if(e.type==="SkinnedMesh"){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};N.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,N.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var K=N;var it=new Set(["1.0","1.0-beta"]),se=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return R(this,null,function*(){let t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return R(this,null,function*(){if(t==null)return null;let r=yield this._v1Import(e,t);if(r)return r;let o=yield this._v0Import(e,t);return o||null})}_v1Import(e,t){return R(this,null,function*(){var d,c;let r=this.parser.json;if(!(((d=r.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let i=(c=r.extensions)==null?void 0:c.VRMC_vrm;if(!i)return null;let n=i.specVersion;if(!it.has(n))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${n}"`),null;let l=i.firstPerson,s=[],a=yield we(e);return Array.from(a.entries()).forEach(([p,m])=>{var h,f;let M=(h=l==null?void 0:l.meshAnnotations)==null?void 0:h.find(V=>V.node===p);s.push({meshes:m,type:(f=M==null?void 0:M.type)!=null?f:"auto"})}),new K(t,s)})}_v0Import(e,t){return R(this,null,function*(){var s;let r=this.parser.json,o=(s=r.extensions)==null?void 0:s.VRM;if(!o)return null;let i=o.firstPerson;if(!i)return null;let n=[],l=yield we(e);return Array.from(l.entries()).forEach(([a,d])=>{let c=r.nodes[a],p=i.meshAnnotations?i.meshAnnotations.find(m=>m.mesh===c.mesh):void 0;n.push({meshes:d,type:this._convertV0FlagToV1Type(p==null?void 0:p.firstPersonFlag)})}),new K(t,n)})}_convertV0FlagToV1Type(e){return e==="FirstPersonOnly"?"firstPersonOnly":e==="ThirdPersonOnly"?"thirdPersonOnly":e==="Both"?"both":"auto"}};var st={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"};import*as U from"three";var ze=new U.Vector3,qe=new U.Vector3,at=new U.Quaternion,ee=class extends U.Group{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(t=>{let r=new U.AxesHelper(1);r.matrixAutoUpdate=!1,r.material.depthTest=!1,r.material.depthWrite=!1,this.add(r),this._boneAxesMap.set(t,r)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([t,r])=>{t.node.updateWorldMatrix(!0,!1),t.node.matrixWorld.decompose(ze,at,qe);let o=ze.set(.1,.1,.1).divide(qe);r.matrix.copy(t.node.matrixWorld).scale(o)}),super.updateMatrixWorld(e)}};var ae=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"];var lt={Hips:"hips",Spine:"spine",Chest:"chest",UpperChest:"upperChest",Neck:"neck",Head:"head",LeftEye:"leftEye",RightEye:"rightEye",Jaw:"jaw",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",LeftToes:"leftToes",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",RightToes:"rightToes",LeftShoulder:"leftShoulder",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightShoulder:"rightShoulder",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand",LeftThumbMetacarpal:"leftThumbMetacarpal",LeftThumbProximal:"leftThumbProximal",LeftThumbDistal:"leftThumbDistal",LeftIndexProximal:"leftIndexProximal",LeftIndexIntermediate:"leftIndexIntermediate",LeftIndexDistal:"leftIndexDistal",LeftMiddleProximal:"leftMiddleProximal",LeftMiddleIntermediate:"leftMiddleIntermediate",LeftMiddleDistal:"leftMiddleDistal",LeftRingProximal:"leftRingProximal",LeftRingIntermediate:"leftRingIntermediate",LeftRingDistal:"leftRingDistal",LeftLittleProximal:"leftLittleProximal",LeftLittleIntermediate:"leftLittleIntermediate",LeftLittleDistal:"leftLittleDistal",RightThumbMetacarpal:"rightThumbMetacarpal",RightThumbProximal:"rightThumbProximal",RightThumbDistal:"rightThumbDistal",RightIndexProximal:"rightIndexProximal",RightIndexIntermediate:"rightIndexIntermediate",RightIndexDistal:"rightIndexDistal",RightMiddleProximal:"rightMiddleProximal",RightMiddleIntermediate:"rightMiddleIntermediate",RightMiddleDistal:"rightMiddleDistal",RightRingProximal:"rightRingProximal",RightRingIntermediate:"rightRingIntermediate",RightRingDistal:"rightRingDistal",RightLittleProximal:"rightLittleProximal",RightLittleIntermediate:"rightLittleIntermediate",RightLittleDistal:"rightLittleDistal"};var Be={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};import*as be from"three";function Te(u){return u.invert?u.invert():u.inverse(),u}var C=new be.Vector3,W=new be.Quaternion,j=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let r=t,o=this.getBoneNode(r);o&&(C.copy(o.position),W.copy(o.quaternion),e[r]={position:C.toArray(),rotation:W.toArray()})}),e}getPose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let r=t,o=this.getBoneNode(r);if(!o)return;C.set(0,0,0),W.identity();let i=this.restPose[r];i!=null&&i.position&&C.fromArray(i.position).negate(),i!=null&&i.rotation&&Te(W.fromArray(i.rotation)),C.add(o.position),W.premultiply(o.quaternion),e[r]={position:C.toArray(),rotation:W.toArray()}}),e}setPose(e){Object.entries(e).forEach(([t,r])=>{let o=t,i=this.getBoneNode(o);if(!i)return;let n=this.restPose[o];n&&(r!=null&&r.position&&(i.position.fromArray(r.position),n.position&&i.position.add(C.fromArray(n.position))),r!=null&&r.rotation&&(i.quaternion.fromArray(r.rotation),n.rotation&&i.quaternion.multiply(W.fromArray(n.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{let r=this.getBoneNode(e);r&&(t!=null&&t.position&&r.position.fromArray(t.position),t!=null&&t.rotation&&r.quaternion.fromArray(t.rotation))})}getBone(e){var t;return(t=this.humanBones[e])!=null?t:void 0}getBoneNode(e){var t,r;return(r=(t=this.humanBones[e])==null?void 0:t.node)!=null?r:null}};import*as w from"three";var ke=new w.Vector3,ut=new w.Quaternion,pt=new w.Vector3,le=class u extends j{static _setupTransforms(e){let t=new w.Object3D;t.name="VRMHumanoidRig";let r={},o={},i={},n={};ae.forEach(s=>{var d;let a=e.getBoneNode(s);if(a){let c=new w.Vector3,p=new w.Quaternion;a.updateWorldMatrix(!0,!1),a.matrixWorld.decompose(c,p,ke),r[s]=c,o[s]=p,i[s]=a.quaternion.clone();let m=new w.Quaternion;(d=a.parent)==null||d.matrixWorld.decompose(ke,m,ke),n[s]=m}});let l={};return ae.forEach(s=>{var d;let a=e.getBoneNode(s);if(a){let c=r[s],p=s,m;for(;m==null&&(p=Be[p],p!=null);)m=r[p];let M=new w.Object3D;M.name="Normalized_"+a.name,(p?(d=l[p])==null?void 0:d.node:t).add(M),M.position.copy(c),m&&M.position.sub(m),l[s]={node:M}}}),{rigBones:l,root:t,parentWorldRotations:n,boneRotations:i}}constructor(e){let{rigBones:t,root:r,parentWorldRotations:o,boneRotations:i}=u._setupTransforms(e);super(t),this.original=e,this.root=r,this._parentWorldRotations=o,this._boneRotations=i}update(){ae.forEach(e=>{let t=this.original.getBoneNode(e);if(t!=null){let r=this.getBoneNode(e),o=this._parentWorldRotations[e],i=ut.copy(o).invert(),n=this._boneRotations[e];if(t.quaternion.copy(r.quaternion).multiply(o).premultiply(i).multiply(n),e==="hips"){let l=r.getWorldPosition(pt);t.parent.updateWorldMatrix(!0,!1);let s=t.parent.matrixWorld,a=l.applyMatrix4(s.invert());t.position.copy(a)}}})}};var te=class u{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,t){var r;this.autoUpdateHumanBones=(r=t==null?void 0:t.autoUpdateHumanBones)!=null?r:!0,this._rawHumanBones=new j(e),this._normalizedHumanBones=new le(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new j(e.humanBones),this._normalizedHumanBones=new le(this._rawHumanBones),this}clone(){return new u(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}};var Fe={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"};var mt=new Set(["1.0","1.0-beta"]),Ye={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},ue=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot,this.autoUpdateHumanBones=t==null?void 0:t.autoUpdateHumanBones}afterRoot(e){return R(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let r=yield this._v0Import(e);return r||null})}_v1Import(e){return R(this,null,function*(){var d,c;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(!o)return null;let i=o.specVersion;if(!mt.has(i))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.humanoid;if(!n)return null;let l=n.humanBones.leftThumbIntermediate!=null||n.humanBones.rightThumbIntermediate!=null,s={};n.humanBones!=null&&(yield Promise.all(Object.entries(n.humanBones).map(M=>R(this,[M],function*([p,m]){let h=p,f=m.node;if(l){let x=Ye[h];x!=null&&(h=x)}let V=yield this.parser.getDependency("node",f);if(V==null){console.warn(`A glTF node bound to the humanoid bone ${h} (index = ${f}) does not exist`);return}s[h]={node:V}}))));let a=new te(this._ensureRequiredBonesExist(s),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){let p=new ee(a);this.helperRoot.add(p),p.renderOrder=this.helperRoot.renderOrder}return a})}_v0Import(e){return R(this,null,function*(){var l;let r=(l=this.parser.json.extensions)==null?void 0:l.VRM;if(!r)return null;let o=r.humanoid;if(!o)return null;let i={};o.humanBones!=null&&(yield Promise.all(o.humanBones.map(s=>R(this,null,function*(){let a=s.bone,d=s.node;if(a==null||d==null)return;let c=yield this.parser.getDependency("node",d);if(c==null){console.warn(`A glTF node bound to the humanoid bone ${a} (index = ${d}) does not exist`);return}let p=Ye[a],m=p!=null?p:a;if(i[m]!=null){console.warn(`Multiple bone entries for ${m} detected (index = ${d}), ignoring duplicated entries.`);return}i[m]={node:c}}))));let n=new te(this._ensureRequiredBonesExist(i),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(n.normalizedHumanBonesRoot),this.helperRoot){let s=new ee(n);this.helperRoot.add(s),s.renderOrder=this.helperRoot.renderOrder}return n})}_ensureRequiredBonesExist(e){let t=Object.values(Fe).filter(r=>e[r]==null);if(t.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(", ")}`);return e}};import*as E from"three";import*as pe from"three";var me=class extends pe.BufferGeometry{constructor(){super();this._currentTheta=0;this._currentRadius=0;this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new pe.BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new pe.BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,t=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let t=0;t<64;t++){let r=t/63*this._currentTheta;this._attrPos.setXYZ(t+1,this._currentRadius*Math.sin(r),0,this._currentRadius*Math.cos(r))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<63;t++)this._attrIndex.setXYZ(t*3,0,t+1,t+2);this._attrIndex.needsUpdate=!0}};import*as D from"three";var He=class extends D.BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new D.Vector3,this._currentTail=new D.Vector3,this._attrPos=new D.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new D.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}};var Le=new E.Quaternion,$e=new E.Quaternion,de=new E.Vector3,Xe=new E.Vector3,Ze=Math.sqrt(2)/2,dt=new E.Quaternion(0,0,-Ze,Ze),ht=new E.Vector3(0,1,0),he=class extends E.Group{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{let t=new me;t.radius=.5;let r=new E.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:E.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new E.Mesh(t,r),this.add(this._meshPitch)}{let t=new me;t.radius=.5;let r=new E.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:E.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new E.Mesh(t,r),this.add(this._meshYaw)}{let t=new He;t.radius=.1;let r=new E.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new E.LineSegments(t,r),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(e){let t=E.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();let r=E.MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=r,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(de),this.vrmLookAt.getLookAtWorldQuaternion(Le),Le.multiply(this.vrmLookAt.getFaceFrontQuaternion($e)),this._meshYaw.position.copy(de),this._meshYaw.quaternion.copy(Le),this._meshPitch.position.copy(de),this._meshPitch.quaternion.copy(Le),this._meshPitch.quaternion.multiply($e.setFromAxisAngle(ht,t)),this._meshPitch.quaternion.multiply(dt);let{target:o,autoUpdate:i}=this.vrmLookAt;o!=null&&i&&(o.getWorldPosition(Xe).sub(de),this._lineTarget.geometry.tail.copy(Xe),this._lineTarget.geometry.update(),this._lineTarget.position.copy(de)),super.updateMatrixWorld(e)}};import*as y from"three";import*as Ie from"three";var ct=new Ie.Vector3,Rt=new Ie.Vector3;function ce(u,e){return u.matrixWorld.decompose(ct,e,Rt),e}function re(u){return[Math.atan2(-u.z,u.x),Math.atan2(u.y,Math.sqrt(u.x*u.x+u.z*u.z))]}function Ne(u){let e=Math.round(u/2/Math.PI);return u-2*Math.PI*e}var Je=new y.Vector3(0,0,1),ft=new y.Vector3,Mt=new y.Vector3,Et=new y.Vector3,gt=new y.Quaternion,Ue=new y.Quaternion,Ke=new y.Quaternion,Vt=new y.Quaternion,Oe=new y.Euler,Pe=class Pe{constructor(e,t){this.offsetFromHeadBone=new y.Vector3;this.autoUpdate=!0;this.faceFront=new y.Vector3(0,0,1);this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new y.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new y.Euler)}getEuler(e){return e.set(y.MathUtils.DEG2RAD*this._pitch,y.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new Pe(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){let t=this.humanoid.getRawBoneNode("head");return ce(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Je)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,r]=re(this.faceFront);return Oe.set(0,.5*Math.PI+t,r,"YZX"),e.setFromEuler(Oe).premultiply(Vt.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(Ue),this.getFaceFrontQuaternion(Ke),e.copy(Je).applyQuaternion(Ue).applyQuaternion(Ke).applyEuler(this.getEuler(Oe))}lookAt(e){let t=gt.copy(this._restHeadWorldQuaternion).multiply(Te(this.getLookAtWorldQuaternion(Ue))),r=this.getLookAtWorldPosition(Mt),o=Et.copy(e).sub(r).applyQuaternion(t).normalize(),[i,n]=re(this.faceFront),[l,s]=re(o),a=Ne(l-i),d=Ne(n-s);this._yaw=y.MathUtils.RAD2DEG*a,this._pitch=y.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(ft)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Pe.EULER_ORDER="YXZ";var Re=Pe;import*as g from"three";var yt=new g.Vector3(0,0,1),k=new g.Quaternion,oe=new g.Quaternion,P=new g.Euler(0,0,0,"YXZ"),G=class{constructor(e,t,r,o,i){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=r,this.rangeMapVerticalDown=o,this.rangeMapVerticalUp=i,this.faceFront=new g.Vector3(0,0,1),this._restQuatLeftEye=new g.Quaternion,this._restQuatRightEye=new g.Quaternion,this._restLeftEyeParentWorldQuat=new g.Quaternion,this._restRightEyeParentWorldQuat=new g.Quaternion;let n=this.humanoid.getRawBoneNode("leftEye"),l=this.humanoid.getRawBoneNode("rightEye");n&&(this._restQuatLeftEye.copy(n.quaternion),ce(n.parent,this._restLeftEyeParentWorldQuat)),l&&(this._restQuatRightEye.copy(l.quaternion),ce(l.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){let r=this.humanoid.getRawBoneNode("leftEye"),o=this.humanoid.getRawBoneNode("rightEye"),i=this.humanoid.getNormalizedBoneNode("leftEye"),n=this.humanoid.getNormalizedBoneNode("rightEye");r&&(t<0?P.x=-g.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-t):P.x=g.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?P.y=-g.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-e):P.y=g.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(e),k.setFromEuler(P),this._getWorldFaceFrontQuat(oe),i.quaternion.copy(oe).multiply(k).multiply(oe.invert()),k.copy(this._restLeftEyeParentWorldQuat),r.quaternion.copy(i.quaternion).multiply(k).premultiply(k.invert()).multiply(this._restQuatLeftEye)),o&&(t<0?P.x=-g.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-t):P.x=g.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?P.y=-g.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):P.y=g.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(e),k.setFromEuler(P),this._getWorldFaceFrontQuat(oe),n.quaternion.copy(oe).multiply(k).multiply(oe.invert()),k.copy(this._restRightEyeParentWorldQuat),o.quaternion.copy(n.quaternion).multiply(k).premultiply(k.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let t=g.MathUtils.RAD2DEG*e.y,r=g.MathUtils.RAD2DEG*e.x;this.applyYawPitch(t,r)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(yt)<.01)return e.identity();let[t,r]=re(this.faceFront);return P.set(0,.5*Math.PI+t,r,"YZX"),e.setFromEuler(P)}};G.type="bone";import*as Se from"three";var Q=class{constructor(e,t,r,o,i){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=r,this.rangeMapVerticalDown=o,this.rangeMapVerticalUp=i}applyYawPitch(e,t){t<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let t=Se.MathUtils.RAD2DEG*e.y,r=Se.MathUtils.RAD2DEG*e.x;this.applyYawPitch(t,r)}};Q.type="expression";var ne=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*ge(e/this.inputMaxValue)}};var xt=new Set(["1.0","1.0-beta"]),_e=.01,fe=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return R(this,null,function*(){let t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");let r=e.userData.vrmExpressionManager;if(r!==null){if(r===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");e.userData.vrmLookAt=yield this._import(e,t,r)}})}_import(e,t,r){return R(this,null,function*(){if(t==null||r==null)return null;let o=yield this._v1Import(e,t,r);if(o)return o;let i=yield this._v0Import(e,t,r);return i||null})}_v1Import(e,t,r){return R(this,null,function*(){var f,V,x;let o=this.parser.json;if(!(((f=o.extensionsUsed)==null?void 0:f.indexOf("VRMC_vrm"))!==-1))return null;let n=(V=o.extensions)==null?void 0:V.VRMC_vrm;if(!n)return null;let l=n.specVersion;if(!xt.has(l))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=n.lookAt;if(!s)return null;let a=s.type==="expression"?1:10,d=this._v1ImportRangeMap(s.rangeMapHorizontalInner,a),c=this._v1ImportRangeMap(s.rangeMapHorizontalOuter,a),p=this._v1ImportRangeMap(s.rangeMapVerticalDown,a),m=this._v1ImportRangeMap(s.rangeMapVerticalUp,a),M;s.type==="expression"?M=new Q(r,d,c,p,m):M=new G(t,d,c,p,m);let h=this._importLookAt(t,M);return h.offsetFromHeadBone.fromArray((x=s.offsetFromHeadBone)!=null?x:[0,.06,0]),h})}_v1ImportRangeMap(e,t){var i,n;let r=(i=e==null?void 0:e.inputMaxValue)!=null?i:90,o=(n=e==null?void 0:e.outputScale)!=null?n:t;return r<_e&&(console.warn("VRMLookAtLoaderPlugin: inputMaxValue of a range map is too small. Consider reviewing the range map!"),r=_e),new ne(r,o)}_v0Import(e,t,r){return R(this,null,function*(){var M,h,f,V;let i=(M=this.parser.json.extensions)==null?void 0:M.VRM;if(!i)return null;let n=i.firstPerson;if(!n)return null;let l=n.lookAtTypeName==="BlendShape"?1:10,s=this._v0ImportDegreeMap(n.lookAtHorizontalInner,l),a=this._v0ImportDegreeMap(n.lookAtHorizontalOuter,l),d=this._v0ImportDegreeMap(n.lookAtVerticalDown,l),c=this._v0ImportDegreeMap(n.lookAtVerticalUp,l),p;n.lookAtTypeName==="BlendShape"?p=new Q(r,s,a,d,c):p=new G(t,s,a,d,c);let m=this._importLookAt(t,p);return n.firstPersonBoneOffset?m.offsetFromHeadBone.set((h=n.firstPersonBoneOffset.x)!=null?h:0,(f=n.firstPersonBoneOffset.y)!=null?f:.06,-((V=n.firstPersonBoneOffset.z)!=null?V:0)):m.offsetFromHeadBone.set(0,.06,0),m.faceFront.set(0,0,-1),p instanceof G&&p.faceFront.set(0,0,-1),m})}_v0ImportDegreeMap(e,t){var n,l;let r=e==null?void 0:e.curve;JSON.stringify(r)!=="[0,0,0,1,1,1,1,0]"&&console.warn("Curves of LookAtDegreeMap defined in VRM 0.0 are not supported");let o=(n=e==null?void 0:e.xRange)!=null?n:90,i=(l=e==null?void 0:e.yRange)!=null?l:t;return o<_e&&(console.warn("VRMLookAtLoaderPlugin: xRange of a degree map is too small. Consider reviewing the degree map!"),o=_e),new ne(o,i)}_importLookAt(e,t){let r=new Re(e,t);if(this.helperRoot){let o=new he(r);this.helperRoot.add(o),o.renderOrder=this.helperRoot.renderOrder}return r}};var Tt={Bone:"bone",Expression:"expression"};import*as tt from"three";function et(u,e){return typeof u!="string"||u===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(u)&&(e=e.replace(/(^https?:\/\/[^/]+).*/i,"$1")),/^(https?:)?\/\//i.test(u)||/^data:.*,.*$/i.test(u)||/^blob:.*$/i.test(u)?u:e+u)}var bt=new Set(["1.0","1.0-beta"]),Me=class{get name(){return"VRMMetaLoaderPlugin"}constructor(e,t){var r,o,i;this.parser=e,this.needThumbnailImage=(r=t==null?void 0:t.needThumbnailImage)!=null?r:!1,this.acceptLicenseUrls=(o=t==null?void 0:t.acceptLicenseUrls)!=null?o:["https://vrm.dev/licenses/1.0/"],this.acceptV0Meta=(i=t==null?void 0:t.acceptV0Meta)!=null?i:!0}afterRoot(e){return R(this,null,function*(){e.userData.vrmMeta=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t!=null)return t;let r=yield this._v0Import(e);return r!=null?r:null})}_v1Import(e){return R(this,null,function*(){var d,c,p;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(o==null)return null;let i=o.specVersion;if(!bt.has(i))return console.warn(`VRMMetaLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.meta;if(!n)return null;let l=n.licenseUrl;if(!new Set(this.acceptLicenseUrls).has(l))throw new Error(`VRMMetaLoaderPlugin: The license url "${l}" is not accepted`);let a;return this.needThumbnailImage&&n.thumbnailImage!=null&&(a=(p=yield this._extractGLTFImage(n.thumbnailImage))!=null?p:void 0),{metaVersion:"1",name:n.name,version:n.version,authors:n.authors,copyrightInformation:n.copyrightInformation,contactInformation:n.contactInformation,references:n.references,thirdPartyLicenses:n.thirdPartyLicenses,thumbnailImage:a,licenseUrl:n.licenseUrl,avatarPermission:n.avatarPermission,allowExcessivelyViolentUsage:n.allowExcessivelyViolentUsage,allowExcessivelySexualUsage:n.allowExcessivelySexualUsage,commercialUsage:n.commercialUsage,allowPoliticalOrReligiousUsage:n.allowPoliticalOrReligiousUsage,allowAntisocialOrHateUsage:n.allowAntisocialOrHateUsage,creditNotation:n.creditNotation,allowRedistribution:n.allowRedistribution,modification:n.modification,otherLicenseUrl:n.otherLicenseUrl}})}_v0Import(e){return R(this,null,function*(){var n;let r=(n=this.parser.json.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.meta;if(!o)return null;if(!this.acceptV0Meta)throw new Error("VRMMetaLoaderPlugin: Attempted to load VRM0.0 meta but acceptV0Meta is false");let i;return this.needThumbnailImage&&o.texture!=null&&o.texture!==-1&&(i=yield this.parser.getDependency("texture",o.texture)),{metaVersion:"0",allowedUserName:o.allowedUserName,author:o.author,commercialUssageName:o.commercialUssageName,contactInformation:o.contactInformation,licenseName:o.licenseName,otherLicenseUrl:o.otherLicenseUrl,otherPermissionUrl:o.otherPermissionUrl,reference:o.reference,sexualUssageName:o.sexualUssageName,texture:i!=null?i:void 0,title:o.title,version:o.version,violentUssageName:o.violentUssageName}})}_extractGLTFImage(e){return R(this,null,function*(){var n;let r=(n=this.parser.json.images)==null?void 0:n[e];if(r==null)return console.warn(`VRMMetaLoaderPlugin: Attempt to use images[${e}] of glTF as a thumbnail but the image doesn't exist`),null;let o=r.uri;if(r.bufferView!=null){let l=yield this.parser.getDependency("bufferView",r.bufferView),s=new Blob([l],{type:r.mimeType});o=URL.createObjectURL(s)}return o==null?(console.warn(`VRMMetaLoaderPlugin: Attempt to use images[${e}] of glTF as a thumbnail but the image couldn't load properly`),null):yield new tt.ImageLoader().loadAsync(et(o,this.parser.options.path)).catch(l=>(console.error(l),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}};var Ee=class{constructor(e){this.scene=e.scene,this.meta=e.meta,this.humanoid=e.humanoid,this.expressionManager=e.expressionManager,this.firstPerson=e.firstPerson,this.lookAt=e.lookAt}update(e){this.humanoid.update(),this.lookAt&&this.lookAt.update(e),this.expressionManager&&this.expressionManager.update()}};var De=class{get name(){return"VRMC_vrm"}constructor(e,t){var i,n,l,s,a;this.parser=e;let r=t==null?void 0:t.helperRoot,o=t==null?void 0:t.autoUpdateHumanBones;this.expressionPlugin=(i=t==null?void 0:t.expressionPlugin)!=null?i:new ie(e),this.firstPersonPlugin=(n=t==null?void 0:t.firstPersonPlugin)!=null?n:new se(e),this.humanoidPlugin=(l=t==null?void 0:t.humanoidPlugin)!=null?l:new ue(e,{helperRoot:r,autoUpdateHumanBones:o}),this.lookAtPlugin=(s=t==null?void 0:t.lookAtPlugin)!=null?s:new fe(e,{helperRoot:r}),this.metaPlugin=(a=t==null?void 0:t.metaPlugin)!=null?a:new Me(e)}afterRoot(e){return R(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e);let t=e.userData.vrmMeta,r=e.userData.vrmHumanoid;if(t&&r){let o=new Ee({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:r,lookAt:e.userData.vrmLookAt,meta:t});e.userData.vrmCore=o}})}};export{Ee as VRMCore,De as VRMCoreLoaderPlugin,z as VRMExpression,ie as VRMExpressionLoaderPlugin,Y as VRMExpressionManager,X as VRMExpressionMaterialColorBind,$ as VRMExpressionMaterialColorType,Z as VRMExpressionMorphTargetBind,nt as VRMExpressionOverrideType,q as VRMExpressionPresetName,J as VRMExpressionTextureTransformBind,K as VRMFirstPerson,se as VRMFirstPersonLoaderPlugin,st as VRMFirstPersonMeshAnnotationType,ae as VRMHumanBoneList,lt as VRMHumanBoneName,Be as VRMHumanBoneParentMap,te as VRMHumanoid,ee as VRMHumanoidHelper,ue as VRMHumanoidLoaderPlugin,Re as VRMLookAt,G as VRMLookAtBoneApplier,Q as VRMLookAtExpressionApplier,he as VRMLookAtHelper,fe as VRMLookAtLoaderPlugin,ne as VRMLookAtRangeMap,Tt as VRMLookAtTypeName,Me as VRMMetaLoaderPlugin,Fe as VRMRequiredHumanBoneName}; +var R=(u,e,t)=>new Promise((r,o)=>{var i=s=>{try{l(t.next(s))}catch(a){o(a)}},n=s=>{try{l(t.throw(s))}catch(a){o(a)}},l=s=>s.done?r(s.value):Promise.resolve(s.value).then(i,n);l((t=t.apply(u,e)).next())});import*as Ge from"three";var z=class extends Ge.Object3D{constructor(t){super();this.weight=0;this.isBinary=!1;this.overrideBlink="none";this.overrideLookAt="none";this.overrideMouth="none";this._binds=[];this.name=`VRMExpression_${t}`,this.expressionName=t,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(t){this._binds.push(t)}deleteBind(t){let r=this._binds.indexOf(t);r>=0&&this._binds.splice(r,1)}applyWeight(t){var o;let r=this.outputWeight;r*=(o=t==null?void 0:t.multiplier)!=null?o:1,this.isBinary&&r<1&&(r=0),this._binds.forEach(i=>i.applyWeight(r))}clearAppliedWeight(){this._binds.forEach(t=>t.clearAppliedWeight())}};import*as S from"three";function Ce(u,e,t){var a,d;let r=u.parser.json,o=(a=r.nodes)==null?void 0:a[e];if(o==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let i=o.mesh;if(i==null)return null;let n=(d=r.meshes)==null?void 0:d[i];if(n==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${i}] of glTF but the mesh doesn't exist`),null;let l=n.primitives.length,s=[];return t.traverse(c=>{s.length{let i=Ce(u,o,r);i!=null&&t.set(o,i)}),t})}var q={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function ge(u){return Math.max(Math.min(u,1),0)}var Y=class u{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"];this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"];this.mouthExpressionNames=["aa","ee","ih","oh","ou"];this._expressions=[];this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},t=new Set(Object.values(q));return Object.entries(this._expressionMap).forEach(([r,o])=>{t.has(r)&&(e[r]=o)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(q));return Object.entries(this._expressionMap).forEach(([r,o])=>{t.has(r)||(e[r]=o)}),e}copy(e){return this._expressions.concat().forEach(r=>{this.unregisterExpression(r)}),e._expressions.forEach(r=>{this.registerExpression(r)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new u().copy(this)}getExpression(e){var t;return(t=this._expressionMap[e])!=null?t:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){var r;let t=this.getExpression(e);return(r=t==null?void 0:t.weight)!=null?r:null}setValue(e,t){let r=this.getExpression(e);r&&(r.weight=ge(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(t=>{t.clearAppliedWeight()}),this._expressions.forEach(t=>{let r=1,o=t.expressionName;this.blinkExpressionNames.indexOf(o)!==-1&&(r*=e.blink),this.lookAtExpressionNames.indexOf(o)!==-1&&(r*=e.lookAt),this.mouthExpressionNames.indexOf(o)!==-1&&(r*=e.mouth),t.applyWeight({multiplier:r})})}_calculateWeightMultipliers(){let e=1,t=1,r=1;return this._expressions.forEach(o=>{e-=o.overrideBlinkAmount,t-=o.overrideLookAtAmount,r-=o.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),r=Math.max(0,r),{blink:e,lookAt:t,mouth:r}}};var $={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},We={_Color:$.Color,_EmissionColor:$.EmissionColor,_ShadeColor:$.ShadeColor,_RimColor:$.RimColor,_OutlineColor:$.OutlineColor};import*as ve from"three";var rt=new ve.Color,Ve=class Ve{constructor({material:e,type:t,targetValue:r,targetAlpha:o}){this.material=e,this.type=t,this.targetValue=r,this.targetAlpha=o!=null?o:1;let i=this._initColorBindState(),n=this._initAlphaBindState();this._state={color:i,alpha:n}}applyWeight(e){let{color:t,alpha:r}=this._state;if(t!=null){let{propertyName:o,deltaValue:i}=t,n=this.material[o];n!=null&&n.add(rt.copy(i).multiplyScalar(e))}if(r!=null){let{propertyName:o,deltaValue:i}=r;this.material[o]!=null&&(this.material[o]+=i*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:r,initialValue:o}=e,i=this.material[r];i!=null&&i.copy(o)}if(t!=null){let{propertyName:r,initialValue:o}=t;this.material[r]!=null&&(this.material[r]=o)}}_initColorBindState(){var a,d,c;let{material:e,type:t,targetValue:r}=this,o=this._getPropertyNameMap(),i=(d=(a=o==null?void 0:o[t])==null?void 0:a[0])!=null?d:null;if(i==null)return console.warn(`Tried to add a material color bind to the material ${(c=e.name)!=null?c:"(no name)"}, the type ${t} but the material or the type is not supported.`),null;let l=e[i].clone(),s=new ve.Color(r.r-l.r,r.g-l.g,r.b-l.b);return{propertyName:i,initialValue:l,deltaValue:s}}_initAlphaBindState(){var s,a,d;let{material:e,type:t,targetAlpha:r}=this,o=this._getPropertyNameMap(),i=(a=(s=o==null?void 0:o[t])==null?void 0:s[1])!=null?a:null;if(i==null&&r!==1)return console.warn(`Tried to add a material alpha bind to the material ${(d=e.name)!=null?d:"(no name)"}, the type ${t} but the material or the type does not support alpha.`),null;if(i==null)return null;let n=e[i],l=r-n;return{propertyName:i,initialValue:n,deltaValue:l}}_getPropertyNameMap(){var e,t;return(t=(e=Object.entries(Ve._propertyNameMapMap).find(([r])=>this.material[r]===!0))==null?void 0:e[1])!=null?t:null}};Ve._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var X=Ve;var Z=class{constructor({primitives:e,index:t,weight:r}){this.primitives=e,this.index=t,this.weight=r}applyWeight(e){this.primitives.forEach(t=>{var r;((r=t.morphTargetInfluences)==null?void 0:r[this.index])!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]=0)})}};import*as Qe from"three";var je=new Qe.Vector2,ye=class ye{constructor({material:e,scale:t,offset:r}){var i,n;this.material=e,this.scale=t,this.offset=r;let o=(i=Object.entries(ye._propertyNamesMap).find(([l])=>e[l]===!0))==null?void 0:i[1];o==null?(console.warn(`Tried to add a texture transform bind to the material ${(n=e.name)!=null?n:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],o.forEach(l=>{var m;let s=(m=e[l])==null?void 0:m.clone();if(!s)return null;e[l]=s;let a=s.offset.clone(),d=s.repeat.clone(),c=r.clone().sub(a),p=t.clone().sub(d);this._properties.push({name:l,initialOffset:a,deltaOffset:c,initialScale:d,deltaScale:p})}))}applyWeight(e){this._properties.forEach(t=>{let r=this.material[t.name];r!==void 0&&(r.offset.add(je.copy(t.deltaOffset).multiplyScalar(e)),r.repeat.add(je.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};ye._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var J=ye;var ot=new Set(["1.0","1.0-beta"]),xe=class xe{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return R(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let r=yield this._v0Import(e);return r||null})}_v1Import(e){return R(this,null,function*(){var d,c;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(!o)return null;let i=o.specVersion;if(!ot.has(i))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.expressions;if(!n)return null;let l=new Set(Object.values(q)),s=new Map;n.preset!=null&&Object.entries(n.preset).forEach(([p,m])=>{if(m!=null){if(!l.has(p)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${p}" detected. Ignoring the expression`);return}s.set(p,m)}}),n.custom!=null&&Object.entries(n.custom).forEach(([p,m])=>{if(l.has(p)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${p}". Ignoring the expression`);return}s.set(p,m)});let a=new Y;return yield Promise.all(Array.from(s.entries()).map(M=>R(this,[M],function*([p,m]){var f,V,x,_,T,b,F;let h=new z(p);if(e.scene.add(h),h.isBinary=(f=m.isBinary)!=null?f:!1,h.overrideBlink=(V=m.overrideBlink)!=null?V:"none",h.overrideLookAt=(x=m.overrideLookAt)!=null?x:"none",h.overrideMouth=(_=m.overrideMouth)!=null?_:"none",(T=m.morphTargetBinds)==null||T.forEach(H=>R(this,null,function*(){var B;if(H.node===void 0||H.index===void 0)return;let L=yield Ae(e,H.node),v=H.index;if(!L.every(I=>Array.isArray(I.morphTargetInfluences)&&v{let v=L.material;v&&(Array.isArray(v)?H.push(...v):H.push(v))}),(b=m.materialColorBinds)==null||b.forEach(L=>R(this,null,function*(){H.filter(B=>{var O;let I=(O=this.parser.associations.get(B))==null?void 0:O.materials;return L.material===I}).forEach(B=>{h.addBind(new X({material:B,type:L.type,targetValue:new S.Color().fromArray(L.targetValue),targetAlpha:L.targetValue[3]}))})})),(F=m.textureTransformBinds)==null||F.forEach(L=>R(this,null,function*(){H.filter(B=>{var O;let I=(O=this.parser.associations.get(B))==null?void 0:O.materials;return L.material===I}).forEach(B=>{var I,O;h.addBind(new J({material:B,offset:new S.Vector2().fromArray((I=L.offset)!=null?I:[0,0]),scale:new S.Vector2().fromArray((O=L.scale)!=null?O:[1,1])}))})}))}a.registerExpression(h)}))),a})}_v0Import(e){return R(this,null,function*(){var s;let t=this.parser.json,r=(s=t.extensions)==null?void 0:s.VRM;if(!r)return null;let o=r.blendShapeMaster;if(!o)return null;let i=new Y,n=o.blendShapeGroups;if(!n)return i;let l=new Set;return yield Promise.all(n.map(a=>R(this,null,function*(){var h;let d=a.presetName,c=d!=null&&xe.v0v1PresetNameMap[d]||null,p=c!=null?c:a.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(l.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}l.add(p);let m=new z(p);e.scene.add(m),m.isBinary=(h=a.isBinary)!=null?h:!1,a.binds&&a.binds.forEach(f=>R(this,null,function*(){var _;if(f.mesh===void 0||f.index===void 0)return;let V=[];(_=t.nodes)==null||_.forEach((T,b)=>{T.mesh===f.mesh&&V.push(b)});let x=f.index;yield Promise.all(V.map(T=>R(this,null,function*(){var F;let b=yield Ae(e,T);if(!b.every(H=>Array.isArray(H.morphTargetInfluences)&&x{if(f.materialName===void 0||f.propertyName===void 0||f.targetValue===void 0)return;let V=[];e.scene.traverse(_=>{if(_.material){let T=_.material;Array.isArray(T)?V.push(...T.filter(b=>(b.name===f.materialName||b.name===f.materialName+" (Outline)")&&V.indexOf(b)===-1)):T.name===f.materialName&&V.indexOf(T)===-1&&V.push(T)}});let x=f.propertyName;V.forEach(_=>{if(x==="_MainTex_ST"){let b=new S.Vector2(f.targetValue[0],f.targetValue[1]),F=new S.Vector2(f.targetValue[2],f.targetValue[3]);F.y=1-F.y-b.y,m.addBind(new J({material:_,scale:b,offset:F}));return}let T=We[x];if(T){m.addBind(new X({material:_,type:T,targetValue:new S.Color().fromArray(f.targetValue),targetAlpha:f.targetValue[3]}));return}console.warn(x+" is not supported")})}),i.registerExpression(m)}))),i})}};xe.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var ie=xe;var nt={None:"none",Block:"block",Blend:"blend"};import*as A from"three";var N=class N{constructor(e,t){this._firstPersonOnlyLayer=N.DEFAULT_FIRSTPERSON_ONLY_LAYER;this._thirdPersonOnlyLayer=N.DEFAULT_THIRDPERSON_ONLY_LAYER;this._initializedLayers=!1;this.humanoid=e,this.meshAnnotations=t}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(t=>({meshes:t.meshes.concat(),type:t.type})),this}clone(){return new N(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=N.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:t=N.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=t,this.meshAnnotations.forEach(r=>{r.meshes.forEach(o=>{r.type==="firstPersonOnly"?(o.layers.set(this._firstPersonOnlyLayer),o.traverse(i=>i.layers.set(this._firstPersonOnlyLayer))):r.type==="thirdPersonOnly"?(o.layers.set(this._thirdPersonOnlyLayer),o.traverse(i=>i.layers.set(this._thirdPersonOnlyLayer))):r.type==="auto"&&this._createHeadlessModel(o)})}),this._initializedLayers=!0)}_excludeTriangles(e,t,r,o){let i=0;if(t!=null&&t.length>0)for(let n=0;n0&&o.includes(c[0])||d[1]>0&&o.includes(c[1])||d[2]>0&&o.includes(c[2])||d[3]>0&&o.includes(c[3]))continue;let p=t[s],m=r[s];if(p[0]>0&&o.includes(m[0])||p[1]>0&&o.includes(m[1])||p[2]>0&&o.includes(m[2])||p[3]>0&&o.includes(m[3]))continue;let M=t[a],h=r[a];M[0]>0&&o.includes(h[0])||M[1]>0&&o.includes(h[1])||M[2]>0&&o.includes(h[2])||M[3]>0&&o.includes(h[3])||(e[i++]=l,e[i++]=s,e[i++]=a)}return i}_createErasedMesh(e,t){let r=new A.SkinnedMesh(e.geometry.clone(),e.material);r.name=`${e.name}(erase)`,r.frustumCulled=e.frustumCulled,r.layers.set(this._firstPersonOnlyLayer);let o=r.geometry,i=o.getAttribute("skinIndex"),n=i instanceof A.GLBufferAttribute?[]:i.array,l=[];for(let h=0;h{this._isEraseTarget(i)&&r.push(n)}),!r.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let o=this._createErasedMesh(t,r);e.add(o)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer));else{let t=new A.Group;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(r=>r.type==="SkinnedMesh").forEach(r=>{let o=r;this._createHeadlessModelForSkinnedMesh(t,o)})}else if(e.type==="SkinnedMesh"){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(t=>t.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};N.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,N.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var K=N;var it=new Set(["1.0","1.0-beta"]),se=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return R(this,null,function*(){let t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return R(this,null,function*(){if(t==null)return null;let r=yield this._v1Import(e,t);if(r)return r;let o=yield this._v0Import(e,t);return o||null})}_v1Import(e,t){return R(this,null,function*(){var d,c;let r=this.parser.json;if(!(((d=r.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let i=(c=r.extensions)==null?void 0:c.VRMC_vrm;if(!i)return null;let n=i.specVersion;if(!it.has(n))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${n}"`),null;let l=i.firstPerson,s=[],a=yield we(e);return Array.from(a.entries()).forEach(([p,m])=>{var h,f;let M=(h=l==null?void 0:l.meshAnnotations)==null?void 0:h.find(V=>V.node===p);s.push({meshes:m,type:(f=M==null?void 0:M.type)!=null?f:"auto"})}),new K(t,s)})}_v0Import(e,t){return R(this,null,function*(){var s;let r=this.parser.json,o=(s=r.extensions)==null?void 0:s.VRM;if(!o)return null;let i=o.firstPerson;if(!i)return null;let n=[],l=yield we(e);return Array.from(l.entries()).forEach(([a,d])=>{let c=r.nodes[a],p=i.meshAnnotations?i.meshAnnotations.find(m=>m.mesh===c.mesh):void 0;n.push({meshes:d,type:this._convertV0FlagToV1Type(p==null?void 0:p.firstPersonFlag)})}),new K(t,n)})}_convertV0FlagToV1Type(e){return e==="FirstPersonOnly"?"firstPersonOnly":e==="ThirdPersonOnly"?"thirdPersonOnly":e==="Both"?"both":"auto"}};var st={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"};import*as U from"three";var ze=new U.Vector3,qe=new U.Vector3,at=new U.Quaternion,ee=class extends U.Group{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(t=>{let r=new U.AxesHelper(1);r.matrixAutoUpdate=!1,r.material.depthTest=!1,r.material.depthWrite=!1,this.add(r),this._boneAxesMap.set(t,r)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([t,r])=>{t.node.updateWorldMatrix(!0,!1),t.node.matrixWorld.decompose(ze,at,qe);let o=ze.set(.1,.1,.1).divide(qe);r.matrix.copy(t.node.matrixWorld).scale(o)}),super.updateMatrixWorld(e)}};var ae=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"];var lt={Hips:"hips",Spine:"spine",Chest:"chest",UpperChest:"upperChest",Neck:"neck",Head:"head",LeftEye:"leftEye",RightEye:"rightEye",Jaw:"jaw",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",LeftToes:"leftToes",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",RightToes:"rightToes",LeftShoulder:"leftShoulder",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightShoulder:"rightShoulder",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand",LeftThumbMetacarpal:"leftThumbMetacarpal",LeftThumbProximal:"leftThumbProximal",LeftThumbDistal:"leftThumbDistal",LeftIndexProximal:"leftIndexProximal",LeftIndexIntermediate:"leftIndexIntermediate",LeftIndexDistal:"leftIndexDistal",LeftMiddleProximal:"leftMiddleProximal",LeftMiddleIntermediate:"leftMiddleIntermediate",LeftMiddleDistal:"leftMiddleDistal",LeftRingProximal:"leftRingProximal",LeftRingIntermediate:"leftRingIntermediate",LeftRingDistal:"leftRingDistal",LeftLittleProximal:"leftLittleProximal",LeftLittleIntermediate:"leftLittleIntermediate",LeftLittleDistal:"leftLittleDistal",RightThumbMetacarpal:"rightThumbMetacarpal",RightThumbProximal:"rightThumbProximal",RightThumbDistal:"rightThumbDistal",RightIndexProximal:"rightIndexProximal",RightIndexIntermediate:"rightIndexIntermediate",RightIndexDistal:"rightIndexDistal",RightMiddleProximal:"rightMiddleProximal",RightMiddleIntermediate:"rightMiddleIntermediate",RightMiddleDistal:"rightMiddleDistal",RightRingProximal:"rightRingProximal",RightRingIntermediate:"rightRingIntermediate",RightRingDistal:"rightRingDistal",RightLittleProximal:"rightLittleProximal",RightLittleIntermediate:"rightLittleIntermediate",RightLittleDistal:"rightLittleDistal"};var Be={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};import*as be from"three";function Te(u){return u.invert?u.invert():u.inverse(),u}var C=new be.Vector3,W=new be.Quaternion,j=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let r=t,o=this.getBoneNode(r);o&&(C.copy(o.position),W.copy(o.quaternion),e[r]={position:C.toArray(),rotation:W.toArray()})}),e}getPose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let r=t,o=this.getBoneNode(r);if(!o)return;C.set(0,0,0),W.identity();let i=this.restPose[r];i!=null&&i.position&&C.fromArray(i.position).negate(),i!=null&&i.rotation&&Te(W.fromArray(i.rotation)),C.add(o.position),W.premultiply(o.quaternion),e[r]={position:C.toArray(),rotation:W.toArray()}}),e}setPose(e){Object.entries(e).forEach(([t,r])=>{let o=t,i=this.getBoneNode(o);if(!i)return;let n=this.restPose[o];n&&(r!=null&&r.position&&(i.position.fromArray(r.position),n.position&&i.position.add(C.fromArray(n.position))),r!=null&&r.rotation&&(i.quaternion.fromArray(r.rotation),n.rotation&&i.quaternion.multiply(W.fromArray(n.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{let r=this.getBoneNode(e);r&&(t!=null&&t.position&&r.position.fromArray(t.position),t!=null&&t.rotation&&r.quaternion.fromArray(t.rotation))})}getBone(e){var t;return(t=this.humanBones[e])!=null?t:void 0}getBoneNode(e){var t,r;return(r=(t=this.humanBones[e])==null?void 0:t.node)!=null?r:null}};import*as w from"three";var ke=new w.Vector3,ut=new w.Quaternion,pt=new w.Vector3,le=class u extends j{static _setupTransforms(e){let t=new w.Object3D;t.name="VRMHumanoidRig";let r={},o={},i={},n={};ae.forEach(s=>{var d;let a=e.getBoneNode(s);if(a){let c=new w.Vector3,p=new w.Quaternion;a.updateWorldMatrix(!0,!1),a.matrixWorld.decompose(c,p,ke),r[s]=c,o[s]=p,i[s]=a.quaternion.clone();let m=new w.Quaternion;(d=a.parent)==null||d.matrixWorld.decompose(ke,m,ke),n[s]=m}});let l={};return ae.forEach(s=>{var d;let a=e.getBoneNode(s);if(a){let c=r[s],p=s,m;for(;m==null&&(p=Be[p],p!=null);)m=r[p];let M=new w.Object3D;M.name="Normalized_"+a.name,(p?(d=l[p])==null?void 0:d.node:t).add(M),M.position.copy(c),m&&M.position.sub(m),l[s]={node:M}}}),{rigBones:l,root:t,parentWorldRotations:n,boneRotations:i}}constructor(e){let{rigBones:t,root:r,parentWorldRotations:o,boneRotations:i}=u._setupTransforms(e);super(t),this.original=e,this.root=r,this._parentWorldRotations=o,this._boneRotations=i}update(){ae.forEach(e=>{let t=this.original.getBoneNode(e);if(t!=null){let r=this.getBoneNode(e),o=this._parentWorldRotations[e],i=ut.copy(o).invert(),n=this._boneRotations[e];if(t.quaternion.copy(r.quaternion).multiply(o).premultiply(i).multiply(n),e==="hips"){let l=r.getWorldPosition(pt);t.parent.updateWorldMatrix(!0,!1);let s=t.parent.matrixWorld,a=l.applyMatrix4(s.invert());t.position.copy(a)}}})}};var te=class u{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,t){var r;this.autoUpdateHumanBones=(r=t==null?void 0:t.autoUpdateHumanBones)!=null?r:!0,this._rawHumanBones=new j(e),this._normalizedHumanBones=new le(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new j(e.humanBones),this._normalizedHumanBones=new le(this._rawHumanBones),this}clone(){return new u(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}};var Fe={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"};var mt=new Set(["1.0","1.0-beta"]),Ye={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},ue=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot,this.autoUpdateHumanBones=t==null?void 0:t.autoUpdateHumanBones}afterRoot(e){return R(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t)return t;let r=yield this._v0Import(e);return r||null})}_v1Import(e){return R(this,null,function*(){var d,c;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(!o)return null;let i=o.specVersion;if(!mt.has(i))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.humanoid;if(!n)return null;let l=n.humanBones.leftThumbIntermediate!=null||n.humanBones.rightThumbIntermediate!=null,s={};n.humanBones!=null&&(yield Promise.all(Object.entries(n.humanBones).map(M=>R(this,[M],function*([p,m]){let h=p,f=m.node;if(l){let x=Ye[h];x!=null&&(h=x)}let V=yield this.parser.getDependency("node",f);if(V==null){console.warn(`A glTF node bound to the humanoid bone ${h} (index = ${f}) does not exist`);return}s[h]={node:V}}))));let a=new te(this._ensureRequiredBonesExist(s),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){let p=new ee(a);this.helperRoot.add(p),p.renderOrder=this.helperRoot.renderOrder}return a})}_v0Import(e){return R(this,null,function*(){var l;let r=(l=this.parser.json.extensions)==null?void 0:l.VRM;if(!r)return null;let o=r.humanoid;if(!o)return null;let i={};o.humanBones!=null&&(yield Promise.all(o.humanBones.map(s=>R(this,null,function*(){let a=s.bone,d=s.node;if(a==null||d==null)return;let c=yield this.parser.getDependency("node",d);if(c==null){console.warn(`A glTF node bound to the humanoid bone ${a} (index = ${d}) does not exist`);return}let p=Ye[a],m=p!=null?p:a;if(i[m]!=null){console.warn(`Multiple bone entries for ${m} detected (index = ${d}), ignoring duplicated entries.`);return}i[m]={node:c}}))));let n=new te(this._ensureRequiredBonesExist(i),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(n.normalizedHumanBonesRoot),this.helperRoot){let s=new ee(n);this.helperRoot.add(s),s.renderOrder=this.helperRoot.renderOrder}return n})}_ensureRequiredBonesExist(e){let t=Object.values(Fe).filter(r=>e[r]==null);if(t.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(", ")}`);return e}};import*as E from"three";import*as pe from"three";var me=class extends pe.BufferGeometry{constructor(){super();this._currentTheta=0;this._currentRadius=0;this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new pe.BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new pe.BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,t=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let t=0;t<64;t++){let r=t/63*this._currentTheta;this._attrPos.setXYZ(t+1,this._currentRadius*Math.sin(r),0,this._currentRadius*Math.cos(r))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<63;t++)this._attrIndex.setXYZ(t*3,0,t+1,t+2);this._attrIndex.needsUpdate=!0}};import*as D from"three";var He=class extends D.BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new D.Vector3,this._currentTail=new D.Vector3,this._attrPos=new D.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new D.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}};var Le=new E.Quaternion,$e=new E.Quaternion,de=new E.Vector3,Xe=new E.Vector3,Ze=Math.sqrt(2)/2,dt=new E.Quaternion(0,0,-Ze,Ze),ht=new E.Vector3(0,1,0),he=class extends E.Group{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{let t=new me;t.radius=.5;let r=new E.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:E.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new E.Mesh(t,r),this.add(this._meshPitch)}{let t=new me;t.radius=.5;let r=new E.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:E.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new E.Mesh(t,r),this.add(this._meshYaw)}{let t=new He;t.radius=.1;let r=new E.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new E.LineSegments(t,r),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(e){let t=E.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();let r=E.MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=r,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(de),this.vrmLookAt.getLookAtWorldQuaternion(Le),Le.multiply(this.vrmLookAt.getFaceFrontQuaternion($e)),this._meshYaw.position.copy(de),this._meshYaw.quaternion.copy(Le),this._meshPitch.position.copy(de),this._meshPitch.quaternion.copy(Le),this._meshPitch.quaternion.multiply($e.setFromAxisAngle(ht,t)),this._meshPitch.quaternion.multiply(dt);let{target:o,autoUpdate:i}=this.vrmLookAt;o!=null&&i&&(o.getWorldPosition(Xe).sub(de),this._lineTarget.geometry.tail.copy(Xe),this._lineTarget.geometry.update(),this._lineTarget.position.copy(de)),super.updateMatrixWorld(e)}};import*as y from"three";import*as Ie from"three";var ct=new Ie.Vector3,Rt=new Ie.Vector3;function ce(u,e){return u.matrixWorld.decompose(ct,e,Rt),e}function re(u){return[Math.atan2(-u.z,u.x),Math.atan2(u.y,Math.sqrt(u.x*u.x+u.z*u.z))]}function Ne(u){let e=Math.round(u/2/Math.PI);return u-2*Math.PI*e}var Je=new y.Vector3(0,0,1),ft=new y.Vector3,Mt=new y.Vector3,Et=new y.Vector3,gt=new y.Quaternion,Ue=new y.Quaternion,Ke=new y.Quaternion,Vt=new y.Quaternion,Oe=new y.Euler,Pe=class Pe{constructor(e,t){this.offsetFromHeadBone=new y.Vector3;this.autoUpdate=!0;this.faceFront=new y.Vector3(0,0,1);this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new y.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new y.Euler)}getEuler(e){return e.set(y.MathUtils.DEG2RAD*this._pitch,y.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new Pe(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){let t=this.humanoid.getRawBoneNode("head");return ce(t,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Je)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,r]=re(this.faceFront);return Oe.set(0,.5*Math.PI+t,r,"YZX"),e.setFromEuler(Oe).premultiply(Vt.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(Ue),this.getFaceFrontQuaternion(Ke),e.copy(Je).applyQuaternion(Ue).applyQuaternion(Ke).applyEuler(this.getEuler(Oe))}lookAt(e){let t=gt.copy(this._restHeadWorldQuaternion).multiply(Te(this.getLookAtWorldQuaternion(Ue))),r=this.getLookAtWorldPosition(Mt),o=Et.copy(e).sub(r).applyQuaternion(t).normalize(),[i,n]=re(this.faceFront),[l,s]=re(o),a=Ne(l-i),d=Ne(n-s);this._yaw=y.MathUtils.RAD2DEG*a,this._pitch=y.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(ft)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Pe.EULER_ORDER="YXZ";var Re=Pe;import*as g from"three";var yt=new g.Vector3(0,0,1),k=new g.Quaternion,oe=new g.Quaternion,P=new g.Euler(0,0,0,"YXZ"),G=class{constructor(e,t,r,o,i){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=r,this.rangeMapVerticalDown=o,this.rangeMapVerticalUp=i,this.faceFront=new g.Vector3(0,0,1),this._restQuatLeftEye=new g.Quaternion,this._restQuatRightEye=new g.Quaternion,this._restLeftEyeParentWorldQuat=new g.Quaternion,this._restRightEyeParentWorldQuat=new g.Quaternion;let n=this.humanoid.getRawBoneNode("leftEye"),l=this.humanoid.getRawBoneNode("rightEye");n&&(this._restQuatLeftEye.copy(n.quaternion),ce(n.parent,this._restLeftEyeParentWorldQuat)),l&&(this._restQuatRightEye.copy(l.quaternion),ce(l.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){let r=this.humanoid.getRawBoneNode("leftEye"),o=this.humanoid.getRawBoneNode("rightEye"),i=this.humanoid.getNormalizedBoneNode("leftEye"),n=this.humanoid.getNormalizedBoneNode("rightEye");r&&(t<0?P.x=-g.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-t):P.x=g.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?P.y=-g.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-e):P.y=g.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(e),k.setFromEuler(P),this._getWorldFaceFrontQuat(oe),i.quaternion.copy(oe).multiply(k).multiply(oe.invert()),k.copy(this._restLeftEyeParentWorldQuat),r.quaternion.copy(i.quaternion).multiply(k).premultiply(k.invert()).multiply(this._restQuatLeftEye)),o&&(t<0?P.x=-g.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-t):P.x=g.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?P.y=-g.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):P.y=g.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(e),k.setFromEuler(P),this._getWorldFaceFrontQuat(oe),n.quaternion.copy(oe).multiply(k).multiply(oe.invert()),k.copy(this._restRightEyeParentWorldQuat),o.quaternion.copy(n.quaternion).multiply(k).premultiply(k.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let t=g.MathUtils.RAD2DEG*e.y,r=g.MathUtils.RAD2DEG*e.x;this.applyYawPitch(t,r)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(yt)<.01)return e.identity();let[t,r]=re(this.faceFront);return P.set(0,.5*Math.PI+t,r,"YZX"),e.setFromEuler(P)}};G.type="bone";import*as Se from"three";var Q=class{constructor(e,t,r,o,i){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=r,this.rangeMapVerticalDown=o,this.rangeMapVerticalUp=i}applyYawPitch(e,t){t<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let t=Se.MathUtils.RAD2DEG*e.y,r=Se.MathUtils.RAD2DEG*e.x;this.applyYawPitch(t,r)}};Q.type="expression";var ne=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*ge(e/this.inputMaxValue)}};var xt=new Set(["1.0","1.0-beta"]),_e=.01,fe=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return R(this,null,function*(){let t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");let r=e.userData.vrmExpressionManager;if(r!==null){if(r===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");e.userData.vrmLookAt=yield this._import(e,t,r)}})}_import(e,t,r){return R(this,null,function*(){if(t==null||r==null)return null;let o=yield this._v1Import(e,t,r);if(o)return o;let i=yield this._v0Import(e,t,r);return i||null})}_v1Import(e,t,r){return R(this,null,function*(){var f,V,x;let o=this.parser.json;if(!(((f=o.extensionsUsed)==null?void 0:f.indexOf("VRMC_vrm"))!==-1))return null;let n=(V=o.extensions)==null?void 0:V.VRMC_vrm;if(!n)return null;let l=n.specVersion;if(!xt.has(l))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=n.lookAt;if(!s)return null;let a=s.type==="expression"?1:10,d=this._v1ImportRangeMap(s.rangeMapHorizontalInner,a),c=this._v1ImportRangeMap(s.rangeMapHorizontalOuter,a),p=this._v1ImportRangeMap(s.rangeMapVerticalDown,a),m=this._v1ImportRangeMap(s.rangeMapVerticalUp,a),M;s.type==="expression"?M=new Q(r,d,c,p,m):M=new G(t,d,c,p,m);let h=this._importLookAt(t,M);return h.offsetFromHeadBone.fromArray((x=s.offsetFromHeadBone)!=null?x:[0,.06,0]),h})}_v1ImportRangeMap(e,t){var i,n;let r=(i=e==null?void 0:e.inputMaxValue)!=null?i:90,o=(n=e==null?void 0:e.outputScale)!=null?n:t;return r<_e&&(console.warn("VRMLookAtLoaderPlugin: inputMaxValue of a range map is too small. Consider reviewing the range map!"),r=_e),new ne(r,o)}_v0Import(e,t,r){return R(this,null,function*(){var M,h,f,V;let i=(M=this.parser.json.extensions)==null?void 0:M.VRM;if(!i)return null;let n=i.firstPerson;if(!n)return null;let l=n.lookAtTypeName==="BlendShape"?1:10,s=this._v0ImportDegreeMap(n.lookAtHorizontalInner,l),a=this._v0ImportDegreeMap(n.lookAtHorizontalOuter,l),d=this._v0ImportDegreeMap(n.lookAtVerticalDown,l),c=this._v0ImportDegreeMap(n.lookAtVerticalUp,l),p;n.lookAtTypeName==="BlendShape"?p=new Q(r,s,a,d,c):p=new G(t,s,a,d,c);let m=this._importLookAt(t,p);return n.firstPersonBoneOffset?m.offsetFromHeadBone.set((h=n.firstPersonBoneOffset.x)!=null?h:0,(f=n.firstPersonBoneOffset.y)!=null?f:.06,-((V=n.firstPersonBoneOffset.z)!=null?V:0)):m.offsetFromHeadBone.set(0,.06,0),m.faceFront.set(0,0,-1),p instanceof G&&p.faceFront.set(0,0,-1),m})}_v0ImportDegreeMap(e,t){var n,l;let r=e==null?void 0:e.curve;JSON.stringify(r)!=="[0,0,0,1,1,1,1,0]"&&console.warn("Curves of LookAtDegreeMap defined in VRM 0.0 are not supported");let o=(n=e==null?void 0:e.xRange)!=null?n:90,i=(l=e==null?void 0:e.yRange)!=null?l:t;return o<_e&&(console.warn("VRMLookAtLoaderPlugin: xRange of a degree map is too small. Consider reviewing the degree map!"),o=_e),new ne(o,i)}_importLookAt(e,t){let r=new Re(e,t);if(this.helperRoot){let o=new he(r);this.helperRoot.add(o),o.renderOrder=this.helperRoot.renderOrder}return r}};var Tt={Bone:"bone",Expression:"expression"};import*as tt from"three";function et(u,e){return typeof u!="string"||u===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(u)&&(e=e.replace(/(^https?:\/\/[^/]+).*/i,"$1")),/^(https?:)?\/\//i.test(u)||/^data:.*,.*$/i.test(u)||/^blob:.*$/i.test(u)?u:e+u)}var bt=new Set(["1.0","1.0-beta"]),Me=class{get name(){return"VRMMetaLoaderPlugin"}constructor(e,t){var r,o,i;this.parser=e,this.needThumbnailImage=(r=t==null?void 0:t.needThumbnailImage)!=null?r:!1,this.acceptLicenseUrls=(o=t==null?void 0:t.acceptLicenseUrls)!=null?o:["https://vrm.dev/licenses/1.0/"],this.acceptV0Meta=(i=t==null?void 0:t.acceptV0Meta)!=null?i:!0}afterRoot(e){return R(this,null,function*(){e.userData.vrmMeta=yield this._import(e)})}_import(e){return R(this,null,function*(){let t=yield this._v1Import(e);if(t!=null)return t;let r=yield this._v0Import(e);return r!=null?r:null})}_v1Import(e){return R(this,null,function*(){var d,c,p;let t=this.parser.json;if(!(((d=t.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;let o=(c=t.extensions)==null?void 0:c.VRMC_vrm;if(o==null)return null;let i=o.specVersion;if(!bt.has(i))return console.warn(`VRMMetaLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let n=o.meta;if(!n)return null;let l=n.licenseUrl;if(!new Set(this.acceptLicenseUrls).has(l))throw new Error(`VRMMetaLoaderPlugin: The license url "${l}" is not accepted`);let a;return this.needThumbnailImage&&n.thumbnailImage!=null&&(a=(p=yield this._extractGLTFImage(n.thumbnailImage))!=null?p:void 0),{metaVersion:"1",name:n.name,version:n.version,authors:n.authors,copyrightInformation:n.copyrightInformation,contactInformation:n.contactInformation,references:n.references,thirdPartyLicenses:n.thirdPartyLicenses,thumbnailImage:a,licenseUrl:n.licenseUrl,avatarPermission:n.avatarPermission,allowExcessivelyViolentUsage:n.allowExcessivelyViolentUsage,allowExcessivelySexualUsage:n.allowExcessivelySexualUsage,commercialUsage:n.commercialUsage,allowPoliticalOrReligiousUsage:n.allowPoliticalOrReligiousUsage,allowAntisocialOrHateUsage:n.allowAntisocialOrHateUsage,creditNotation:n.creditNotation,allowRedistribution:n.allowRedistribution,modification:n.modification,otherLicenseUrl:n.otherLicenseUrl}})}_v0Import(e){return R(this,null,function*(){var n;let r=(n=this.parser.json.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.meta;if(!o)return null;if(!this.acceptV0Meta)throw new Error("VRMMetaLoaderPlugin: Attempted to load VRM0.0 meta but acceptV0Meta is false");let i;return this.needThumbnailImage&&o.texture!=null&&o.texture!==-1&&(i=yield this.parser.getDependency("texture",o.texture)),{metaVersion:"0",allowedUserName:o.allowedUserName,author:o.author,commercialUssageName:o.commercialUssageName,contactInformation:o.contactInformation,licenseName:o.licenseName,otherLicenseUrl:o.otherLicenseUrl,otherPermissionUrl:o.otherPermissionUrl,reference:o.reference,sexualUssageName:o.sexualUssageName,texture:i!=null?i:void 0,title:o.title,version:o.version,violentUssageName:o.violentUssageName}})}_extractGLTFImage(e){return R(this,null,function*(){var n;let r=(n=this.parser.json.images)==null?void 0:n[e];if(r==null)return console.warn(`VRMMetaLoaderPlugin: Attempt to use images[${e}] of glTF as a thumbnail but the image doesn't exist`),null;let o=r.uri;if(r.bufferView!=null){let l=yield this.parser.getDependency("bufferView",r.bufferView),s=new Blob([l],{type:r.mimeType});o=URL.createObjectURL(s)}return o==null?(console.warn(`VRMMetaLoaderPlugin: Attempt to use images[${e}] of glTF as a thumbnail but the image couldn't load properly`),null):yield new tt.ImageLoader().loadAsync(et(o,this.parser.options.path)).catch(l=>(console.error(l),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}};var Ee=class{constructor(e){this.scene=e.scene,this.meta=e.meta,this.humanoid=e.humanoid,this.expressionManager=e.expressionManager,this.firstPerson=e.firstPerson,this.lookAt=e.lookAt}update(e){this.humanoid.update(),this.lookAt&&this.lookAt.update(e),this.expressionManager&&this.expressionManager.update()}};var De=class{get name(){return"VRMC_vrm"}constructor(e,t){var i,n,l,s,a;this.parser=e;let r=t==null?void 0:t.helperRoot,o=t==null?void 0:t.autoUpdateHumanBones;this.expressionPlugin=(i=t==null?void 0:t.expressionPlugin)!=null?i:new ie(e),this.firstPersonPlugin=(n=t==null?void 0:t.firstPersonPlugin)!=null?n:new se(e),this.humanoidPlugin=(l=t==null?void 0:t.humanoidPlugin)!=null?l:new ue(e,{helperRoot:r,autoUpdateHumanBones:o}),this.lookAtPlugin=(s=t==null?void 0:t.lookAtPlugin)!=null?s:new fe(e,{helperRoot:r}),this.metaPlugin=(a=t==null?void 0:t.metaPlugin)!=null?a:new Me(e)}afterRoot(e){return R(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e);let t=e.userData.vrmMeta,r=e.userData.vrmHumanoid;if(t&&r){let o=new Ee({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:r,lookAt:e.userData.vrmLookAt,meta:t});e.userData.vrmCore=o}})}};export{Ee as VRMCore,De as VRMCoreLoaderPlugin,z as VRMExpression,ie as VRMExpressionLoaderPlugin,Y as VRMExpressionManager,X as VRMExpressionMaterialColorBind,$ as VRMExpressionMaterialColorType,Z as VRMExpressionMorphTargetBind,nt as VRMExpressionOverrideType,q as VRMExpressionPresetName,J as VRMExpressionTextureTransformBind,K as VRMFirstPerson,se as VRMFirstPersonLoaderPlugin,st as VRMFirstPersonMeshAnnotationType,ae as VRMHumanBoneList,lt as VRMHumanBoneName,Be as VRMHumanBoneParentMap,te as VRMHumanoid,ee as VRMHumanoidHelper,ue as VRMHumanoidLoaderPlugin,Re as VRMLookAt,G as VRMLookAtBoneApplier,Q as VRMLookAtExpressionApplier,he as VRMLookAtHelper,fe as VRMLookAtLoaderPlugin,ne as VRMLookAtRangeMap,Tt as VRMLookAtTypeName,Me as VRMMetaLoaderPlugin,Fe as VRMRequiredHumanBoneName}; diff --git a/packages/three-vrm-core/types/expressions/VRMExpression.d.ts b/packages/three-vrm-core/types/expressions/VRMExpression.d.ts index dcc86d379..a4f870661 100644 --- a/packages/three-vrm-core/types/expressions/VRMExpression.d.ts +++ b/packages/three-vrm-core/types/expressions/VRMExpression.d.ts @@ -31,7 +31,14 @@ export declare class VRMExpression extends THREE.Object3D { * Specify how the expression overrides mouth expressions. */ overrideMouth: VRMExpressionOverrideType; + /** + * Binds that this expression influences. + */ private _binds; + /** + * Binds that this expression influences. + */ + get binds(): readonly VRMExpressionBind[]; readonly type: string | 'VRMExpression'; /** * A value represents how much it should override blink expressions. @@ -53,7 +60,18 @@ export declare class VRMExpression extends THREE.Object3D { */ get outputWeight(): number; constructor(expressionName: string); + /** + * Add an expression bind to the expression. + * + * @param bind A bind to add + */ addBind(bind: VRMExpressionBind): void; + /** + * Delete an expression bind from the expression. + * + * @param bind A bind to delete + */ + deleteBind(bind: VRMExpressionBind): void; /** * Apply weight to every assigned blend shapes. * Should be called every frame. diff --git a/packages/three-vrm-materials-hdr-emissive-multiplier/docs/classes/VRMMaterialsHDREmissiveMultiplierLoaderPlugin.html b/packages/three-vrm-materials-hdr-emissive-multiplier/docs/classes/VRMMaterialsHDREmissiveMultiplierLoaderPlugin.html index 2cf67dc76..e32fde32d 100644 --- a/packages/three-vrm-materials-hdr-emissive-multiplier/docs/classes/VRMMaterialsHDREmissiveMultiplierLoaderPlugin.html +++ b/packages/three-vrm-materials-hdr-emissive-multiplier/docs/classes/VRMMaterialsHDREmissiveMultiplierLoaderPlugin.html @@ -1,6 +1,6 @@ -VRMMaterialsHDREmissiveMultiplierLoaderPlugin | @pixiv/three-vrm-materials-hdr-emissive-multiplier

    Implements

    • GLTFLoaderPlugin

    Constructors

    constructor +VRMMaterialsHDREmissiveMultiplierLoaderPlugin | @pixiv/three-vrm-materials-hdr-emissive-multiplier

    Implements

    • GLTFLoaderPlugin

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    parser: GLTFParser
    EXTENSION_NAME: "VRMC_materials_hdr_emissiveMultiplier" = ...

    Accessors

    Methods

    • Parameters

      • materialIndex: number
      • materialParams: {
            [key: string]: any;
        }
        • [key: string]: any

      Returns Promise<void>

    +

    Constructors

    Properties

    parser: GLTFParser
    EXTENSION_NAME: "VRMC_materials_hdr_emissiveMultiplier" = ...

    Accessors

    Methods

    • Parameters

      • materialIndex: number
      • materialParams: {
            [key: string]: any;
        }
        • [key: string]: any

      Returns Promise<void>

    diff --git a/packages/three-vrm-materials-hdr-emissive-multiplier/lib/three-vrm-materials-hdr-emissive-multiplier.cjs b/packages/three-vrm-materials-hdr-emissive-multiplier/lib/three-vrm-materials-hdr-emissive-multiplier.cjs index 34d3d7c9e..78c3b81e9 100644 --- a/packages/three-vrm-materials-hdr-emissive-multiplier/lib/three-vrm-materials-hdr-emissive-multiplier.cjs +++ b/packages/three-vrm-materials-hdr-emissive-multiplier/lib/three-vrm-materials-hdr-emissive-multiplier.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.0 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.3.0 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-materials-hdr-emissive-multiplier/lib/three-vrm-materials-hdr-emissive-multiplier.module.js b/packages/three-vrm-materials-hdr-emissive-multiplier/lib/three-vrm-materials-hdr-emissive-multiplier.module.js index 0e2fb9711..7194cf272 100644 --- a/packages/three-vrm-materials-hdr-emissive-multiplier/lib/three-vrm-materials-hdr-emissive-multiplier.module.js +++ b/packages/three-vrm-materials-hdr-emissive-multiplier/lib/three-vrm-materials-hdr-emissive-multiplier.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.0 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.3.0 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-materials-mtoon/docs/classes/MToonMaterial.html b/packages/three-vrm-materials-mtoon/docs/classes/MToonMaterial.html index 7c594eca4..bec4685e2 100644 --- a/packages/three-vrm-materials-mtoon/docs/classes/MToonMaterial.html +++ b/packages/three-vrm-materials-mtoon/docs/classes/MToonMaterial.html @@ -1,7 +1,7 @@ MToonMaterial | @pixiv/three-vrm-materials-mtoon

    MToon is a material specification that has various features. The spec and implementation are originally founded for Unity engine and this is a port of the material.

    See: https://github.com/Santarh/MToon

    -

    Hierarchy

    • ShaderMaterial
      • MToonMaterial

    Constructors

    Hierarchy

    • ShaderMaterial
      • MToonMaterial

    Constructors

    Properties

    Constructors

    Properties

    alphaHash: boolean

    Enables alpha hashed transparency, an alternative to .transparent or .alphaTest. The material +

    Constructors

    Properties

    alphaHash: boolean

    Enables alpha hashed transparency, an alternative to .transparent or .alphaTest. The material will not be rendered if opacity is lower than a random threshold. Randomization introduces some grain or noise, but approximates alpha blending without the associated problems of sorting. Using TAARenderPass can reduce the resulting noise.

    @@ -220,7 +220,7 @@
    fog: boolean = true

    Whether the material is affected by fog. true by default.

    -
    forceSinglePass: boolean
    false
    +
    forceSinglePass: boolean
    false
     
    fragmentShader: string
    glslVersion: null | GLSLVersion
    null
    @@ -248,7 +248,7 @@
     
     
    normalMapType: 0 = THREE.TangentSpaceNormalMap
    opacity: number

    Opacity. Default is 1.

    +
    opacity: number

    Opacity. Default is 1.

    1
     
    @@ -333,7 +333,7 @@
    uniforms: {
        alphaTest: IUniform<number>;
        emissive: IUniform<Color>;
        emissiveIntensity: IUniform<number>;
        emissiveMap: IUniform<null | Texture>;
        emissiveMapUvTransform: IUniform<Matrix3>;
        giEqualizationFactor: IUniform<number>;
        litFactor: IUniform<Color>;
        map: IUniform<null | Texture>;
        mapUvTransform: IUniform<Matrix3>;
        matcapFactor: IUniform<Color>;
        matcapTexture: IUniform<null | Texture>;
        matcapTextureUvTransform: IUniform<Matrix3>;
        normalMap: IUniform<null | Texture>;
        normalMapUvTransform: IUniform<Matrix3>;
        normalScale: IUniform<Vector2>;
        opacity: IUniform<number>;
        outlineColorFactor: IUniform<Color>;
        outlineLightingMixFactor: IUniform<number>;
        outlineWidthFactor: IUniform<number>;
        outlineWidthMultiplyTexture: IUniform<null | Texture>;
        outlineWidthMultiplyTextureUvTransform: IUniform<Matrix3>;
        parametricRimColorFactor: IUniform<Color>;
        parametricRimFresnelPowerFactor: IUniform<number>;
        parametricRimLiftFactor: IUniform<number>;
        rimLightingMixFactor: IUniform<number>;
        rimMultiplyTexture: IUniform<null | Texture>;
        rimMultiplyTextureUvTransform: IUniform<Matrix3>;
        shadeColorFactor: IUniform<Color>;
        shadeMultiplyTexture: IUniform<null | Texture>;
        shadeMultiplyTextureUvTransform: IUniform<Matrix3>;
        shadingShiftFactor: IUniform<number>;
        shadingShiftTexture: IUniform<null | Texture>;
        shadingShiftTextureScale: IUniform<number>;
        shadingShiftTextureUvTransform: IUniform<Matrix3>;
        shadingToonyFactor: IUniform<number>;
        uvAnimationMaskTexture: IUniform<null | Texture>;
        uvAnimationMaskTextureUvTransform: IUniform<Matrix3>;
        uvAnimationRotationPhase: IUniform<number>;
        uvAnimationScrollXOffset: IUniform<number>;
        uvAnimationScrollYOffset: IUniform<number>;
    }
    {}
     
    -
    uniformsGroups: UniformsGroup[]
    uniformsNeedUpdate: boolean
    false
    +
    uniformsGroups: UniformsGroup[]
    uniformsNeedUpdate: boolean
    false
     
    userData: Record<string, any>

    An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.

    @@ -341,7 +341,7 @@
    uuid: string

    UUID of this material instance. This gets automatically assigned, so this shouldn't be edited.

    -
    uvAnimationRotationSpeedFactor: number = 0.0
    uvAnimationScrollXSpeedFactor: number = 0.0
    uvAnimationScrollYSpeedFactor: number = 0.0
    version: number

    This starts at 0 and counts how many times .needsUpdate is set to true.

    +
    uvAnimationRotationSpeedFactor: number = 0.0
    uvAnimationScrollXSpeedFactor: number = 0.0
    uvAnimationScrollYSpeedFactor: number = 0.0
    version: number

    This starts at 0 and counts how many times .needsUpdate is set to true.

    0
     
    @@ -367,34 +367,34 @@

    Parameters

    • value: number

    Returns void

    0
     
    -
    • get debugMode(): MToonMaterialDebugMode
    • Debug mode for the material. +

    • set needsUpdate(value): void
    • Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL. This property is automatically set to true when instancing a new material.

      Parameters

      • value: boolean

      Returns void

      false
       
      -
    • get v0CompatShade(): boolean
    • There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. +

    • get v0CompatShade(): boolean
    • There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. When this is true, the material enables the line to make it compatible with the legacy rendering of VRM. Usually not recommended to turn this on. false by default.

      -

      Returns boolean

    • set v0CompatShade(v): void
    • There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. +

      Returns boolean

    • set v0CompatShade(v): void
    • There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. When this is true, the material enables the line to make it compatible with the legacy rendering of VRM. Usually not recommended to turn this on. false by default.

      -

      Parameters

      • v: boolean

      Returns void

    Methods

    Methods

    • Adds a listener to an event type.

      Type Parameters

      • T extends "dispose"

      Parameters

      • type: T

        The type of event to listen to.

      • listener: EventListener<{
            dispose: {};
        }[T], T, MToonMaterial>

        The function that gets called when the event is fired.

      Returns void

    • Return a new material with the same parameters as this material.

      Returns this

    • In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader as needed.

      +

      Parameters

      • source: this

      Returns this

    • In case onBeforeCompile is used, this callback can be used to identify values of settings used in onBeforeCompile, so three.js can reuse a cached shader or recompile the shader as needed.

      Returns string

    • Fire an event type.

      Type Parameters

      • T extends "dispose"

      Parameters

      • event: BaseEvent<T> & {
            dispose: {};
        }[T]

        The event that gets fired.

      Returns void

    • Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer @@ -422,4 +422,4 @@

      Parameters

      • Optionalmeta: JSONMeta

        Object containing metadata such as textures or images for the material.

      Returns ShaderMaterialJSON

    +

    Returns void

    diff --git a/packages/three-vrm-materials-mtoon/docs/classes/MToonMaterialLoaderPlugin.html b/packages/three-vrm-materials-mtoon/docs/classes/MToonMaterialLoaderPlugin.html index 6ded2efc6..d4482ef7d 100644 --- a/packages/three-vrm-materials-mtoon/docs/classes/MToonMaterialLoaderPlugin.html +++ b/packages/three-vrm-materials-mtoon/docs/classes/MToonMaterialLoaderPlugin.html @@ -4,7 +4,7 @@
    import { MToonMaterialLoaderPlugin } from '@pixiv/three-vrm-materials-mtoon';
    import { MToonNodeMaterial } from '@pixiv/three-vrm-materials-mtoon/nodes';

    // ...

    // Register a MToonMaterialLoaderPlugin with MToonNodeMaterial
    loader.register((parser) => {

    // create a WebGPU compatible MToonMaterialLoaderPlugin
    return new MToonMaterialLoaderPlugin(parser, {

    // set the material type to MToonNodeMaterial
    materialType: MToonNodeMaterial,

    });

    });
    -

    Implements

    • GLTFLoaderPlugin

    Constructors

    Implements

    • GLTFLoaderPlugin

    Constructors

    Properties

    Debug mode for the material. +

    Constructors

    Properties

    Debug mode for the material. You can visualize several components for diagnosis using debug mode.

    See: MToonMaterialDebugMode

    'none'
     
    -
    materialType: typeof Material

    The type of the material that this plugin will generate.

    +
    materialType: typeof Material

    The type of the material that this plugin will generate.

    If you are using this plugin with WebGPU, set this to MToonNodeMaterial.

    MToonMaterial
     
    -
    parser: GLTFParser
    renderOrderOffset: number

    This value will be added to renderOrder of every meshes who have MaterialsMToon. +

    parser: GLTFParser
    renderOrderOffset: number

    This value will be added to renderOrder of every meshes who have MaterialsMToon. The final renderOrder will be sum of this renderOrderOffset and renderQueueOffsetNumber for each materials.

    0
     
    -
    v0CompatShade: boolean

    There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. +

    v0CompatShade: boolean

    There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. When this is true, the material enables the line to make it compatible with the legacy rendering of VRM. Usually not recommended to turn this on.

    false
     
    -
    EXTENSION_NAME: string = 'VRMC_materials_mtoon'

    Accessors

    Methods

    • Parameters

      • meshIndex: number

      Returns Promise<Group<Object3DEventMap> | Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | SkinnedMesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>>

    +
    EXTENSION_NAME: string = 'VRMC_materials_mtoon'

    Accessors

    Methods

    • Parameters

      • meshIndex: number

      Returns Promise<Group<Object3DEventMap> | Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | SkinnedMesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>>

    diff --git a/packages/three-vrm-materials-mtoon/docs/interfaces/MToonMaterialLoaderPluginOptions.html b/packages/three-vrm-materials-mtoon/docs/interfaces/MToonMaterialLoaderPluginOptions.html index 87d4a60df..886605600 100644 --- a/packages/three-vrm-materials-mtoon/docs/interfaces/MToonMaterialLoaderPluginOptions.html +++ b/packages/three-vrm-materials-mtoon/docs/interfaces/MToonMaterialLoaderPluginOptions.html @@ -1,4 +1,4 @@ -MToonMaterialLoaderPluginOptions | @pixiv/three-vrm-materials-mtoon
    interface MToonMaterialLoaderPluginOptions {
        debugMode?: MToonMaterialDebugMode;
        materialType?: typeof Material;
        renderOrderOffset?: number;
        v0CompatShade?: boolean;
    }

    Properties

    debugMode? +MToonMaterialLoaderPluginOptions | @pixiv/three-vrm-materials-mtoon
    interface MToonMaterialLoaderPluginOptions {
        debugMode?: MToonMaterialDebugMode;
        materialType?: typeof Material;
        renderOrderOffset?: number;
        v0CompatShade?: boolean;
    }

    Properties

    'none'
     
    -
    materialType?: typeof Material

    The type of the material that the loader plugin will generate.

    +
    materialType?: typeof Material

    The type of the material that the loader plugin will generate.

    If you are using this plugin with WebGPU, set this to MToonNodeMaterial.

    MToonMaterial
     
    -
    renderOrderOffset?: number

    This value will be added to renderOrder of every meshes who have MToonMaterial. +

    renderOrderOffset?: number

    This value will be added to renderOrder of every meshes who have MToonMaterial. The final renderOrder will be sum of this renderOrderOffset and renderQueueOffsetNumber for each materials.

    0
     
    -
    v0CompatShade?: boolean

    There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. +

    v0CompatShade?: boolean

    There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. When this is true, the material enables the line to make it compatible with the legacy rendering of VRM. Usually not recommended to turn this on.

    false
     
    -
    +
    diff --git a/packages/three-vrm-materials-mtoon/docs/interfaces/MToonMaterialParameters.html b/packages/three-vrm-materials-mtoon/docs/interfaces/MToonMaterialParameters.html index 90ac6c339..b8fa49dcf 100644 --- a/packages/three-vrm-materials-mtoon/docs/interfaces/MToonMaterialParameters.html +++ b/packages/three-vrm-materials-mtoon/docs/interfaces/MToonMaterialParameters.html @@ -1,4 +1,4 @@ -MToonMaterialParameters | @pixiv/three-vrm-materials-mtoon
    interface MToonMaterialParameters {
        alphaHash?: boolean;
        alphaTest?: number;
        alphaToCoverage?: boolean;
        blendAlpha?: number;
        blendColor?: ColorRepresentation;
        blendDst?: BlendingDstFactor;
        blendDstAlpha?: number;
        blendEquation?: BlendingEquation;
        blendEquationAlpha?: number;
        blending?: Blending;
        blendSrc?:
            | 200
            | 201
            | 202
            | 203
            | 204
            | 205
            | 206
            | 207
            | 208
            | 209
            | 210
            | 211
            | 212
            | 213
            | 214;
        blendSrcAlpha?: number;
        clipIntersection?: boolean;
        clipping?: boolean;
        clippingPlanes?: Plane[];
        clipShadows?: boolean;
        color?: Color;
        colorWrite?: boolean;
        debugMode?: MToonMaterialDebugMode;
        defines?: any;
        depthFunc?: DepthModes;
        depthTest?: boolean;
        depthWrite?: boolean;
        dithering?: boolean;
        emissive?: Color;
        emissiveIntensity?: number;
        emissiveMap?: Texture;
        extensions?: {
            clipCullDistance?: boolean;
            multiDraw?: boolean;
        };
        fog?: boolean;
        forceSinglePass?: boolean;
        format?: PixelFormat;
        fragmentShader?: string;
        giEqualizationFactor?: number;
        glslVersion?: GLSLVersion;
        ignoreVertexColor?: boolean;
        isOutline?: boolean;
        lights?: boolean;
        linewidth?: number;
        map?: Texture;
        matcapFactor?: Color;
        matcapTexture?: Texture;
        name?: string;
        normalMap?: Texture;
        normalScale?: Vector2;
        opacity?: number;
        outlineColorFactor?: Color;
        outlineLightingMixFactor?: number;
        outlineWidthFactor?: number;
        outlineWidthMode?: MToonMaterialOutlineWidthMode;
        outlineWidthMultiplyTexture?: Texture;
        parametricRimColorFactor?: Color;
        parametricRimFresnelPowerFactor?: number;
        parametricRimLiftFactor?: number;
        polygonOffset?: boolean;
        polygonOffsetFactor?: number;
        polygonOffsetUnits?: number;
        precision?:
            | null
            | "highp"
            | "mediump"
            | "lowp";
        premultipliedAlpha?: boolean;
        rimLightingMixFactor?: number;
        rimMultiplyTexture?: Texture;
        shadeColorFactor?: Color;
        shadeMultiplyTexture?: Texture;
        shadingShiftFactor?: number;
        shadingShiftTexture?: Texture;
        shadingShiftTextureScale?: number;
        shadingToonyFactor?: number;
        shadowSide?: Side;
        side?: Side;
        stencilFail?: StencilOp;
        stencilFunc?: StencilFunc;
        stencilFuncMask?: number;
        stencilRef?: number;
        stencilWrite?: boolean;
        stencilWriteMask?: number;
        stencilZFail?: StencilOp;
        stencilZPass?: StencilOp;
        toneMapped?: boolean;
        transparent?: boolean;
        transparentWithZWrite?: boolean;
        uniforms?: {
            [uniform: string]: IUniform;
        };
        uniformsGroups?: UniformsGroup[];
        userData?: Record<string, any>;
        uvAnimationMaskTexture?: Texture;
        uvAnimationRotationSpeedFactor?: number;
        uvAnimationScrollXSpeedFactor?: number;
        uvAnimationScrollYSpeedFactor?: number;
        v0CompatShade?: boolean;
        vertexColors?: boolean;
        vertexShader?: string;
        visible?: boolean;
        wireframe?: boolean;
        wireframeLinewidth?: number;
    }

    Hierarchy

    • ShaderMaterialParameters
      • MToonMaterialParameters

    Properties

    alphaHash? +MToonMaterialParameters | @pixiv/three-vrm-materials-mtoon
    interface MToonMaterialParameters {
        alphaHash?: boolean;
        alphaTest?: number;
        alphaToCoverage?: boolean;
        blendAlpha?: number;
        blendColor?: ColorRepresentation;
        blendDst?: BlendingDstFactor;
        blendDstAlpha?: number;
        blendEquation?: BlendingEquation;
        blendEquationAlpha?: number;
        blending?: Blending;
        blendSrc?:
            | 200
            | 201
            | 202
            | 203
            | 204
            | 205
            | 206
            | 207
            | 208
            | 209
            | 210
            | 211
            | 212
            | 213
            | 214;
        blendSrcAlpha?: number;
        clipIntersection?: boolean;
        clipping?: boolean;
        clippingPlanes?: Plane[];
        clipShadows?: boolean;
        color?: Color;
        colorWrite?: boolean;
        debugMode?: MToonMaterialDebugMode;
        defines?: any;
        depthFunc?: DepthModes;
        depthTest?: boolean;
        depthWrite?: boolean;
        dithering?: boolean;
        emissive?: Color;
        emissiveIntensity?: number;
        emissiveMap?: Texture;
        extensions?: {
            clipCullDistance?: boolean;
            multiDraw?: boolean;
        };
        fog?: boolean;
        forceSinglePass?: boolean;
        format?: PixelFormat;
        fragmentShader?: string;
        giEqualizationFactor?: number;
        glslVersion?: GLSLVersion;
        ignoreVertexColor?: boolean;
        isOutline?: boolean;
        lights?: boolean;
        linewidth?: number;
        map?: Texture;
        matcapFactor?: Color;
        matcapTexture?: Texture;
        name?: string;
        normalMap?: Texture;
        normalScale?: Vector2;
        opacity?: number;
        outlineColorFactor?: Color;
        outlineLightingMixFactor?: number;
        outlineWidthFactor?: number;
        outlineWidthMode?: MToonMaterialOutlineWidthMode;
        outlineWidthMultiplyTexture?: Texture;
        parametricRimColorFactor?: Color;
        parametricRimFresnelPowerFactor?: number;
        parametricRimLiftFactor?: number;
        polygonOffset?: boolean;
        polygonOffsetFactor?: number;
        polygonOffsetUnits?: number;
        precision?:
            | null
            | "highp"
            | "mediump"
            | "lowp";
        premultipliedAlpha?: boolean;
        rimLightingMixFactor?: number;
        rimMultiplyTexture?: Texture;
        shadeColorFactor?: Color;
        shadeMultiplyTexture?: Texture;
        shadingShiftFactor?: number;
        shadingShiftTexture?: Texture;
        shadingShiftTextureScale?: number;
        shadingToonyFactor?: number;
        shadowSide?: Side;
        side?: Side;
        stencilFail?: StencilOp;
        stencilFunc?: StencilFunc;
        stencilFuncMask?: number;
        stencilRef?: number;
        stencilWrite?: boolean;
        stencilWriteMask?: number;
        stencilZFail?: StencilOp;
        stencilZPass?: StencilOp;
        toneMapped?: boolean;
        transparent?: boolean;
        transparentWithZWrite?: boolean;
        uniforms?: {
            [uniform: string]: IUniform;
        };
        uniformsGroups?: UniformsGroup[];
        userData?: Record<string, any>;
        uvAnimationMaskTexture?: Texture;
        uvAnimationRotationSpeedFactor?: number;
        uvAnimationScrollXSpeedFactor?: number;
        uvAnimationScrollYSpeedFactor?: number;
        v0CompatShade?: boolean;
        vertexColors?: boolean;
        vertexShader?: string;
        visible?: boolean;
        wireframe?: boolean;
        wireframeLinewidth?: number;
    }

    Hierarchy

    • ShaderMaterialParameters
      • MToonMaterialParameters

    Properties

    alphaHash?: boolean
    alphaTest?: number
    alphaToCoverage?: boolean
    blendAlpha?: number
    blendColor?: ColorRepresentation
    blendDst?: BlendingDstFactor
    blendDstAlpha?: number
    blendEquation?: BlendingEquation
    blendEquationAlpha?: number
    blending?: Blending
    blendSrc?:
        | 200
        | 201
        | 202
        | 203
        | 204
        | 205
        | 206
        | 207
        | 208
        | 209
        | 210
        | 211
        | 212
        | 213
        | 214
    blendSrcAlpha?: number
    clipIntersection?: boolean
    clipping?: boolean
    clippingPlanes?: Plane[]
    clipShadows?: boolean
    color?: Color
    colorWrite?: boolean

    Debug mode for the material. +

    Properties

    alphaHash?: boolean
    alphaTest?: number
    alphaToCoverage?: boolean
    blendAlpha?: number
    blendColor?: ColorRepresentation
    blendDst?: BlendingDstFactor
    blendDstAlpha?: number
    blendEquation?: BlendingEquation
    blendEquationAlpha?: number
    blending?: Blending
    blendSrc?:
        | 200
        | 201
        | 202
        | 203
        | 204
        | 205
        | 206
        | 207
        | 208
        | 209
        | 210
        | 211
        | 212
        | 213
        | 214
    blendSrcAlpha?: number
    clipIntersection?: boolean
    clipping?: boolean
    clippingPlanes?: Plane[]
    clipShadows?: boolean
    color?: Color
    colorWrite?: boolean

    Debug mode for the material. You can visualize several components for diagnosis using debug mode.

    See: MToonMaterialDebugMode

    -
    defines?: any
    depthFunc?: DepthModes
    depthTest?: boolean
    depthWrite?: boolean
    dithering?: boolean
    emissive?: Color
    emissiveIntensity?: number
    emissiveMap?: Texture
    extensions?: {
        clipCullDistance?: boolean;
        multiDraw?: boolean;
    }
    fog?: boolean

    Whether the material is affected by fog. +

    defines?: any
    depthFunc?: DepthModes
    depthTest?: boolean
    depthWrite?: boolean
    dithering?: boolean
    emissive?: Color
    emissiveIntensity?: number
    emissiveMap?: Texture
    extensions?: {
        clipCullDistance?: boolean;
        multiDraw?: boolean;
    }
    fog?: boolean

    Whether the material is affected by fog. true by default.

    -
    forceSinglePass?: boolean
    format?: PixelFormat
    fragmentShader?: string
    giEqualizationFactor?: number
    glslVersion?: GLSLVersion
    ignoreVertexColor?: boolean

    When this is true, vertex colors will be ignored. +

    forceSinglePass?: boolean
    format?: PixelFormat
    fragmentShader?: string
    giEqualizationFactor?: number
    glslVersion?: GLSLVersion
    ignoreVertexColor?: boolean

    When this is true, vertex colors will be ignored. true by default.

    -
    isOutline?: boolean

    It will draw its outline instead when it's true.

    -
    lights?: boolean
    linewidth?: number
    map?: Texture
    matcapFactor?: Color
    matcapTexture?: Texture
    name?: string
    normalMap?: Texture
    normalScale?: Vector2
    opacity?: number
    outlineColorFactor?: Color
    outlineLightingMixFactor?: number
    outlineWidthFactor?: number
    outlineWidthMultiplyTexture?: Texture
    parametricRimColorFactor?: Color
    parametricRimFresnelPowerFactor?: number
    parametricRimLiftFactor?: number
    polygonOffset?: boolean
    polygonOffsetFactor?: number
    polygonOffsetUnits?: number
    precision?:
        | null
        | "highp"
        | "mediump"
        | "lowp"
    premultipliedAlpha?: boolean
    rimLightingMixFactor?: number
    rimMultiplyTexture?: Texture
    shadeColorFactor?: Color
    shadeMultiplyTexture?: Texture
    shadingShiftFactor?: number
    shadingShiftTexture?: Texture
    shadingShiftTextureScale?: number
    shadingToonyFactor?: number
    shadowSide?: Side
    side?: Side
    stencilFail?: StencilOp
    stencilFunc?: StencilFunc
    stencilFuncMask?: number
    stencilRef?: number
    stencilWrite?: boolean
    stencilWriteMask?: number
    stencilZFail?: StencilOp
    stencilZPass?: StencilOp
    toneMapped?: boolean
    transparent?: boolean
    transparentWithZWrite?: boolean

    Enable depth buffer when renderMode is transparent. +

    isOutline?: boolean

    It will draw its outline instead when it's true.

    +
    lights?: boolean
    linewidth?: number
    map?: Texture
    matcapFactor?: Color
    matcapTexture?: Texture
    name?: string
    normalMap?: Texture
    normalScale?: Vector2
    opacity?: number
    outlineColorFactor?: Color
    outlineLightingMixFactor?: number
    outlineWidthFactor?: number
    outlineWidthMultiplyTexture?: Texture
    parametricRimColorFactor?: Color
    parametricRimFresnelPowerFactor?: number
    parametricRimLiftFactor?: number
    polygonOffset?: boolean
    polygonOffsetFactor?: number
    polygonOffsetUnits?: number
    precision?:
        | null
        | "highp"
        | "mediump"
        | "lowp"
    premultipliedAlpha?: boolean
    rimLightingMixFactor?: number
    rimMultiplyTexture?: Texture
    shadeColorFactor?: Color
    shadeMultiplyTexture?: Texture
    shadingShiftFactor?: number
    shadingShiftTexture?: Texture
    shadingShiftTextureScale?: number
    shadingToonyFactor?: number
    shadowSide?: Side
    side?: Side
    stencilFail?: StencilOp
    stencilFunc?: StencilFunc
    stencilFuncMask?: number
    stencilRef?: number
    stencilWrite?: boolean
    stencilWriteMask?: number
    stencilZFail?: StencilOp
    stencilZPass?: StencilOp
    toneMapped?: boolean
    transparent?: boolean
    transparentWithZWrite?: boolean

    Enable depth buffer when renderMode is transparent. Will be processed in the constructor.

    -
    uniforms?: {
        [uniform: string]: IUniform;
    }
    uniformsGroups?: UniformsGroup[]
    userData?: Record<string, any>
    uvAnimationMaskTexture?: Texture
    uvAnimationRotationSpeedFactor?: number
    uvAnimationScrollXSpeedFactor?: number
    uvAnimationScrollYSpeedFactor?: number
    v0CompatShade?: boolean

    There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. +

    uniforms?: {
        [uniform: string]: IUniform;
    }
    uniformsGroups?: UniformsGroup[]
    userData?: Record<string, any>
    uvAnimationMaskTexture?: Texture
    uvAnimationRotationSpeedFactor?: number
    uvAnimationScrollXSpeedFactor?: number
    uvAnimationScrollYSpeedFactor?: number
    v0CompatShade?: boolean

    There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. When this is true, the material enables the line to make it compatible with the legacy rendering of VRM. Usually not recommended to turn this on. false by default.

    -
    vertexColors?: boolean
    vertexShader?: string
    visible?: boolean
    wireframe?: boolean
    wireframeLinewidth?: number
    +
    vertexColors?: boolean
    vertexShader?: string
    visible?: boolean
    wireframe?: boolean
    wireframeLinewidth?: number
    diff --git a/packages/three-vrm-materials-mtoon/docs/types/MToonMaterialDebugMode.html b/packages/three-vrm-materials-mtoon/docs/types/MToonMaterialDebugMode.html index 4da98d391..cea41d2d0 100644 --- a/packages/three-vrm-materials-mtoon/docs/types/MToonMaterialDebugMode.html +++ b/packages/three-vrm-materials-mtoon/docs/types/MToonMaterialDebugMode.html @@ -1 +1 @@ -MToonMaterialDebugMode | @pixiv/three-vrm-materials-mtoon
    +MToonMaterialDebugMode | @pixiv/three-vrm-materials-mtoon
    diff --git a/packages/three-vrm-materials-mtoon/docs/types/MToonMaterialOutlineWidthMode.html b/packages/three-vrm-materials-mtoon/docs/types/MToonMaterialOutlineWidthMode.html index 44aff4386..fa854d52f 100644 --- a/packages/three-vrm-materials-mtoon/docs/types/MToonMaterialOutlineWidthMode.html +++ b/packages/three-vrm-materials-mtoon/docs/types/MToonMaterialOutlineWidthMode.html @@ -1 +1 @@ -MToonMaterialOutlineWidthMode | @pixiv/three-vrm-materials-mtoon
    +MToonMaterialOutlineWidthMode | @pixiv/three-vrm-materials-mtoon
    diff --git a/packages/three-vrm-materials-mtoon/docs/variables/MToonMaterialDebugMode-1.html b/packages/three-vrm-materials-mtoon/docs/variables/MToonMaterialDebugMode-1.html index 07b513d07..9ead2e349 100644 --- a/packages/three-vrm-materials-mtoon/docs/variables/MToonMaterialDebugMode-1.html +++ b/packages/three-vrm-materials-mtoon/docs/variables/MToonMaterialDebugMode-1.html @@ -4,4 +4,4 @@
  • ReadonlyNone: "none"

    Render normally.

  • ReadonlyNormal: "normal"

    Visualize normals of the surface.

  • ReadonlyUV: "uv"

    Visualize UV of the surface.

    -
  • +
    diff --git a/packages/three-vrm-materials-mtoon/docs/variables/MToonMaterialOutlineWidthMode-1.html b/packages/three-vrm-materials-mtoon/docs/variables/MToonMaterialOutlineWidthMode-1.html index 2a0683ebd..213857684 100644 --- a/packages/three-vrm-materials-mtoon/docs/variables/MToonMaterialOutlineWidthMode-1.html +++ b/packages/three-vrm-materials-mtoon/docs/variables/MToonMaterialOutlineWidthMode-1.html @@ -1 +1 @@ -MToonMaterialOutlineWidthMode | @pixiv/three-vrm-materials-mtoon

    Variable MToonMaterialOutlineWidthModeConst

    MToonMaterialOutlineWidthMode: {
        None: "none";
        ScreenCoordinates: "screenCoordinates";
        WorldCoordinates: "worldCoordinates";
    } = ...
    +MToonMaterialOutlineWidthMode | @pixiv/three-vrm-materials-mtoon

    Variable MToonMaterialOutlineWidthModeConst

    MToonMaterialOutlineWidthMode: {
        None: "none";
        ScreenCoordinates: "screenCoordinates";
        WorldCoordinates: "worldCoordinates";
    } = ...
    diff --git a/packages/three-vrm-materials-mtoon/lib/nodes/index.cjs b/packages/three-vrm-materials-mtoon/lib/nodes/index.cjs index aed7dbf53..26da9841f 100644 --- a/packages/three-vrm-materials-mtoon/lib/nodes/index.cjs +++ b/packages/three-vrm-materials-mtoon/lib/nodes/index.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-materials-mtoon/lib/nodes/index.module.js b/packages/three-vrm-materials-mtoon/lib/nodes/index.module.js index 9d213779e..362366c88 100644 --- a/packages/three-vrm-materials-mtoon/lib/nodes/index.module.js +++ b/packages/three-vrm-materials-mtoon/lib/nodes/index.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-materials-mtoon/lib/three-vrm-materials-mtoon.cjs b/packages/three-vrm-materials-mtoon/lib/three-vrm-materials-mtoon.cjs index 0e0b1ed25..3e3cc907c 100644 --- a/packages/three-vrm-materials-mtoon/lib/three-vrm-materials-mtoon.cjs +++ b/packages/three-vrm-materials-mtoon/lib/three-vrm-materials-mtoon.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-materials-mtoon/lib/three-vrm-materials-mtoon.module.js b/packages/three-vrm-materials-mtoon/lib/three-vrm-materials-mtoon.module.js index a057e46dd..a683ef31a 100644 --- a/packages/three-vrm-materials-mtoon/lib/three-vrm-materials-mtoon.module.js +++ b/packages/three-vrm-materials-mtoon/lib/three-vrm-materials-mtoon.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-materials-v0compat/docs/classes/VRMMaterialsV0CompatPlugin.html b/packages/three-vrm-materials-v0compat/docs/classes/VRMMaterialsV0CompatPlugin.html index 6e46e38e5..92dd946fa 100644 --- a/packages/three-vrm-materials-v0compat/docs/classes/VRMMaterialsV0CompatPlugin.html +++ b/packages/three-vrm-materials-v0compat/docs/classes/VRMMaterialsV0CompatPlugin.html @@ -1,5 +1,5 @@ -VRMMaterialsV0CompatPlugin | @pixiv/three-vrm-materials-v0compat

    Implements

    • GLTFLoaderPlugin

    Constructors

    constructor +VRMMaterialsV0CompatPlugin | @pixiv/three-vrm-materials-v0compat

    Implements

    • GLTFLoaderPlugin

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    parser: GLTFParser

    Accessors

    Methods

    +

    Constructors

    Properties

    parser: GLTFParser

    Accessors

    Methods

    diff --git a/packages/three-vrm-materials-v0compat/lib/three-vrm-materials-v0compat.cjs b/packages/three-vrm-materials-v0compat/lib/three-vrm-materials-v0compat.cjs index c353dc10e..5e8be9ca9 100644 --- a/packages/three-vrm-materials-v0compat/lib/three-vrm-materials-v0compat.cjs +++ b/packages/three-vrm-materials-v0compat/lib/three-vrm-materials-v0compat.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-materials-v0compat v3.2.0 + * @pixiv/three-vrm-materials-v0compat v3.3.0 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-materials-v0compat/lib/three-vrm-materials-v0compat.module.js b/packages/three-vrm-materials-v0compat/lib/three-vrm-materials-v0compat.module.js index 541578e1f..975d85f19 100644 --- a/packages/three-vrm-materials-v0compat/lib/three-vrm-materials-v0compat.module.js +++ b/packages/three-vrm-materials-v0compat/lib/three-vrm-materials-v0compat.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-materials-v0compat v3.2.0 + * @pixiv/three-vrm-materials-v0compat v3.3.0 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-node-constraint/docs/classes/VRMAimConstraint.html b/packages/three-vrm-node-constraint/docs/classes/VRMAimConstraint.html index c49b5df72..4f31b9e44 100644 --- a/packages/three-vrm-node-constraint/docs/classes/VRMAimConstraint.html +++ b/packages/three-vrm-node-constraint/docs/classes/VRMAimConstraint.html @@ -1,6 +1,6 @@ VRMAimConstraint | @pixiv/three-vrm-node-constraint

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Methods

    Constructors

    Properties

    destination: Object3D<Object3DEventMap>

    The object being constrained by the source.

    -
    source: Object3D<Object3DEventMap>

    The object constrains the destination.

    -
    weight: number

    The weight of the constraint.

    -

    Accessors

    • get aimAxis():
          | "PositiveX"
          | "NegativeX"
          | "PositiveY"
          | "NegativeY"
          | "PositiveZ"
          | "NegativeZ"
    • The aim axis of the constraint.

      -

      Returns
          | "PositiveX"
          | "NegativeX"
          | "PositiveY"
          | "NegativeY"
          | "PositiveZ"
          | "NegativeZ"

    • set aimAxis(aimAxis): void
    • The aim axis of the constraint.

      -

      Parameters

      • aimAxis:
            | "PositiveX"
            | "NegativeX"
            | "PositiveY"
            | "NegativeY"
            | "PositiveZ"
            | "NegativeZ"

      Returns void

    Methods

    +

    Constructors

    Properties

    destination: Object3D<Object3DEventMap>

    The object being constrained by the source.

    +
    source: Object3D<Object3DEventMap>

    The object constrains the destination.

    +
    weight: number

    The weight of the constraint.

    +

    Accessors

    • get aimAxis():
          | "PositiveX"
          | "NegativeX"
          | "PositiveY"
          | "NegativeY"
          | "PositiveZ"
          | "NegativeZ"
    • The aim axis of the constraint.

      +

      Returns
          | "PositiveX"
          | "NegativeX"
          | "PositiveY"
          | "NegativeY"
          | "PositiveZ"
          | "NegativeZ"

    • set aimAxis(aimAxis): void
    • The aim axis of the constraint.

      +

      Parameters

      • aimAxis:
            | "PositiveX"
            | "NegativeX"
            | "PositiveY"
            | "NegativeY"
            | "PositiveZ"
            | "NegativeZ"

      Returns void

    Methods

    diff --git a/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraint.html b/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraint.html index 4658e387b..58148e3cb 100644 --- a/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraint.html +++ b/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraint.html @@ -1,5 +1,5 @@ VRMNodeConstraint | @pixiv/three-vrm-node-constraint

    A base class of VRM constraint classes.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    destination source weight @@ -8,9 +8,9 @@ update

    Constructors

    Properties

    destination: Object3D<Object3DEventMap>

    The object being constrained by the source.

    -
    source: Object3D<Object3DEventMap>

    The object constrains the destination.

    -
    weight: number

    The weight of the constraint.

    -

    Accessors

    Methods

    +

    Returns VRMNodeConstraint

    Properties

    destination: Object3D<Object3DEventMap>

    The object being constrained by the source.

    +
    source: Object3D<Object3DEventMap>

    The object constrains the destination.

    +
    weight: number

    The weight of the constraint.

    +

    Accessors

    Methods

    diff --git a/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraintHelper.html b/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraintHelper.html index 9d40aeffe..ae0be5ef2 100644 --- a/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraintHelper.html +++ b/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraintHelper.html @@ -1,4 +1,4 @@ -VRMNodeConstraintHelper | @pixiv/three-vrm-node-constraint

    Hierarchy

    • Group
      • VRMNodeConstraintHelper

    Constructors

    constructor +VRMNodeConstraintHelper | @pixiv/three-vrm-node-constraint

    Hierarchy

    • Group
      • VRMNodeConstraintHelper

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    +

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    []

    castShadow: boolean

    Whether the object gets rendered into shadow map.

    false

    children: Object3D<Object3DEventMap>[]

    Array with object's children.

    THREE.Object3DGroup | Group for info on manually grouping objects.

    []

    -
    constraint: VRMNodeConstraint
    customDepthMaterial?: Material

    Custom depth material to be used when rendering to the depth map.

    +
    constraint: VRMNodeConstraint
    customDepthMaterial?: Material

    Custom depth material to be used when rendering to the depth map.

    Can only be used in context of meshes. When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.

    @@ -317,7 +317,7 @@ And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.

    Parameters

    • Optionalforce: boolean

      A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame. Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.

      -

    Returns void

    • Updates the global transform of the object.

      +

    Returns void

    • Updates the global transform of the object.

      Parameters

      • updateParents: boolean

        Recursively updates global transform of ancestors.

      • updateChildren: boolean

        Recursively updates global transform of descendants.

      Returns void

    Returns Promise<null | VRMNodeConstraintManager>

    diff --git a/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraintManager.html b/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraintManager.html index f786c5667..ee756bdf6 100644 --- a/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraintManager.html +++ b/packages/three-vrm-node-constraint/docs/classes/VRMNodeConstraintManager.html @@ -1,7 +1,7 @@ -VRMNodeConstraintManager | @pixiv/three-vrm-node-constraint

    Constructors

    constructor +VRMNodeConstraintManager | @pixiv/three-vrm-node-constraint

    Constructors

    Accessors

    Methods

    +

    Constructors

    Accessors

    Methods

    diff --git a/packages/three-vrm-node-constraint/docs/classes/VRMRollConstraint.html b/packages/three-vrm-node-constraint/docs/classes/VRMRollConstraint.html index 07c61930c..8054014bf 100644 --- a/packages/three-vrm-node-constraint/docs/classes/VRMRollConstraint.html +++ b/packages/three-vrm-node-constraint/docs/classes/VRMRollConstraint.html @@ -1,6 +1,6 @@ VRMRollConstraint | @pixiv/three-vrm-node-constraint

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    destination source weight @@ -8,11 +8,11 @@ rollAxis

    Methods

    Constructors

    Properties

    destination: Object3D<Object3DEventMap>

    The object being constrained by the source.

    -
    source: Object3D<Object3DEventMap>

    The object constrains the destination.

    -
    weight: number

    The weight of the constraint.

    -

    Accessors

    Methods

    +

    Constructors

    Properties

    destination: Object3D<Object3DEventMap>

    The object being constrained by the source.

    +
    source: Object3D<Object3DEventMap>

    The object constrains the destination.

    +
    weight: number

    The weight of the constraint.

    +

    Accessors

    Methods

    diff --git a/packages/three-vrm-node-constraint/docs/classes/VRMRotationConstraint.html b/packages/three-vrm-node-constraint/docs/classes/VRMRotationConstraint.html index 7b0fecc2f..dd605e939 100644 --- a/packages/three-vrm-node-constraint/docs/classes/VRMRotationConstraint.html +++ b/packages/three-vrm-node-constraint/docs/classes/VRMRotationConstraint.html @@ -1,15 +1,15 @@ VRMRotationConstraint | @pixiv/three-vrm-node-constraint

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    destination: Object3D<Object3DEventMap>

    The object being constrained by the source.

    -
    source: Object3D<Object3DEventMap>

    The object constrains the destination.

    -
    weight: number

    The weight of the constraint.

    -

    Accessors

    Methods

    +

    Constructors

    Properties

    destination: Object3D<Object3DEventMap>

    The object being constrained by the source.

    +
    source: Object3D<Object3DEventMap>

    The object constrains the destination.

    +
    weight: number

    The weight of the constraint.

    +

    Accessors

    Methods

    diff --git a/packages/three-vrm-node-constraint/lib/three-vrm-node-constraint.cjs b/packages/three-vrm-node-constraint/lib/three-vrm-node-constraint.cjs index 29f8128bc..0508805dc 100644 --- a/packages/three-vrm-node-constraint/lib/three-vrm-node-constraint.cjs +++ b/packages/three-vrm-node-constraint/lib/three-vrm-node-constraint.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-node-constraint v3.2.0 + * @pixiv/three-vrm-node-constraint v3.3.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-node-constraint/lib/three-vrm-node-constraint.module.js b/packages/three-vrm-node-constraint/lib/three-vrm-node-constraint.module.js index 7d59cf8d7..cf198d830 100644 --- a/packages/three-vrm-node-constraint/lib/three-vrm-node-constraint.module.js +++ b/packages/three-vrm-node-constraint/lib/three-vrm-node-constraint.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-node-constraint v3.2.0 + * @pixiv/three-vrm-node-constraint v3.3.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-springbone/docs/assets/search.js b/packages/three-vrm-springbone/docs/assets/search.js index cbec5af0a..891308819 100644 --- a/packages/three-vrm-springbone/docs/assets/search.js +++ b/packages/three-vrm-springbone/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7WcbW/bOBLHv4vy1siaz3be3XZ7dz1se0Vz2DvACAqtpSTacyxDktsugnz3BfVgzXjImHrIKzcuZ/gn+ZshRVJ+jor8exndbJ6j/2f7JLphfLWI9vFTGt1Ev335eHsosv3Dz/k+fZfvdlmSFv9Md4e0iBbRsdhFN9F2F5dlWv70Stnrx+ppFy26otFNFL0suvoU46f6tvm+rIrjtsqH+7/CxqCuRXSIi3RfXWhQL4ktuQSamlJjBJ0sp6jhS9mPSJKVh7xMh4vpDWfTcjwkcZV+jKsi+/HfvNglw1W5XEwaOR+8/8qzfRVCLig4P7bnzoczC9vhAbY8FR4oBhmO1jIcVyJkEKsBKgaCSvSMpNQzVpfya1gUvV1OnZhNvVg+xofAvNXi2BqMq5sr/Xo3/6PIj4eTnmxfpcV9vPVJqku/2ufOSaMcUcEVNB7Q+KZBHkH1xwgtrd0UGZd4vw0Hoy76duT37sfj37QGcKg5k/04VH8Ob+tVazRFBUyH23i3Pe7iqildZvl+ePe4XEzQFwbJu/hQHndD+q+1eGNkYC0TyemaOBdASNpIjqgmlFry+/syrcZqOlnPrKqKs93ofmpsZ1ZUxEl2LMdqOlnPrCrbl1kymqiT9Qycz5aicDjOkakcfRiUsD7v4kurcFr+jZNVX8fEVNU0bq5EBWSNTFPneqYlKaBndIp6VdE+L57iISkKKDrZTh6z2YIOYjVHyJG+Cwq428NjWgzBrjF445ADlUyMubZ9cwUdFDYy6oiiaWEHFY2Ou9c1DZ6HoabR0/DrmgbPwlDT6EmY0jRbOkDIz5EPaP+9utUXsMPzRtt7Uzb2vHsnaVVl+4cL0ILqgcHUurvdiPq5PlwBMZuq4/ewDc2m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EDKcaEBWF73XNnr3vW6eZwuu4JghzkahnW1O5SOwgb4IS3ESPCRrNm3pMmAP0qrMnd1RfQb2AodRgT51gxmBXaOFdhreveBgL9DZyJsOTQvWwBFIFA5m0QijYjiTDIuutpoLsBYSqMBIopA05421ci0Fl61koBukotGysT1mVlWln6y+YaA3AJolG2qduwUJftCT4YTJBwZBhc7U8n9D5Ah7HAxjmTO8ztA93ggAEZWcswT/1xPfADcoIJm5Sbl3sBTGBJxMOkNK9KARdgtmKrds5u52jRMiXC1HXXQwBNoKtUG34mDIPG2VP9uyXfm98tAV0HqGrsw7LNsUzT9hqsc70kQH+qMEi+FU89J671JnDJwpYUTpcPzU9+9H4BPSysS51+H9vfFeodgwwwQS8JYwZYYGFA+R1vu19TAP7BZMinCj80Lz+DRAZ6hYela7/3sn3TE7gHnSPCAhm5JwtjDsJahuVv6pCyARccI526pgkJgsSMaP6uvg59aN/uAPEMekGFzR3I71N3bRpIBSDogI69W0SH7JDusn0a3WzuXl7+AhmpXW+1TgAA"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7WcbW/bOBLHv4vy1siaz3Le3XZ7dz1se0Vz2DvACAqtpSTac2xDktsugnz3BfVgzXjImHrIK/eBM/yT/M1wTFF+jor99zK6WT9H/893aXTDeLyIdslTFt1Ev335eHso8t3Dz/td9m6/3eZpVvwz2x6yIlpEx2Ib3USbbVKWWfnTK22vH6unbbTomkY3UfSy6PpTjJ/62+x3ZVUcN9V+uP8rbAz6WkSHpMh21YUB9ZLYkkugqWk1RtDJcooavpT9iqR5ediX2XAxveFsWo6HNKmyj0lV5D/+uy+26XBVLheTVs4H77/2+a4KIRc0nB/bc+fDmYXj8ABbnhoPFIMMR2sZjisRMojVABUDQSV6RlLqWatL+TUsit4up07Mpl4sH5NDYN5qcWwNZui7y8TNEg6bhjPLcWocONYgDRfkMh6pSenXQfxHsT8eTtryXZUV98nGJ69u/SqVziUpR3RwBY0HDL4ZkEdQ/TFCS2s3Rca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5Pepu0EPcgTYcXXAHNwtokN+yLb5Lotu1ncvL38Bm0vSofBSAAA="; \ No newline at end of file diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneCollider.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneCollider.html index 3825db7ae..5b862a893 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneCollider.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneCollider.html @@ -1,8 +1,9 @@ VRMSpringBoneCollider | @pixiv/three-vrm-springbone

    Represents a collider of a VRM.

    -

    Hierarchy

    • Object3D
      • VRMSpringBoneCollider

    Constructors

    Hierarchy

    • Object3D
      • VRMSpringBoneCollider

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    +

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    []

    castShadow: boolean

    Whether the object gets rendered into shadow map.

    false

    children: Object3D<Object3DEventMap>[]

    Array with object's children.

    THREE.Object3DGroup | Group for info on manually grouping objects.

    []

    -
    customDepthMaterial?: Material

    Custom depth material to be used when rendering to the depth map.

    +
    colliderMatrix: Matrix4 = ...

    World space matrix for the collider shape used in collision calculations.

    +
    customDepthMaterial?: Material

    Custom depth material to be used when rendering to the depth map.

    Can only be used in context of meshes. When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.

    @@ -146,7 +148,7 @@
    scale: Vector3

    The object's local scale.

    new THREE.Vector3( 1, 1, 1 )

    The shape of the collider.

    -
    type: string

    A Read-only string to check this object type.

    +
    type: string

    A Read-only string to check this object type.

    This can be used to find a specific type of Object3D in a scene. Sub-classes will update this value.

    Object3D

    @@ -315,9 +317,9 @@ And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.

    Parameters

    • Optionalforce: boolean

      A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame. Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.

      -

    Returns void

    • Updates the global transform of the object.

      +

    Returns void

    • Updates the global transform of the object.

      Parameters

      • updateParents: boolean

        Recursively updates global transform of ancestors.

      • updateChildren: boolean

        Recursively updates global transform of descendants.

        -

      Returns void

    • Converts the vector from world space to this object's local space.

      +

    Returns void

    • Converts the vector from world space to this object's local space.

      Parameters

      • vector: Vector3

        A vector representing a position in world space.

        -

      Returns Vector3

    +

    Returns Vector3

    diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderHelper.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderHelper.html index ce91a093f..0a2d5643c 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderHelper.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderHelper.html @@ -1,4 +1,4 @@ -VRMSpringBoneColliderHelper | @pixiv/three-vrm-springbone

    Hierarchy

    • Group
      • VRMSpringBoneColliderHelper

    Constructors

    constructor +VRMSpringBoneColliderHelper | @pixiv/three-vrm-springbone

    Hierarchy

    • Group
      • VRMSpringBoneColliderHelper

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    +

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    []

    castShadow: boolean

    Whether the object gets rendered into shadow map.

    false

    children: Object3D<Object3DEventMap>[]

    Array with object's children.

    THREE.Object3DGroup | Group for info on manually grouping objects.

    []

    -
    customDepthMaterial?: Material

    Custom depth material to be used when rendering to the depth map.

    +
    customDepthMaterial?: Material

    Custom depth material to be used when rendering to the depth map.

    Can only be used in context of meshes. When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.

    @@ -193,7 +193,7 @@

    Returns this

    Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

    • Fire an event type.

      Type Parameters

      • T extends keyof Object3DEventMap

      Parameters

      • event: BaseEvent<T> & Object3DEventMap[T]

        The event that gets fired.

        -

      Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      +

    Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      Parameters

      • id: number

        Unique number of the object instance. Expects a Integer

      Returns undefined | Object3D<Object3DEventMap>

      Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

      id

      @@ -318,7 +318,7 @@ And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.

      Parameters

      • force: boolean

        A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame. Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.

        -

      Returns void

    • Updates the global transform of the object.

      +

    Returns void

    • Updates the global transform of the object.

      Parameters

      • updateParents: boolean

        Recursively updates global transform of ancestors.

      • updateChildren: boolean

        Recursively updates global transform of descendants.

      Returns void

    Returns number

    diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapeCapsule.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapeCapsule.html index 82c622780..cbceed1ca 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapeCapsule.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapeCapsule.html @@ -1,21 +1,21 @@ VRMSpringBoneColliderShapeCapsule | @pixiv/three-vrm-springbone

    Represents a shape of a collider.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    inside: boolean

    If true, the collider prevents spring bones from going outside of the capsule instead.

    -
    offset: Vector3

    The offset of the capsule head from the origin in local space.

    -
    radius: number

    The radius of the capsule.

    -
    tail: Vector3

    The offset of the capsule tail from the origin in local space.

    -

    Accessors

    Methods

    • Calculate a distance and a direction from the collider to a target object. +

    Constructors

    Properties

    inside: boolean

    If true, the collider prevents spring bones from going outside of the capsule instead.

    +
    offset: Vector3

    The offset of the capsule head from the origin in local space.

    +
    radius: number

    The radius of the capsule.

    +
    tail: Vector3

    The offset of the capsule tail from the origin in local space.

    +

    Accessors

    Methods

    • Calculate a distance and a direction from the collider to a target object. It's hit if the distance is negative. The direction will be contained in the given target vector.

      Parameters

      • colliderMatrix: Matrix4

        A matrix represents the transform of the collider

      • objectPosition: Vector3

        A vector represents the position of the target object

      • objectRadius: number

        The radius of the object

      • target: Vector3

        The result direction will be contained in this vector

        -

      Returns number

    +

    Returns number

    diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapePlane.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapePlane.html index 063c7561d..b8071259a 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapePlane.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapePlane.html @@ -1,17 +1,17 @@ VRMSpringBoneColliderShapePlane | @pixiv/three-vrm-springbone

    Represents a shape of a collider.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    normal: Vector3

    The normal of the plane in local space. Must be normalized.

    -
    offset: Vector3

    The offset of the plane from the origin in local space.

    -

    Accessors

    Methods

    • Calculate a distance and a direction from the collider to a target object. +

    Constructors

    Properties

    normal: Vector3

    The normal of the plane in local space. Must be normalized.

    +
    offset: Vector3

    The offset of the plane from the origin in local space.

    +

    Accessors

    Methods

    • Calculate a distance and a direction from the collider to a target object. It's hit if the distance is negative. The direction will be contained in the given target vector.

      Parameters

      • colliderMatrix: Matrix4

        A matrix represents the transform of the collider

      • objectPosition: Vector3

        A vector represents the position of the target object

      • objectRadius: number

        The radius of the object

      • target: Vector3

        The result direction will be contained in this vector

        -

      Returns number

    +

    Returns number

    diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapeSphere.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapeSphere.html index e466e6db9..a1a26862e 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapeSphere.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderShapeSphere.html @@ -1,19 +1,19 @@ VRMSpringBoneColliderShapeSphere | @pixiv/three-vrm-springbone

    Represents a shape of a collider.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    inside: boolean

    If true, the collider prevents spring bones from going outside of the sphere instead.

    -
    offset: Vector3

    The offset of the sphere from the origin in local space.

    -
    radius: number

    The radius.

    -

    Accessors

    Methods

    • Calculate a distance and a direction from the collider to a target object. +

    Constructors

    Properties

    inside: boolean

    If true, the collider prevents spring bones from going outside of the sphere instead.

    +
    offset: Vector3

    The offset of the sphere from the origin in local space.

    +
    radius: number

    The radius.

    +

    Accessors

    Methods

    • Calculate a distance and a direction from the collider to a target object. It's hit if the distance is negative. The direction will be contained in the given target vector.

      Parameters

      • colliderMatrix: Matrix4

        A matrix represents the transform of the collider

      • objectPosition: Vector3

        A vector represents the position of the target object

      • objectRadius: number

        The radius of the object

      • target: Vector3

        The result direction will be contained in this vector

        -

      Returns number

    +

    Returns number

    diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJoint.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJoint.html index b6628a782..01c02e6e2 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJoint.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJoint.html @@ -1,11 +1,12 @@ VRMSpringBoneJoint | @pixiv/three-vrm-springbone

    A class represents a single joint of a spring bone. It should be managed by a [[VRMSpringBoneManager]].

    -

    Constructors

    Constructors

    Properties

    Accessors

    Methods

    reset setInitState @@ -15,16 +16,17 @@
  • child: null | Object3D<Object3DEventMap>

    An Object3D that will be used as a tail of this spring bone. It can be null when the spring bone is imported from VRM 0.0

  • settings: Partial<VRMSpringBoneJointSettings> = {}

    Several parameters related to behavior of the spring bone

  • colliderGroups: VRMSpringBoneColliderGroup[] = []

    Collider groups that will be collided with this spring bone

    -
  • Returns VRMSpringBoneJoint

    Properties

    bone: Object3D<Object3DEventMap>

    An Object3D attached to this bone.

    -
    child: null | Object3D<Object3DEventMap>

    An Object3D that will be used as a tail of this spring bone. +

    Returns VRMSpringBoneJoint

    Properties

    bone: Object3D<Object3DEventMap>

    An Object3D attached to this bone.

    +
    child: null | Object3D<Object3DEventMap>

    An Object3D that will be used as a tail of this spring bone. It can be null when the spring bone is imported from VRM 0.0.

    -
    colliderGroups: VRMSpringBoneColliderGroup[]

    Collider groups attached to this bone.

    -

    Settings of the bone.

    -

    Accessors

    Methods

    colliderGroups: VRMSpringBoneColliderGroup[]

    Collider groups attached to this bone.

    +

    Settings of the bone.

    +

    Accessors

    Methods

    +

    Returns void

    diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJointHelper.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJointHelper.html index d27bf7c94..fc02c40ea 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJointHelper.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJointHelper.html @@ -1,4 +1,4 @@ -VRMSpringBoneJointHelper | @pixiv/three-vrm-springbone

    Hierarchy

    • Group
      • VRMSpringBoneJointHelper

    Constructors

    constructor +VRMSpringBoneJointHelper | @pixiv/three-vrm-springbone

    Hierarchy

    • Group
      • VRMSpringBoneJointHelper

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    +

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    []

    castShadow: boolean

    Whether the object gets rendered into shadow map.

    false

    @@ -149,7 +149,7 @@

    new THREE.Euler() - that is (0, 0, 0, Euler.DEFAULT_ORDER).

    scale: Vector3

    The object's local scale.

    new THREE.Vector3( 1, 1, 1 )

    -
    springBone: VRMSpringBoneJoint
    type: string

    A Read-only string to check this object type.

    +
    springBone: VRMSpringBoneJoint
    type: string

    A Read-only string to check this object type.

    This can be used to find a specific type of Object3D in a scene. Sub-classes will update this value.

    Object3D

    @@ -193,7 +193,7 @@

    Returns this

    Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

    • Fire an event type.

      Type Parameters

      • T extends keyof Object3DEventMap

      Parameters

      • event: BaseEvent<T> & Object3DEventMap[T]

        The event that gets fired.

        -

      Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      +

    Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      Parameters

      • id: number

        Unique number of the object instance. Expects a Integer

      Returns undefined | Object3D<Object3DEventMap>

      Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

      id

      @@ -318,7 +318,7 @@ And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.

      Parameters

      • force: boolean

        A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame. Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.

        -

      Returns void

    • Updates the global transform of the object.

      +

    Returns void

    • Updates the global transform of the object.

      Parameters

      • updateParents: boolean

        Recursively updates global transform of ancestors.

      • updateChildren: boolean

        Recursively updates global transform of descendants.

      Returns void

    EXTENSION_NAME: "VRMC_springBone" = 'VRMC_springBone'

    Accessors

    Methods

    diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneManager.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneManager.html index f4c3374de..d48e068d9 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneManager.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneManager.html @@ -1,4 +1,4 @@ -VRMSpringBoneManager | @pixiv/three-vrm-springbone

    Constructors

    constructor +VRMSpringBoneManager | @pixiv/three-vrm-springbone

    Constructors

    Accessors

    Constructors

    Accessors

    Methods

    +

    Constructors

    Accessors

    Methods

    diff --git a/packages/three-vrm-springbone/docs/interfaces/VRMSpringBoneColliderGroup.html b/packages/three-vrm-springbone/docs/interfaces/VRMSpringBoneColliderGroup.html index 9fa4f4788..d7afd2f84 100644 --- a/packages/three-vrm-springbone/docs/interfaces/VRMSpringBoneColliderGroup.html +++ b/packages/three-vrm-springbone/docs/interfaces/VRMSpringBoneColliderGroup.html @@ -1,6 +1,6 @@ VRMSpringBoneColliderGroup | @pixiv/three-vrm-springbone

    Interface VRMSpringBoneColliderGroup

    Represents a collider group of a VRM.

    -
    interface VRMSpringBoneColliderGroup {
        colliders: VRMSpringBoneCollider[];
        name?: string;
    }

    Properties

    interface VRMSpringBoneColliderGroup {
        colliders: VRMSpringBoneCollider[];
        name?: string;
    }

    Properties

    Properties

    The colliders of the collider group.

    -
    name?: string

    The name of the collider.

    -
    +
    name?: string

    The name of the collider.

    +
    diff --git a/packages/three-vrm-springbone/docs/interfaces/VRMSpringBoneJointSettings.html b/packages/three-vrm-springbone/docs/interfaces/VRMSpringBoneJointSettings.html index ce607c758..23ef52a48 100644 --- a/packages/three-vrm-springbone/docs/interfaces/VRMSpringBoneJointSettings.html +++ b/packages/three-vrm-springbone/docs/interfaces/VRMSpringBoneJointSettings.html @@ -1,7 +1,7 @@ -VRMSpringBoneJointSettings | @pixiv/three-vrm-springbone

    Interface VRMSpringBoneJointSettings

    interface VRMSpringBoneJointSettings {
        dragForce: number;
        gravityDir: Vector3;
        gravityPower: number;
        hitRadius: number;
        stiffness: number;
    }

    Properties

    dragForce +VRMSpringBoneJointSettings | @pixiv/three-vrm-springbone

    Interface VRMSpringBoneJointSettings

    interface VRMSpringBoneJointSettings {
        dragForce: number;
        gravityDir: Vector3;
        gravityPower: number;
        hitRadius: number;
        stiffness: number;
    }

    Properties

    dragForce: number
    gravityDir: Vector3
    gravityPower: number
    hitRadius: number

    Radius of the bone, will be used for collision.

    -
    stiffness: number
    +

    Properties

    dragForce: number
    gravityDir: Vector3
    gravityPower: number
    hitRadius: number

    Radius of the bone, will be used for collision.

    +
    stiffness: number
    diff --git a/packages/three-vrm-springbone/lib/three-vrm-springbone.cjs b/packages/three-vrm-springbone/lib/three-vrm-springbone.cjs index 8de309392..3d96aae12 100644 --- a/packages/three-vrm-springbone/lib/three-vrm-springbone.cjs +++ b/packages/three-vrm-springbone/lib/three-vrm-springbone.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-springbone v3.2.0 + * @pixiv/three-vrm-springbone v3.3.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -97,8 +97,8 @@ var VRMSpringBoneColliderShapeCapsule = class extends VRMSpringBoneColliderShape this.inside = (_d = params == null ? void 0 : params.inside) != null ? _d : false; } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - _v3A.copy(this.offset).applyMatrix4(colliderMatrix); - _v3B.copy(this.tail).applyMatrix4(colliderMatrix); + _v3A.setFromMatrixPosition(colliderMatrix); + _v3B.subVectors(this.tail, this.offset).applyMatrix4(colliderMatrix); _v3B.sub(_v3A); const lengthSqCapsule = _v3B.lengthSq(); target.copy(objectPosition).sub(_v3A); @@ -110,10 +110,13 @@ var VRMSpringBoneColliderShapeCapsule = class extends VRMSpringBoneColliderShape _v3B.multiplyScalar(dot / lengthSqCapsule); target.sub(_v3B); } - const distance = this.inside ? this.radius - objectRadius - target.length() : target.length() - objectRadius - this.radius; - target.normalize(); - if (this.inside) { - target.negate(); + const length = target.length(); + const distance = this.inside ? this.radius - objectRadius - length : length - objectRadius - this.radius; + if (distance < 0) { + target.multiplyScalar(1 / length); + if (this.inside) { + target.negate(); + } } return distance; } @@ -134,7 +137,7 @@ var VRMSpringBoneColliderShapePlane = class extends VRMSpringBoneColliderShape { this.normal = (_b = params == null ? void 0 : params.normal) != null ? _b : new THREE2.Vector3(0, 0, 1); } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - target.copy(this.offset).applyMatrix4(colliderMatrix); + target.setFromMatrixPosition(colliderMatrix); target.negate().add(objectPosition); _mat3A.getNormalMatrix(colliderMatrix); _v3A2.copy(this.normal).applyNormalMatrix(_mat3A).normalize(); @@ -146,6 +149,7 @@ var VRMSpringBoneColliderShapePlane = class extends VRMSpringBoneColliderShape { // src/VRMSpringBoneColliderShapeSphere.ts var THREE3 = __toESM(require("three"), 1); +var _v3A3 = new THREE3.Vector3(); var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape { get type() { return "sphere"; @@ -158,12 +162,14 @@ var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape this.inside = (_c = params == null ? void 0 : params.inside) != null ? _c : false; } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - target.copy(this.offset).applyMatrix4(colliderMatrix); - target.negate().add(objectPosition); - const distance = this.inside ? this.radius - objectRadius - target.length() : target.length() - objectRadius - this.radius; - target.normalize(); - if (this.inside) { - target.negate(); + target.subVectors(objectPosition, _v3A3.setFromMatrixPosition(colliderMatrix)); + const length = target.length(); + const distance = this.inside ? this.radius - objectRadius - length : length - objectRadius - this.radius; + if (distance < 0) { + target.multiplyScalar(1 / length); + if (this.inside) { + target.negate(); + } } return distance; } @@ -171,7 +177,7 @@ var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape // src/helpers/utils/ColliderShapeCapsuleBufferGeometry.ts var THREE4 = __toESM(require("three"), 1); -var _v3A3 = new THREE4.Vector3(); +var _v3A4 = new THREE4.Vector3(); var ColliderShapeCapsuleBufferGeometry = class extends THREE4.BufferGeometry { constructor(shape) { super(); @@ -198,7 +204,7 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE4.BufferGeometry { this._currentOffset.copy(this._shape.offset); shouldUpdateGeometry = true; } - const tail = _v3A3.copy(this._shape.tail).divideScalar(this.worldScale); + const tail = _v3A4.copy(this._shape.tail).divideScalar(this.worldScale); if (this._currentTail.distanceToSquared(tail) > 1e-10) { this._currentTail.copy(tail); shouldUpdateGeometry = true; @@ -208,8 +214,8 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE4.BufferGeometry { } } _buildPosition() { - _v3A3.copy(this._currentTail).sub(this._currentOffset); - const l = _v3A3.length() / this._currentRadius; + _v3A4.copy(this._currentTail).sub(this._currentOffset); + const l = _v3A4.length() / this._currentRadius; for (let i = 0; i <= 16; i++) { const t = i / 16 * Math.PI; this._attrPos.setXYZ(i, -Math.sin(t), -Math.cos(t), 0); @@ -222,8 +228,8 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE4.BufferGeometry { this._attrPos.setXYZ(68 + i, 0, Math.sin(t), Math.cos(t)); this._attrPos.setXYZ(100 + i, l, Math.sin(t), Math.cos(t)); } - const theta = Math.atan2(_v3A3.y, Math.sqrt(_v3A3.x * _v3A3.x + _v3A3.z * _v3A3.z)); - const phi = -Math.atan2(_v3A3.z, _v3A3.x); + const theta = Math.atan2(_v3A4.y, Math.sqrt(_v3A4.x * _v3A4.x + _v3A4.z * _v3A4.z)); + const phi = -Math.atan2(_v3A4.z, _v3A4.x); this.rotateZ(theta); this.rotateY(phi); this.scale(this._currentRadius, this._currentRadius, this._currentRadius); @@ -350,7 +356,7 @@ var ColliderShapeSphereBufferGeometry = class extends THREE6.BufferGeometry { }; // src/helpers/VRMSpringBoneColliderHelper.ts -var _v3A4 = new THREE7.Vector3(); +var _v3A5 = new THREE7.Vector3(); var VRMSpringBoneColliderHelper = class extends THREE7.Group { constructor(collider) { super(); @@ -380,7 +386,7 @@ var VRMSpringBoneColliderHelper = class extends THREE7.Group { this.collider.updateWorldMatrix(true, false); this.matrix.copy(this.collider.matrixWorld); const matrixWorldElements = this.matrix.elements; - this._geometry.worldScale = _v3A4.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); + this._geometry.worldScale = _v3A5.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); this._geometry.update(); super.updateMatrixWorld(force); } @@ -446,7 +452,7 @@ var SpringBoneBufferGeometry = class extends THREE8.BufferGeometry { }; // src/helpers/VRMSpringBoneJointHelper.ts -var _v3A5 = new THREE9.Vector3(); +var _v3A6 = new THREE9.Vector3(); var VRMSpringBoneJointHelper = class extends THREE9.Group { constructor(springBone) { super(); @@ -468,7 +474,7 @@ var VRMSpringBoneJointHelper = class extends THREE9.Group { this.springBone.bone.updateWorldMatrix(true, false); this.matrix.copy(this.springBone.bone.matrixWorld); const matrixWorldElements = this.matrix.elements; - this._geometry.worldScale = _v3A5.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); + this._geometry.worldScale = _v3A6.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); this._geometry.update(); super.updateMatrixWorld(force); } @@ -479,13 +485,33 @@ var THREE10 = __toESM(require("three"), 1); var VRMSpringBoneCollider = class extends THREE10.Object3D { constructor(shape) { super(); + /** + * World space matrix for the collider shape used in collision calculations. + */ + this.colliderMatrix = new THREE10.Matrix4(); this.shape = shape; } + updateWorldMatrix(updateParents, updateChildren) { + super.updateWorldMatrix(updateParents, updateChildren); + updateColliderMatrix(this.colliderMatrix, this.matrixWorld, this.shape.offset); + } }; +function updateColliderMatrix(colliderMatrix, matrixWorld, offset) { + const me = matrixWorld.elements; + colliderMatrix.copy(matrixWorld); + if (offset) { + colliderMatrix.elements[12] = me[0] * offset.x + me[4] * offset.y + me[8] * offset.z + me[12]; + colliderMatrix.elements[13] = me[1] * offset.x + me[5] * offset.y + me[9] * offset.z + me[13]; + colliderMatrix.elements[14] = me[2] * offset.x + me[6] * offset.y + me[10] * offset.z + me[14]; + } +} // src/VRMSpringBoneJoint.ts var THREE13 = __toESM(require("three"), 1); +// src/utils/Matrix4InverseCache.ts +var THREE12 = __toESM(require("three"), 1); + // src/utils/mat4InvertCompat.ts var THREE11 = __toESM(require("three"), 1); var _matA = new THREE11.Matrix4(); @@ -499,7 +525,6 @@ function mat4InvertCompat(target) { } // src/utils/Matrix4InverseCache.ts -var THREE12 = __toESM(require("three"), 1); var Matrix4InverseCache = class { constructor(matrix) { /** @@ -541,15 +566,11 @@ var Matrix4InverseCache = class { // src/VRMSpringBoneJoint.ts var IDENTITY_MATRIX4 = new THREE13.Matrix4(); -var _v3A6 = new THREE13.Vector3(); +var _v3A7 = new THREE13.Vector3(); var _v3B2 = new THREE13.Vector3(); -var _v3C = new THREE13.Vector3(); var _worldSpacePosition = new THREE13.Vector3(); -var _centerSpacePosition = new THREE13.Vector3(); var _nextTail = new THREE13.Vector3(); -var _quatA = new THREE13.Quaternion(); var _matA2 = new THREE13.Matrix4(); -var _matB = new THREE13.Matrix4(); var VRMSpringBoneJoint = class { /** * Create a new VRMSpringBone. @@ -609,6 +630,22 @@ var VRMSpringBoneJoint = class { }; this.colliderGroups = colliderGroups; } + /** + * Set of dependencies that need to be updated before this joint. + */ + get dependencies() { + const set = /* @__PURE__ */ new Set(); + const parent = this.bone.parent; + if (parent) { + set.add(parent); + } + for (let cg = 0; cg < this.colliderGroups.length; cg++) { + for (let c = 0; c < this.colliderGroups[cg].colliders.length; c++) { + set.add(this.colliderGroups[cg].colliders[c]); + } + } + return set; + } get center() { return this._center; } @@ -647,7 +684,7 @@ var VRMSpringBoneJoint = class { } else { this._initialLocalChildPosition.copy(this.bone.position).normalize().multiplyScalar(0.07); } - const matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); + const matrixWorldToCenter = this._getMatrixWorldToCenter(); this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(matrixWorldToCenter); this._prevTail.copy(this._currentTail); this._boneAxis.copy(this._initialLocalChildPosition).normalize(); @@ -660,7 +697,7 @@ var VRMSpringBoneJoint = class { this.bone.quaternion.copy(this._initialLocalRotation); this.bone.updateMatrix(); this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld, this.bone.matrix); - const matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); + const matrixWorldToCenter = this._getMatrixWorldToCenter(); this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(matrixWorldToCenter); this._prevTail.copy(this._currentTail); } @@ -673,30 +710,15 @@ var VRMSpringBoneJoint = class { update(delta) { if (delta <= 0) return; this._calcWorldSpaceBoneLength(); + const worldSpaceBoneAxis = _v3B2.copy(this._boneAxis).transformDirection(this._initialLocalMatrix).transformDirection(this._parentMatrixWorld); + _nextTail.copy(this._currentTail).add(_v3A7.subVectors(this._currentTail, this._prevTail).multiplyScalar(1 - this.settings.dragForce)).applyMatrix4(this._getMatrixCenterToWorld()).addScaledVector(worldSpaceBoneAxis, this.settings.stiffness * delta).addScaledVector(this.settings.gravityDir, this.settings.gravityPower * delta); _worldSpacePosition.setFromMatrixPosition(this.bone.matrixWorld); - let matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); - _centerSpacePosition.copy(_worldSpacePosition).applyMatrix4(matrixWorldToCenter); - const quatWorldToCenter = _quatA.setFromRotationMatrix(matrixWorldToCenter); - const centerSpaceParentMatrix = _matB.copy(matrixWorldToCenter).multiply(this._parentMatrixWorld); - const centerSpaceBoneAxis = _v3B2.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(centerSpaceParentMatrix).sub(_centerSpacePosition).normalize(); - const centerSpaceGravity = _v3C.copy(this.settings.gravityDir).applyQuaternion(quatWorldToCenter).normalize(); - const matrixCenterToWorld = this._getMatrixCenterToWorld(_matA2); - _nextTail.copy(this._currentTail).add( - _v3A6.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1 - this.settings.dragForce) - ).add(_v3A6.copy(centerSpaceBoneAxis).multiplyScalar(this.settings.stiffness * delta)).add(_v3A6.copy(centerSpaceGravity).multiplyScalar(this.settings.gravityPower * delta)).applyMatrix4(matrixCenterToWorld); _nextTail.sub(_worldSpacePosition).normalize().multiplyScalar(this._worldSpaceBoneLength).add(_worldSpacePosition); this._collision(_nextTail); - matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); this._prevTail.copy(this._currentTail); - this._currentTail.copy(_v3A6.copy(_nextTail).applyMatrix4(matrixWorldToCenter)); - const worldSpaceInitialMatrixInv = mat4InvertCompat( - _matA2.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix) - ); - const applyRotation = _quatA.setFromUnitVectors( - this._boneAxis, - _v3A6.copy(_nextTail).applyMatrix4(worldSpaceInitialMatrixInv).normalize() - ); - this.bone.quaternion.copy(this._initialLocalRotation).multiply(applyRotation); + this._currentTail.copy(_nextTail).applyMatrix4(this._getMatrixWorldToCenter()); + const worldSpaceInitialMatrixInv = _matA2.multiplyMatrices(this._parentMatrixWorld, this._initialLocalMatrix).invert(); + this.bone.quaternion.setFromUnitVectors(this._boneAxis, _v3A7.copy(_nextTail).applyMatrix4(worldSpaceInitialMatrixInv).normalize()).premultiply(this._initialLocalRotation); this.bone.updateMatrix(); this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld, this.bone.matrix); } @@ -706,53 +728,44 @@ var VRMSpringBoneJoint = class { * @param tail The tail you want to process */ _collision(tail) { - this.colliderGroups.forEach((colliderGroup) => { - colliderGroup.colliders.forEach((collider) => { - const dist = collider.shape.calculateCollision(collider.matrixWorld, tail, this.settings.hitRadius, _v3A6); + for (let cg = 0; cg < this.colliderGroups.length; cg++) { + for (let c = 0; c < this.colliderGroups[cg].colliders.length; c++) { + const collider = this.colliderGroups[cg].colliders[c]; + const dist = collider.shape.calculateCollision(collider.colliderMatrix, tail, this.settings.hitRadius, _v3A7); if (dist < 0) { - tail.add(_v3A6.multiplyScalar(-dist)); - tail.sub(_worldSpacePosition).normalize().multiplyScalar(this._worldSpaceBoneLength).add(_worldSpacePosition); + tail.addScaledVector(_v3A7, -dist); + tail.sub(_worldSpacePosition); + const length = tail.length(); + tail.multiplyScalar(this._worldSpaceBoneLength / length).add(_worldSpacePosition); } - }); - }); + } + } } /** * Calculate the {@link _worldSpaceBoneLength}. * Intended to be used in {@link update}. */ _calcWorldSpaceBoneLength() { - _v3A6.setFromMatrixPosition(this.bone.matrixWorld); + _v3A7.setFromMatrixPosition(this.bone.matrixWorld); if (this.child) { _v3B2.setFromMatrixPosition(this.child.matrixWorld); } else { _v3B2.copy(this._initialLocalChildPosition); _v3B2.applyMatrix4(this.bone.matrixWorld); } - this._worldSpaceBoneLength = _v3A6.sub(_v3B2).length(); + this._worldSpaceBoneLength = _v3A7.sub(_v3B2).length(); } /** * Create a matrix that converts center space into world space. - * @param target Target matrix */ - _getMatrixCenterToWorld(target) { - if (this._center) { - target.copy(this._center.matrixWorld); - } else { - target.identity(); - } - return target; + _getMatrixCenterToWorld() { + return this._center ? this._center.matrixWorld : IDENTITY_MATRIX4; } /** * Create a matrix that converts world space into center space. - * @param target Target matrix */ - _getMatrixWorldToCenter(target) { - if (this._center) { - target.copy(this._center.userData.inverseCacheProxy.inverse); - } else { - target.identity(); - } - return target; + _getMatrixWorldToCenter() { + return this._center ? this._center.userData.inverseCacheProxy.inverse : IDENTITY_MATRIX4; } }; @@ -782,12 +795,40 @@ function traverseChildrenUntilConditionMet(object, callback) { }); } +// src/utils/lowestCommonAncestor.ts +function lowestCommonAncestor(objects) { + var _a; + const sharedAncestors = /* @__PURE__ */ new Map(); + for (const object of objects) { + let current = object; + do { + const newValue = ((_a = sharedAncestors.get(current)) != null ? _a : 0) + 1; + if (newValue === objects.size) { + return current; + } + sharedAncestors.set(current, newValue); + current = current.parent; + } while (current !== null); + } + return null; +} + // src/VRMSpringBoneManager.ts var VRMSpringBoneManager = class { constructor() { this._joints = /* @__PURE__ */ new Set(); + this._sortedJoints = []; this._hasWarnedCircularDependency = false; + /** + * An ordered list of ancestors of all the SpringBone joints. Before the + * SpringBone joints can be updated, the world matrices of these ancestors + * must be calculated. The first element is the lowest common ancestor, for + * which not only its world matrix but its ancestors' world matrices are + * updated as well. + */ + this._ancestors = []; this._objectSpringBonesMap = /* @__PURE__ */ new Map(); + this._relevantChildrenUpdated = this._relevantChildrenUpdated.bind(this); } get joints() { return this._joints; @@ -825,6 +866,7 @@ var VRMSpringBoneManager = class { this._objectSpringBonesMap.set(joint.bone, objectSet); } objectSet.add(joint); + this._sortJoints(); } /** * @deprecated Use {@link addJoint} instead. @@ -837,6 +879,7 @@ var VRMSpringBoneManager = class { this._joints.delete(joint); const objectSet = this._objectSpringBonesMap.get(joint.bone); objectSet.delete(joint); + this._sortJoints(); } /** * @deprecated Use {@link deleteJoint} instead. @@ -846,117 +889,99 @@ var VRMSpringBoneManager = class { this.deleteJoint(joint); } setInitState() { - const springBonesTried = /* @__PURE__ */ new Set(); - const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); - for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.setInitState() - ); + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.setInitState(); } } reset() { - const springBonesTried = /* @__PURE__ */ new Set(); - const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); - for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.reset() - ); + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.reset(); } } update(delta) { + for (let i = 0; i < this._ancestors.length; i++) { + this._ancestors[i].updateWorldMatrix(i === 0, false); + } + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.update(delta); + traverseChildrenUntilConditionMet(springBone.bone, this._relevantChildrenUpdated); + } + } + /** + * Sorts the joints ensuring they are updated in the correct order taking dependencies into account. + */ + _sortJoints() { + const springBoneOrder = []; const springBonesTried = /* @__PURE__ */ new Set(); const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); + const ancestors = /* @__PURE__ */ new Set(); for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.update(delta) - ); - traverseChildrenUntilConditionMet(springBone.bone, (object) => { + this._insertJointSort(springBone, springBonesTried, springBonesDone, springBoneOrder, ancestors); + } + this._sortedJoints = springBoneOrder; + const lca = lowestCommonAncestor(ancestors); + this._ancestors = []; + if (lca) { + this._ancestors.push(lca); + traverseChildrenUntilConditionMet(lca, (object) => { var _a, _b; if (((_b = (_a = this._objectSpringBonesMap.get(object)) == null ? void 0 : _a.size) != null ? _b : 0) > 0) { return true; } - object.updateWorldMatrix(false, false); + this._ancestors.push(object); return false; }); } } - /** - * Update a spring bone. - * If there are other spring bone that are dependant, it will try to update them recursively. - * It updates matrixWorld of all ancestors and myself. - * It might log an warning message if there are any circular dependencies. - * - * Intended to be used in {@link update} and {@link _processSpringBone} itself recursively. - * - * @param springBone A springBone you want to update - * @param springBonesTried Set of springBones that are already tried to be updated - * @param springBonesDone Set of springBones that are already up to date - * @param objectUpdated Set of object3D whose matrixWorld is updated - */ - _processSpringBone(springBone, springBonesTried, springBonesDone, objectUpdated, callback) { + _insertJointSort(springBone, springBonesTried, springBonesDone, springBoneOrder, ancestors) { if (springBonesDone.has(springBone)) { return; } if (springBonesTried.has(springBone)) { if (!this._hasWarnedCircularDependency) { - console.warn("VRMSpringBoneManager: Circular dependency detected while updating springbones"); + console.warn("VRMSpringBoneManager: Circular dependency detected"); this._hasWarnedCircularDependency = true; } return; } - springBonesTried.add(springBone); - const depObjects = this._getDependencies(springBone); + const depObjects = springBone.dependencies; for (const depObject of depObjects) { + let encounteredSpringBone = false; + let ancestor = null; traverseAncestorsFromRoot(depObject, (depObjectAncestor) => { const objectSet = this._objectSpringBonesMap.get(depObjectAncestor); if (objectSet) { for (const depSpringBone of objectSet) { - this._processSpringBone(depSpringBone, springBonesTried, springBonesDone, objectUpdated, callback); + encounteredSpringBone = true; + this._insertJointSort(depSpringBone, springBonesTried, springBonesDone, springBoneOrder, ancestors); } - } else if (!objectUpdated.has(depObjectAncestor)) { - depObjectAncestor.updateWorldMatrix(false, false); - objectUpdated.add(depObjectAncestor); + } else if (!encounteredSpringBone) { + ancestor = depObjectAncestor; } }); + if (ancestor) { + ancestors.add(ancestor); + } } - springBone.bone.updateMatrix(); - springBone.bone.updateWorldMatrix(false, false); - callback(springBone); - objectUpdated.add(springBone.bone); + springBoneOrder.push(springBone); springBonesDone.add(springBone); } - /** - * Return a set of objects that are dependant of given spring bone. - * @param springBone A spring bone - * @return A set of objects that are dependant of given spring bone - */ - _getDependencies(springBone) { - const set = /* @__PURE__ */ new Set(); - const parent = springBone.bone.parent; - if (parent) { - set.add(parent); + _relevantChildrenUpdated(object) { + var _a, _b; + if (((_b = (_a = this._objectSpringBonesMap.get(object)) == null ? void 0 : _a.size) != null ? _b : 0) > 0) { + return true; } - springBone.colliderGroups.forEach((colliderGroup) => { - colliderGroup.colliders.forEach((collider) => { - set.add(collider); - }); - }); - return set; + object.updateWorldMatrix(false, false); + return false; } }; @@ -1267,4 +1292,4 @@ var _VRMSpringBoneLoaderPlugin = class _VRMSpringBoneLoaderPlugin { }; _VRMSpringBoneLoaderPlugin.EXTENSION_NAME = "VRMC_springBone"; var VRMSpringBoneLoaderPlugin = _VRMSpringBoneLoaderPlugin; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uL3NyYy9oZWxwZXJzL1ZSTVNwcmluZ0JvbmVDb2xsaWRlckhlbHBlci50cyIsICIuLi9zcmMvVlJNU3ByaW5nQm9uZUNvbGxpZGVyU2hhcGVDYXBzdWxlLnRzIiwgIi4uL3NyYy9WUk1TcHJpbmdCb25lQ29sbGlkZXJTaGFwZS50cyIsICIuLi9zcmMvVlJNU3ByaW5nQm9uZUNvbGxpZGVyU2hhcGVQbGFuZS50cyIsICIuLi9zcmMvVlJNU3ByaW5nQm9uZUN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ZUdyb3VwLnN0aWZmaW5lc3MsXG4gICAgICAgICAgZ3Jhdml0eURpcixcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBwcmVwYXJlIGNvbGxpZGVyc1xuICAgICAgICBjb25zdCBjb2xsaWRlckdyb3Vwc0ZvclNwcmluZyA9IHNjaGVtYUJvbmVHcm91cC5jb2xsaWRlckdyb3Vwcz8ubWFwKChpQ29sbGlkZXJHcm91cCkgPT4ge1xuICAgICAgICAgIGNvbnN0IGdyb3VwID0gY29sbGlkZXJHcm91cHM/LltpQ29sbGlkZXJHcm91cF07XG5cbiAgICAgICAgICBpZiAoZ3JvdXAgPT0gbnVsbCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICBgVlJNU3ByaW5nQm9uZUxvYWRlclBsdWdpbjogVGhlIHNwcmluZyAjJHtpQm9uZUdyb3VwfSBhdHRlbXB0ZWQgdG8gdXNlIGEgY29sbGlkZXJHcm91cCAke2lDb2xsaWRlckdyb3VwfSBidXQgbm90IGZvdW5kYCxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIGdyb3VwO1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBjcmVhdGUgc3ByaW5nIGJvbmVzXG4gICAgICAgIHJvb3QudHJhdmVyc2UoKG5vZGUpID0+IHtcbiAgICAgICAgICBjb25zdCBjaGlsZDogVEhSRUUuT2JqZWN0M0QgfCBudWxsID0gbm9kZS5jaGlsZHJlblswXSA/PyBudWxsO1xuXG4gICAgICAgICAgY29uc3Qgam9pbnQgPSB0aGlzLl9pbXBvcnRKb2ludChub2RlLCBjaGlsZCwgc2V0dGluZywgY29sbGlkZXJHcm91cHNGb3JTcHJpbmcpO1xuICAgICAgICAgIGlmIChjZW50ZXIpIHtcbiAgICAgICAgICAgIGpvaW50LmNlbnRlciA9IGNlbnRlcjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBtYW5hZ2VyLmFk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gICAgaWYgKHNjaGVtYUNvbGxpZGVyLm9mZnNldCkge1xuICAgICAgICAgICAgb2Zmc2V0LnNldChcbiAgICAgICAgICAgICAgc2NoZW1hQ29sbGlkZXIub2Zmc2V0LnggPz8gMC4wLFxuICAgICAgICAgICAgICBzY2hlbWFDb2xsaWRlci5vZmZzZXQueSA/PyAwLjAsXG4gICAgICAgICAgICAgIHNjaGVtYUNvbGxpZGVyLm9mZnNldC56ID8gLXNjaGVtYUNvbGxpZGVyLm9mZnNldC56IDogMC4wLCAvLyB6IGlzIG9wcG9zaXRlIGluIFZSTTAuMFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdGhpcy5faW1wb3J0U3BoZXJlQ29sbGlkZXIobm9kZSwge1xuICAgICAgICAgICAgb2Zmc2V0LFxuICAgICAgICAgICAgcmFkaXVzOiBzY2hlbWFDb2xsaWRlci5yYWRpdXMgPz8gMC4wLFxuICAgICAgICAgICAgaW5zaWRlOiBmYWxzZSxcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIHsgY29sbGlkZXJzIH07XG4gICAgICB9LFxuICAgICk7XG5cbiAgICAvLyBpbXBvcnQgc3ByaW5nIGJvbmVzIGZvciBlYWNoIHNwcmluZyBib25lIGdyb3Vwc1xuICAgIHNjaGVtYUJvbmVHcm91cHM/LmZvckVhY2goKHNjaGVtYUJvbmVHcm91cCwgaUJvbmVHcm91cCkgPT4ge1xuICAgICAgY29uc3Qgcm9vdEluZGljZXMgPSBzY2hlbWFCb25lR3JvdXAuYm9uZXM7XG4gICAgICBpZiAoIXJvb3RJbmRpY2VzKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgcm9vdEluZGljZXMuZm9yRWFjaCgocm9vdEluZGV4KSA9PiB7XG4gICAgICAgIGNvbnN0IHJvb3QgPSB0aHJlZU5vZGVzW3Jvb3RJbmRleF07XG5cbiAgICAgICAgLy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Q2xDLGFBQU8sY0FBYyxLQUFLLG1CQUFtQjtBQUFBLElBQy9DO0FBRUEsV0FBTztBQUFBLEVBQ1Q7QUFDRjtBQTFhYSwyQkFDWSxpQkFBaUI7QUFEbkMsSUFBTSw0QkFBTjsiLAogICJuYW1lcyI6IFsiVEhSRUUiLCAiVEhSRUUiLCAiX3YzQSIsICJUSFJFRSIsICJfdjNBIiwgIlRIUkVFIiwgIl92M0EiLCAiVEhSRUUiLCAiVEhSRUUiLCAiX3YzQSIsICJUSFJFRSIsICJUSFJFRSIsICJfdjNBIiwgIlRIUkVFIiwgIlRIUkVFIiwgIlRIUkVFIiwgIlRIUkVFIiwgIl92M0EiLCAiX3YzQiIsICJfbWF0QSIsICJUSFJFRSIsICJfYSIsICJfYiIsICJfYyIsICJfZCIsICJfZSJdCn0K diff --git a/packages/three-vrm-springbone/lib/three-vrm-springbone.min.cjs b/packages/three-vrm-springbone/lib/three-vrm-springbone.min.cjs index 57f1133f0..82b77ae44 100644 --- a/packages/three-vrm-springbone/lib/three-vrm-springbone.min.cjs +++ b/packages/three-vrm-springbone/lib/three-vrm-springbone.min.cjs @@ -1,2 +1,2 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -"use strict";var Ie=Object.create;var se=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var De=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var je=(s,t)=>{for(var e in t)se(s,e,{get:t[e],enumerable:!0})},xe=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ae(t))!Le.call(s,i)&&i!==e&&se(s,i,{get:()=>t[i],enumerable:!(r=Oe(t,i))||r.enumerable});return s};var m=(s,t,e)=>(e=s!=null?Ie(De(s)):{},xe(t||!s||!s.__esModule?se(e,"default",{value:s,enumerable:!0}):e,s)),Je=s=>xe(se({},"__esModule",{value:!0}),s);var te=(s,t,e)=>new Promise((r,i)=>{var o=a=>{try{l(e.next(a))}catch(d){i(d)}},n=a=>{try{l(e.throw(a))}catch(d){i(d)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,n);l((e=e.apply(s,t)).next())});var Ze={};je(Ze,{VRMSpringBoneCollider:()=>U,VRMSpringBoneColliderHelper:()=>I,VRMSpringBoneColliderShape:()=>v,VRMSpringBoneColliderShapeCapsule:()=>W,VRMSpringBoneColliderShapePlane:()=>G,VRMSpringBoneColliderShapeSphere:()=>X,VRMSpringBoneJoint:()=>ne,VRMSpringBoneJointHelper:()=>Z,VRMSpringBoneLoaderPlugin:()=>_e,VRMSpringBoneManager:()=>k});module.exports=Je(Ze);var O=m(require("three"),1);var re=m(require("three"),1);var v=class{};var ue=new re.Vector3,J=new re.Vector3,W=class extends v{get type(){return"capsule"}constructor(t){var e,r,i,o;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new re.Vector3(0,0,0),this.tail=(r=t==null?void 0:t.tail)!=null?r:new re.Vector3(0,0,0),this.radius=(i=t==null?void 0:t.radius)!=null?i:0,this.inside=(o=t==null?void 0:t.inside)!=null?o:!1}calculateCollision(t,e,r,i){ue.copy(this.offset).applyMatrix4(t),J.copy(this.tail).applyMatrix4(t),J.sub(ue);let o=J.lengthSq();i.copy(e).sub(ue);let n=J.dot(i);n<=0||(o<=n||J.multiplyScalar(n/o),i.sub(J));let l=this.inside?this.radius-r-i.length():i.length()-r-this.radius;return i.normalize(),this.inside&&i.negate(),l}};var z=m(require("three"),1);var fe=new z.Vector3,be=new z.Matrix3,G=class extends v{get type(){return"plane"}constructor(t){var e,r;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new z.Vector3(0,0,0),this.normal=(r=t==null?void 0:t.normal)!=null?r:new z.Vector3(0,0,1)}calculateCollision(t,e,r,i){i.copy(this.offset).applyMatrix4(t),i.negate().add(e),be.getNormalMatrix(t),fe.copy(this.normal).applyNormalMatrix(be).normalize();let o=i.dot(fe)-r;return i.copy(fe),o}};var ye=m(require("three"),1);var X=class extends v{get type(){return"sphere"}constructor(t){var e,r,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new ye.Vector3(0,0,0),this.radius=(r=t==null?void 0:t.radius)!=null?r:0,this.inside=(i=t==null?void 0:t.inside)!=null?i:!1}calculateCollision(t,e,r,i){i.copy(this.offset).applyMatrix4(t),i.negate().add(e);let o=this.inside?this.radius-r-i.length():i.length()-r-this.radius;return i.normalize(),this.inside&&i.negate(),o}};var B=m(require("three"),1),H=new B.Vector3,ae=class extends B.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentOffset=new B.Vector3;this._currentTail=new B.Vector3;this._shape=e,this._attrPos=new B.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new B.BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0);let i=H.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(i)>1e-10&&(this._currentTail.copy(i),e=!0),e&&this._buildPosition()}_buildPosition(){H.copy(this._currentTail).sub(this._currentOffset);let e=H.length()/this._currentRadius;for(let o=0;o<=16;o++){let n=o/16*Math.PI;this._attrPos.setXYZ(o,-Math.sin(n),-Math.cos(n),0),this._attrPos.setXYZ(17+o,e+Math.sin(n),Math.cos(n),0),this._attrPos.setXYZ(34+o,-Math.sin(n),0,-Math.cos(n)),this._attrPos.setXYZ(51+o,e+Math.sin(n),0,Math.cos(n))}for(let o=0;o<32;o++){let n=o/16*Math.PI;this._attrPos.setXYZ(68+o,0,Math.sin(n),Math.cos(n)),this._attrPos.setXYZ(100+o,e,Math.sin(n),Math.cos(n))}let r=Math.atan2(H.y,Math.sqrt(H.x*H.x+H.z*H.z)),i=-Math.atan2(H.z,H.x);this.rotateZ(r),this.rotateY(i),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<34;e++){let r=(e+1)%34;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(68+e*2,34+e,34+r)}for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(136+e*2,68+e,68+r),this._attrIndex.setXY(200+e*2,100+e,100+r)}this._attrIndex.needsUpdate=!0}};var P=m(require("three"),1),le=class extends P.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentOffset=new P.Vector3;this._currentNormal=new P.Vector3;this._shape=e,this._attrPos=new P.BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new P.BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}};var F=m(require("three"),1),pe=class extends F.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentOffset=new F.Vector3;this._shape=e,this._attrPos=new F.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new F.BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let r=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+e,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+e,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(64+e*2,32+e,32+r),this._attrIndex.setXY(128+e*2,64+e,64+r)}this._attrIndex.needsUpdate=!0}};var We=new O.Vector3,I=class extends O.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof X)this._geometry=new pe(this.collider.shape);else if(this.collider.shape instanceof W)this._geometry=new ae(this.collider.shape);else if(this.collider.shape instanceof G)this._geometry=new le(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");let e=new O.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new O.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=We.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}};var A=m(require("three"),1);var Y=m(require("three"),1),ce=class extends Y.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentTail=new Y.Vector3;this._springBone=e,this._attrPos=new Y.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Y.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let r=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+e,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+e,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(64+e*2,32+e,32+r),this._attrIndex.setXY(128+e*2,64+e,64+r)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}};var Ge=new A.Vector3,Z=class extends A.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new ce(this.springBone);let e=new A.LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new A.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=Ge.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}};var He=m(require("three"),1),U=class extends He.Object3D{constructor(t){super(),this.shape=t}};var c=m(require("three"),1);var Ve=m(require("three"),1),Xe=new Ve.Matrix4;function de(s){return s.invert?s.invert():s.getInverse(Xe.copy(s)),s}var ve=m(require("three"),1);var he=class{constructor(t){this._inverseCache=new ve.Matrix4;this._shouldUpdateInverse=!0;this.matrix=t;let e={set:(r,i,o)=>(this._shouldUpdateInverse=!0,r[i]=o,!0)};this._originalElements=t.elements,t.elements=new Proxy(t.elements,e)}get inverse(){return this._shouldUpdateInverse&&(de(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}};var Fe=new c.Matrix4,w=new c.Vector3,ie=new c.Vector3,Ye=new c.Vector3,q=new c.Vector3,Be=new c.Vector3,oe=new c.Vector3,we=new c.Quaternion,$=new c.Matrix4,Ue=new c.Matrix4,ne=class{constructor(t,e,r={},i=[]){this._currentTail=new c.Vector3;this._prevTail=new c.Vector3;this._boneAxis=new c.Vector3;this._worldSpaceBoneLength=0;this._center=null;this._initialLocalMatrix=new c.Matrix4;this._initialLocalRotation=new c.Quaternion;this._initialLocalChildPosition=new c.Vector3;var o,n,l,a,d,T;this.bone=t,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(o=r.hitRadius)!=null?o:0,stiffness:(n=r.stiffness)!=null?n:1,gravityPower:(l=r.gravityPower)!=null?l:0,gravityDir:(d=(a=r.gravityDir)==null?void 0:a.clone())!=null?d:new c.Vector3(0,-1,0),dragForce:(T=r.dragForce)!=null?T:.4},this.colliderGroups=i}get center(){return this._center}set center(t){var e;(e=this._center)!=null&&e.userData.inverseCacheProxy&&(this._center.userData.inverseCacheProxy.revert(),delete this._center.userData.inverseCacheProxy),this._center=t,this._center&&(this._center.userData.inverseCacheProxy||(this._center.userData.inverseCacheProxy=new he(this._center.matrixWorld)))}get initialLocalChildPosition(){return this._initialLocalChildPosition}get _parentMatrixWorld(){return this.bone.parent?this.bone.parent.matrixWorld:Fe}setInitState(){this._initialLocalMatrix.copy(this.bone.matrix),this._initialLocalRotation.copy(this.bone.quaternion),this.child?this._initialLocalChildPosition.copy(this.child.position):this._initialLocalChildPosition.copy(this.bone.position).normalize().multiplyScalar(.07);let t=this._getMatrixWorldToCenter($);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail),this._boneAxis.copy(this._initialLocalChildPosition).normalize()}reset(){this.bone.quaternion.copy(this._initialLocalRotation),this.bone.updateMatrix(),this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld,this.bone.matrix);let t=this._getMatrixWorldToCenter($);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail)}update(t){if(t<=0)return;this._calcWorldSpaceBoneLength(),q.setFromMatrixPosition(this.bone.matrixWorld);let e=this._getMatrixWorldToCenter($);Be.copy(q).applyMatrix4(e);let r=we.setFromRotationMatrix(e),i=Ue.copy(e).multiply(this._parentMatrixWorld),o=ie.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(i).sub(Be).normalize(),n=Ye.copy(this.settings.gravityDir).applyQuaternion(r).normalize(),l=this._getMatrixCenterToWorld($);oe.copy(this._currentTail).add(w.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1-this.settings.dragForce)).add(w.copy(o).multiplyScalar(this.settings.stiffness*t)).add(w.copy(n).multiplyScalar(this.settings.gravityPower*t)).applyMatrix4(l),oe.sub(q).normalize().multiplyScalar(this._worldSpaceBoneLength).add(q),this._collision(oe),e=this._getMatrixWorldToCenter($),this._prevTail.copy(this._currentTail),this._currentTail.copy(w.copy(oe).applyMatrix4(e));let a=de($.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix)),d=we.setFromUnitVectors(this._boneAxis,w.copy(oe).applyMatrix4(a).normalize());this.bone.quaternion.copy(this._initialLocalRotation).multiply(d),this.bone.updateMatrix(),this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld,this.bone.matrix)}_collision(t){this.colliderGroups.forEach(e=>{e.colliders.forEach(r=>{let i=r.shape.calculateCollision(r.matrixWorld,t,this.settings.hitRadius,w);i<0&&(t.add(w.multiplyScalar(-i)),t.sub(q).normalize().multiplyScalar(this._worldSpaceBoneLength).add(q))})})}_calcWorldSpaceBoneLength(){w.setFromMatrixPosition(this.bone.matrixWorld),this.child?ie.setFromMatrixPosition(this.child.matrixWorld):(ie.copy(this._initialLocalChildPosition),ie.applyMatrix4(this.bone.matrixWorld)),this._worldSpaceBoneLength=w.sub(ie).length()}_getMatrixCenterToWorld(t){return this._center?t.copy(this._center.matrixWorld):t.identity(),t}_getMatrixWorldToCenter(t){return this._center?t.copy(this._center.userData.inverseCacheProxy.inverse):t.identity(),t}};var g=m(require("three"),1);function Ce(s,t){let e=[],r=s;for(;r!==null;)e.unshift(r),r=r.parent;e.forEach(i=>{t(i)})}function Ee(s,t){s.children.forEach(e=>{t(e)||Ee(e,t)})}var k=class{constructor(){this._joints=new Set;this._hasWarnedCircularDependency=!1;this._objectSpringBonesMap=new Map}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){let t=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(r=>{t.add(r)})}),Array.from(t)}get colliders(){let t=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(r=>{t.add(r)})}),Array.from(t)}addJoint(t){this._joints.add(t);let e=this._objectSpringBonesMap.get(t.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(t.bone,e)),e.add(t)}addSpringBone(t){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(t)}deleteJoint(t){this._joints.delete(t),this._objectSpringBonesMap.get(t.bone).delete(t)}deleteSpringBone(t){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(t)}setInitState(){let t=new Set,e=new Set,r=new Set;for(let i of this._joints)this._processSpringBone(i,t,e,r,o=>o.setInitState())}reset(){let t=new Set,e=new Set,r=new Set;for(let i of this._joints)this._processSpringBone(i,t,e,r,o=>o.reset())}update(t){let e=new Set,r=new Set,i=new Set;for(let o of this._joints)this._processSpringBone(o,e,r,i,n=>n.update(t)),Ee(o.bone,n=>{var l,a;return((a=(l=this._objectSpringBonesMap.get(n))==null?void 0:l.size)!=null?a:0)>0?!0:(n.updateWorldMatrix(!1,!1),!1)})}_processSpringBone(t,e,r,i,o){if(r.has(t))return;if(e.has(t)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected while updating springbones"),this._hasWarnedCircularDependency=!0);return}e.add(t);let n=this._getDependencies(t);for(let l of n)Ce(l,a=>{let d=this._objectSpringBonesMap.get(a);if(d)for(let T of d)this._processSpringBone(T,e,r,i,o);else i.has(a)||(a.updateWorldMatrix(!1,!1),i.add(a))});t.bone.updateMatrix(),t.bone.updateWorldMatrix(!1,!1),o(t),i.add(t.bone),r.add(t)}_getDependencies(t){let e=new Set,r=t.bone.parent;return r&&e.add(r),t.colliderGroups.forEach(i=>{i.colliders.forEach(o=>{e.add(o)})}),e}};var Pe="VRMC_springBone_extended_collider",Ne=new Set(["1.0","1.0-beta"]),ze=new Set(["1.0"]),D=class D{get name(){return D.EXTENSION_NAME}constructor(t,e){var r;this.parser=t,this.jointHelperRoot=e==null?void 0:e.jointHelperRoot,this.colliderHelperRoot=e==null?void 0:e.colliderHelperRoot,this.useExtendedColliders=(r=e==null?void 0:e.useExtendedColliders)!=null?r:!0}afterRoot(t){return te(this,null,function*(){t.userData.vrmSpringBoneManager=yield this._import(t)})}_import(t){return te(this,null,function*(){let e=yield this._v1Import(t);if(e!=null)return e;let r=yield this._v0Import(t);return r!=null?r:null})}_v1Import(t){return te(this,null,function*(){var T,Q,K,h,N;let e=t.parser.json;if(!(((T=e.extensionsUsed)==null?void 0:T.indexOf(D.EXTENSION_NAME))!==-1))return null;let i=new k,o=yield t.parser.getDependencies("node"),n=(Q=e.extensions)==null?void 0:Q[D.EXTENSION_NAME];if(!n)return null;let l=n.specVersion;if(!Ne.has(l))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${D.EXTENSION_NAME} specVersion "${l}"`),null;let a=(K=n.colliders)==null?void 0:K.map((E,M)=>{var p,x,R,b,L,j,y,V,C,ee,Re,me,Se,ge,Te;let u=o[E.node],f=E.shape,_=(p=E.extensions)==null?void 0:p[Pe];if(this.useExtendedColliders&&_!=null){let Me=_.specVersion;if(!ze.has(Me))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Pe} specVersion "${Me}". Fallbacking to the ${D.EXTENSION_NAME} definition`);else{let S=_.shape;if(S.sphere)return this._importSphereCollider(u,{offset:new g.Vector3().fromArray((x=S.sphere.offset)!=null?x:[0,0,0]),radius:(R=S.sphere.radius)!=null?R:0,inside:(b=S.sphere.inside)!=null?b:!1});if(S.capsule)return this._importCapsuleCollider(u,{offset:new g.Vector3().fromArray((L=S.capsule.offset)!=null?L:[0,0,0]),radius:(j=S.capsule.radius)!=null?j:0,tail:new g.Vector3().fromArray((y=S.capsule.tail)!=null?y:[0,0,0]),inside:(V=S.capsule.inside)!=null?V:!1});if(S.plane)return this._importPlaneCollider(u,{offset:new g.Vector3().fromArray((C=S.plane.offset)!=null?C:[0,0,0]),normal:new g.Vector3().fromArray((ee=S.plane.normal)!=null?ee:[0,0,1])})}}if(f.sphere)return this._importSphereCollider(u,{offset:new g.Vector3().fromArray((Re=f.sphere.offset)!=null?Re:[0,0,0]),radius:(me=f.sphere.radius)!=null?me:0,inside:!1});if(f.capsule)return this._importCapsuleCollider(u,{offset:new g.Vector3().fromArray((Se=f.capsule.offset)!=null?Se:[0,0,0]),radius:(ge=f.capsule.radius)!=null?ge:0,tail:new g.Vector3().fromArray((Te=f.capsule.tail)!=null?Te:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${M} has no valid shape`)}),d=(h=n.colliderGroups)==null?void 0:h.map((E,M)=>{var f;return{colliders:((f=E.colliders)!=null?f:[]).map(_=>{let p=a==null?void 0:a[_];if(p==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${M} attempted to use a collider #${_} but not found`);return p}),name:E.name}});return(N=n.springs)==null||N.forEach((E,M)=>{var x;let u=E.joints,f=(x=E.colliderGroups)==null?void 0:x.map(R=>{let b=d==null?void 0:d[R];if(b==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${M} attempted to use a colliderGroup ${R} but not found`);return b}),_=E.center!=null?o[E.center]:void 0,p;u.forEach(R=>{if(p){let b=p.node,L=o[b],j=R.node,y=o[j],V={hitRadius:p.hitRadius,dragForce:p.dragForce,gravityPower:p.gravityPower,stiffness:p.stiffness,gravityDir:p.gravityDir!=null?new g.Vector3().fromArray(p.gravityDir):void 0},C=this._importJoint(L,y,V,f);_&&(C.center=_),i.addJoint(C)}p=R})}),i.setInitState(),i})}_v0Import(t){return te(this,null,function*(){var T,Q,K;let e=t.parser.json;if(!(((T=e.extensionsUsed)==null?void 0:T.indexOf("VRM"))!==-1))return null;let i=(Q=e.extensions)==null?void 0:Q.VRM,o=i==null?void 0:i.secondaryAnimation;if(!o)return null;let n=o==null?void 0:o.boneGroups;if(!n)return null;let l=new k,a=yield t.parser.getDependencies("node"),d=(K=o.colliderGroups)==null?void 0:K.map(h=>{var M;let N=a[h.node];return{colliders:((M=h.colliders)!=null?M:[]).map((u,f)=>{var p,x,R;let _=new g.Vector3(0,0,0);return u.offset&&_.set((p=u.offset.x)!=null?p:0,(x=u.offset.y)!=null?x:0,u.offset.z?-u.offset.z:0),this._importSphereCollider(N,{offset:_,radius:(R=u.radius)!=null?R:0,inside:!1})})}});return n==null||n.forEach((h,N)=>{let E=h.bones;E&&E.forEach(M=>{var R,b,L,j;let u=a[M],f=new g.Vector3;h.gravityDir?f.set((R=h.gravityDir.x)!=null?R:0,(b=h.gravityDir.y)!=null?b:0,(L=h.gravityDir.z)!=null?L:0):f.set(0,-1,0);let _=h.center!=null?a[h.center]:void 0,p={hitRadius:h.hitRadius,dragForce:h.dragForce,gravityPower:h.gravityPower,stiffness:h.stiffiness,gravityDir:f},x=(j=h.colliderGroups)==null?void 0:j.map(y=>{let V=d==null?void 0:d[y];if(V==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${N} attempted to use a colliderGroup ${y} but not found`);return V});u.traverse(y=>{var ee;let V=(ee=y.children[0])!=null?ee:null,C=this._importJoint(y,V,p,x);_&&(C.center=_),l.addJoint(C)})})}),t.scene.updateMatrixWorld(),l.setInitState(),l})}_importJoint(t,e,r,i){let o=new ne(t,e,r,i);if(this.jointHelperRoot){let n=new Z(o);this.jointHelperRoot.add(n),n.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(t,e){let r=new X(e),i=new U(r);if(t.add(i),this.colliderHelperRoot){let o=new I(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}_importCapsuleCollider(t,e){let r=new W(e),i=new U(r);if(t.add(i),this.colliderHelperRoot){let o=new I(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}_importPlaneCollider(t,e){let r=new G(e),i=new U(r);if(t.add(i),this.colliderHelperRoot){let o=new I(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}};D.EXTENSION_NAME="VRMC_springBone";var _e=D; +"use strict";var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Ae=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty;var De=(n,t)=>{for(var e in t)ne(n,e,{get:t[e],enumerable:!0})},Me=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Oe(t))!je.call(n,i)&&i!==e&&ne(n,i,{get:()=>t[i],enumerable:!(r=Ie(t,i))||r.enumerable});return n};var m=(n,t,e)=>(e=n!=null?Pe(Ae(n)):{},Me(t||!n||!n.__esModule?ne(e,"default",{value:n,enumerable:!0}):e,n)),Le=n=>Me(ne({},"__esModule",{value:!0}),n);var K=(n,t,e)=>new Promise((r,i)=>{var o=l=>{try{a(e.next(l))}catch(p){i(p)}},s=l=>{try{a(e.throw(l))}catch(p){i(p)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((e=e.apply(n,t)).next())});var ze={};De(ze,{VRMSpringBoneCollider:()=>N,VRMSpringBoneColliderHelper:()=>I,VRMSpringBoneColliderShape:()=>v,VRMSpringBoneColliderShapeCapsule:()=>W,VRMSpringBoneColliderShapePlane:()=>X,VRMSpringBoneColliderShapeSphere:()=>F,VRMSpringBoneJoint:()=>oe,VRMSpringBoneJointHelper:()=>q,VRMSpringBoneLoaderPlugin:()=>Re,VRMSpringBoneManager:()=>k});module.exports=Le(ze);var O=m(require("three"),1);var ee=m(require("three"),1);var v=class{};var ue=new ee.Vector3,G=new ee.Vector3,W=class extends v{get type(){return"capsule"}constructor(t){var e,r,i,o;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new ee.Vector3(0,0,0),this.tail=(r=t==null?void 0:t.tail)!=null?r:new ee.Vector3(0,0,0),this.radius=(i=t==null?void 0:t.radius)!=null?i:0,this.inside=(o=t==null?void 0:t.inside)!=null?o:!1}calculateCollision(t,e,r,i){ue.setFromMatrixPosition(t),G.subVectors(this.tail,this.offset).applyMatrix4(t),G.sub(ue);let o=G.lengthSq();i.copy(e).sub(ue);let s=G.dot(i);s<=0||(o<=s||G.multiplyScalar(s/o),i.sub(G));let a=i.length(),l=this.inside?this.radius-r-a:a-r-this.radius;return l<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),l}};var Z=m(require("three"),1);var fe=new Z.Vector3,ye=new Z.Matrix3,X=class extends v{get type(){return"plane"}constructor(t){var e,r;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Z.Vector3(0,0,0),this.normal=(r=t==null?void 0:t.normal)!=null?r:new Z.Vector3(0,0,1)}calculateCollision(t,e,r,i){i.setFromMatrixPosition(t),i.negate().add(e),ye.getNormalMatrix(t),fe.copy(this.normal).applyNormalMatrix(ye).normalize();let o=i.dot(fe)-r;return i.copy(fe),o}};var Ee=m(require("three"),1);var Je=new Ee.Vector3,F=class extends v{get type(){return"sphere"}constructor(t){var e,r,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Ee.Vector3(0,0,0),this.radius=(r=t==null?void 0:t.radius)!=null?r:0,this.inside=(i=t==null?void 0:t.inside)!=null?i:!1}calculateCollision(t,e,r,i){i.subVectors(e,Je.setFromMatrixPosition(t));let o=i.length(),s=this.inside?this.radius-r-o:o-r-this.radius;return s<0&&(i.multiplyScalar(1/o),this.inside&&i.negate()),s}};var B=m(require("three"),1),H=new B.Vector3,se=class extends B.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentOffset=new B.Vector3;this._currentTail=new B.Vector3;this._shape=e,this._attrPos=new B.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new B.BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0);let i=H.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(i)>1e-10&&(this._currentTail.copy(i),e=!0),e&&this._buildPosition()}_buildPosition(){H.copy(this._currentTail).sub(this._currentOffset);let e=H.length()/this._currentRadius;for(let o=0;o<=16;o++){let s=o/16*Math.PI;this._attrPos.setXYZ(o,-Math.sin(s),-Math.cos(s),0),this._attrPos.setXYZ(17+o,e+Math.sin(s),Math.cos(s),0),this._attrPos.setXYZ(34+o,-Math.sin(s),0,-Math.cos(s)),this._attrPos.setXYZ(51+o,e+Math.sin(s),0,Math.cos(s))}for(let o=0;o<32;o++){let s=o/16*Math.PI;this._attrPos.setXYZ(68+o,0,Math.sin(s),Math.cos(s)),this._attrPos.setXYZ(100+o,e,Math.sin(s),Math.cos(s))}let r=Math.atan2(H.y,Math.sqrt(H.x*H.x+H.z*H.z)),i=-Math.atan2(H.z,H.x);this.rotateZ(r),this.rotateY(i),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<34;e++){let r=(e+1)%34;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(68+e*2,34+e,34+r)}for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(136+e*2,68+e,68+r),this._attrIndex.setXY(200+e*2,100+e,100+r)}this._attrIndex.needsUpdate=!0}};var P=m(require("three"),1),le=class extends P.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentOffset=new P.Vector3;this._currentNormal=new P.Vector3;this._shape=e,this._attrPos=new P.BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new P.BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}};var U=m(require("three"),1),ae=class extends U.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentOffset=new U.Vector3;this._shape=e,this._attrPos=new U.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U.BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let r=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+e,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+e,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(64+e*2,32+e,32+r),this._attrIndex.setXY(128+e*2,64+e,64+r)}this._attrIndex.needsUpdate=!0}};var Ge=new O.Vector3,I=class extends O.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof F)this._geometry=new ae(this.collider.shape);else if(this.collider.shape instanceof W)this._geometry=new se(this.collider.shape);else if(this.collider.shape instanceof X)this._geometry=new le(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");let e=new O.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new O.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=Ge.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}};var A=m(require("three"),1);var Y=m(require("three"),1),ce=class extends Y.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentTail=new Y.Vector3;this._springBone=e,this._attrPos=new Y.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Y.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let r=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+e,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+e,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(64+e*2,32+e,32+r),this._attrIndex.setXY(128+e*2,64+e,64+r)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}};var We=new A.Vector3,q=class extends A.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new ce(this.springBone);let e=new A.LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new A.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=We.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}};var pe=m(require("three"),1),N=class extends pe.Object3D{constructor(e){super();this.colliderMatrix=new pe.Matrix4;this.shape=e}updateWorldMatrix(e,r){super.updateWorldMatrix(e,r),Xe(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function Xe(n,t,e){let r=t.elements;n.copy(t),e&&(n.elements[12]=r[0]*e.x+r[4]*e.y+r[8]*e.z+r[12],n.elements[13]=r[1]*e.x+r[5]*e.y+r[9]*e.z+r[13],n.elements[14]=r[2]*e.x+r[6]*e.y+r[10]*e.z+r[14])}var f=m(require("three"),1);var ve=m(require("three"),1);var He=m(require("three"),1),Fe=new He.Matrix4;function Ve(n){return n.invert?n.invert():n.getInverse(Fe.copy(n)),n}var de=class{constructor(t){this._inverseCache=new ve.Matrix4;this._shouldUpdateInverse=!0;this.matrix=t;let e={set:(r,i,o)=>(this._shouldUpdateInverse=!0,r[i]=o,!0)};this._originalElements=t.elements,t.elements=new Proxy(t.elements,e)}get inverse(){return this._shouldUpdateInverse&&(Ve(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}};var _e=new f.Matrix4,$=new f.Vector3,te=new f.Vector3,re=new f.Vector3,ie=new f.Vector3,Ue=new f.Matrix4,oe=class{constructor(t,e,r={},i=[]){this._currentTail=new f.Vector3;this._prevTail=new f.Vector3;this._boneAxis=new f.Vector3;this._worldSpaceBoneLength=0;this._center=null;this._initialLocalMatrix=new f.Matrix4;this._initialLocalRotation=new f.Quaternion;this._initialLocalChildPosition=new f.Vector3;var o,s,a,l,p,S;this.bone=t,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(o=r.hitRadius)!=null?o:0,stiffness:(s=r.stiffness)!=null?s:1,gravityPower:(a=r.gravityPower)!=null?a:0,gravityDir:(p=(l=r.gravityDir)==null?void 0:l.clone())!=null?p:new f.Vector3(0,-1,0),dragForce:(S=r.dragForce)!=null?S:.4},this.colliderGroups=i}get dependencies(){let t=new Set,e=this.bone.parent;e&&t.add(e);for(let r=0;r{t(i)})}function he(n,t){n.children.forEach(e=>{t(e)||he(e,t)})}function we(n){var e;let t=new Map;for(let r of n){let i=r;do{let o=((e=t.get(i))!=null?e:0)+1;if(o===n.size)return i;t.set(i,o),i=i.parent}while(i!==null)}return null}var k=class{constructor(){this._joints=new Set;this._sortedJoints=[];this._hasWarnedCircularDependency=!1;this._ancestors=[];this._objectSpringBonesMap=new Map;this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){let t=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(r=>{t.add(r)})}),Array.from(t)}get colliders(){let t=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(r=>{t.add(r)})}),Array.from(t)}addJoint(t){this._joints.add(t);let e=this._objectSpringBonesMap.get(t.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(t.bone,e)),e.add(t),this._sortJoints()}addSpringBone(t){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(t)}deleteJoint(t){this._joints.delete(t),this._objectSpringBonesMap.get(t.bone).delete(t),this._sortJoints()}deleteSpringBone(t){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(t)}setInitState(){for(let t=0;t{var a,l;return((l=(a=this._objectSpringBonesMap.get(s))==null?void 0:a.size)!=null?l:0)>0?!0:(this._ancestors.push(s),!1)}))}_insertJointSort(t,e,r,i,o){if(r.has(t))return;if(e.has(t)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}let s=t.dependencies;for(let a of s){let l=!1,p=null;Be(a,S=>{let w=this._objectSpringBonesMap.get(S);if(w)for(let D of w)l=!0,this._insertJointSort(D,e,r,i,o);else l||(p=S)}),p&&o.add(p)}i.push(t),r.add(t)}_relevantChildrenUpdated(t){var e,r;return((r=(e=this._objectSpringBonesMap.get(t))==null?void 0:e.size)!=null?r:0)>0?!0:(t.updateWorldMatrix(!1,!1),!1)}};var Ce="VRMC_springBone_extended_collider",Ye=new Set(["1.0","1.0-beta"]),Ne=new Set(["1.0"]),j=class j{get name(){return j.EXTENSION_NAME}constructor(t,e){var r;this.parser=t,this.jointHelperRoot=e==null?void 0:e.jointHelperRoot,this.colliderHelperRoot=e==null?void 0:e.colliderHelperRoot,this.useExtendedColliders=(r=e==null?void 0:e.useExtendedColliders)!=null?r:!0}afterRoot(t){return K(this,null,function*(){t.userData.vrmSpringBoneManager=yield this._import(t)})}_import(t){return K(this,null,function*(){let e=yield this._v1Import(t);if(e!=null)return e;let r=yield this._v0Import(t);return r!=null?r:null})}_v1Import(t){return K(this,null,function*(){var S,w,D,d,z;let e=t.parser.json;if(!(((S=e.extensionsUsed)==null?void 0:S.indexOf(j.EXTENSION_NAME))!==-1))return null;let i=new k,o=yield t.parser.getDependencies("node"),s=(w=e.extensions)==null?void 0:w[j.EXTENSION_NAME];if(!s)return null;let a=s.specVersion;if(!Ye.has(a))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${j.EXTENSION_NAME} specVersion "${a}"`),null;let l=(D=s.colliders)==null?void 0:D.map((E,T)=>{var c,x,R,M,L,J,y,V,C,Q,me,ge,be,Se,Te;let h=o[E.node],u=E.shape,_=(c=E.extensions)==null?void 0:c[Ce];if(this.useExtendedColliders&&_!=null){let xe=_.specVersion;if(!Ne.has(xe))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Ce} specVersion "${xe}". Fallbacking to the ${j.EXTENSION_NAME} definition`);else{let g=_.shape;if(g.sphere)return this._importSphereCollider(h,{offset:new b.Vector3().fromArray((x=g.sphere.offset)!=null?x:[0,0,0]),radius:(R=g.sphere.radius)!=null?R:0,inside:(M=g.sphere.inside)!=null?M:!1});if(g.capsule)return this._importCapsuleCollider(h,{offset:new b.Vector3().fromArray((L=g.capsule.offset)!=null?L:[0,0,0]),radius:(J=g.capsule.radius)!=null?J:0,tail:new b.Vector3().fromArray((y=g.capsule.tail)!=null?y:[0,0,0]),inside:(V=g.capsule.inside)!=null?V:!1});if(g.plane)return this._importPlaneCollider(h,{offset:new b.Vector3().fromArray((C=g.plane.offset)!=null?C:[0,0,0]),normal:new b.Vector3().fromArray((Q=g.plane.normal)!=null?Q:[0,0,1])})}}if(u.sphere)return this._importSphereCollider(h,{offset:new b.Vector3().fromArray((me=u.sphere.offset)!=null?me:[0,0,0]),radius:(ge=u.sphere.radius)!=null?ge:0,inside:!1});if(u.capsule)return this._importCapsuleCollider(h,{offset:new b.Vector3().fromArray((be=u.capsule.offset)!=null?be:[0,0,0]),radius:(Se=u.capsule.radius)!=null?Se:0,tail:new b.Vector3().fromArray((Te=u.capsule.tail)!=null?Te:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${T} has no valid shape`)}),p=(d=s.colliderGroups)==null?void 0:d.map((E,T)=>{var u;return{colliders:((u=E.colliders)!=null?u:[]).map(_=>{let c=l==null?void 0:l[_];if(c==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${T} attempted to use a collider #${_} but not found`);return c}),name:E.name}});return(z=s.springs)==null||z.forEach((E,T)=>{var x;let h=E.joints,u=(x=E.colliderGroups)==null?void 0:x.map(R=>{let M=p==null?void 0:p[R];if(M==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${T} attempted to use a colliderGroup ${R} but not found`);return M}),_=E.center!=null?o[E.center]:void 0,c;h.forEach(R=>{if(c){let M=c.node,L=o[M],J=R.node,y=o[J],V={hitRadius:c.hitRadius,dragForce:c.dragForce,gravityPower:c.gravityPower,stiffness:c.stiffness,gravityDir:c.gravityDir!=null?new b.Vector3().fromArray(c.gravityDir):void 0},C=this._importJoint(L,y,V,u);_&&(C.center=_),i.addJoint(C)}c=R})}),i.setInitState(),i})}_v0Import(t){return K(this,null,function*(){var S,w,D;let e=t.parser.json;if(!(((S=e.extensionsUsed)==null?void 0:S.indexOf("VRM"))!==-1))return null;let i=(w=e.extensions)==null?void 0:w.VRM,o=i==null?void 0:i.secondaryAnimation;if(!o)return null;let s=o==null?void 0:o.boneGroups;if(!s)return null;let a=new k,l=yield t.parser.getDependencies("node"),p=(D=o.colliderGroups)==null?void 0:D.map(d=>{var T;let z=l[d.node];return{colliders:((T=d.colliders)!=null?T:[]).map((h,u)=>{var c,x,R;let _=new b.Vector3(0,0,0);return h.offset&&_.set((c=h.offset.x)!=null?c:0,(x=h.offset.y)!=null?x:0,h.offset.z?-h.offset.z:0),this._importSphereCollider(z,{offset:_,radius:(R=h.radius)!=null?R:0,inside:!1})})}});return s==null||s.forEach((d,z)=>{let E=d.bones;E&&E.forEach(T=>{var R,M,L,J;let h=l[T],u=new b.Vector3;d.gravityDir?u.set((R=d.gravityDir.x)!=null?R:0,(M=d.gravityDir.y)!=null?M:0,(L=d.gravityDir.z)!=null?L:0):u.set(0,-1,0);let _=d.center!=null?l[d.center]:void 0,c={hitRadius:d.hitRadius,dragForce:d.dragForce,gravityPower:d.gravityPower,stiffness:d.stiffiness,gravityDir:u},x=(J=d.colliderGroups)==null?void 0:J.map(y=>{let V=p==null?void 0:p[y];if(V==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${z} attempted to use a colliderGroup ${y} but not found`);return V});h.traverse(y=>{var Q;let V=(Q=y.children[0])!=null?Q:null,C=this._importJoint(y,V,c,x);_&&(C.center=_),a.addJoint(C)})})}),t.scene.updateMatrixWorld(),a.setInitState(),a})}_importJoint(t,e,r,i){let o=new oe(t,e,r,i);if(this.jointHelperRoot){let s=new q(o);this.jointHelperRoot.add(s),s.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(t,e){let r=new F(e),i=new N(r);if(t.add(i),this.colliderHelperRoot){let o=new I(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}_importCapsuleCollider(t,e){let r=new W(e),i=new N(r);if(t.add(i),this.colliderHelperRoot){let o=new I(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}_importPlaneCollider(t,e){let r=new X(e),i=new N(r);if(t.add(i),this.colliderHelperRoot){let o=new I(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}};j.EXTENSION_NAME="VRMC_springBone";var Re=j; diff --git a/packages/three-vrm-springbone/lib/three-vrm-springbone.module.js b/packages/three-vrm-springbone/lib/three-vrm-springbone.module.js index d8dd0c962..27382f2e6 100644 --- a/packages/three-vrm-springbone/lib/three-vrm-springbone.module.js +++ b/packages/three-vrm-springbone/lib/three-vrm-springbone.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm-springbone v3.2.0 + * @pixiv/three-vrm-springbone v3.3.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -53,8 +53,8 @@ var VRMSpringBoneColliderShapeCapsule = class extends VRMSpringBoneColliderShape this.inside = (_d = params == null ? void 0 : params.inside) != null ? _d : false; } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - _v3A.copy(this.offset).applyMatrix4(colliderMatrix); - _v3B.copy(this.tail).applyMatrix4(colliderMatrix); + _v3A.setFromMatrixPosition(colliderMatrix); + _v3B.subVectors(this.tail, this.offset).applyMatrix4(colliderMatrix); _v3B.sub(_v3A); const lengthSqCapsule = _v3B.lengthSq(); target.copy(objectPosition).sub(_v3A); @@ -66,10 +66,13 @@ var VRMSpringBoneColliderShapeCapsule = class extends VRMSpringBoneColliderShape _v3B.multiplyScalar(dot / lengthSqCapsule); target.sub(_v3B); } - const distance = this.inside ? this.radius - objectRadius - target.length() : target.length() - objectRadius - this.radius; - target.normalize(); - if (this.inside) { - target.negate(); + const length = target.length(); + const distance = this.inside ? this.radius - objectRadius - length : length - objectRadius - this.radius; + if (distance < 0) { + target.multiplyScalar(1 / length); + if (this.inside) { + target.negate(); + } } return distance; } @@ -90,7 +93,7 @@ var VRMSpringBoneColliderShapePlane = class extends VRMSpringBoneColliderShape { this.normal = (_b = params == null ? void 0 : params.normal) != null ? _b : new THREE2.Vector3(0, 0, 1); } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - target.copy(this.offset).applyMatrix4(colliderMatrix); + target.setFromMatrixPosition(colliderMatrix); target.negate().add(objectPosition); _mat3A.getNormalMatrix(colliderMatrix); _v3A2.copy(this.normal).applyNormalMatrix(_mat3A).normalize(); @@ -102,6 +105,7 @@ var VRMSpringBoneColliderShapePlane = class extends VRMSpringBoneColliderShape { // src/VRMSpringBoneColliderShapeSphere.ts import * as THREE3 from "three"; +var _v3A3 = new THREE3.Vector3(); var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape { get type() { return "sphere"; @@ -114,12 +118,14 @@ var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape this.inside = (_c = params == null ? void 0 : params.inside) != null ? _c : false; } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - target.copy(this.offset).applyMatrix4(colliderMatrix); - target.negate().add(objectPosition); - const distance = this.inside ? this.radius - objectRadius - target.length() : target.length() - objectRadius - this.radius; - target.normalize(); - if (this.inside) { - target.negate(); + target.subVectors(objectPosition, _v3A3.setFromMatrixPosition(colliderMatrix)); + const length = target.length(); + const distance = this.inside ? this.radius - objectRadius - length : length - objectRadius - this.radius; + if (distance < 0) { + target.multiplyScalar(1 / length); + if (this.inside) { + target.negate(); + } } return distance; } @@ -127,7 +133,7 @@ var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape // src/helpers/utils/ColliderShapeCapsuleBufferGeometry.ts import * as THREE4 from "three"; -var _v3A3 = new THREE4.Vector3(); +var _v3A4 = new THREE4.Vector3(); var ColliderShapeCapsuleBufferGeometry = class extends THREE4.BufferGeometry { constructor(shape) { super(); @@ -154,7 +160,7 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE4.BufferGeometry { this._currentOffset.copy(this._shape.offset); shouldUpdateGeometry = true; } - const tail = _v3A3.copy(this._shape.tail).divideScalar(this.worldScale); + const tail = _v3A4.copy(this._shape.tail).divideScalar(this.worldScale); if (this._currentTail.distanceToSquared(tail) > 1e-10) { this._currentTail.copy(tail); shouldUpdateGeometry = true; @@ -164,8 +170,8 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE4.BufferGeometry { } } _buildPosition() { - _v3A3.copy(this._currentTail).sub(this._currentOffset); - const l = _v3A3.length() / this._currentRadius; + _v3A4.copy(this._currentTail).sub(this._currentOffset); + const l = _v3A4.length() / this._currentRadius; for (let i = 0; i <= 16; i++) { const t = i / 16 * Math.PI; this._attrPos.setXYZ(i, -Math.sin(t), -Math.cos(t), 0); @@ -178,8 +184,8 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE4.BufferGeometry { this._attrPos.setXYZ(68 + i, 0, Math.sin(t), Math.cos(t)); this._attrPos.setXYZ(100 + i, l, Math.sin(t), Math.cos(t)); } - const theta = Math.atan2(_v3A3.y, Math.sqrt(_v3A3.x * _v3A3.x + _v3A3.z * _v3A3.z)); - const phi = -Math.atan2(_v3A3.z, _v3A3.x); + const theta = Math.atan2(_v3A4.y, Math.sqrt(_v3A4.x * _v3A4.x + _v3A4.z * _v3A4.z)); + const phi = -Math.atan2(_v3A4.z, _v3A4.x); this.rotateZ(theta); this.rotateY(phi); this.scale(this._currentRadius, this._currentRadius, this._currentRadius); @@ -306,7 +312,7 @@ var ColliderShapeSphereBufferGeometry = class extends THREE6.BufferGeometry { }; // src/helpers/VRMSpringBoneColliderHelper.ts -var _v3A4 = new THREE7.Vector3(); +var _v3A5 = new THREE7.Vector3(); var VRMSpringBoneColliderHelper = class extends THREE7.Group { constructor(collider) { super(); @@ -336,7 +342,7 @@ var VRMSpringBoneColliderHelper = class extends THREE7.Group { this.collider.updateWorldMatrix(true, false); this.matrix.copy(this.collider.matrixWorld); const matrixWorldElements = this.matrix.elements; - this._geometry.worldScale = _v3A4.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); + this._geometry.worldScale = _v3A5.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); this._geometry.update(); super.updateMatrixWorld(force); } @@ -402,7 +408,7 @@ var SpringBoneBufferGeometry = class extends THREE8.BufferGeometry { }; // src/helpers/VRMSpringBoneJointHelper.ts -var _v3A5 = new THREE9.Vector3(); +var _v3A6 = new THREE9.Vector3(); var VRMSpringBoneJointHelper = class extends THREE9.Group { constructor(springBone) { super(); @@ -424,7 +430,7 @@ var VRMSpringBoneJointHelper = class extends THREE9.Group { this.springBone.bone.updateWorldMatrix(true, false); this.matrix.copy(this.springBone.bone.matrixWorld); const matrixWorldElements = this.matrix.elements; - this._geometry.worldScale = _v3A5.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); + this._geometry.worldScale = _v3A6.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); this._geometry.update(); super.updateMatrixWorld(force); } @@ -435,13 +441,33 @@ import * as THREE10 from "three"; var VRMSpringBoneCollider = class extends THREE10.Object3D { constructor(shape) { super(); + /** + * World space matrix for the collider shape used in collision calculations. + */ + this.colliderMatrix = new THREE10.Matrix4(); this.shape = shape; } + updateWorldMatrix(updateParents, updateChildren) { + super.updateWorldMatrix(updateParents, updateChildren); + updateColliderMatrix(this.colliderMatrix, this.matrixWorld, this.shape.offset); + } }; +function updateColliderMatrix(colliderMatrix, matrixWorld, offset) { + const me = matrixWorld.elements; + colliderMatrix.copy(matrixWorld); + if (offset) { + colliderMatrix.elements[12] = me[0] * offset.x + me[4] * offset.y + me[8] * offset.z + me[12]; + colliderMatrix.elements[13] = me[1] * offset.x + me[5] * offset.y + me[9] * offset.z + me[13]; + colliderMatrix.elements[14] = me[2] * offset.x + me[6] * offset.y + me[10] * offset.z + me[14]; + } +} // src/VRMSpringBoneJoint.ts import * as THREE13 from "three"; +// src/utils/Matrix4InverseCache.ts +import * as THREE12 from "three"; + // src/utils/mat4InvertCompat.ts import * as THREE11 from "three"; var _matA = new THREE11.Matrix4(); @@ -455,7 +481,6 @@ function mat4InvertCompat(target) { } // src/utils/Matrix4InverseCache.ts -import * as THREE12 from "three"; var Matrix4InverseCache = class { constructor(matrix) { /** @@ -497,15 +522,11 @@ var Matrix4InverseCache = class { // src/VRMSpringBoneJoint.ts var IDENTITY_MATRIX4 = new THREE13.Matrix4(); -var _v3A6 = new THREE13.Vector3(); +var _v3A7 = new THREE13.Vector3(); var _v3B2 = new THREE13.Vector3(); -var _v3C = new THREE13.Vector3(); var _worldSpacePosition = new THREE13.Vector3(); -var _centerSpacePosition = new THREE13.Vector3(); var _nextTail = new THREE13.Vector3(); -var _quatA = new THREE13.Quaternion(); var _matA2 = new THREE13.Matrix4(); -var _matB = new THREE13.Matrix4(); var VRMSpringBoneJoint = class { /** * Create a new VRMSpringBone. @@ -565,6 +586,22 @@ var VRMSpringBoneJoint = class { }; this.colliderGroups = colliderGroups; } + /** + * Set of dependencies that need to be updated before this joint. + */ + get dependencies() { + const set = /* @__PURE__ */ new Set(); + const parent = this.bone.parent; + if (parent) { + set.add(parent); + } + for (let cg = 0; cg < this.colliderGroups.length; cg++) { + for (let c = 0; c < this.colliderGroups[cg].colliders.length; c++) { + set.add(this.colliderGroups[cg].colliders[c]); + } + } + return set; + } get center() { return this._center; } @@ -603,7 +640,7 @@ var VRMSpringBoneJoint = class { } else { this._initialLocalChildPosition.copy(this.bone.position).normalize().multiplyScalar(0.07); } - const matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); + const matrixWorldToCenter = this._getMatrixWorldToCenter(); this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(matrixWorldToCenter); this._prevTail.copy(this._currentTail); this._boneAxis.copy(this._initialLocalChildPosition).normalize(); @@ -616,7 +653,7 @@ var VRMSpringBoneJoint = class { this.bone.quaternion.copy(this._initialLocalRotation); this.bone.updateMatrix(); this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld, this.bone.matrix); - const matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); + const matrixWorldToCenter = this._getMatrixWorldToCenter(); this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(matrixWorldToCenter); this._prevTail.copy(this._currentTail); } @@ -629,30 +666,15 @@ var VRMSpringBoneJoint = class { update(delta) { if (delta <= 0) return; this._calcWorldSpaceBoneLength(); + const worldSpaceBoneAxis = _v3B2.copy(this._boneAxis).transformDirection(this._initialLocalMatrix).transformDirection(this._parentMatrixWorld); + _nextTail.copy(this._currentTail).add(_v3A7.subVectors(this._currentTail, this._prevTail).multiplyScalar(1 - this.settings.dragForce)).applyMatrix4(this._getMatrixCenterToWorld()).addScaledVector(worldSpaceBoneAxis, this.settings.stiffness * delta).addScaledVector(this.settings.gravityDir, this.settings.gravityPower * delta); _worldSpacePosition.setFromMatrixPosition(this.bone.matrixWorld); - let matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); - _centerSpacePosition.copy(_worldSpacePosition).applyMatrix4(matrixWorldToCenter); - const quatWorldToCenter = _quatA.setFromRotationMatrix(matrixWorldToCenter); - const centerSpaceParentMatrix = _matB.copy(matrixWorldToCenter).multiply(this._parentMatrixWorld); - const centerSpaceBoneAxis = _v3B2.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(centerSpaceParentMatrix).sub(_centerSpacePosition).normalize(); - const centerSpaceGravity = _v3C.copy(this.settings.gravityDir).applyQuaternion(quatWorldToCenter).normalize(); - const matrixCenterToWorld = this._getMatrixCenterToWorld(_matA2); - _nextTail.copy(this._currentTail).add( - _v3A6.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1 - this.settings.dragForce) - ).add(_v3A6.copy(centerSpaceBoneAxis).multiplyScalar(this.settings.stiffness * delta)).add(_v3A6.copy(centerSpaceGravity).multiplyScalar(this.settings.gravityPower * delta)).applyMatrix4(matrixCenterToWorld); _nextTail.sub(_worldSpacePosition).normalize().multiplyScalar(this._worldSpaceBoneLength).add(_worldSpacePosition); this._collision(_nextTail); - matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); this._prevTail.copy(this._currentTail); - this._currentTail.copy(_v3A6.copy(_nextTail).applyMatrix4(matrixWorldToCenter)); - const worldSpaceInitialMatrixInv = mat4InvertCompat( - _matA2.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix) - ); - const applyRotation = _quatA.setFromUnitVectors( - this._boneAxis, - _v3A6.copy(_nextTail).applyMatrix4(worldSpaceInitialMatrixInv).normalize() - ); - this.bone.quaternion.copy(this._initialLocalRotation).multiply(applyRotation); + this._currentTail.copy(_nextTail).applyMatrix4(this._getMatrixWorldToCenter()); + const worldSpaceInitialMatrixInv = _matA2.multiplyMatrices(this._parentMatrixWorld, this._initialLocalMatrix).invert(); + this.bone.quaternion.setFromUnitVectors(this._boneAxis, _v3A7.copy(_nextTail).applyMatrix4(worldSpaceInitialMatrixInv).normalize()).premultiply(this._initialLocalRotation); this.bone.updateMatrix(); this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld, this.bone.matrix); } @@ -662,53 +684,44 @@ var VRMSpringBoneJoint = class { * @param tail The tail you want to process */ _collision(tail) { - this.colliderGroups.forEach((colliderGroup) => { - colliderGroup.colliders.forEach((collider) => { - const dist = collider.shape.calculateCollision(collider.matrixWorld, tail, this.settings.hitRadius, _v3A6); + for (let cg = 0; cg < this.colliderGroups.length; cg++) { + for (let c = 0; c < this.colliderGroups[cg].colliders.length; c++) { + const collider = this.colliderGroups[cg].colliders[c]; + const dist = collider.shape.calculateCollision(collider.colliderMatrix, tail, this.settings.hitRadius, _v3A7); if (dist < 0) { - tail.add(_v3A6.multiplyScalar(-dist)); - tail.sub(_worldSpacePosition).normalize().multiplyScalar(this._worldSpaceBoneLength).add(_worldSpacePosition); + tail.addScaledVector(_v3A7, -dist); + tail.sub(_worldSpacePosition); + const length = tail.length(); + tail.multiplyScalar(this._worldSpaceBoneLength / length).add(_worldSpacePosition); } - }); - }); + } + } } /** * Calculate the {@link _worldSpaceBoneLength}. * Intended to be used in {@link update}. */ _calcWorldSpaceBoneLength() { - _v3A6.setFromMatrixPosition(this.bone.matrixWorld); + _v3A7.setFromMatrixPosition(this.bone.matrixWorld); if (this.child) { _v3B2.setFromMatrixPosition(this.child.matrixWorld); } else { _v3B2.copy(this._initialLocalChildPosition); _v3B2.applyMatrix4(this.bone.matrixWorld); } - this._worldSpaceBoneLength = _v3A6.sub(_v3B2).length(); + this._worldSpaceBoneLength = _v3A7.sub(_v3B2).length(); } /** * Create a matrix that converts center space into world space. - * @param target Target matrix */ - _getMatrixCenterToWorld(target) { - if (this._center) { - target.copy(this._center.matrixWorld); - } else { - target.identity(); - } - return target; + _getMatrixCenterToWorld() { + return this._center ? this._center.matrixWorld : IDENTITY_MATRIX4; } /** * Create a matrix that converts world space into center space. - * @param target Target matrix */ - _getMatrixWorldToCenter(target) { - if (this._center) { - target.copy(this._center.userData.inverseCacheProxy.inverse); - } else { - target.identity(); - } - return target; + _getMatrixWorldToCenter() { + return this._center ? this._center.userData.inverseCacheProxy.inverse : IDENTITY_MATRIX4; } }; @@ -738,12 +751,40 @@ function traverseChildrenUntilConditionMet(object, callback) { }); } +// src/utils/lowestCommonAncestor.ts +function lowestCommonAncestor(objects) { + var _a; + const sharedAncestors = /* @__PURE__ */ new Map(); + for (const object of objects) { + let current = object; + do { + const newValue = ((_a = sharedAncestors.get(current)) != null ? _a : 0) + 1; + if (newValue === objects.size) { + return current; + } + sharedAncestors.set(current, newValue); + current = current.parent; + } while (current !== null); + } + return null; +} + // src/VRMSpringBoneManager.ts var VRMSpringBoneManager = class { constructor() { this._joints = /* @__PURE__ */ new Set(); + this._sortedJoints = []; this._hasWarnedCircularDependency = false; + /** + * An ordered list of ancestors of all the SpringBone joints. Before the + * SpringBone joints can be updated, the world matrices of these ancestors + * must be calculated. The first element is the lowest common ancestor, for + * which not only its world matrix but its ancestors' world matrices are + * updated as well. + */ + this._ancestors = []; this._objectSpringBonesMap = /* @__PURE__ */ new Map(); + this._relevantChildrenUpdated = this._relevantChildrenUpdated.bind(this); } get joints() { return this._joints; @@ -781,6 +822,7 @@ var VRMSpringBoneManager = class { this._objectSpringBonesMap.set(joint.bone, objectSet); } objectSet.add(joint); + this._sortJoints(); } /** * @deprecated Use {@link addJoint} instead. @@ -793,6 +835,7 @@ var VRMSpringBoneManager = class { this._joints.delete(joint); const objectSet = this._objectSpringBonesMap.get(joint.bone); objectSet.delete(joint); + this._sortJoints(); } /** * @deprecated Use {@link deleteJoint} instead. @@ -802,117 +845,99 @@ var VRMSpringBoneManager = class { this.deleteJoint(joint); } setInitState() { - const springBonesTried = /* @__PURE__ */ new Set(); - const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); - for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.setInitState() - ); + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.setInitState(); } } reset() { - const springBonesTried = /* @__PURE__ */ new Set(); - const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); - for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.reset() - ); + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.reset(); } } update(delta) { + for (let i = 0; i < this._ancestors.length; i++) { + this._ancestors[i].updateWorldMatrix(i === 0, false); + } + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.update(delta); + traverseChildrenUntilConditionMet(springBone.bone, this._relevantChildrenUpdated); + } + } + /** + * Sorts the joints ensuring they are updated in the correct order taking dependencies into account. + */ + _sortJoints() { + const springBoneOrder = []; const springBonesTried = /* @__PURE__ */ new Set(); const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); + const ancestors = /* @__PURE__ */ new Set(); for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.update(delta) - ); - traverseChildrenUntilConditionMet(springBone.bone, (object) => { + this._insertJointSort(springBone, springBonesTried, springBonesDone, springBoneOrder, ancestors); + } + this._sortedJoints = springBoneOrder; + const lca = lowestCommonAncestor(ancestors); + this._ancestors = []; + if (lca) { + this._ancestors.push(lca); + traverseChildrenUntilConditionMet(lca, (object) => { var _a, _b; if (((_b = (_a = this._objectSpringBonesMap.get(object)) == null ? void 0 : _a.size) != null ? _b : 0) > 0) { return true; } - object.updateWorldMatrix(false, false); + this._ancestors.push(object); return false; }); } } - /** - * Update a spring bone. - * If there are other spring bone that are dependant, it will try to update them recursively. - * It updates matrixWorld of all ancestors and myself. - * It might log an warning message if there are any circular dependencies. - * - * Intended to be used in {@link update} and {@link _processSpringBone} itself recursively. - * - * @param springBone A springBone you want to update - * @param springBonesTried Set of springBones that are already tried to be updated - * @param springBonesDone Set of springBones that are already up to date - * @param objectUpdated Set of object3D whose matrixWorld is updated - */ - _processSpringBone(springBone, springBonesTried, springBonesDone, objectUpdated, callback) { + _insertJointSort(springBone, springBonesTried, springBonesDone, springBoneOrder, ancestors) { if (springBonesDone.has(springBone)) { return; } if (springBonesTried.has(springBone)) { if (!this._hasWarnedCircularDependency) { - console.warn("VRMSpringBoneManager: Circular dependency detected while updating springbones"); + console.warn("VRMSpringBoneManager: Circular dependency detected"); this._hasWarnedCircularDependency = true; } return; } - springBonesTried.add(springBone); - const depObjects = this._getDependencies(springBone); + const depObjects = springBone.dependencies; for (const depObject of depObjects) { + let encounteredSpringBone = false; + let ancestor = null; traverseAncestorsFromRoot(depObject, (depObjectAncestor) => { const objectSet = this._objectSpringBonesMap.get(depObjectAncestor); if (objectSet) { for (const depSpringBone of objectSet) { - this._processSpringBone(depSpringBone, springBonesTried, springBonesDone, objectUpdated, callback); + encounteredSpringBone = true; + this._insertJointSort(depSpringBone, springBonesTried, springBonesDone, springBoneOrder, ancestors); } - } else if (!objectUpdated.has(depObjectAncestor)) { - depObjectAncestor.updateWorldMatrix(false, false); - objectUpdated.add(depObjectAncestor); + } else if (!encounteredSpringBone) { + ancestor = depObjectAncestor; } }); + if (ancestor) { + ancestors.add(ancestor); + } } - springBone.bone.updateMatrix(); - springBone.bone.updateWorldMatrix(false, false); - callback(springBone); - objectUpdated.add(springBone.bone); + springBoneOrder.push(springBone); springBonesDone.add(springBone); } - /** - * Return a set of objects that are dependant of given spring bone. - * @param springBone A spring bone - * @return A set of objects that are dependant of given spring bone - */ - _getDependencies(springBone) { - const set = /* @__PURE__ */ new Set(); - const parent = springBone.bone.parent; - if (parent) { - set.add(parent); + _relevantChildrenUpdated(object) { + var _a, _b; + if (((_b = (_a = this._objectSpringBonesMap.get(object)) == null ? void 0 : _a.size) != null ? _b : 0) > 0) { + return true; } - springBone.colliderGroups.forEach((colliderGroup) => { - colliderGroup.colliders.forEach((collider) => { - set.add(collider); - }); - }); - return set; + object.updateWorldMatrix(false, false); + return false; } }; @@ -1235,4 +1260,4 @@ export { VRMSpringBoneLoaderPlugin, VRMSpringBoneManager }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2hlbHBlcnMvVlJNU3ByaW5nQm9uZUNvbGxpZGVySGVscGVyLnRzIiwgIi4uL3NyYy9WUk1TcHJpbmdCb25lQ29sbGlkZXJTaGFwZUNhcHN1bGUudHMiLCAiLi4vc3JjL1ZSTVNwcmluZ0JvbmVDb2xsaWRlclNoYXBlLnRzIiwgIi4uL3NyYy9WUk1TcHJpbmdCb25lQ29sbGlkZXJTaGFwZVBsYW5lLnRzIiwgIi4uL3NyYy9WUk1TcHJpbmdCb25lQ29sbGlkZXJTa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0aW5nOiBQYXJ0aWFsPFZSTVNwcmluZ0JvbmVKb2ludFNldHRpbmdzPiA9IHtcbiAgICAgICAgICAgIGhpdFJhZGl1czogcHJldlNjaGVtYUpvaW50LmhpdFJhZGl1cyxcbiAgICAgICAgICAgIGRyYWdGb3JjZTogcHJldlNjaGVtYUpvaW50LmRyYWdGb3JjZSxcbiAgICAgICAgICAgIGdyYXZpdHlQb3dlcjogcHJldlNjaGVtYUpvaW50LmdyYXZpdHlQb3dlcixcbiAgICAgICAgICAgIHN0aWZmbmVzczogcHJldlNjaGVtYUpvaW50LnN0aWZmbmVzcyxcbiAgICAgICAgICAgIGdyYXZpdHlEaXI6XG4gICAgICAgICAgICAgIHByZXZTY2hlbWFKb2ludC5ncmF2aXR5RGlyICE9IG51bGxcbiAgICAgICAgICAgICAgICA/IG5ldyBUSFJFRS5WZWN0b3IzKCkuZnJvbUFycmF5KHByZXZTY2hlbWFKb2ludC5ncmF2aXR5RGlyKVxuICAgICAgICAgICAgICAgIDogdW5kZWZpbmVkLFxuICAgICAgICAgIH07XG5cbiAgICAgICAgICAvLyBjcmVhdGUgc3ByaW5nIGJvbmVzXG4gICAgICAgICAgY29uc3Qgam9pbnQgPSB0aGlzLl9pbXBvcnRKb2ludChub2RlLCBjaGlsZCwgc2V0dGluZywgY29sbGlkZXJHcm91cHNGb3JTcHJpbmcpO1xuICAgICAgICAgIGlmIChjZW50ZXIpIHtcbiAgICAgICAgICAgIGpvaW50LmNlbnRlciA9IGNlbnRlcjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBtYW5hZ2VyLmFkZEpvaW50KGpvaW50KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHByZXZTY2hlbWFKb2ludCA9IHNjaGVtYUpvaW50O1xuICAgICAgfSk7XG4gICAgfSk7XG5cbiAgICAvLyBpbml0IHNwcmluZyBib25lc1xuICAgIG1hbmFnZXIuc2V0SW5pdFN0YXRlKCk7XG5cbiAgICByZXR1cm4gbWFuYWdlcjtcbiAg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sXG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiB7IGNvbGxpZGVycyB9O1xuICAgICAgfSxcbiAgICApO1xuXG4gICAgLy8gaW1wb3J0IHNwcmluZyBib25lcyBmb3IgZWFjaCBzcHJpbmcgYm9uZSBncm91cHNcbiAgICBzY2hlbWFCb25lR3JvdXBzPy5mb3JFYWNoKChzY2hlbWFCb25lR3JvdXAsIGlCb25lR3JvdXApID0+IHtcbiAgICAgIGNvbnN0IHJvb3RJbmRpY2VzID0gc2NoZW1hQm9uZUdyb3VwLmJvbmVzO1xuICAgICAgaWYgKCFyb290SW5kaWNlcykge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIHJvb3RJbmRpY2VzLmZvckVhY2goKHJvb3RJbmRleCkgPT4ge1xuICAgICAgICBjb25zdCByb290ID0gdGhyZWVOb2Rlc1tyb290SW5kZXhdO1xuXG4gICAgICAgIC8vIHByZXBhcmUgc2V0dGluZ1xuICAgICAgICBjb25zdCBncmF2aXR5RGlyID0gbmV3IFRIUkVFLlZlY3RvcjMoKTtcbiAgICAgICAgaWYgKHNjaGVtYUJvbmVHcm91cC5ncmF2aXR5RGlyKSB7XG4gICAgICAgICAgZ3Jhdml0eURpci5zZXQoXG4gICAgICAgICAgICBzY2hlbWFCb25lR3JvdXAuZ3Jhdml0eURpci54ID8/IDAuMCxcbiAgICAgICAgICAgIHNjaGVtYUJvbmVHcm91cC5ncmF2aXR5RGlyLnkgPz8gMC4wLFxuICAgICAgICAgICAgc2NoZW1hQm9uZUdyb3VwLmdyYXZpdHlEaXIueiA/PyAwLjAsXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBncmF2aXR5RGlyLnNldCgwLjAsIC0xLjAsIDAuMCk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjZW50ZXIgPSBzY2hlbWFCb25lR3JvdXAuY2VudGVyICE9IG51bGwgPyB0aHJlZU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JLE1BQU07QUFDbEMsYUFBTyxjQUFjLEtBQUssbUJBQW1CO0FBQUEsSUFDL0M7QUFFQSxXQUFPO0FBQUEsRUFDVDtBQUFBLEVBRVEscUJBQ04sYUFDQSxRQUl1QjtBQUN2QixVQUFNLFFBQVEsSUFBSSxnQ0FBZ0MsTUFBTTtBQUV4RCxVQUFNLFdBQVcsSUFBSSxzQkFBc0IsS0FBSztBQUVoRCxnQkFBWSxJQUFJLFFBQVE7QUFFeEIsUUFBSSxLQUFLLG9CQUFvQjtBQUMzQixZQUFNLFNBQVMsSUFBSSw0QkFBNEIsUUFBUTtBQUN2RCxXQUFLLG1CQUFtQixJQUFJLE1BQU07QUFDbEMsYUFBTyxjQUFjLEtBQUssbUJBQW1CO0FBQUEsSUFDL0M7QUFFQSxXQUFPO0FBQUEsRUFDVDtBQUNGO0FBMWFhLDJCQUNZLGlCQUFpQjtBQURuQyxJQUFNLDRCQUFOOyIsCiAgIm5hbWVzIjogWyJUSFJFRSIsICJUSFJFRSIsICJfdjNBIiwgIlRIUkVFIiwgIl92M0EiLCAiVEhSRUUiLCAiX3YzQSIsICJUSFJFRSIsICJUSFJFRSIsICJfdjNBIiwgIlRIUkVFIiwgIlRIUkVFIiwgIl92M0EiLCAiVEhSRUUiLCAiVEhSRUUiLCAiVEhSRUUiLCAiVEhSRUUiLCAiX3YzQSIsICJfdjNCIiwgIl9tYXRBIiwgIlRIUkVFIiwgIl9hIiwgIl9iIiwgIl9jIiwgIl9kIiwgIl9lIl0KfQo= diff --git a/packages/three-vrm-springbone/lib/three-vrm-springbone.module.min.js b/packages/three-vrm-springbone/lib/three-vrm-springbone.module.min.js index 762f4cb48..4992a770f 100644 --- a/packages/three-vrm-springbone/lib/three-vrm-springbone.module.min.js +++ b/packages/three-vrm-springbone/lib/three-vrm-springbone.module.min.js @@ -1,2 +1,2 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -var Q=(a,t,e)=>new Promise((r,i)=>{var o=s=>{try{l(e.next(s))}catch(d){i(d)}},n=s=>{try{l(e.throw(s))}catch(d){i(d)}},l=s=>s.done?r(s.value):Promise.resolve(s.value).then(o,n);l((e=e.apply(a,t)).next())});import*as P from"three";import*as K from"three";var w=class{};var de=new K.Vector3,L=new K.Vector3,X=class extends w{get type(){return"capsule"}constructor(t){var e,r,i,o;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new K.Vector3(0,0,0),this.tail=(r=t==null?void 0:t.tail)!=null?r:new K.Vector3(0,0,0),this.radius=(i=t==null?void 0:t.radius)!=null?i:0,this.inside=(o=t==null?void 0:t.inside)!=null?o:!1}calculateCollision(t,e,r,i){de.copy(this.offset).applyMatrix4(t),L.copy(this.tail).applyMatrix4(t),L.sub(de);let o=L.lengthSq();i.copy(e).sub(de);let n=L.dot(i);n<=0||(o<=n||L.multiplyScalar(n/o),i.sub(L));let l=this.inside?this.radius-r-i.length():i.length()-r-this.radius;return i.normalize(),this.inside&&i.negate(),l}};import*as F from"three";var he=new F.Vector3,ge=new F.Matrix3,Y=class extends w{get type(){return"plane"}constructor(t){var e,r;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new F.Vector3(0,0,0),this.normal=(r=t==null?void 0:t.normal)!=null?r:new F.Vector3(0,0,1)}calculateCollision(t,e,r,i){i.copy(this.offset).applyMatrix4(t),i.negate().add(e),ge.getNormalMatrix(t),he.copy(this.normal).applyNormalMatrix(ge).normalize();let o=i.dot(he)-r;return i.copy(he),o}};import*as Te from"three";var U=class extends w{get type(){return"sphere"}constructor(t){var e,r,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Te.Vector3(0,0,0),this.radius=(r=t==null?void 0:t.radius)!=null?r:0,this.inside=(i=t==null?void 0:t.inside)!=null?i:!1}calculateCollision(t,e,r,i){i.copy(this.offset).applyMatrix4(t),i.negate().add(e);let o=this.inside?this.radius-r-i.length():i.length()-r-this.radius;return i.normalize(),this.inside&&i.negate(),o}};import*as V from"three";var y=new V.Vector3,oe=class extends V.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentOffset=new V.Vector3;this._currentTail=new V.Vector3;this._shape=e,this._attrPos=new V.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new V.BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0);let i=y.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(i)>1e-10&&(this._currentTail.copy(i),e=!0),e&&this._buildPosition()}_buildPosition(){y.copy(this._currentTail).sub(this._currentOffset);let e=y.length()/this._currentRadius;for(let o=0;o<=16;o++){let n=o/16*Math.PI;this._attrPos.setXYZ(o,-Math.sin(n),-Math.cos(n),0),this._attrPos.setXYZ(17+o,e+Math.sin(n),Math.cos(n),0),this._attrPos.setXYZ(34+o,-Math.sin(n),0,-Math.cos(n)),this._attrPos.setXYZ(51+o,e+Math.sin(n),0,Math.cos(n))}for(let o=0;o<32;o++){let n=o/16*Math.PI;this._attrPos.setXYZ(68+o,0,Math.sin(n),Math.cos(n)),this._attrPos.setXYZ(100+o,e,Math.sin(n),Math.cos(n))}let r=Math.atan2(y.y,Math.sqrt(y.x*y.x+y.z*y.z)),i=-Math.atan2(y.z,y.x);this.rotateZ(r),this.rotateY(i),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<34;e++){let r=(e+1)%34;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(68+e*2,34+e,34+r)}for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(136+e*2,68+e,68+r),this._attrIndex.setXY(200+e*2,100+e,100+r)}this._attrIndex.needsUpdate=!0}};import*as C from"three";var ne=class extends C.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentOffset=new C.Vector3;this._currentNormal=new C.Vector3;this._shape=e,this._attrPos=new C.BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new C.BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}};import*as j from"three";var se=class extends j.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentOffset=new j.Vector3;this._shape=e,this._attrPos=new j.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new j.BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let r=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+e,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+e,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(64+e*2,32+e,32+r),this._attrIndex.setXY(128+e*2,64+e,64+r)}this._attrIndex.needsUpdate=!0}};var we=new P.Vector3,J=class extends P.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof U)this._geometry=new se(this.collider.shape);else if(this.collider.shape instanceof X)this._geometry=new oe(this.collider.shape);else if(this.collider.shape instanceof Y)this._geometry=new ne(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");let e=new P.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new P.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=we.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}};import*as I from"three";import*as W from"three";var ae=class extends W.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentTail=new W.Vector3;this._springBone=e,this._attrPos=new W.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new W.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let r=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+e,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+e,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(64+e*2,32+e,32+r),this._attrIndex.setXY(128+e*2,64+e,64+r)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}};var Ce=new I.Vector3,ee=class extends I.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new ae(this.springBone);let e=new I.LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new I.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=Ce.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}};import*as Me from"three";var N=class extends Me.Object3D{constructor(t){super(),this.shape=t}};import*as c from"three";import*as xe from"three";var Pe=new xe.Matrix4;function le(a){return a.invert?a.invert():a.getInverse(Pe.copy(a)),a}import*as be from"three";var pe=class{constructor(t){this._inverseCache=new be.Matrix4;this._shouldUpdateInverse=!0;this.matrix=t;let e={set:(r,i,o)=>(this._shouldUpdateInverse=!0,r[i]=o,!0)};this._originalElements=t.elements,t.elements=new Proxy(t.elements,e)}get inverse(){return this._shouldUpdateInverse&&(le(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}};var Ie=new c.Matrix4,v=new c.Vector3,te=new c.Vector3,Oe=new c.Vector3,z=new c.Vector3,ye=new c.Vector3,re=new c.Vector3,He=new c.Quaternion,Z=new c.Matrix4,Ae=new c.Matrix4,ce=class{constructor(t,e,r={},i=[]){this._currentTail=new c.Vector3;this._prevTail=new c.Vector3;this._boneAxis=new c.Vector3;this._worldSpaceBoneLength=0;this._center=null;this._initialLocalMatrix=new c.Matrix4;this._initialLocalRotation=new c.Quaternion;this._initialLocalChildPosition=new c.Vector3;var o,n,l,s,d,g;this.bone=t,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(o=r.hitRadius)!=null?o:0,stiffness:(n=r.stiffness)!=null?n:1,gravityPower:(l=r.gravityPower)!=null?l:0,gravityDir:(d=(s=r.gravityDir)==null?void 0:s.clone())!=null?d:new c.Vector3(0,-1,0),dragForce:(g=r.dragForce)!=null?g:.4},this.colliderGroups=i}get center(){return this._center}set center(t){var e;(e=this._center)!=null&&e.userData.inverseCacheProxy&&(this._center.userData.inverseCacheProxy.revert(),delete this._center.userData.inverseCacheProxy),this._center=t,this._center&&(this._center.userData.inverseCacheProxy||(this._center.userData.inverseCacheProxy=new pe(this._center.matrixWorld)))}get initialLocalChildPosition(){return this._initialLocalChildPosition}get _parentMatrixWorld(){return this.bone.parent?this.bone.parent.matrixWorld:Ie}setInitState(){this._initialLocalMatrix.copy(this.bone.matrix),this._initialLocalRotation.copy(this.bone.quaternion),this.child?this._initialLocalChildPosition.copy(this.child.position):this._initialLocalChildPosition.copy(this.bone.position).normalize().multiplyScalar(.07);let t=this._getMatrixWorldToCenter(Z);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail),this._boneAxis.copy(this._initialLocalChildPosition).normalize()}reset(){this.bone.quaternion.copy(this._initialLocalRotation),this.bone.updateMatrix(),this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld,this.bone.matrix);let t=this._getMatrixWorldToCenter(Z);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail)}update(t){if(t<=0)return;this._calcWorldSpaceBoneLength(),z.setFromMatrixPosition(this.bone.matrixWorld);let e=this._getMatrixWorldToCenter(Z);ye.copy(z).applyMatrix4(e);let r=He.setFromRotationMatrix(e),i=Ae.copy(e).multiply(this._parentMatrixWorld),o=te.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(i).sub(ye).normalize(),n=Oe.copy(this.settings.gravityDir).applyQuaternion(r).normalize(),l=this._getMatrixCenterToWorld(Z);re.copy(this._currentTail).add(v.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1-this.settings.dragForce)).add(v.copy(o).multiplyScalar(this.settings.stiffness*t)).add(v.copy(n).multiplyScalar(this.settings.gravityPower*t)).applyMatrix4(l),re.sub(z).normalize().multiplyScalar(this._worldSpaceBoneLength).add(z),this._collision(re),e=this._getMatrixWorldToCenter(Z),this._prevTail.copy(this._currentTail),this._currentTail.copy(v.copy(re).applyMatrix4(e));let s=le(Z.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix)),d=He.setFromUnitVectors(this._boneAxis,v.copy(re).applyMatrix4(s).normalize());this.bone.quaternion.copy(this._initialLocalRotation).multiply(d),this.bone.updateMatrix(),this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld,this.bone.matrix)}_collision(t){this.colliderGroups.forEach(e=>{e.colliders.forEach(r=>{let i=r.shape.calculateCollision(r.matrixWorld,t,this.settings.hitRadius,v);i<0&&(t.add(v.multiplyScalar(-i)),t.sub(z).normalize().multiplyScalar(this._worldSpaceBoneLength).add(z))})})}_calcWorldSpaceBoneLength(){v.setFromMatrixPosition(this.bone.matrixWorld),this.child?te.setFromMatrixPosition(this.child.matrixWorld):(te.copy(this._initialLocalChildPosition),te.applyMatrix4(this.bone.matrixWorld)),this._worldSpaceBoneLength=v.sub(te).length()}_getMatrixCenterToWorld(t){return this._center?t.copy(this._center.matrixWorld):t.identity(),t}_getMatrixWorldToCenter(t){return this._center?t.copy(this._center.userData.inverseCacheProxy.inverse):t.identity(),t}};import*as S from"three";function Ve(a,t){let e=[],r=a;for(;r!==null;)e.unshift(r),r=r.parent;e.forEach(i=>{t(i)})}function ue(a,t){a.children.forEach(e=>{t(e)||ue(e,t)})}var ie=class{constructor(){this._joints=new Set;this._hasWarnedCircularDependency=!1;this._objectSpringBonesMap=new Map}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){let t=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(r=>{t.add(r)})}),Array.from(t)}get colliders(){let t=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(r=>{t.add(r)})}),Array.from(t)}addJoint(t){this._joints.add(t);let e=this._objectSpringBonesMap.get(t.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(t.bone,e)),e.add(t)}addSpringBone(t){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(t)}deleteJoint(t){this._joints.delete(t),this._objectSpringBonesMap.get(t.bone).delete(t)}deleteSpringBone(t){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(t)}setInitState(){let t=new Set,e=new Set,r=new Set;for(let i of this._joints)this._processSpringBone(i,t,e,r,o=>o.setInitState())}reset(){let t=new Set,e=new Set,r=new Set;for(let i of this._joints)this._processSpringBone(i,t,e,r,o=>o.reset())}update(t){let e=new Set,r=new Set,i=new Set;for(let o of this._joints)this._processSpringBone(o,e,r,i,n=>n.update(t)),ue(o.bone,n=>{var l,s;return((s=(l=this._objectSpringBonesMap.get(n))==null?void 0:l.size)!=null?s:0)>0?!0:(n.updateWorldMatrix(!1,!1),!1)})}_processSpringBone(t,e,r,i,o){if(r.has(t))return;if(e.has(t)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected while updating springbones"),this._hasWarnedCircularDependency=!0);return}e.add(t);let n=this._getDependencies(t);for(let l of n)Ve(l,s=>{let d=this._objectSpringBonesMap.get(s);if(d)for(let g of d)this._processSpringBone(g,e,r,i,o);else i.has(s)||(s.updateWorldMatrix(!1,!1),i.add(s))});t.bone.updateMatrix(),t.bone.updateWorldMatrix(!1,!1),o(t),i.add(t.bone),r.add(t)}_getDependencies(t){let e=new Set,r=t.bone.parent;return r&&e.add(r),t.colliderGroups.forEach(i=>{i.colliders.forEach(o=>{e.add(o)})}),e}};var ve="VRMC_springBone_extended_collider",De=new Set(["1.0","1.0-beta"]),Le=new Set(["1.0"]),O=class O{get name(){return O.EXTENSION_NAME}constructor(t,e){var r;this.parser=t,this.jointHelperRoot=e==null?void 0:e.jointHelperRoot,this.colliderHelperRoot=e==null?void 0:e.colliderHelperRoot,this.useExtendedColliders=(r=e==null?void 0:e.useExtendedColliders)!=null?r:!0}afterRoot(t){return Q(this,null,function*(){t.userData.vrmSpringBoneManager=yield this._import(t)})}_import(t){return Q(this,null,function*(){let e=yield this._v1Import(t);if(e!=null)return e;let r=yield this._v0Import(t);return r!=null?r:null})}_v1Import(t){return Q(this,null,function*(){var g,q,$,h,G;let e=t.parser.json;if(!(((g=e.extensionsUsed)==null?void 0:g.indexOf(O.EXTENSION_NAME))!==-1))return null;let i=new ie,o=yield t.parser.getDependencies("node"),n=(q=e.extensions)==null?void 0:q[O.EXTENSION_NAME];if(!n)return null;let l=n.specVersion;if(!De.has(l))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${O.EXTENSION_NAME} specVersion "${l}"`),null;let s=($=n.colliders)==null?void 0:$.map((E,T)=>{var p,M,R,x,A,D,b,H,B,k,fe,Ee,_e,Re,me;let u=o[E.node],f=E.shape,_=(p=E.extensions)==null?void 0:p[ve];if(this.useExtendedColliders&&_!=null){let Se=_.specVersion;if(!Le.has(Se))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${ve} specVersion "${Se}". Fallbacking to the ${O.EXTENSION_NAME} definition`);else{let m=_.shape;if(m.sphere)return this._importSphereCollider(u,{offset:new S.Vector3().fromArray((M=m.sphere.offset)!=null?M:[0,0,0]),radius:(R=m.sphere.radius)!=null?R:0,inside:(x=m.sphere.inside)!=null?x:!1});if(m.capsule)return this._importCapsuleCollider(u,{offset:new S.Vector3().fromArray((A=m.capsule.offset)!=null?A:[0,0,0]),radius:(D=m.capsule.radius)!=null?D:0,tail:new S.Vector3().fromArray((b=m.capsule.tail)!=null?b:[0,0,0]),inside:(H=m.capsule.inside)!=null?H:!1});if(m.plane)return this._importPlaneCollider(u,{offset:new S.Vector3().fromArray((B=m.plane.offset)!=null?B:[0,0,0]),normal:new S.Vector3().fromArray((k=m.plane.normal)!=null?k:[0,0,1])})}}if(f.sphere)return this._importSphereCollider(u,{offset:new S.Vector3().fromArray((fe=f.sphere.offset)!=null?fe:[0,0,0]),radius:(Ee=f.sphere.radius)!=null?Ee:0,inside:!1});if(f.capsule)return this._importCapsuleCollider(u,{offset:new S.Vector3().fromArray((_e=f.capsule.offset)!=null?_e:[0,0,0]),radius:(Re=f.capsule.radius)!=null?Re:0,tail:new S.Vector3().fromArray((me=f.capsule.tail)!=null?me:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${T} has no valid shape`)}),d=(h=n.colliderGroups)==null?void 0:h.map((E,T)=>{var f;return{colliders:((f=E.colliders)!=null?f:[]).map(_=>{let p=s==null?void 0:s[_];if(p==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${T} attempted to use a collider #${_} but not found`);return p}),name:E.name}});return(G=n.springs)==null||G.forEach((E,T)=>{var M;let u=E.joints,f=(M=E.colliderGroups)==null?void 0:M.map(R=>{let x=d==null?void 0:d[R];if(x==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${T} attempted to use a colliderGroup ${R} but not found`);return x}),_=E.center!=null?o[E.center]:void 0,p;u.forEach(R=>{if(p){let x=p.node,A=o[x],D=R.node,b=o[D],H={hitRadius:p.hitRadius,dragForce:p.dragForce,gravityPower:p.gravityPower,stiffness:p.stiffness,gravityDir:p.gravityDir!=null?new S.Vector3().fromArray(p.gravityDir):void 0},B=this._importJoint(A,b,H,f);_&&(B.center=_),i.addJoint(B)}p=R})}),i.setInitState(),i})}_v0Import(t){return Q(this,null,function*(){var g,q,$;let e=t.parser.json;if(!(((g=e.extensionsUsed)==null?void 0:g.indexOf("VRM"))!==-1))return null;let i=(q=e.extensions)==null?void 0:q.VRM,o=i==null?void 0:i.secondaryAnimation;if(!o)return null;let n=o==null?void 0:o.boneGroups;if(!n)return null;let l=new ie,s=yield t.parser.getDependencies("node"),d=($=o.colliderGroups)==null?void 0:$.map(h=>{var T;let G=s[h.node];return{colliders:((T=h.colliders)!=null?T:[]).map((u,f)=>{var p,M,R;let _=new S.Vector3(0,0,0);return u.offset&&_.set((p=u.offset.x)!=null?p:0,(M=u.offset.y)!=null?M:0,u.offset.z?-u.offset.z:0),this._importSphereCollider(G,{offset:_,radius:(R=u.radius)!=null?R:0,inside:!1})})}});return n==null||n.forEach((h,G)=>{let E=h.bones;E&&E.forEach(T=>{var R,x,A,D;let u=s[T],f=new S.Vector3;h.gravityDir?f.set((R=h.gravityDir.x)!=null?R:0,(x=h.gravityDir.y)!=null?x:0,(A=h.gravityDir.z)!=null?A:0):f.set(0,-1,0);let _=h.center!=null?s[h.center]:void 0,p={hitRadius:h.hitRadius,dragForce:h.dragForce,gravityPower:h.gravityPower,stiffness:h.stiffiness,gravityDir:f},M=(D=h.colliderGroups)==null?void 0:D.map(b=>{let H=d==null?void 0:d[b];if(H==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${G} attempted to use a colliderGroup ${b} but not found`);return H});u.traverse(b=>{var k;let H=(k=b.children[0])!=null?k:null,B=this._importJoint(b,H,p,M);_&&(B.center=_),l.addJoint(B)})})}),t.scene.updateMatrixWorld(),l.setInitState(),l})}_importJoint(t,e,r,i){let o=new ce(t,e,r,i);if(this.jointHelperRoot){let n=new ee(o);this.jointHelperRoot.add(n),n.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(t,e){let r=new U(e),i=new N(r);if(t.add(i),this.colliderHelperRoot){let o=new J(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}_importCapsuleCollider(t,e){let r=new X(e),i=new N(r);if(t.add(i),this.colliderHelperRoot){let o=new J(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}_importPlaneCollider(t,e){let r=new Y(e),i=new N(r);if(t.add(i),this.colliderHelperRoot){let o=new J(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}};O.EXTENSION_NAME="VRMC_springBone";var Be=O;export{N as VRMSpringBoneCollider,J as VRMSpringBoneColliderHelper,w as VRMSpringBoneColliderShape,X as VRMSpringBoneColliderShapeCapsule,Y as VRMSpringBoneColliderShapePlane,U as VRMSpringBoneColliderShapeSphere,ce as VRMSpringBoneJoint,ee as VRMSpringBoneJointHelper,Be as VRMSpringBoneLoaderPlugin,ie as VRMSpringBoneManager}; +var $=(s,t,e)=>new Promise((r,i)=>{var o=l=>{try{a(e.next(l))}catch(p){i(p)}},n=l=>{try{a(e.throw(l))}catch(p){i(p)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,n);a((e=e.apply(s,t)).next())});import*as P from"three";import*as k from"three";var w=class{};var de=new k.Vector3,L=new k.Vector3,F=class extends w{get type(){return"capsule"}constructor(t){var e,r,i,o;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new k.Vector3(0,0,0),this.tail=(r=t==null?void 0:t.tail)!=null?r:new k.Vector3(0,0,0),this.radius=(i=t==null?void 0:t.radius)!=null?i:0,this.inside=(o=t==null?void 0:t.inside)!=null?o:!1}calculateCollision(t,e,r,i){de.setFromMatrixPosition(t),L.subVectors(this.tail,this.offset).applyMatrix4(t),L.sub(de);let o=L.lengthSq();i.copy(e).sub(de);let n=L.dot(i);n<=0||(o<=n||L.multiplyScalar(n/o),i.sub(L));let a=i.length(),l=this.inside?this.radius-r-a:a-r-this.radius;return l<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),l}};import*as U from"three";var he=new U.Vector3,Se=new U.Matrix3,Y=class extends w{get type(){return"plane"}constructor(t){var e,r;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new U.Vector3(0,0,0),this.normal=(r=t==null?void 0:t.normal)!=null?r:new U.Vector3(0,0,1)}calculateCollision(t,e,r,i){i.setFromMatrixPosition(t),i.negate().add(e),Se.getNormalMatrix(t),he.copy(this.normal).applyNormalMatrix(Se).normalize();let o=i.dot(he)-r;return i.copy(he),o}};import*as ue from"three";var Be=new ue.Vector3,N=class extends w{get type(){return"sphere"}constructor(t){var e,r,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new ue.Vector3(0,0,0),this.radius=(r=t==null?void 0:t.radius)!=null?r:0,this.inside=(i=t==null?void 0:t.inside)!=null?i:!1}calculateCollision(t,e,r,i){i.subVectors(e,Be.setFromMatrixPosition(t));let o=i.length(),n=this.inside?this.radius-r-o:o-r-this.radius;return n<0&&(i.multiplyScalar(1/o),this.inside&&i.negate()),n}};import*as V from"three";var y=new V.Vector3,ie=class extends V.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentOffset=new V.Vector3;this._currentTail=new V.Vector3;this._shape=e,this._attrPos=new V.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new V.BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0);let i=y.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(i)>1e-10&&(this._currentTail.copy(i),e=!0),e&&this._buildPosition()}_buildPosition(){y.copy(this._currentTail).sub(this._currentOffset);let e=y.length()/this._currentRadius;for(let o=0;o<=16;o++){let n=o/16*Math.PI;this._attrPos.setXYZ(o,-Math.sin(n),-Math.cos(n),0),this._attrPos.setXYZ(17+o,e+Math.sin(n),Math.cos(n),0),this._attrPos.setXYZ(34+o,-Math.sin(n),0,-Math.cos(n)),this._attrPos.setXYZ(51+o,e+Math.sin(n),0,Math.cos(n))}for(let o=0;o<32;o++){let n=o/16*Math.PI;this._attrPos.setXYZ(68+o,0,Math.sin(n),Math.cos(n)),this._attrPos.setXYZ(100+o,e,Math.sin(n),Math.cos(n))}let r=Math.atan2(y.y,Math.sqrt(y.x*y.x+y.z*y.z)),i=-Math.atan2(y.z,y.x);this.rotateZ(r),this.rotateY(i),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<34;e++){let r=(e+1)%34;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(68+e*2,34+e,34+r)}for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(136+e*2,68+e,68+r),this._attrIndex.setXY(200+e*2,100+e,100+r)}this._attrIndex.needsUpdate=!0}};import*as C from"three";var oe=class extends C.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentOffset=new C.Vector3;this._currentNormal=new C.Vector3;this._shape=e,this._attrPos=new C.BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new C.BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}};import*as J from"three";var ne=class extends J.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentOffset=new J.Vector3;this._shape=e,this._attrPos=new J.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new J.BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let r=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+e,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+e,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(64+e*2,32+e,32+r),this._attrIndex.setXY(128+e*2,64+e,64+r)}this._attrIndex.needsUpdate=!0}};var we=new P.Vector3,G=class extends P.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof N)this._geometry=new ne(this.collider.shape);else if(this.collider.shape instanceof F)this._geometry=new ie(this.collider.shape);else if(this.collider.shape instanceof Y)this._geometry=new oe(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");let e=new P.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new P.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=we.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}};import*as I from"three";import*as W from"three";var se=class extends W.BufferGeometry{constructor(e){super();this.worldScale=1;this._currentRadius=0;this._currentTail=new W.Vector3;this._springBone=e,this._attrPos=new W.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new W.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,r=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,e=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let r=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+e,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+e,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let r=(e+1)%32;this._attrIndex.setXY(e*2,e,r),this._attrIndex.setXY(64+e*2,32+e,32+r),this._attrIndex.setXY(128+e*2,64+e,64+r)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}};var Ce=new I.Vector3,Q=class extends I.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new se(this.springBone);let e=new I.LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new I.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=Ce.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}};import*as le from"three";var z=class extends le.Object3D{constructor(e){super();this.colliderMatrix=new le.Matrix4;this.shape=e}updateWorldMatrix(e,r){super.updateWorldMatrix(e,r),Pe(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function Pe(s,t,e){let r=t.elements;s.copy(t),e&&(s.elements[12]=r[0]*e.x+r[4]*e.y+r[8]*e.z+r[12],s.elements[13]=r[1]*e.x+r[5]*e.y+r[9]*e.z+r[13],s.elements[14]=r[2]*e.x+r[6]*e.y+r[10]*e.z+r[14])}import*as f from"three";import*as Me from"three";import*as Te from"three";var Ie=new Te.Matrix4;function xe(s){return s.invert?s.invert():s.getInverse(Ie.copy(s)),s}var ae=class{constructor(t){this._inverseCache=new Me.Matrix4;this._shouldUpdateInverse=!0;this.matrix=t;let e={set:(r,i,o)=>(this._shouldUpdateInverse=!0,r[i]=o,!0)};this._originalElements=t.elements,t.elements=new Proxy(t.elements,e)}get inverse(){return this._shouldUpdateInverse&&(xe(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}};var fe=new f.Matrix4,Z=new f.Vector3,K=new f.Vector3,ee=new f.Vector3,te=new f.Vector3,Oe=new f.Matrix4,ce=class{constructor(t,e,r={},i=[]){this._currentTail=new f.Vector3;this._prevTail=new f.Vector3;this._boneAxis=new f.Vector3;this._worldSpaceBoneLength=0;this._center=null;this._initialLocalMatrix=new f.Matrix4;this._initialLocalRotation=new f.Quaternion;this._initialLocalChildPosition=new f.Vector3;var o,n,a,l,p,b;this.bone=t,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(o=r.hitRadius)!=null?o:0,stiffness:(n=r.stiffness)!=null?n:1,gravityPower:(a=r.gravityPower)!=null?a:0,gravityDir:(p=(l=r.gravityDir)==null?void 0:l.clone())!=null?p:new f.Vector3(0,-1,0),dragForce:(b=r.dragForce)!=null?b:.4},this.colliderGroups=i}get dependencies(){let t=new Set,e=this.bone.parent;e&&t.add(e);for(let r=0;r{t(i)})}function pe(s,t){s.children.forEach(e=>{t(e)||pe(e,t)})}function He(s){var e;let t=new Map;for(let r of s){let i=r;do{let o=((e=t.get(i))!=null?e:0)+1;if(o===s.size)return i;t.set(i,o),i=i.parent}while(i!==null)}return null}var re=class{constructor(){this._joints=new Set;this._sortedJoints=[];this._hasWarnedCircularDependency=!1;this._ancestors=[];this._objectSpringBonesMap=new Map;this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){let t=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(r=>{t.add(r)})}),Array.from(t)}get colliders(){let t=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(r=>{t.add(r)})}),Array.from(t)}addJoint(t){this._joints.add(t);let e=this._objectSpringBonesMap.get(t.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(t.bone,e)),e.add(t),this._sortJoints()}addSpringBone(t){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(t)}deleteJoint(t){this._joints.delete(t),this._objectSpringBonesMap.get(t.bone).delete(t),this._sortJoints()}deleteSpringBone(t){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(t)}setInitState(){for(let t=0;t{var a,l;return((l=(a=this._objectSpringBonesMap.get(n))==null?void 0:a.size)!=null?l:0)>0?!0:(this._ancestors.push(n),!1)}))}_insertJointSort(t,e,r,i,o){if(r.has(t))return;if(e.has(t)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}let n=t.dependencies;for(let a of n){let l=!1,p=null;ye(a,b=>{let v=this._objectSpringBonesMap.get(b);if(v)for(let A of v)l=!0,this._insertJointSort(A,e,r,i,o);else l||(p=b)}),p&&o.add(p)}i.push(t),r.add(t)}_relevantChildrenUpdated(t){var e,r;return((r=(e=this._objectSpringBonesMap.get(t))==null?void 0:e.size)!=null?r:0)>0?!0:(t.updateWorldMatrix(!1,!1),!1)}};var Ve="VRMC_springBone_extended_collider",Ae=new Set(["1.0","1.0-beta"]),je=new Set(["1.0"]),O=class O{get name(){return O.EXTENSION_NAME}constructor(t,e){var r;this.parser=t,this.jointHelperRoot=e==null?void 0:e.jointHelperRoot,this.colliderHelperRoot=e==null?void 0:e.colliderHelperRoot,this.useExtendedColliders=(r=e==null?void 0:e.useExtendedColliders)!=null?r:!0}afterRoot(t){return $(this,null,function*(){t.userData.vrmSpringBoneManager=yield this._import(t)})}_import(t){return $(this,null,function*(){let e=yield this._v1Import(t);if(e!=null)return e;let r=yield this._v0Import(t);return r!=null?r:null})}_v1Import(t){return $(this,null,function*(){var b,v,A,d,X;let e=t.parser.json;if(!(((b=e.extensionsUsed)==null?void 0:b.indexOf(O.EXTENSION_NAME))!==-1))return null;let i=new re,o=yield t.parser.getDependencies("node"),n=(v=e.extensions)==null?void 0:v[O.EXTENSION_NAME];if(!n)return null;let a=n.specVersion;if(!Ae.has(a))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${O.EXTENSION_NAME} specVersion "${a}"`),null;let l=(A=n.colliders)==null?void 0:A.map((E,S)=>{var c,T,R,x,j,D,M,H,B,q,Ee,_e,Re,me,ge;let h=o[E.node],u=E.shape,_=(c=E.extensions)==null?void 0:c[Ve];if(this.useExtendedColliders&&_!=null){let be=_.specVersion;if(!je.has(be))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Ve} specVersion "${be}". Fallbacking to the ${O.EXTENSION_NAME} definition`);else{let m=_.shape;if(m.sphere)return this._importSphereCollider(h,{offset:new g.Vector3().fromArray((T=m.sphere.offset)!=null?T:[0,0,0]),radius:(R=m.sphere.radius)!=null?R:0,inside:(x=m.sphere.inside)!=null?x:!1});if(m.capsule)return this._importCapsuleCollider(h,{offset:new g.Vector3().fromArray((j=m.capsule.offset)!=null?j:[0,0,0]),radius:(D=m.capsule.radius)!=null?D:0,tail:new g.Vector3().fromArray((M=m.capsule.tail)!=null?M:[0,0,0]),inside:(H=m.capsule.inside)!=null?H:!1});if(m.plane)return this._importPlaneCollider(h,{offset:new g.Vector3().fromArray((B=m.plane.offset)!=null?B:[0,0,0]),normal:new g.Vector3().fromArray((q=m.plane.normal)!=null?q:[0,0,1])})}}if(u.sphere)return this._importSphereCollider(h,{offset:new g.Vector3().fromArray((Ee=u.sphere.offset)!=null?Ee:[0,0,0]),radius:(_e=u.sphere.radius)!=null?_e:0,inside:!1});if(u.capsule)return this._importCapsuleCollider(h,{offset:new g.Vector3().fromArray((Re=u.capsule.offset)!=null?Re:[0,0,0]),radius:(me=u.capsule.radius)!=null?me:0,tail:new g.Vector3().fromArray((ge=u.capsule.tail)!=null?ge:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${S} has no valid shape`)}),p=(d=n.colliderGroups)==null?void 0:d.map((E,S)=>{var u;return{colliders:((u=E.colliders)!=null?u:[]).map(_=>{let c=l==null?void 0:l[_];if(c==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${S} attempted to use a collider #${_} but not found`);return c}),name:E.name}});return(X=n.springs)==null||X.forEach((E,S)=>{var T;let h=E.joints,u=(T=E.colliderGroups)==null?void 0:T.map(R=>{let x=p==null?void 0:p[R];if(x==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${S} attempted to use a colliderGroup ${R} but not found`);return x}),_=E.center!=null?o[E.center]:void 0,c;h.forEach(R=>{if(c){let x=c.node,j=o[x],D=R.node,M=o[D],H={hitRadius:c.hitRadius,dragForce:c.dragForce,gravityPower:c.gravityPower,stiffness:c.stiffness,gravityDir:c.gravityDir!=null?new g.Vector3().fromArray(c.gravityDir):void 0},B=this._importJoint(j,M,H,u);_&&(B.center=_),i.addJoint(B)}c=R})}),i.setInitState(),i})}_v0Import(t){return $(this,null,function*(){var b,v,A;let e=t.parser.json;if(!(((b=e.extensionsUsed)==null?void 0:b.indexOf("VRM"))!==-1))return null;let i=(v=e.extensions)==null?void 0:v.VRM,o=i==null?void 0:i.secondaryAnimation;if(!o)return null;let n=o==null?void 0:o.boneGroups;if(!n)return null;let a=new re,l=yield t.parser.getDependencies("node"),p=(A=o.colliderGroups)==null?void 0:A.map(d=>{var S;let X=l[d.node];return{colliders:((S=d.colliders)!=null?S:[]).map((h,u)=>{var c,T,R;let _=new g.Vector3(0,0,0);return h.offset&&_.set((c=h.offset.x)!=null?c:0,(T=h.offset.y)!=null?T:0,h.offset.z?-h.offset.z:0),this._importSphereCollider(X,{offset:_,radius:(R=h.radius)!=null?R:0,inside:!1})})}});return n==null||n.forEach((d,X)=>{let E=d.bones;E&&E.forEach(S=>{var R,x,j,D;let h=l[S],u=new g.Vector3;d.gravityDir?u.set((R=d.gravityDir.x)!=null?R:0,(x=d.gravityDir.y)!=null?x:0,(j=d.gravityDir.z)!=null?j:0):u.set(0,-1,0);let _=d.center!=null?l[d.center]:void 0,c={hitRadius:d.hitRadius,dragForce:d.dragForce,gravityPower:d.gravityPower,stiffness:d.stiffiness,gravityDir:u},T=(D=d.colliderGroups)==null?void 0:D.map(M=>{let H=p==null?void 0:p[M];if(H==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${X} attempted to use a colliderGroup ${M} but not found`);return H});h.traverse(M=>{var q;let H=(q=M.children[0])!=null?q:null,B=this._importJoint(M,H,c,T);_&&(B.center=_),a.addJoint(B)})})}),t.scene.updateMatrixWorld(),a.setInitState(),a})}_importJoint(t,e,r,i){let o=new ce(t,e,r,i);if(this.jointHelperRoot){let n=new Q(o);this.jointHelperRoot.add(n),n.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(t,e){let r=new N(e),i=new z(r);if(t.add(i),this.colliderHelperRoot){let o=new G(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}_importCapsuleCollider(t,e){let r=new F(e),i=new z(r);if(t.add(i),this.colliderHelperRoot){let o=new G(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}_importPlaneCollider(t,e){let r=new Y(e),i=new z(r);if(t.add(i),this.colliderHelperRoot){let o=new G(i);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return i}};O.EXTENSION_NAME="VRMC_springBone";var ve=O;export{z as VRMSpringBoneCollider,G as VRMSpringBoneColliderHelper,w as VRMSpringBoneColliderShape,F as VRMSpringBoneColliderShapeCapsule,Y as VRMSpringBoneColliderShapePlane,N as VRMSpringBoneColliderShapeSphere,ce as VRMSpringBoneJoint,Q as VRMSpringBoneJointHelper,ve as VRMSpringBoneLoaderPlugin,re as VRMSpringBoneManager}; diff --git a/packages/three-vrm-springbone/types/VRMSpringBoneCollider.d.ts b/packages/three-vrm-springbone/types/VRMSpringBoneCollider.d.ts index 2813f17b0..663c6dc75 100644 --- a/packages/three-vrm-springbone/types/VRMSpringBoneCollider.d.ts +++ b/packages/three-vrm-springbone/types/VRMSpringBoneCollider.d.ts @@ -8,5 +8,10 @@ export declare class VRMSpringBoneCollider extends THREE.Object3D { * The shape of the collider. */ readonly shape: VRMSpringBoneColliderShape; + /** + * World space matrix for the collider shape used in collision calculations. + */ + readonly colliderMatrix: THREE.Matrix4; constructor(shape: VRMSpringBoneColliderShape); + updateWorldMatrix(updateParents: boolean, updateChildren: boolean): void; } diff --git a/packages/three-vrm-springbone/types/VRMSpringBoneColliderShape.d.ts b/packages/three-vrm-springbone/types/VRMSpringBoneColliderShape.d.ts index e2e568d09..bb256033a 100644 --- a/packages/three-vrm-springbone/types/VRMSpringBoneColliderShape.d.ts +++ b/packages/three-vrm-springbone/types/VRMSpringBoneColliderShape.d.ts @@ -7,6 +7,10 @@ export declare abstract class VRMSpringBoneColliderShape { * The type of the shape. */ abstract get type(): string; + /** + * The offset to the shape. + */ + offset?: THREE.Vector3; /** * Calculate a distance and a direction from the collider to a target object. * It's hit if the distance is negative. diff --git a/packages/three-vrm-springbone/types/VRMSpringBoneJoint.d.ts b/packages/three-vrm-springbone/types/VRMSpringBoneJoint.d.ts index edd25e386..9f76a17ae 100644 --- a/packages/three-vrm-springbone/types/VRMSpringBoneJoint.d.ts +++ b/packages/three-vrm-springbone/types/VRMSpringBoneJoint.d.ts @@ -42,6 +42,10 @@ export declare class VRMSpringBoneJoint { * It's same as local unit length unless there are scale transformations in the world space. */ private _worldSpaceBoneLength; + /** + * Set of dependencies that need to be updated before this joint. + */ + get dependencies(): Set; /** * This springbone will be calculated based on the space relative from this object. * If this is `null`, springbone will be calculated in world space. @@ -106,12 +110,10 @@ export declare class VRMSpringBoneJoint { private _calcWorldSpaceBoneLength; /** * Create a matrix that converts center space into world space. - * @param target Target matrix */ private _getMatrixCenterToWorld; /** * Create a matrix that converts world space into center space. - * @param target Target matrix */ private _getMatrixWorldToCenter; } diff --git a/packages/three-vrm-springbone/types/VRMSpringBoneManager.d.ts b/packages/three-vrm-springbone/types/VRMSpringBoneManager.d.ts index 420d6ed60..9325d0ca5 100644 --- a/packages/three-vrm-springbone/types/VRMSpringBoneManager.d.ts +++ b/packages/three-vrm-springbone/types/VRMSpringBoneManager.d.ts @@ -1,9 +1,18 @@ -import type { VRMSpringBoneJoint } from './VRMSpringBoneJoint'; -import type { VRMSpringBoneCollider } from './VRMSpringBoneCollider'; -import type { VRMSpringBoneColliderGroup } from './VRMSpringBoneColliderGroup'; +import type { VRMSpringBoneJoint } from './VRMSpringBoneJoint.js'; +import type { VRMSpringBoneCollider } from './VRMSpringBoneCollider.js'; +import type { VRMSpringBoneColliderGroup } from './VRMSpringBoneColliderGroup.js'; export declare class VRMSpringBoneManager { private _joints; + private _sortedJoints; private _hasWarnedCircularDependency; + /** + * An ordered list of ancestors of all the SpringBone joints. Before the + * SpringBone joints can be updated, the world matrices of these ancestors + * must be calculated. The first element is the lowest common ancestor, for + * which not only its world matrix but its ancestors' world matrices are + * updated as well. + */ + private _ancestors; get joints(): Set; /** * @deprecated Use {@link joints} instead. @@ -12,6 +21,7 @@ export declare class VRMSpringBoneManager { get colliderGroups(): VRMSpringBoneColliderGroup[]; get colliders(): VRMSpringBoneCollider[]; private _objectSpringBonesMap; + constructor(); addJoint(joint: VRMSpringBoneJoint): void; /** * @deprecated Use {@link addJoint} instead. @@ -26,23 +36,9 @@ export declare class VRMSpringBoneManager { reset(): void; update(delta: number): void; /** - * Update a spring bone. - * If there are other spring bone that are dependant, it will try to update them recursively. - * It updates matrixWorld of all ancestors and myself. - * It might log an warning message if there are any circular dependencies. - * - * Intended to be used in {@link update} and {@link _processSpringBone} itself recursively. - * - * @param springBone A springBone you want to update - * @param springBonesTried Set of springBones that are already tried to be updated - * @param springBonesDone Set of springBones that are already up to date - * @param objectUpdated Set of object3D whose matrixWorld is updated - */ - private _processSpringBone; - /** - * Return a set of objects that are dependant of given spring bone. - * @param springBone A spring bone - * @return A set of objects that are dependant of given spring bone + * Sorts the joints ensuring they are updated in the correct order taking dependencies into account. */ - private _getDependencies; + private _sortJoints; + private _insertJointSort; + private _relevantChildrenUpdated; } diff --git a/packages/three-vrm-springbone/types/utils/lowestCommonAncestor.d.ts b/packages/three-vrm-springbone/types/utils/lowestCommonAncestor.d.ts new file mode 100644 index 000000000..96b07751f --- /dev/null +++ b/packages/three-vrm-springbone/types/utils/lowestCommonAncestor.d.ts @@ -0,0 +1,6 @@ +import type * as THREE from 'three'; +/** + * Finds the lowest common ancestors of the given objects, if it exists. + * @param objects The objects to find the lowest common ancestor for. + */ +export declare function lowestCommonAncestor(objects: Set): THREE.Object3D | null; diff --git a/packages/three-vrm/docs/assets/search.js b/packages/three-vrm/docs/assets/search.js index 0fcb0c6cb..06103af3d 100644 --- a/packages/three-vrm/docs/assets/search.js +++ b/packages/three-vrm/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA8W9WZPkNpK2+19Kt9X1JfYI3am71ac1ppJ0Sst8fWRtsqgMViZHsQ2DkVU1bf3fjxEIRgLOF6RzSc3NtKaScLwBOjZ/HOC/XlXHj+dXX/76r1e/l4ftqy+FXL1+ddjsi1dfvvrl3dtXr19dqt2rL1/d7zbnc3H+P7+8e/vmsd7vXr1u/+nVl69e/ft1W94IeSt/fzyc6+pyXx+rrJ0v0ocim69fnTZVcaivQp6rEHdS3+rYb+qiKje7c76G+JHR9s+nqjw8/Pl4KN5uDpuHoueXoEdH13c4bou/+CbZlId6sM7c45x65Z1+fteX03ZTF/mKbn8f34L3xaHHcPvnZ7v1efun8vyn8vBYVGVdbLmeUNSbHicIf51dy+Nlvzkcy22+puiJ2bUVn05VcT6Xx8OgJ6BHZ9f/oazO9Q9FdT4e8jWnD82uc3c8/v5Vna/u9vdJNaXD27fHzbaofthdHkr4A+O/LzXsdWxyh8BEbKbxTpvqjL2kW+3t2Vk1PvvdiGb8ApSapSLywTEyULFZOtrOP0ZEp8wsBaF7jKmflJhVezPMjqk7eX5ezfWxGfrCVD9KAiw4T0u74vj7X999vS/P5/KpeHvZ1eVpV44abr5gWlpG7S93fznuT5tRzpMvPEvT81pqjBhQapaKdHU1Rkmm5Fg10kqhIz3N//DqD0+Ori9eEr4vPhyr4t3xCCfjbp3J87Nq3h0327fF+ZE7ft2enlXrQ1G3w8BPn0/Mhu4WmqWh+FQXh+1tNNpUmz3c2aAZFZacpWbzoS4qvgPEj4+u19jcwuz7U10eD8/NUB7qovqwue/KuD7Zu1LjLV54dUxexrQ/afRqhqlr8rpmQFhmecNUNW2hMyAJrneYgqasfAbkgAUQU8z4pdCQlJ4VEVfT9LXRk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ztct9hjQPMzOiatxhWorkPasd5TtyQVLV/xsz42/HxN2P5y/+uVf8h+TRqEmdG8n2qaxp12Wj2c/xpv2u7m7ohktgMezTImL7fnM6XHakhFs9Mk8nXcNptSOpEnAXsmIfU8vbPp8eCxsNiB+dP6M8VdL83HO/9Hb+fE5PIU+Ljtcx8zq5hmHkYZ7+tmBkIiel8eDAWzQ/n9Oa/6Hil7PgD3aUu02szk8/Y8rp1956I+Kou0Z64l7eLM1Y31nlLkW3/g4lyPbvMJfnGIWvLvMvpc/pVDhknPWnOTRL/fP3qVJ4K/62QL3/957///f8DZphUbDEZAwA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA8W9XZPjNpL3+13atz39CO+S7zwznmNvuG2f9ss+cxwTDnWJXcW1StJSVHX3bux3P0FAVAHJP8jkS3lvdnpdRCIFJoBE/jLB/35VHT+eX33523+/+qM87F59KeT69avD9rF49eWrX9+9ffX61aXav/ry1d1+ez4X5//z67u3bx7qx/2r1+1/evXlq1f/87ptb4S8tb87Hs51dbmrj1VWzhfpQ5HM169O26o41FdFnrsQK6lvfTxu66Iqt/tzvof4kdHyz6eqPNz/9Xgo3m4P2/ui55egR0f3dzjuir/5IdmWh3qwz9zjnH7lSj+/68tpt62LfEe3v48fwbvi0CO4/fOz3Pq8+0t5/kt5eCiqsi52XEso6m2PEYS/zu7l4fK4PRzLXb6n6InZvRWfTlVxPpfHw6AloEdn9/+hrM71j0V1Ph7yPacPze5zfzz+8VWd7+7290k9pcvbd8ftrqh+3F/uS/gD478vtex1ZHKXwETZzOCdttUZW0m329uzs3p8trsRw/gFaDVLi8gGx6iBms3So538Y5TotJmlQZgeY/onLWb13iyzY/pOnp/Xc31slr6w1Y9SATacp0vrcXzz93dfP5bnc/lUvL3s6/K0L0ctN18wJS2j7a+rvx0fT9tRxpNvPEunZ19qjDKg1SwtUu9qjCaZlmO1kVYKHenT/A+v//Dk6P5il/B98eFYFe+OR7gZd/tMnp/V8/643b0tzg/c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lmECjmpUmx5BBNoTcHxbeJK+aFSbHUNHk7BniKeUdSK43c1SzjILZqD8eKSd4ioeFK1/QkHsezmbG8SGJuhsn4flfFTEPIyAXehIyj24rrwFeP2QUh3qQmSUO3aSQXePKF0uowGfsnur1mSfOn6LVEzH++mZRcxKcAZl7GTWBj81Bo7C3z5xG95w2JjmvTNTPSeRMNrD++SUIzS1Jv8rK2H9/aq5lA9ia1LTVJJcZxY+b9WjeJzf7ROaTFNzPoW5CQGXx/qh7pGUnFJWSGmW1ylVM+no5VXVRoDsUxO8MsD7iKzV+jE0eGmXGfp+oxvZEjRaPxQYx/5E0ldu1Tx0nLjr+GpHKz4xCjIcuMN3akI0Qa5305Zj3rU/WYudUnnk1s17uTKBR/yEsx7124yoHxSRkDJsU/K1fFf17KKrp+pDM1Y/9RuVtuOb+H436f+9prnE/ADK95icETzUmN49bcmFT1+Eyu23B4Gq2PCxr57n9X6n11TLO0dMxpHbNMD4pGUza+GI55+xeUDbJBYtH8fSUj+m57Ol/2pIf4++vMeyLzPZz2W5KNIZPwEtuiM/LPp4eCBsRiU+T7hc8ddL9qHGcYOn6sjohElhIPNjPboysYJjPGS8iayQMS0fn4YDwrmWkJiWR0R1Z8o8+aefvpU/V4qcv0Ss7kliHe6ta9eiK+TUe0mePydhdHGyu37TeIXBvfd0w67PFkNm849iSY90R9Tj/5IWOWrznHmX+9fnUqT4X/EMmXv/3rf/7n/wezHN2qViEDAA=="; \ No newline at end of file diff --git a/packages/three-vrm/docs/classes/VRM.html b/packages/three-vrm/docs/classes/VRM.html index 2f46fe6bd..d5915fcce 100644 --- a/packages/three-vrm/docs/classes/VRM.html +++ b/packages/three-vrm/docs/classes/VRM.html @@ -1,5 +1,5 @@ VRM | @pixiv/three-vrm

    A class that represents a single VRM model.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Methods

    Constructors

    Properties

    expressionManager?: VRMExpressionManager

    Contains VRMExpressionManager of the VRM. +

    Returns VRM

    Properties

    expressionManager?: VRMExpressionManager

    Contains VRMExpressionManager of the VRM. You might want to control these facial expressions via VRMExpressionManager.setValue.

    firstPerson?: VRMFirstPerson

    Contains VRMFirstPerson of the VRM. VRMFirstPerson is mostly used for mesh culling for first person view.

    @@ -23,14 +23,14 @@ You might want to use VRMLookAt.target to control the eye direction of your VRMs.

    materials?: Material[]

    Contains materials of the VRM. update method of these materials will be called via its VRM.update method.

    -
    meta: VRMMeta

    Contains meta fields of the VRM. +

    meta: VRMMeta

    Contains meta fields of the VRM. You might want to refer these license fields before use your VRMs.

    nodeConstraintManager?: VRMNodeConstraintManager

    A VRMNodeConstraintManager manipulates all constraints attached on the VRM. Usually you don't have to care about this property.

    -
    scene: Group<Object3DEventMap>

    THREE.Group that contains the entire VRM.

    +
    scene: Group<Object3DEventMap>

    THREE.Group that contains the entire VRM.

    springBoneManager?: VRMSpringBoneManager

    A VRMSpringBoneManager manipulates all spring bones attached on the VRM. Usually you don't have to care about this property.

    -

    Methods

    Methods

    +

    Returns void

    diff --git a/packages/three-vrm/docs/classes/VRMExpression.html b/packages/three-vrm/docs/classes/VRMExpression.html index 3b03ebb67..e4ae0a0f3 100644 --- a/packages/three-vrm/docs/classes/VRMExpression.html +++ b/packages/three-vrm/docs/classes/VRMExpression.html @@ -37,7 +37,8 @@ DEFAULT_MATRIX_AUTO_UPDATE DEFAULT_MATRIX_WORLD_AUTO_UPDATE DEFAULT_UP -

    Accessors

    Accessors

    Constructors

    • Parameters

      • expressionName: string

      Returns VRMExpression

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    +

    Constructors

    • Parameters

      • expressionName: string

      Returns VRMExpression

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    []

    castShadow: boolean

    Whether the object gets rendered into shadow map.

    false

    @@ -166,7 +168,7 @@

    This can be used to find a specific type of Object3D in a scene. Sub-classes will update this value.

    Object3D

    -
    up: Vector3

    This is used by the lookAt method, for example, to determine the orientation of the result.

    +
    up: Vector3

    This is used by the lookAt method, for example, to determine the orientation of the result.

    Object3D.DEFAULT_UP - that is (0, 1, 0).

    userData: Record<string, any>

    An object that can be used to store custom data about the Object3D.

    It should not hold references to functions as these will not be cloned.

    @@ -185,21 +187,24 @@
    DEFAULT_UP: Vector3

    The default up direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down).

    new THREE.Vector3( 0, 1, 0)

    -

    Accessors

    • get outputWeight(): number
    • An output weight of this expression, considering the isBinary.

      -

      Returns number

    • get overrideBlinkAmount(): number
    • A value represents how much it should override blink expressions. +

    Accessors

    • get binds(): readonly VRMExpressionBind[]
    • Binds that this expression influences.

      +

      Returns readonly VRMExpressionBind[]

    • get outputWeight(): number
    • An output weight of this expression, considering the isBinary.

      +

      Returns number

    • get overrideBlinkAmount(): number
    • A value represents how much it should override blink expressions. 0.0 == no override at all, 1.0 == completely block the expressions.

      -

      Returns number

    • get overrideLookAtAmount(): number
    • A value represents how much it should override lookAt expressions. +

      Returns number

    • get overrideLookAtAmount(): number
    • A value represents how much it should override lookAt expressions. 0.0 == no override at all, 1.0 == completely block the expressions.

      -

      Returns number

    • get overrideMouthAmount(): number
    • A value represents how much it should override mouth expressions. +

      Returns number

    • get overrideMouthAmount(): number
    • A value represents how much it should override mouth expressions. 0.0 == no override at all, 1.0 == completely block the expressions.

      -

      Returns number

    Methods

    • Adds another Object3D as child of this Object3D.

      +

      Returns number

    Methods

    • Adds another Object3D as child of this Object3D.

      Parameters

      • Rest...object: Object3D<Object3DEventMap>[]

      Returns this

      An arbitrary number of objects may be added Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent.

      • attach
      • THREE.Group | Group for info on manually grouping objects.
      -
    • Parameters

      Returns void

    • Adds a listener to an event type.

      +
    • Add an expression bind to the expression.

      +

      Parameters

      Returns void

    • Adds a listener to an event type.

      Type Parameters

      • T extends keyof Object3DEventMap

      Parameters

      • type: T

        The type of event to listen to.

      • listener: EventListener<Object3DEventMap[T], T, VRMExpression>

        The function that gets called when the event is fired.

      Returns void

    • Applies the matrix transform to the object and updates the object's position, rotation and scale.

      @@ -209,18 +214,20 @@

      Parameters

      • Optionaloptions: {
            multiplier?: number;
        }
        • Optionalmultiplier?: number

          Multiplies a value to its weight to apply. Intended to be used for overriding an expression weight by another expression. See also: overrideBlink, overrideLookAt, overrideMouth

          -

      Returns void

    • Adds a Object3D as a child of this, while maintaining the object's world transform.

      +

    Returns void

    • Adds a Object3D as a child of this, while maintaining the object's world transform.

      Parameters

      • object: Object3D<Object3DEventMap>

      Returns this

      Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).

      add

    • Removes all child objects.

      Returns this

    • Clear previously assigned blend shapes.

      -

      Returns void

    • Returns a clone of this object and optionally all descendants.

      +

      Returns void

    • Returns a clone of this object and optionally all descendants.

      Parameters

      • Optionalrecursive: boolean

        If true, descendants of the object are also cloned. Default true

      Returns this

    • Copies the given object into this object.

      Parameters

      • object: Object3D<Object3DEventMap>
      • Optionalrecursive: boolean

        If set to true, descendants of the object are copied next to the existing ones. If set to false, descendants are left unchanged. Default is true.

      Returns this

      Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

      -
    • Fire an event type.

      +
    • Delete an expression bind from the expression.

      +

      Parameters

      Returns void

    • Fire an event type.

      Type Parameters

      • T extends keyof Object3DEventMap

      Parameters

      • event: BaseEvent<T> & Object3DEventMap[T]

        The event that gets fired.

      Returns void

    • Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

      Parameters

      • id: number

        Unique number of the object instance. Expects a Integer

        @@ -352,4 +359,4 @@
      • updateChildren: boolean

        Recursively updates global transform of descendants.

      Returns void

    • Converts the vector from world space to this object's local space.

      Parameters

      • vector: Vector3

        A vector representing a position in world space.

        -

      Returns Vector3

    +

    Returns Vector3

    diff --git a/packages/three-vrm/docs/classes/VRMLoaderPlugin.html b/packages/three-vrm/docs/classes/VRMLoaderPlugin.html index 036d0bff0..220c4752a 100644 --- a/packages/three-vrm/docs/classes/VRMLoaderPlugin.html +++ b/packages/three-vrm/docs/classes/VRMLoaderPlugin.html @@ -1,4 +1,4 @@ -VRMLoaderPlugin | @pixiv/three-vrm

    Class VRMLoaderPlugin

    Implements

    • GLTFLoaderPlugin

    Constructors

    constructor +VRMLoaderPlugin | @pixiv/three-vrm

    Class VRMLoaderPlugin

    Implements

    • GLTFLoaderPlugin

    Constructors

    Properties

    expressionPlugin: VRMExpressionLoaderPlugin
    firstPersonPlugin: VRMFirstPersonLoaderPlugin
    humanoidPlugin: VRMHumanoidLoaderPlugin
    lookAtPlugin: VRMLookAtLoaderPlugin
    materialsHDREmissiveMultiplierPlugin: VRMMaterialsHDREmissiveMultiplierLoaderPlugin
    materialsV0CompatPlugin: VRMMaterialsV0CompatPlugin
    mtoonMaterialPlugin: MToonMaterialLoaderPlugin
    nodeConstraintPlugin: VRMNodeConstraintLoaderPlugin
    parser: GLTFParser
    springBonePlugin: VRMSpringBoneLoaderPlugin

    Accessors

    Methods

    • Parameters

      • materialIndex: number
      • materialParams: {
            [key: string]: any;
        }
        • [key: string]: any

      Returns Promise<any>

    • Parameters

      • materialIndex: number

      Returns null | typeof Material

    • Parameters

      • meshIndex: number

      Returns Promise<Group<Object3DEventMap> | Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | SkinnedMesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>>

    +

    Constructors

    Properties

    expressionPlugin: VRMExpressionLoaderPlugin
    firstPersonPlugin: VRMFirstPersonLoaderPlugin
    humanoidPlugin: VRMHumanoidLoaderPlugin
    lookAtPlugin: VRMLookAtLoaderPlugin
    materialsHDREmissiveMultiplierPlugin: VRMMaterialsHDREmissiveMultiplierLoaderPlugin
    materialsV0CompatPlugin: VRMMaterialsV0CompatPlugin
    mtoonMaterialPlugin: MToonMaterialLoaderPlugin
    nodeConstraintPlugin: VRMNodeConstraintLoaderPlugin
    parser: GLTFParser
    springBonePlugin: VRMSpringBoneLoaderPlugin

    Accessors

    Methods

    • Parameters

      • materialIndex: number
      • materialParams: {
            [key: string]: any;
        }
        • [key: string]: any

      Returns Promise<any>

    • Parameters

      • materialIndex: number

      Returns null | typeof Material

    • Parameters

      • meshIndex: number

      Returns Promise<Group<Object3DEventMap> | Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | SkinnedMesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>>

    diff --git a/packages/three-vrm/docs/classes/VRMSpringBoneCollider.html b/packages/three-vrm/docs/classes/VRMSpringBoneCollider.html index e6a09fc09..986a0f612 100644 --- a/packages/three-vrm/docs/classes/VRMSpringBoneCollider.html +++ b/packages/three-vrm/docs/classes/VRMSpringBoneCollider.html @@ -3,6 +3,7 @@

    Properties

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    +

    Constructors

    Properties

    animations: AnimationClip[]

    Array with object's animation clips.

    []

    castShadow: boolean

    Whether the object gets rendered into shadow map.

    false

    children: Object3D<Object3DEventMap>[]

    Array with object's children.

    THREE.Object3DGroup | Group for info on manually grouping objects.

    []

    -
    customDepthMaterial?: Material

    Custom depth material to be used when rendering to the depth map.

    +
    colliderMatrix: Matrix4

    World space matrix for the collider shape used in collision calculations.

    +
    customDepthMaterial?: Material

    Custom depth material to be used when rendering to the depth map.

    Can only be used in context of meshes. When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.

    @@ -315,9 +317,9 @@ And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.

    Parameters

    • Optionalforce: boolean

      A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame. Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.

      -

    Returns void

    • Updates the global transform of the object.

      +

    Returns void

    • Updates the global transform of the object.

      Parameters

      • updateParents: boolean

        Recursively updates global transform of ancestors.

      • updateChildren: boolean

        Recursively updates global transform of descendants.

        -

      Returns void

    • Converts the vector from world space to this object's local space.

      +

    Returns void

    • Converts the vector from world space to this object's local space.

      Parameters

      • vector: Vector3

        A vector representing a position in world space.

        -

      Returns Vector3

    +

    Returns Vector3

    diff --git a/packages/three-vrm/docs/classes/VRMSpringBoneColliderShape.html b/packages/three-vrm/docs/classes/VRMSpringBoneColliderShape.html index 7020640f7..0324b1aa7 100644 --- a/packages/three-vrm/docs/classes/VRMSpringBoneColliderShape.html +++ b/packages/three-vrm/docs/classes/VRMSpringBoneColliderShape.html @@ -1,8 +1,10 @@ VRMSpringBoneColliderShape | @pixiv/three-vrm

    Class VRMSpringBoneColliderShapeAbstract

    Represents a shape of a collider.

    Hierarchy (view full)

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Accessors

    • get type(): string
    • The type of the shape.

      +

    Constructors

    Properties

    offset?: Vector3

    The offset to the shape.

    +

    Accessors

    • get type(): string
    • The type of the shape.

      Returns string

    Methods

    • Calculate a distance and a direction from the collider to a target object. It's hit if the distance is negative. The direction will be contained in the given target vector.

      @@ -10,4 +12,4 @@
    • objectPosition: Vector3

      A vector represents the position of the target object

    • objectRadius: number

      The radius of the object

    • target: Vector3

      The result direction will be contained in this vector

      -

    Returns number

    +

    Returns number

    diff --git a/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapeCapsule.html b/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapeCapsule.html index 07fff3b6a..c098dad50 100644 --- a/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapeCapsule.html +++ b/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapeCapsule.html @@ -8,7 +8,7 @@

    Methods

    Constructors

    Properties

    inside: boolean

    If true, the collider prevents spring bones from going outside of the capsule instead.

    offset: Vector3

    The offset of the capsule head from the origin in local space.

    -
    radius: number

    The radius of the capsule.

    +
    radius: number

    The radius of the capsule.

    tail: Vector3

    The offset of the capsule tail from the origin in local space.

    Accessors

    • get type(): "capsule"
    • The type of the shape.

      Returns "capsule"

    Methods

    • Calculate a distance and a direction from the collider to a target object. diff --git a/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapePlane.html b/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapePlane.html index be4bed29a..349720440 100644 --- a/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapePlane.html +++ b/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapePlane.html @@ -6,7 +6,7 @@

    Methods

    Constructors

    Properties

    normal: Vector3

    The normal of the plane in local space. Must be normalized.

    offset: Vector3

    The offset of the plane from the origin in local space.

    -

    Accessors

    • get type(): "plane"
    • The type of the shape.

      +

    Accessors

    • get type(): "plane"
    • The type of the shape.

      Returns "plane"

    Methods

    • Calculate a distance and a direction from the collider to a target object. It's hit if the distance is negative. The direction will be contained in the given target vector.

      diff --git a/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapeSphere.html b/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapeSphere.html index bfc9c8d80..242796edd 100644 --- a/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapeSphere.html +++ b/packages/three-vrm/docs/classes/VRMSpringBoneColliderShapeSphere.html @@ -7,7 +7,7 @@

    Methods

    Constructors

    Properties

    inside: boolean

    If true, the collider prevents spring bones from going outside of the sphere instead.

    offset: Vector3

    The offset of the sphere from the origin in local space.

    -
    radius: number

    The radius.

    +
    radius: number

    The radius.

    Accessors

    • get type(): "sphere"
    • The type of the shape.

      Returns "sphere"

    Methods

    • Calculate a distance and a direction from the collider to a target object. It's hit if the distance is negative. diff --git a/packages/three-vrm/docs/classes/VRMSpringBoneJoint.html b/packages/three-vrm/docs/classes/VRMSpringBoneJoint.html index 9ae0aac7e..efe6bf675 100644 --- a/packages/three-vrm/docs/classes/VRMSpringBoneJoint.html +++ b/packages/three-vrm/docs/classes/VRMSpringBoneJoint.html @@ -6,6 +6,7 @@ colliderGroups settings

    Accessors

    Methods

    reset setInitState @@ -15,16 +16,17 @@
  • child: null | Object3D<Object3DEventMap>

    An Object3D that will be used as a tail of this spring bone. It can be null when the spring bone is imported from VRM 0.0

  • Optionalsettings: Partial<VRMSpringBoneJointSettings>

    Several parameters related to behavior of the spring bone

  • OptionalcolliderGroups: VRMSpringBoneColliderGroup[]

    Collider groups that will be collided with this spring bone

    -
  • Returns VRMSpringBoneJoint

    Properties

    bone: Object3D<Object3DEventMap>

    An Object3D attached to this bone.

    +

    Returns VRMSpringBoneJoint

    Properties

    bone: Object3D<Object3DEventMap>

    An Object3D attached to this bone.

    child: null | Object3D<Object3DEventMap>

    An Object3D that will be used as a tail of this spring bone. It can be null when the spring bone is imported from VRM 0.0.

    colliderGroups: VRMSpringBoneColliderGroup[]

    Collider groups attached to this bone.

    Settings of the bone.

    -

    Accessors

    • get center(): null | Object3D<Object3DEventMap>
    • Returns null | Object3D<Object3DEventMap>

    • set center(center): void
    • Parameters

      • center: null | Object3D<Object3DEventMap>

      Returns void

    • get initialLocalChildPosition(): Vector3
    • Returns Vector3

    Methods

    • Reset the state of this bone. +

    Accessors

    • get center(): null | Object3D<Object3DEventMap>
    • Returns null | Object3D<Object3DEventMap>

    • set center(center): void
    • Parameters

      • center: null | Object3D<Object3DEventMap>

      Returns void

    • get dependencies(): Set<Object3D<Object3DEventMap>>
    • Set of dependencies that need to be updated before this joint.

      +

      Returns Set<Object3D<Object3DEventMap>>

    • get initialLocalChildPosition(): Vector3
    • Returns Vector3

    Methods

    • Reset the state of this bone. You might want to call [[VRMSpringBoneManager.reset]] instead.

      -

      Returns void

    • Set the initial state of this spring bone. +

      Returns void

    • Set the initial state of this spring bone. You might want to call VRMSpringBoneManager.setInitState instead.

      -

      Returns void

    • Update the state of this bone. +

      Returns void

    • Update the state of this bone. You might want to call [[VRMSpringBoneManager.update]] instead.

      Parameters

      • delta: number

        deltaTime

        -

      Returns void

    +

    Returns void

    diff --git a/packages/three-vrm/docs/classes/VRMSpringBoneManager.html b/packages/three-vrm/docs/classes/VRMSpringBoneManager.html index c8417752f..0ded9c638 100644 --- a/packages/three-vrm/docs/classes/VRMSpringBoneManager.html +++ b/packages/three-vrm/docs/classes/VRMSpringBoneManager.html @@ -10,7 +10,7 @@ reset setInitState update -

    Constructors

    Accessors

    Methods

    • Parameters

      Returns void

    • Parameters

      Returns void

      Use addJoint instead.

      -
    • Parameters

      Returns void

    • Parameters

      Returns void

      Use deleteJoint instead.

      -
    • Returns void

    • Returns void

    • Parameters

      • delta: number

      Returns void

    +

    Constructors

    Accessors

    Methods

    • Parameters

      Returns void

    • Parameters

      Returns void

      Use addJoint instead.

      +
    • Parameters

      Returns void

    • Parameters

      Returns void

      Use deleteJoint instead.

      +
    • Returns void

    • Returns void

    • Parameters

      • delta: number

      Returns void

    diff --git a/packages/three-vrm/docs/classes/VRMUtils.html b/packages/three-vrm/docs/classes/VRMUtils.html index a83d60ec7..c42e7c2ce 100644 --- a/packages/three-vrm/docs/classes/VRMUtils.html +++ b/packages/three-vrm/docs/classes/VRMUtils.html @@ -1,13 +1,17 @@ -VRMUtils | @pixiv/three-vrm

    Properties

    combineSkeletons +VRMUtils | @pixiv/three-vrm

    Properties

    combineSkeletons: ((root: Object3D<Object3DEventMap>) => void) = combineSkeletons

    Type declaration

      • (root): void
      • Traverses the given object and combines the skeletons of skinned meshes.

        +

    Properties

    combineMorphs: ((vrm: VRMCore) => void) = combineMorphs

    Type declaration

      • (vrm): void
      • Combine morph targets by VRM expressions.

        +

        This function prevents crashes caused by the limitation of the number of morph targets, especially on mobile devices.

        +

        Parameters

        Returns void

    combineSkeletons: ((root: Object3D<Object3DEventMap>) => void) = combineSkeletons

    Type declaration

      • (root): void
      • Traverses the given object and combines the skeletons of skinned meshes.

        Each frame the bone matrices are computed for every skeleton. Combining skeletons reduces the number of calculations needed, improving performance.

        Parameters

        • root: Object3D<Object3DEventMap>

          Root object that will be traversed

          -

        Returns void

    deepDispose: ((object3D: Object3D<Object3DEventMap>) => void) = deepDispose
    removeUnnecessaryJoints: ((root: Object3D<Object3DEventMap>, options?: {
        experimentalSameBoneCounts?: boolean;
    }) => void) = removeUnnecessaryJoints

    Type declaration

      • (root, options?): void
      • Traverse the given object and remove unnecessarily bound joints from every THREE.SkinnedMesh.

        +

    Returns void

    deepDispose: ((object3D: Object3D<Object3DEventMap>) => void) = deepDispose
    removeUnnecessaryJoints: ((root: Object3D<Object3DEventMap>, options?: {
        experimentalSameBoneCounts?: boolean;
    }) => void) = removeUnnecessaryJoints

    Type declaration

      • (root, options?): void
      • Traverse the given object and remove unnecessarily bound joints from every THREE.SkinnedMesh.

        Some environments like mobile devices have a lower limit of bones and might be unable to perform mesh skinning with many bones. This function might resolve such an issue.

        @@ -19,12 +23,12 @@

        Consider this parameter as experimental. We might modify or delete this API without notice in the future.

        false by default.

    Returns void

    removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.

    -
    removeUnnecessaryVertices: ((root: Object3D<Object3DEventMap>) => void) = removeUnnecessaryVertices

    Type declaration

      • (root): void
      • Traverse given object and remove unnecessary vertices from every BufferGeometries. +

    removeUnnecessaryVertices: ((root: Object3D<Object3DEventMap>) => void) = removeUnnecessaryVertices

    Type declaration

      • (root): void
      • Traverse given object and remove unnecessary vertices from every BufferGeometries. This only processes buffer geometries with index buffer.

        Three.js creates morph textures for each geometries and it sometimes consumes unnecessary amount of VRAM for certain models. This function will optimize geometries to reduce the size of morph texture. See: https://github.com/mrdoob/three.js/issues/23095

        Parameters

        • root: Object3D<Object3DEventMap>

          Root object that will be traversed

          -

        Returns void

    rotateVRM0: ((vrm: VRM) => void) = rotateVRM0

    Type declaration

      • (vrm): void
      • If the given VRM is VRM0.0, rotate the vrm.scene by 180 degrees around the Y axis.

        +

    Returns void

    rotateVRM0: ((vrm: VRM) => void) = rotateVRM0

    Type declaration

      • (vrm): void
      • If the given VRM is VRM0.0, rotate the vrm.scene by 180 degrees around the Y axis.

        Parameters

        • vrm: VRM

          The target VRM

          -

        Returns void

    +

    Returns void

    diff --git a/packages/three-vrm/docs/interfaces/VRMLoaderPluginOptions.html b/packages/three-vrm/docs/interfaces/VRMLoaderPluginOptions.html index 8b62dd454..e49bf3ca5 100644 --- a/packages/three-vrm/docs/interfaces/VRMLoaderPluginOptions.html +++ b/packages/three-vrm/docs/interfaces/VRMLoaderPluginOptions.html @@ -1,4 +1,4 @@ -VRMLoaderPluginOptions | @pixiv/three-vrm

    Interface VRMLoaderPluginOptions

    interface VRMLoaderPluginOptions {
        autoUpdateHumanBones?: boolean;
        expressionPlugin?: VRMExpressionLoaderPlugin;
        firstPersonPlugin?: VRMFirstPersonLoaderPlugin;
        helperRoot?: Object3D<Object3DEventMap>;
        humanoidPlugin?: VRMHumanoidLoaderPlugin;
        lookAtPlugin?: VRMLookAtLoaderPlugin;
        materialsHDREmissiveMultiplierPlugin?: VRMMaterialsHDREmissiveMultiplierLoaderPlugin;
        materialsV0CompatPlugin?: VRMMaterialsV0CompatPlugin;
        metaPlugin?: VRMMetaLoaderPlugin;
        mtoonMaterialPlugin?: MToonMaterialLoaderPlugin;
        nodeConstraintPlugin?: VRMNodeConstraintLoaderPlugin;
        springBonePlugin?: VRMSpringBoneLoaderPlugin;
    }

    Properties

    autoUpdateHumanBones? +VRMLoaderPluginOptions | @pixiv/three-vrm

    Interface VRMLoaderPluginOptions

    interface VRMLoaderPluginOptions {
        autoUpdateHumanBones?: boolean;
        expressionPlugin?: VRMExpressionLoaderPlugin;
        firstPersonPlugin?: VRMFirstPersonLoaderPlugin;
        helperRoot?: Object3D<Object3DEventMap>;
        humanoidPlugin?: VRMHumanoidLoaderPlugin;
        lookAtPlugin?: VRMLookAtLoaderPlugin;
        materialsHDREmissiveMultiplierPlugin?: VRMMaterialsHDREmissiveMultiplierLoaderPlugin;
        materialsV0CompatPlugin?: VRMMaterialsV0CompatPlugin;
        metaPlugin?: VRMMetaLoaderPlugin;
        mtoonMaterialPlugin?: MToonMaterialLoaderPlugin;
        nodeConstraintPlugin?: VRMNodeConstraintLoaderPlugin;
        springBonePlugin?: VRMSpringBoneLoaderPlugin;
    }

    Properties

    true
     
    -
    expressionPlugin?: VRMExpressionLoaderPlugin
    firstPersonPlugin?: VRMFirstPersonLoaderPlugin
    helperRoot?: Object3D<Object3DEventMap>

    If assigned, the object will be used as a helper root of every component. +

    expressionPlugin?: VRMExpressionLoaderPlugin
    firstPersonPlugin?: VRMFirstPersonLoaderPlugin
    helperRoot?: Object3D<Object3DEventMap>

    If assigned, the object will be used as a helper root of every component. Useful for debug. Will be overwritten if you use custom loader plugins for each components.

    -
    humanoidPlugin?: VRMHumanoidLoaderPlugin
    lookAtPlugin?: VRMLookAtLoaderPlugin
    materialsHDREmissiveMultiplierPlugin?: VRMMaterialsHDREmissiveMultiplierLoaderPlugin
    materialsV0CompatPlugin?: VRMMaterialsV0CompatPlugin
    metaPlugin?: VRMMetaLoaderPlugin
    mtoonMaterialPlugin?: MToonMaterialLoaderPlugin
    nodeConstraintPlugin?: VRMNodeConstraintLoaderPlugin
    springBonePlugin?: VRMSpringBoneLoaderPlugin
    +
    humanoidPlugin?: VRMHumanoidLoaderPlugin
    lookAtPlugin?: VRMLookAtLoaderPlugin
    materialsHDREmissiveMultiplierPlugin?: VRMMaterialsHDREmissiveMultiplierLoaderPlugin
    materialsV0CompatPlugin?: VRMMaterialsV0CompatPlugin
    metaPlugin?: VRMMetaLoaderPlugin
    mtoonMaterialPlugin?: MToonMaterialLoaderPlugin
    nodeConstraintPlugin?: VRMNodeConstraintLoaderPlugin
    springBonePlugin?: VRMSpringBoneLoaderPlugin
    diff --git a/packages/three-vrm/docs/interfaces/VRMParameters.html b/packages/three-vrm/docs/interfaces/VRMParameters.html index 52d5e7f10..dc76ba04b 100644 --- a/packages/three-vrm/docs/interfaces/VRMParameters.html +++ b/packages/three-vrm/docs/interfaces/VRMParameters.html @@ -1,5 +1,5 @@ VRMParameters | @pixiv/three-vrm

    Interface VRMParameters

    Parameters for a VRM class.

    -
    interface VRMParameters {
        expressionManager?: VRMExpressionManager;
        firstPerson?: VRMFirstPerson;
        humanoid: VRMHumanoid;
        lookAt?: VRMLookAt;
        materials?: Material[];
        meta: VRMMeta;
        nodeConstraintManager?: VRMNodeConstraintManager;
        scene: Group<Object3DEventMap>;
        springBoneManager?: VRMSpringBoneManager;
    }

    Hierarchy (view full)

    Properties

    interface VRMParameters {
        expressionManager?: VRMExpressionManager;
        firstPerson?: VRMFirstPerson;
        humanoid: VRMHumanoid;
        lookAt?: VRMLookAt;
        materials?: Material[];
        meta: VRMMeta;
        nodeConstraintManager?: VRMNodeConstraintManager;
        scene: Group<Object3DEventMap>;
        springBoneManager?: VRMSpringBoneManager;
    }

    Hierarchy (view full)

    Properties

    expressionManager?: VRMExpressionManager
    firstPerson?: VRMFirstPerson
    humanoid: VRMHumanoid
    lookAt?: VRMLookAt
    materials?: Material[]
    meta: VRMMeta
    nodeConstraintManager?: VRMNodeConstraintManager
    scene: Group<Object3DEventMap>
    springBoneManager?: VRMSpringBoneManager
    +

    Properties

    expressionManager?: VRMExpressionManager
    firstPerson?: VRMFirstPerson
    humanoid: VRMHumanoid
    lookAt?: VRMLookAt
    materials?: Material[]
    meta: VRMMeta
    nodeConstraintManager?: VRMNodeConstraintManager
    scene: Group<Object3DEventMap>
    springBoneManager?: VRMSpringBoneManager
    diff --git a/packages/three-vrm/examples/animations.html b/packages/three-vrm/examples/animations.html index fbe5655de..364f6ebe9 100644 --- a/packages/three-vrm/examples/animations.html +++ b/packages/three-vrm/examples/animations.html @@ -82,6 +82,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/basic.html b/packages/three-vrm/examples/basic.html index ce42f37e2..b5b8dc626 100644 --- a/packages/three-vrm/examples/basic.html +++ b/packages/three-vrm/examples/basic.html @@ -83,6 +83,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/bones.html b/packages/three-vrm/examples/bones.html index 9830e3b5e..425e3f547 100644 --- a/packages/three-vrm/examples/bones.html +++ b/packages/three-vrm/examples/bones.html @@ -81,6 +81,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/debug.html b/packages/three-vrm/examples/debug.html index 2c4852697..7062a708a 100644 --- a/packages/three-vrm/examples/debug.html +++ b/packages/three-vrm/examples/debug.html @@ -89,6 +89,7 @@ // calling this function greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/dnd.html b/packages/three-vrm/examples/dnd.html index b9579d8b1..55e6d35cf 100644 --- a/packages/three-vrm/examples/dnd.html +++ b/packages/three-vrm/examples/dnd.html @@ -83,6 +83,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); if ( currentVrm ) { diff --git a/packages/three-vrm/examples/expressions.html b/packages/three-vrm/examples/expressions.html index 11c30f93f..b6ee27796 100644 --- a/packages/three-vrm/examples/expressions.html +++ b/packages/three-vrm/examples/expressions.html @@ -77,10 +77,11 @@ ( gltf ) => { const vrm = gltf.userData.vrm; - + // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/firstperson.html b/packages/three-vrm/examples/firstperson.html index 94abc4bc9..ff33362ac 100644 --- a/packages/three-vrm/examples/firstperson.html +++ b/packages/three-vrm/examples/firstperson.html @@ -81,6 +81,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/humanoidAnimation/main.js b/packages/three-vrm/examples/humanoidAnimation/main.js index 1ed8ebd2a..e6e7b07ae 100644 --- a/packages/three-vrm/examples/humanoidAnimation/main.js +++ b/packages/three-vrm/examples/humanoidAnimation/main.js @@ -62,6 +62,11 @@ function loadVRM( modelUrl ) { const vrm = gltf.userData.vrm; + // calling this function greatly improves the performance + VRMUtils.removeUnnecessaryVertices( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); + if ( currentVrm ) { scene.remove( currentVrm.scene ); diff --git a/packages/three-vrm/examples/lookat-advanced.html b/packages/three-vrm/examples/lookat-advanced.html index de42627aa..cdb236bf6 100644 --- a/packages/three-vrm/examples/lookat-advanced.html +++ b/packages/three-vrm/examples/lookat-advanced.html @@ -152,6 +152,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/lookat.html b/packages/three-vrm/examples/lookat.html index d6dba3bce..35361a093 100644 --- a/packages/three-vrm/examples/lookat.html +++ b/packages/three-vrm/examples/lookat.html @@ -85,6 +85,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/materials-debug.html b/packages/three-vrm/examples/materials-debug.html index 9a7e36903..8536554f4 100644 --- a/packages/three-vrm/examples/materials-debug.html +++ b/packages/three-vrm/examples/materials-debug.html @@ -81,6 +81,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/meta.html b/packages/three-vrm/examples/meta.html index bc249e714..65217419c 100644 --- a/packages/three-vrm/examples/meta.html +++ b/packages/three-vrm/examples/meta.html @@ -98,6 +98,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/mouse.html b/packages/three-vrm/examples/mouse.html index a2c5a7dca..0d5cbcd70 100644 --- a/packages/three-vrm/examples/mouse.html +++ b/packages/three-vrm/examples/mouse.html @@ -76,6 +76,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/webgpu-dnd.html b/packages/three-vrm/examples/webgpu-dnd.html index 9a64a3e76..7a2905edb 100644 --- a/packages/three-vrm/examples/webgpu-dnd.html +++ b/packages/three-vrm/examples/webgpu-dnd.html @@ -99,6 +99,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); VRMUtils.combineSkeletons( gltf.scene ); + VRMUtils.combineMorphs( vrm ); if ( currentVrm ) { diff --git a/packages/three-vrm/lib/nodes/index.cjs b/packages/three-vrm/lib/nodes/index.cjs index 1ff855533..53c865eb4 100644 --- a/packages/three-vrm/lib/nodes/index.cjs +++ b/packages/three-vrm/lib/nodes/index.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm v3.2.0 + * @pixiv/three-vrm v3.3.0 * VRM file loader for three.js. * * Copyright (c) 2019-2024 pixiv Inc. @@ -522,7 +522,7 @@ var MToonNodeMaterial = class extends THREE8.NodeMaterial { } }; /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm/lib/nodes/index.min.cjs b/packages/three-vrm/lib/nodes/index.min.cjs index 0cef00e9e..41def001f 100644 --- a/packages/three-vrm/lib/nodes/index.min.cjs +++ b/packages/three-vrm/lib/nodes/index.min.cjs @@ -1,7 +1,7 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ "use strict";var B=Object.create;var v=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var $=(t,e)=>{for(var o in e)v(t,o,{get:e[o],enumerable:!0})},O=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of K(e))!Z.call(t,l)&&l!==o&&v(t,l,{get:()=>e[l],enumerable:!(r=q(e,l))||r.enumerable});return t};var h=(t,e,o)=>(o=t!=null?B(j(t)):{},O(e||!t||!t.__esModule?v(o,"default",{value:t,enumerable:!0}):o,t)),G=t=>O(v({},"__esModule",{value:!0}),t);var Ct={};$(Ct,{MToonAnimatedUVNode:()=>D,MToonLightingModel:()=>z,MToonNodeMaterial:()=>yt});module.exports=G(Ct);var b=h(require("three"),1),s=h(require("three/webgpu"),1),a=h(require("three/webgpu"),1),n=h(require("three/webgpu"),1),u=h(require("three/webgpu"),1),E=h(require("three/webgpu"),1),i=h(require("three/webgpu"),1),p=h(require("three/webgpu"),1);var W=parseInt(b.REVISION,10);W<167&&console.warn(`MToonNodeMaterial requires Three.js r167 or higher (You are using r${W}). This would not work correctly.`);var J=a.materialReference("color","color"),Q=a.materialReference("map","texture"),tt=a.materialReference("normalMap","texture"),et=a.materialReference("normalScale","vec2"),it=a.materialReference("emissive","color"),ot=a.materialReference("emissiveIntensity","float"),rt=a.materialReference("emissiveMap","texture"),at=a.materialReference("shadeColorFactor","color"),lt=a.materialReference("shadingShiftFactor","float"),U=a.materialReference("shadeMultiplyTexture","texture"),nt=a.materialReference("shadeMultiplyTextureScale","float"),st=a.materialReference("shadingToonyFactor","float"),ut=a.materialReference("rimLightingMixFactor","float"),mt=a.materialReference("rimMultiplyTexture","texture"),ht=a.materialReference("matcapFactor","color"),dt=a.materialReference("matcapTexture","texture"),ct=a.materialReference("parametricRimColorFactor","color"),Et=a.materialReference("parametricRimLiftFactor","float"),pt=a.materialReference("parametricRimFresnelPowerFactor","float"),Rt=a.materialReference("outlineWidthMultiplyTexture","texture"),ft=a.materialReference("outlineWidthFactor","float"),I=a.materialReference("outlineColorFactor","color"),Tt=a.materialReference("outlineLightingMixFactor","float"),vt=a.materialReference("uvAnimationMaskTexture","texture"),Nt=a.materialReference("uvAnimationScrollXOffset","float"),gt=a.materialReference("uvAnimationScrollYOffset","float"),Ht=a.materialReference("uvAnimationRotationPhase","float"),D=class extends s.TempNode{constructor(t){super("vec2"),this.hasMaskTexture=t}setup(){let t=1;this.hasMaskTexture&&(t=s.vec4(vt).context({getUV:()=>s.uv()}).r);let e=s.uv(),o=Ht.mul(t),r=s.cos(o),l=s.sin(o);e=e.sub(s.vec2(.5,.5)),e=e.mul(s.mat2(r,l,l.negate(),r)),e=e.add(s.vec2(.5,.5));let m=s.vec2(Nt,gt).mul(t);return e=e.add(m),e.toVar("AnimatedUV")}},k=u.nodeImmutable(u.PropertyNode,"vec3").toVar("ShadeColor"),Y=u.nodeImmutable(u.PropertyNode,"float").toVar("ShadingShift"),X=u.nodeImmutable(u.PropertyNode,"float").toVar("ShadingToony"),g=u.nodeImmutable(u.PropertyNode,"float").toVar("RimLightingMix"),H=u.nodeImmutable(u.PropertyNode,"vec3").toVar("RimMultiply"),M=u.nodeImmutable(u.PropertyNode,"vec3").toVar("matcap"),x=u.nodeImmutable(u.PropertyNode,"vec3").toVar("ParametricRim"),N=t=>parseInt(E.REVISION,10)>=168?E.Fn(t):E.tslFn(t),Mt=N(({a:t,b:e,t:o})=>{let r=o.sub(t),l=e.sub(t);return r.div(l).clamp()}),xt=N(({dotNL:t})=>{let o=n.float(1).sub(X),r=t.add(Y);return r=Mt({a:o.negate(),b:o,t:r}),r=r.mul(1),r}),St=N(({shading:t,lightColor:e})=>{let o=n.mix(k,n.diffuseColor,t);return e.mul(n.BRDF_Lambert({diffuseColor:o}))}),z=class extends n.LightingModel{constructor(){super()}direct({lightDirection:t,lightColor:e,reflectedLight:o}){let r=n.transformedNormalView.dot(t).clamp(-1,1),l=xt({dotNL:r});o.directDiffuse.assign(o.directDiffuse.add(St({shading:l,lightColor:e}))),o.directSpecular.assign(o.directSpecular.add(x.add(M).mul(H).mul(n.mix(n.vec3(0),n.BRDF_Lambert({diffuseColor:e}),g))))}indirect(t){this.indirectDiffuse(t),this.indirectSpecular(t)}indirectDiffuse({irradiance:t,reflectedLight:e}){e.indirectDiffuse.assign(e.indirectDiffuse.add(t.mul(n.BRDF_Lambert({diffuseColor:n.diffuseColor}))))}indirectSpecular({reflectedLight:t}){t.indirectSpecular.assign(t.indirectSpecular.add(x.add(M).mul(H).mul(n.mix(n.vec3(1),n.vec3(0),g))))}},f={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},Ft=N(({parametricRimLift:t,parametricRimFresnelPower:e,parametricRimColor:o})=>{let r=p.modelViewPosition.normalize(),l=p.transformedNormalView.dot(r.negate());return p.float(1).sub(l).add(t).clamp().pow(e).mul(o)}),yt=class extends i.NodeMaterial{customProgramCacheKey(){let t=super.customProgramCacheKey();return t+=`isOutline:${this.isOutline},`,t}get isMToonNodeMaterial(){return!0}constructor(t={}){super(),t.transparentWithZWrite&&(t.depthWrite=!0),delete t.transparentWithZWrite,delete t.giEqualizationFactor,delete t.v0CompatShade,delete t.debugMode,this.emissiveNode=null,this.lights=!0,this.color=new i.Color(1,1,1),this.map=null,this.emissive=new i.Color(0,0,0),this.emissiveIntensity=1,this.emissiveMap=null,this.normalMap=null,this.normalScale=new i.Vector2(1,1),this.shadeColorFactor=new i.Color(0,0,0),this.shadeMultiplyTexture=null,this.shadingShiftFactor=0,this.shadingShiftTexture=null,this.shadingShiftTextureScale=1,this.shadingToonyFactor=.9,this.rimLightingMixFactor=1,this.rimMultiplyTexture=null,this.matcapFactor=new i.Color(1,1,1),this.matcapTexture=null,this.parametricRimColorFactor=new i.Color(0,0,0),this.parametricRimLiftFactor=0,this.parametricRimFresnelPowerFactor=5,this.outlineWidthMode=f.None,this.outlineWidthMultiplyTexture=null,this.outlineWidthFactor=0,this.outlineColorFactor=new i.Color(0,0,0),this.outlineLightingMixFactor=1,this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.uvAnimationMaskTexture=null,this.shadeColorNode=null,this.shadingShiftNode=null,this.shadingToonyNode=null,this.rimLightingMixNode=null,this.rimMultiplyNode=null,this.matcapNode=null,this.parametricRimColorNode=null,this.parametricRimLiftNode=null,this.parametricRimFresnelPowerNode=null,this.uvAnimationScrollXOffset=0,this.uvAnimationScrollYOffset=0,this.uvAnimationRotationPhase=0,this.isOutline=!1,this._animatedUVNode=null,this.setValues(t)}setupLightingModel(){return new z}setup(t){var e;this._animatedUVNode=new D((e=this.uvAnimationMaskTexture&&this.uvAnimationMaskTexture.isTexture===!0)!=null?e:!1),super.setup(t)}setupDiffuseColor(t){let e=null;if(this.colorNode==null){if(e=J,this.map&&this.map.isTexture===!0){let o=Q.context({getUV:()=>this._animatedUVNode});e=e.mul(o)}this.colorNode=e}this.vertexColors===!0&&t.geometry.hasAttribute("color")&&(console.warn("MToonNodeMaterial: MToon ignores vertex colors. Consider using a model without vertex colors instead."),this.vertexColors=!1),super.setupDiffuseColor(t),parseInt(i.REVISION,10)<166&&this.transparent===!1&&this.blending===i.NormalBlending&&this.alphaToCoverage===!1&&i.diffuseColor.a.assign(1),this.colorNode===e&&(this.colorNode=null)}setupVariants(){k.assign(this._setupShadeColorNode()),Y.assign(this._setupShadingShiftNode()),X.assign(this._setupShadingToonyNode()),g.assign(this._setupRimLightingMixNode()),H.assign(this._setupRimMultiplyNode()),M.assign(this._setupMatcapNode()),x.assign(this._setupParametricRimNode())}setupNormal(t){let e=this.normalNode;if(this.normalNode==null){if(this.normalNode=i.materialNormal,this.normalMap&&this.normalMap.isTexture===!0){let r=tt.context({getUV:()=>this._animatedUVNode});this.normalNode=i.normalMap(r,et)}this.isOutline&&(this.normalNode=this.normalNode.negate())}if(parseInt(i.REVISION,10)>=168){let r=this.normalNode;return this.normalNode=e,r}else{super.setupNormal(t),this.normalNode=e;return}}setupLighting(t){let e=null;if(this.emissiveNode==null){if(e=it.mul(ot),this.emissiveMap&&this.emissiveMap.isTexture===!0){let r=rt.context({getUV:()=>this._animatedUVNode});e=e.mul(r)}this.emissiveNode=e}let o=super.setupLighting(t);return this.emissiveNode===e&&(this.emissiveNode=null),o}setupOutput(t,e){return this.isOutline&&this.outlineWidthMode!==f.None&&(e=i.vec4(i.mix(I,e.xyz.mul(I),Tt),e.w)),super.setupOutput(t,e)}setupPosition(t){var e,o;let r=this.positionNode;if(this.isOutline&&this.outlineWidthMode!==f.None){(e=this.positionNode)!=null||(this.positionNode=i.positionLocal);let m=i.normalLocal.normalize(),d=ft;if(this.outlineWidthMultiplyTexture&&this.outlineWidthMultiplyTexture.isTexture===!0){let c=Rt.context({getUV:()=>this._animatedUVNode});d=d.mul(c)}let T=i.length(i.modelNormalMatrix.mul(m)),R=d.mul(T).mul(m);if(this.outlineWidthMode===f.WorldCoordinates)this.positionNode=this.positionNode.add(R);else if(this.outlineWidthMode===f.ScreenCoordinates){let c=i.cameraProjectionMatrix.element(1).element(1);this.positionNode=this.positionNode.add(R.div(c).mul(i.positionView.z.negate()))}(o=this.positionNode)!=null||(this.positionNode=i.positionLocal)}let l=super.setupPosition(t);return l.z.add(l.w.mul(1e-6)),this.positionNode=r,l}copy(t){var e,o,r,l,m,d,T,R,c,S,F,y,C,_,V,L,w,P,A;return this.color.copy(t.color),this.map=(e=t.map)!=null?e:null,this.emissive.copy(t.emissive),this.emissiveIntensity=t.emissiveIntensity,this.emissiveMap=(o=t.emissiveMap)!=null?o:null,this.normalMap=(r=t.normalMap)!=null?r:null,this.normalScale.copy(t.normalScale),this.shadeColorFactor.copy(t.shadeColorFactor),this.shadeMultiplyTexture=(l=t.shadeMultiplyTexture)!=null?l:null,this.shadingShiftFactor=t.shadingShiftFactor,this.shadingShiftTexture=(m=t.shadingShiftTexture)!=null?m:null,this.shadingShiftTextureScale=t.shadingShiftTextureScale,this.shadingToonyFactor=t.shadingToonyFactor,this.rimLightingMixFactor=t.rimLightingMixFactor,this.rimMultiplyTexture=(d=t.rimMultiplyTexture)!=null?d:null,this.matcapFactor.copy(t.matcapFactor),this.matcapTexture=(T=t.matcapTexture)!=null?T:null,this.parametricRimColorFactor.copy(t.parametricRimColorFactor),this.parametricRimLiftFactor=t.parametricRimLiftFactor,this.parametricRimFresnelPowerFactor=t.parametricRimFresnelPowerFactor,this.outlineWidthMode=t.outlineWidthMode,this.outlineWidthMultiplyTexture=(R=t.outlineWidthMultiplyTexture)!=null?R:null,this.outlineWidthFactor=t.outlineWidthFactor,this.outlineColorFactor.copy(t.outlineColorFactor),this.outlineLightingMixFactor=t.outlineLightingMixFactor,this.uvAnimationScrollXSpeedFactor=t.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=t.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=t.uvAnimationRotationSpeedFactor,this.uvAnimationMaskTexture=(c=t.uvAnimationMaskTexture)!=null?c:null,this.shadeColorNode=(S=t.shadeColorNode)!=null?S:null,this.shadingShiftNode=(F=t.shadingShiftNode)!=null?F:null,this.shadingToonyNode=(y=t.shadingToonyNode)!=null?y:null,this.rimLightingMixNode=(C=t.rimLightingMixNode)!=null?C:null,this.rimMultiplyNode=(_=t.rimMultiplyNode)!=null?_:null,this.matcapNode=(V=t.matcapNode)!=null?V:null,this.parametricRimColorNode=(L=t.parametricRimColorNode)!=null?L:null,this.parametricRimLiftNode=(w=t.parametricRimLiftNode)!=null?w:null,this.parametricRimFresnelPowerNode=(P=t.parametricRimFresnelPowerNode)!=null?P:null,this.isOutline=(A=t.isOutline)!=null?A:null,super.copy(t)}update(t){this.uvAnimationScrollXOffset+=t*this.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYOffset+=t*this.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationPhase+=t*this.uvAnimationRotationSpeedFactor}_setupShadeColorNode(){if(this.shadeColorNode!=null)return i.vec3(this.shadeColorNode);let t=at;if(this.shadeMultiplyTexture&&this.shadeMultiplyTexture.isTexture===!0){let e=U.context({getUV:()=>this._animatedUVNode});t=t.mul(e)}return t}_setupShadingShiftNode(){if(this.shadingShiftNode!=null)return i.float(this.shadingShiftNode);let t=lt;if(this.shadingShiftTexture&&this.shadingShiftTexture.isTexture===!0){let e=U.context({getUV:()=>this._animatedUVNode});t=t.add(e.mul(nt))}return t}_setupShadingToonyNode(){return this.shadingToonyNode!=null?i.float(this.shadingToonyNode):st}_setupRimLightingMixNode(){return this.rimLightingMixNode!=null?i.float(this.rimLightingMixNode):ut}_setupRimMultiplyNode(){return this.rimMultiplyNode!=null?i.vec3(this.rimMultiplyNode):this.rimMultiplyTexture&&this.rimMultiplyTexture.isTexture===!0?mt.context({getUV:()=>this._animatedUVNode}):i.vec3(1)}_setupMatcapNode(){return this.matcapNode!=null?i.vec3(this.matcapNode):this.matcapTexture&&this.matcapTexture.isTexture===!0?dt.context({getUV:()=>i.matcapUV.mul(1,-1).add(0,1)}).mul(ht):i.vec3(0)}_setupParametricRimNode(){let t=this.parametricRimColorNode!=null?i.vec3(this.parametricRimColorNode):ct,e=this.parametricRimLiftNode!=null?i.float(this.parametricRimLiftNode):Et,o=this.parametricRimFresnelPowerNode!=null?i.float(this.parametricRimFresnelPowerNode):pt;return Ft({parametricRimLift:e,parametricRimFresnelPower:o,parametricRimColor:t})}}; /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm/lib/nodes/index.module.js b/packages/three-vrm/lib/nodes/index.module.js index 54211c280..416e3cfe2 100644 --- a/packages/three-vrm/lib/nodes/index.module.js +++ b/packages/three-vrm/lib/nodes/index.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm v3.2.0 + * @pixiv/three-vrm v3.3.0 * VRM file loader for three.js. * * Copyright (c) 2019-2024 pixiv Inc. @@ -490,7 +490,7 @@ export { MToonNodeMaterial }; /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm/lib/nodes/index.module.min.js b/packages/three-vrm/lib/nodes/index.module.min.js index 348c179eb..9b3c3b69d 100644 --- a/packages/three-vrm/lib/nodes/index.module.min.js +++ b/packages/three-vrm/lib/nodes/index.module.min.js @@ -1,7 +1,7 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ import*as W from"three";import*as n from"three/webgpu";import*as r from"three/webgpu";import*as l from"three/webgpu";import*as s from"three/webgpu";import*as c from"three/webgpu";import*as i from"three/webgpu";import*as E from"three/webgpu";var P=parseInt(W.REVISION,10);P<167&&console.warn(`MToonNodeMaterial requires Three.js r167 or higher (You are using r${P}). This would not work correctly.`);var D=r.materialReference("color","color"),k=r.materialReference("map","texture"),Y=r.materialReference("normalMap","texture"),X=r.materialReference("normalScale","vec2"),z=r.materialReference("emissive","color"),B=r.materialReference("emissiveIntensity","float"),q=r.materialReference("emissiveMap","texture"),K=r.materialReference("shadeColorFactor","color"),j=r.materialReference("shadingShiftFactor","float"),A=r.materialReference("shadeMultiplyTexture","texture"),Z=r.materialReference("shadeMultiplyTextureScale","float"),$=r.materialReference("shadingToonyFactor","float"),G=r.materialReference("rimLightingMixFactor","float"),J=r.materialReference("rimMultiplyTexture","texture"),Q=r.materialReference("matcapFactor","color"),tt=r.materialReference("matcapTexture","texture"),et=r.materialReference("parametricRimColorFactor","color"),it=r.materialReference("parametricRimLiftFactor","float"),ot=r.materialReference("parametricRimFresnelPowerFactor","float"),rt=r.materialReference("outlineWidthMultiplyTexture","texture"),at=r.materialReference("outlineWidthFactor","float"),O=r.materialReference("outlineColorFactor","color"),lt=r.materialReference("outlineLightingMixFactor","float"),nt=r.materialReference("uvAnimationMaskTexture","texture"),st=r.materialReference("uvAnimationScrollXOffset","float"),ut=r.materialReference("uvAnimationScrollYOffset","float"),mt=r.materialReference("uvAnimationRotationPhase","float"),ht=class extends n.TempNode{constructor(t){super("vec2"),this.hasMaskTexture=t}setup(){let t=1;this.hasMaskTexture&&(t=n.vec4(nt).context({getUV:()=>n.uv()}).r);let e=n.uv(),o=mt.mul(t),a=n.cos(o),u=n.sin(o);e=e.sub(n.vec2(.5,.5)),e=e.mul(n.mat2(a,u,u.negate(),a)),e=e.add(n.vec2(.5,.5));let m=n.vec2(st,ut).mul(t);return e=e.add(m),e.toVar("AnimatedUV")}},U=s.nodeImmutable(s.PropertyNode,"vec3").toVar("ShadeColor"),I=s.nodeImmutable(s.PropertyNode,"float").toVar("ShadingShift"),b=s.nodeImmutable(s.PropertyNode,"float").toVar("ShadingToony"),v=s.nodeImmutable(s.PropertyNode,"float").toVar("RimLightingMix"),N=s.nodeImmutable(s.PropertyNode,"vec3").toVar("RimMultiply"),g=s.nodeImmutable(s.PropertyNode,"vec3").toVar("matcap"),H=s.nodeImmutable(s.PropertyNode,"vec3").toVar("ParametricRim"),T=t=>parseInt(c.REVISION,10)>=168?c.Fn(t):c.tslFn(t),dt=T(({a:t,b:e,t:o})=>{let a=o.sub(t),u=e.sub(t);return a.div(u).clamp()}),ct=T(({dotNL:t})=>{let o=l.float(1).sub(b),a=t.add(I);return a=dt({a:o.negate(),b:o,t:a}),a=a.mul(1),a}),Et=T(({shading:t,lightColor:e})=>{let o=l.mix(U,l.diffuseColor,t);return e.mul(l.BRDF_Lambert({diffuseColor:o}))}),pt=class extends l.LightingModel{constructor(){super()}direct({lightDirection:t,lightColor:e,reflectedLight:o}){let a=l.transformedNormalView.dot(t).clamp(-1,1),u=ct({dotNL:a});o.directDiffuse.assign(o.directDiffuse.add(Et({shading:u,lightColor:e}))),o.directSpecular.assign(o.directSpecular.add(H.add(g).mul(N).mul(l.mix(l.vec3(0),l.BRDF_Lambert({diffuseColor:e}),v))))}indirect(t){this.indirectDiffuse(t),this.indirectSpecular(t)}indirectDiffuse({irradiance:t,reflectedLight:e}){e.indirectDiffuse.assign(e.indirectDiffuse.add(t.mul(l.BRDF_Lambert({diffuseColor:l.diffuseColor}))))}indirectSpecular({reflectedLight:t}){t.indirectSpecular.assign(t.indirectSpecular.add(H.add(g).mul(N).mul(l.mix(l.vec3(1),l.vec3(0),v))))}},R={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},Rt=T(({parametricRimLift:t,parametricRimFresnelPower:e,parametricRimColor:o})=>{let a=E.modelViewPosition.normalize(),u=E.transformedNormalView.dot(a.negate());return E.float(1).sub(u).add(t).clamp().pow(e).mul(o)}),ft=class extends i.NodeMaterial{customProgramCacheKey(){let t=super.customProgramCacheKey();return t+=`isOutline:${this.isOutline},`,t}get isMToonNodeMaterial(){return!0}constructor(t={}){super(),t.transparentWithZWrite&&(t.depthWrite=!0),delete t.transparentWithZWrite,delete t.giEqualizationFactor,delete t.v0CompatShade,delete t.debugMode,this.emissiveNode=null,this.lights=!0,this.color=new i.Color(1,1,1),this.map=null,this.emissive=new i.Color(0,0,0),this.emissiveIntensity=1,this.emissiveMap=null,this.normalMap=null,this.normalScale=new i.Vector2(1,1),this.shadeColorFactor=new i.Color(0,0,0),this.shadeMultiplyTexture=null,this.shadingShiftFactor=0,this.shadingShiftTexture=null,this.shadingShiftTextureScale=1,this.shadingToonyFactor=.9,this.rimLightingMixFactor=1,this.rimMultiplyTexture=null,this.matcapFactor=new i.Color(1,1,1),this.matcapTexture=null,this.parametricRimColorFactor=new i.Color(0,0,0),this.parametricRimLiftFactor=0,this.parametricRimFresnelPowerFactor=5,this.outlineWidthMode=R.None,this.outlineWidthMultiplyTexture=null,this.outlineWidthFactor=0,this.outlineColorFactor=new i.Color(0,0,0),this.outlineLightingMixFactor=1,this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.uvAnimationMaskTexture=null,this.shadeColorNode=null,this.shadingShiftNode=null,this.shadingToonyNode=null,this.rimLightingMixNode=null,this.rimMultiplyNode=null,this.matcapNode=null,this.parametricRimColorNode=null,this.parametricRimLiftNode=null,this.parametricRimFresnelPowerNode=null,this.uvAnimationScrollXOffset=0,this.uvAnimationScrollYOffset=0,this.uvAnimationRotationPhase=0,this.isOutline=!1,this._animatedUVNode=null,this.setValues(t)}setupLightingModel(){return new pt}setup(t){var e;this._animatedUVNode=new ht((e=this.uvAnimationMaskTexture&&this.uvAnimationMaskTexture.isTexture===!0)!=null?e:!1),super.setup(t)}setupDiffuseColor(t){let e=null;if(this.colorNode==null){if(e=D,this.map&&this.map.isTexture===!0){let o=k.context({getUV:()=>this._animatedUVNode});e=e.mul(o)}this.colorNode=e}this.vertexColors===!0&&t.geometry.hasAttribute("color")&&(console.warn("MToonNodeMaterial: MToon ignores vertex colors. Consider using a model without vertex colors instead."),this.vertexColors=!1),super.setupDiffuseColor(t),parseInt(i.REVISION,10)<166&&this.transparent===!1&&this.blending===i.NormalBlending&&this.alphaToCoverage===!1&&i.diffuseColor.a.assign(1),this.colorNode===e&&(this.colorNode=null)}setupVariants(){U.assign(this._setupShadeColorNode()),I.assign(this._setupShadingShiftNode()),b.assign(this._setupShadingToonyNode()),v.assign(this._setupRimLightingMixNode()),N.assign(this._setupRimMultiplyNode()),g.assign(this._setupMatcapNode()),H.assign(this._setupParametricRimNode())}setupNormal(t){let e=this.normalNode;if(this.normalNode==null){if(this.normalNode=i.materialNormal,this.normalMap&&this.normalMap.isTexture===!0){let a=Y.context({getUV:()=>this._animatedUVNode});this.normalNode=i.normalMap(a,X)}this.isOutline&&(this.normalNode=this.normalNode.negate())}if(parseInt(i.REVISION,10)>=168){let a=this.normalNode;return this.normalNode=e,a}else{super.setupNormal(t),this.normalNode=e;return}}setupLighting(t){let e=null;if(this.emissiveNode==null){if(e=z.mul(B),this.emissiveMap&&this.emissiveMap.isTexture===!0){let a=q.context({getUV:()=>this._animatedUVNode});e=e.mul(a)}this.emissiveNode=e}let o=super.setupLighting(t);return this.emissiveNode===e&&(this.emissiveNode=null),o}setupOutput(t,e){return this.isOutline&&this.outlineWidthMode!==R.None&&(e=i.vec4(i.mix(O,e.xyz.mul(O),lt),e.w)),super.setupOutput(t,e)}setupPosition(t){var e,o;let a=this.positionNode;if(this.isOutline&&this.outlineWidthMode!==R.None){(e=this.positionNode)!=null||(this.positionNode=i.positionLocal);let m=i.normalLocal.normalize(),h=at;if(this.outlineWidthMultiplyTexture&&this.outlineWidthMultiplyTexture.isTexture===!0){let d=rt.context({getUV:()=>this._animatedUVNode});h=h.mul(d)}let f=i.length(i.modelNormalMatrix.mul(m)),p=h.mul(f).mul(m);if(this.outlineWidthMode===R.WorldCoordinates)this.positionNode=this.positionNode.add(p);else if(this.outlineWidthMode===R.ScreenCoordinates){let d=i.cameraProjectionMatrix.element(1).element(1);this.positionNode=this.positionNode.add(p.div(d).mul(i.positionView.z.negate()))}(o=this.positionNode)!=null||(this.positionNode=i.positionLocal)}let u=super.setupPosition(t);return u.z.add(u.w.mul(1e-6)),this.positionNode=a,u}copy(t){var e,o,a,u,m,h,f,p,d,M,x,S,F,y,C,_,V,L,w;return this.color.copy(t.color),this.map=(e=t.map)!=null?e:null,this.emissive.copy(t.emissive),this.emissiveIntensity=t.emissiveIntensity,this.emissiveMap=(o=t.emissiveMap)!=null?o:null,this.normalMap=(a=t.normalMap)!=null?a:null,this.normalScale.copy(t.normalScale),this.shadeColorFactor.copy(t.shadeColorFactor),this.shadeMultiplyTexture=(u=t.shadeMultiplyTexture)!=null?u:null,this.shadingShiftFactor=t.shadingShiftFactor,this.shadingShiftTexture=(m=t.shadingShiftTexture)!=null?m:null,this.shadingShiftTextureScale=t.shadingShiftTextureScale,this.shadingToonyFactor=t.shadingToonyFactor,this.rimLightingMixFactor=t.rimLightingMixFactor,this.rimMultiplyTexture=(h=t.rimMultiplyTexture)!=null?h:null,this.matcapFactor.copy(t.matcapFactor),this.matcapTexture=(f=t.matcapTexture)!=null?f:null,this.parametricRimColorFactor.copy(t.parametricRimColorFactor),this.parametricRimLiftFactor=t.parametricRimLiftFactor,this.parametricRimFresnelPowerFactor=t.parametricRimFresnelPowerFactor,this.outlineWidthMode=t.outlineWidthMode,this.outlineWidthMultiplyTexture=(p=t.outlineWidthMultiplyTexture)!=null?p:null,this.outlineWidthFactor=t.outlineWidthFactor,this.outlineColorFactor.copy(t.outlineColorFactor),this.outlineLightingMixFactor=t.outlineLightingMixFactor,this.uvAnimationScrollXSpeedFactor=t.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=t.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=t.uvAnimationRotationSpeedFactor,this.uvAnimationMaskTexture=(d=t.uvAnimationMaskTexture)!=null?d:null,this.shadeColorNode=(M=t.shadeColorNode)!=null?M:null,this.shadingShiftNode=(x=t.shadingShiftNode)!=null?x:null,this.shadingToonyNode=(S=t.shadingToonyNode)!=null?S:null,this.rimLightingMixNode=(F=t.rimLightingMixNode)!=null?F:null,this.rimMultiplyNode=(y=t.rimMultiplyNode)!=null?y:null,this.matcapNode=(C=t.matcapNode)!=null?C:null,this.parametricRimColorNode=(_=t.parametricRimColorNode)!=null?_:null,this.parametricRimLiftNode=(V=t.parametricRimLiftNode)!=null?V:null,this.parametricRimFresnelPowerNode=(L=t.parametricRimFresnelPowerNode)!=null?L:null,this.isOutline=(w=t.isOutline)!=null?w:null,super.copy(t)}update(t){this.uvAnimationScrollXOffset+=t*this.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYOffset+=t*this.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationPhase+=t*this.uvAnimationRotationSpeedFactor}_setupShadeColorNode(){if(this.shadeColorNode!=null)return i.vec3(this.shadeColorNode);let t=K;if(this.shadeMultiplyTexture&&this.shadeMultiplyTexture.isTexture===!0){let e=A.context({getUV:()=>this._animatedUVNode});t=t.mul(e)}return t}_setupShadingShiftNode(){if(this.shadingShiftNode!=null)return i.float(this.shadingShiftNode);let t=j;if(this.shadingShiftTexture&&this.shadingShiftTexture.isTexture===!0){let e=A.context({getUV:()=>this._animatedUVNode});t=t.add(e.mul(Z))}return t}_setupShadingToonyNode(){return this.shadingToonyNode!=null?i.float(this.shadingToonyNode):$}_setupRimLightingMixNode(){return this.rimLightingMixNode!=null?i.float(this.rimLightingMixNode):G}_setupRimMultiplyNode(){return this.rimMultiplyNode!=null?i.vec3(this.rimMultiplyNode):this.rimMultiplyTexture&&this.rimMultiplyTexture.isTexture===!0?J.context({getUV:()=>this._animatedUVNode}):i.vec3(1)}_setupMatcapNode(){return this.matcapNode!=null?i.vec3(this.matcapNode):this.matcapTexture&&this.matcapTexture.isTexture===!0?tt.context({getUV:()=>i.matcapUV.mul(1,-1).add(0,1)}).mul(Q):i.vec3(0)}_setupParametricRimNode(){let t=this.parametricRimColorNode!=null?i.vec3(this.parametricRimColorNode):et,e=this.parametricRimLiftNode!=null?i.float(this.parametricRimLiftNode):it,o=this.parametricRimFresnelPowerNode!=null?i.float(this.parametricRimFresnelPowerNode):ot;return Rt({parametricRimLift:e,parametricRimFresnelPower:o,parametricRimColor:t})}};export{ht as MToonAnimatedUVNode,pt as MToonLightingModel,ft as MToonNodeMaterial}; /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm/lib/three-vrm.cjs b/packages/three-vrm/lib/three-vrm.cjs index f28cf152c..53d36a089 100644 --- a/packages/three-vrm/lib/three-vrm.cjs +++ b/packages/three-vrm/lib/three-vrm.cjs @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm v3.2.0 + * @pixiv/three-vrm v3.3.0 * VRM file loader for three.js. * * Copyright (c) 2019-2024 pixiv Inc. @@ -165,6 +165,12 @@ var VRMExpression = class extends THREE.Object3D { this.type = "VRMExpression"; this.visible = false; } + /** + * Binds that this expression influences. + */ + get binds() { + return this._binds; + } /** * A value represents how much it should override blink expressions. * `0.0` == no override at all, `1.0` == completely block the expressions. @@ -213,9 +219,25 @@ var VRMExpression = class extends THREE.Object3D { } return this.weight; } + /** + * Add an expression bind to the expression. + * + * @param bind A bind to add + */ addBind(bind) { this._binds.push(bind); } + /** + * Delete an expression bind from the expression. + * + * @param bind A bind to delete + */ + deleteBind(bind) { + const index = this._binds.indexOf(bind); + if (index >= 0) { + this._binds.splice(index, 1); + } + } /** * Apply weight to every assigned blend shapes. * Should be called every frame. @@ -4857,8 +4879,8 @@ var THREE92 = __toESM(require("three"), 1); var THREE82 = __toESM(require("three"), 1); var THREE102 = __toESM(require("three"), 1); var THREE132 = __toESM(require("three"), 1); -var THREE112 = __toESM(require("three"), 1); var THREE122 = __toESM(require("three"), 1); +var THREE112 = __toESM(require("three"), 1); var THREE142 = __toESM(require("three"), 1); var __async7 = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { @@ -4897,8 +4919,8 @@ var VRMSpringBoneColliderShapeCapsule = class extends VRMSpringBoneColliderShape this.inside = (_d = params == null ? void 0 : params.inside) != null ? _d : false; } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - _v3A7.copy(this.offset).applyMatrix4(colliderMatrix); - _v3B5.copy(this.tail).applyMatrix4(colliderMatrix); + _v3A7.setFromMatrixPosition(colliderMatrix); + _v3B5.subVectors(this.tail, this.offset).applyMatrix4(colliderMatrix); _v3B5.sub(_v3A7); const lengthSqCapsule = _v3B5.lengthSq(); target.copy(objectPosition).sub(_v3A7); @@ -4910,10 +4932,13 @@ var VRMSpringBoneColliderShapeCapsule = class extends VRMSpringBoneColliderShape _v3B5.multiplyScalar(dot / lengthSqCapsule); target.sub(_v3B5); } - const distance = this.inside ? this.radius - objectRadius - target.length() : target.length() - objectRadius - this.radius; - target.normalize(); - if (this.inside) { - target.negate(); + const length = target.length(); + const distance = this.inside ? this.radius - objectRadius - length : length - objectRadius - this.radius; + if (distance < 0) { + target.multiplyScalar(1 / length); + if (this.inside) { + target.negate(); + } } return distance; } @@ -4931,7 +4956,7 @@ var VRMSpringBoneColliderShapePlane = class extends VRMSpringBoneColliderShape { this.normal = (_b = params == null ? void 0 : params.normal) != null ? _b : new THREE24.Vector3(0, 0, 1); } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - target.copy(this.offset).applyMatrix4(colliderMatrix); + target.setFromMatrixPosition(colliderMatrix); target.negate().add(objectPosition); _mat3A.getNormalMatrix(colliderMatrix); _v3A23.copy(this.normal).applyNormalMatrix(_mat3A).normalize(); @@ -4940,6 +4965,7 @@ var VRMSpringBoneColliderShapePlane = class extends VRMSpringBoneColliderShape { return distance; } }; +var _v3A33 = new THREE34.Vector3(); var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape { get type() { return "sphere"; @@ -4952,17 +4978,19 @@ var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape this.inside = (_c = params == null ? void 0 : params.inside) != null ? _c : false; } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - target.copy(this.offset).applyMatrix4(colliderMatrix); - target.negate().add(objectPosition); - const distance = this.inside ? this.radius - objectRadius - target.length() : target.length() - objectRadius - this.radius; - target.normalize(); - if (this.inside) { - target.negate(); + target.subVectors(objectPosition, _v3A33.setFromMatrixPosition(colliderMatrix)); + const length = target.length(); + const distance = this.inside ? this.radius - objectRadius - length : length - objectRadius - this.radius; + if (distance < 0) { + target.multiplyScalar(1 / length); + if (this.inside) { + target.negate(); + } } return distance; } }; -var _v3A33 = new THREE44.Vector3(); +var _v3A43 = new THREE44.Vector3(); var ColliderShapeCapsuleBufferGeometry = class extends THREE44.BufferGeometry { constructor(shape) { super(); @@ -4989,7 +5017,7 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE44.BufferGeometry { this._currentOffset.copy(this._shape.offset); shouldUpdateGeometry = true; } - const tail = _v3A33.copy(this._shape.tail).divideScalar(this.worldScale); + const tail = _v3A43.copy(this._shape.tail).divideScalar(this.worldScale); if (this._currentTail.distanceToSquared(tail) > 1e-10) { this._currentTail.copy(tail); shouldUpdateGeometry = true; @@ -4999,8 +5027,8 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE44.BufferGeometry { } } _buildPosition() { - _v3A33.copy(this._currentTail).sub(this._currentOffset); - const l = _v3A33.length() / this._currentRadius; + _v3A43.copy(this._currentTail).sub(this._currentOffset); + const l = _v3A43.length() / this._currentRadius; for (let i = 0; i <= 16; i++) { const t = i / 16 * Math.PI; this._attrPos.setXYZ(i, -Math.sin(t), -Math.cos(t), 0); @@ -5013,8 +5041,8 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE44.BufferGeometry { this._attrPos.setXYZ(68 + i, 0, Math.sin(t), Math.cos(t)); this._attrPos.setXYZ(100 + i, l, Math.sin(t), Math.cos(t)); } - const theta = Math.atan2(_v3A33.y, Math.sqrt(_v3A33.x * _v3A33.x + _v3A33.z * _v3A33.z)); - const phi = -Math.atan2(_v3A33.z, _v3A33.x); + const theta = Math.atan2(_v3A43.y, Math.sqrt(_v3A43.x * _v3A43.x + _v3A43.z * _v3A43.z)); + const phi = -Math.atan2(_v3A43.z, _v3A43.x); this.rotateZ(theta); this.rotateY(phi); this.scale(this._currentRadius, this._currentRadius, this._currentRadius); @@ -5133,7 +5161,7 @@ var ColliderShapeSphereBufferGeometry = class extends THREE62.BufferGeometry { this._attrIndex.needsUpdate = true; } }; -var _v3A43 = new THREE72.Vector3(); +var _v3A52 = new THREE72.Vector3(); var VRMSpringBoneColliderHelper = class extends THREE72.Group { constructor(collider) { super(); @@ -5163,7 +5191,7 @@ var VRMSpringBoneColliderHelper = class extends THREE72.Group { this.collider.updateWorldMatrix(true, false); this.matrix.copy(this.collider.matrixWorld); const matrixWorldElements = this.matrix.elements; - this._geometry.worldScale = _v3A43.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); + this._geometry.worldScale = _v3A52.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); this._geometry.update(); super.updateMatrixWorld(force); } @@ -5221,7 +5249,7 @@ var SpringBoneBufferGeometry = class extends THREE82.BufferGeometry { this._attrIndex.needsUpdate = true; } }; -var _v3A52 = new THREE92.Vector3(); +var _v3A62 = new THREE92.Vector3(); var VRMSpringBoneJointHelper = class extends THREE92.Group { constructor(springBone) { super(); @@ -5243,7 +5271,7 @@ var VRMSpringBoneJointHelper = class extends THREE92.Group { this.springBone.bone.updateWorldMatrix(true, false); this.matrix.copy(this.springBone.bone.matrixWorld); const matrixWorldElements = this.matrix.elements; - this._geometry.worldScale = _v3A52.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); + this._geometry.worldScale = _v3A62.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); this._geometry.update(); super.updateMatrixWorld(force); } @@ -5251,9 +5279,23 @@ var VRMSpringBoneJointHelper = class extends THREE92.Group { var VRMSpringBoneCollider = class extends THREE102.Object3D { constructor(shape) { super(); + this.colliderMatrix = new THREE102.Matrix4(); this.shape = shape; } + updateWorldMatrix(updateParents, updateChildren) { + super.updateWorldMatrix(updateParents, updateChildren); + updateColliderMatrix(this.colliderMatrix, this.matrixWorld, this.shape.offset); + } }; +function updateColliderMatrix(colliderMatrix, matrixWorld, offset) { + const me = matrixWorld.elements; + colliderMatrix.copy(matrixWorld); + if (offset) { + colliderMatrix.elements[12] = me[0] * offset.x + me[4] * offset.y + me[8] * offset.z + me[12]; + colliderMatrix.elements[13] = me[1] * offset.x + me[5] * offset.y + me[9] * offset.z + me[13]; + colliderMatrix.elements[14] = me[2] * offset.x + me[6] * offset.y + me[10] * offset.z + me[14]; + } +} var _matA = new THREE112.Matrix4(); function mat4InvertCompat(target) { if (target.invert) { @@ -5295,15 +5337,11 @@ var Matrix4InverseCache = class { } }; var IDENTITY_MATRIX4 = new THREE132.Matrix4(); -var _v3A62 = new THREE132.Vector3(); +var _v3A72 = new THREE132.Vector3(); var _v3B23 = new THREE132.Vector3(); -var _v3C3 = new THREE132.Vector3(); var _worldSpacePosition = new THREE132.Vector3(); -var _centerSpacePosition = new THREE132.Vector3(); var _nextTail = new THREE132.Vector3(); -var _quatA8 = new THREE132.Quaternion(); var _matA2 = new THREE132.Matrix4(); -var _matB = new THREE132.Matrix4(); var VRMSpringBoneJoint = class { /** * Create a new VRMSpringBone. @@ -5335,6 +5373,22 @@ var VRMSpringBoneJoint = class { }; this.colliderGroups = colliderGroups; } + /** + * Set of dependencies that need to be updated before this joint. + */ + get dependencies() { + const set = /* @__PURE__ */ new Set(); + const parent = this.bone.parent; + if (parent) { + set.add(parent); + } + for (let cg = 0; cg < this.colliderGroups.length; cg++) { + for (let c = 0; c < this.colliderGroups[cg].colliders.length; c++) { + set.add(this.colliderGroups[cg].colliders[c]); + } + } + return set; + } get center() { return this._center; } @@ -5373,7 +5427,7 @@ var VRMSpringBoneJoint = class { } else { this._initialLocalChildPosition.copy(this.bone.position).normalize().multiplyScalar(0.07); } - const matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); + const matrixWorldToCenter = this._getMatrixWorldToCenter(); this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(matrixWorldToCenter); this._prevTail.copy(this._currentTail); this._boneAxis.copy(this._initialLocalChildPosition).normalize(); @@ -5386,7 +5440,7 @@ var VRMSpringBoneJoint = class { this.bone.quaternion.copy(this._initialLocalRotation); this.bone.updateMatrix(); this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld, this.bone.matrix); - const matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); + const matrixWorldToCenter = this._getMatrixWorldToCenter(); this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(matrixWorldToCenter); this._prevTail.copy(this._currentTail); } @@ -5399,30 +5453,15 @@ var VRMSpringBoneJoint = class { update(delta) { if (delta <= 0) return; this._calcWorldSpaceBoneLength(); + const worldSpaceBoneAxis = _v3B23.copy(this._boneAxis).transformDirection(this._initialLocalMatrix).transformDirection(this._parentMatrixWorld); + _nextTail.copy(this._currentTail).add(_v3A72.subVectors(this._currentTail, this._prevTail).multiplyScalar(1 - this.settings.dragForce)).applyMatrix4(this._getMatrixCenterToWorld()).addScaledVector(worldSpaceBoneAxis, this.settings.stiffness * delta).addScaledVector(this.settings.gravityDir, this.settings.gravityPower * delta); _worldSpacePosition.setFromMatrixPosition(this.bone.matrixWorld); - let matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); - _centerSpacePosition.copy(_worldSpacePosition).applyMatrix4(matrixWorldToCenter); - const quatWorldToCenter = _quatA8.setFromRotationMatrix(matrixWorldToCenter); - const centerSpaceParentMatrix = _matB.copy(matrixWorldToCenter).multiply(this._parentMatrixWorld); - const centerSpaceBoneAxis = _v3B23.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(centerSpaceParentMatrix).sub(_centerSpacePosition).normalize(); - const centerSpaceGravity = _v3C3.copy(this.settings.gravityDir).applyQuaternion(quatWorldToCenter).normalize(); - const matrixCenterToWorld = this._getMatrixCenterToWorld(_matA2); - _nextTail.copy(this._currentTail).add( - _v3A62.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1 - this.settings.dragForce) - ).add(_v3A62.copy(centerSpaceBoneAxis).multiplyScalar(this.settings.stiffness * delta)).add(_v3A62.copy(centerSpaceGravity).multiplyScalar(this.settings.gravityPower * delta)).applyMatrix4(matrixCenterToWorld); _nextTail.sub(_worldSpacePosition).normalize().multiplyScalar(this._worldSpaceBoneLength).add(_worldSpacePosition); this._collision(_nextTail); - matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); this._prevTail.copy(this._currentTail); - this._currentTail.copy(_v3A62.copy(_nextTail).applyMatrix4(matrixWorldToCenter)); - const worldSpaceInitialMatrixInv = mat4InvertCompat( - _matA2.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix) - ); - const applyRotation = _quatA8.setFromUnitVectors( - this._boneAxis, - _v3A62.copy(_nextTail).applyMatrix4(worldSpaceInitialMatrixInv).normalize() - ); - this.bone.quaternion.copy(this._initialLocalRotation).multiply(applyRotation); + this._currentTail.copy(_nextTail).applyMatrix4(this._getMatrixWorldToCenter()); + const worldSpaceInitialMatrixInv = _matA2.multiplyMatrices(this._parentMatrixWorld, this._initialLocalMatrix).invert(); + this.bone.quaternion.setFromUnitVectors(this._boneAxis, _v3A72.copy(_nextTail).applyMatrix4(worldSpaceInitialMatrixInv).normalize()).premultiply(this._initialLocalRotation); this.bone.updateMatrix(); this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld, this.bone.matrix); } @@ -5432,53 +5471,44 @@ var VRMSpringBoneJoint = class { * @param tail The tail you want to process */ _collision(tail) { - this.colliderGroups.forEach((colliderGroup) => { - colliderGroup.colliders.forEach((collider) => { - const dist = collider.shape.calculateCollision(collider.matrixWorld, tail, this.settings.hitRadius, _v3A62); + for (let cg = 0; cg < this.colliderGroups.length; cg++) { + for (let c = 0; c < this.colliderGroups[cg].colliders.length; c++) { + const collider = this.colliderGroups[cg].colliders[c]; + const dist = collider.shape.calculateCollision(collider.colliderMatrix, tail, this.settings.hitRadius, _v3A72); if (dist < 0) { - tail.add(_v3A62.multiplyScalar(-dist)); - tail.sub(_worldSpacePosition).normalize().multiplyScalar(this._worldSpaceBoneLength).add(_worldSpacePosition); + tail.addScaledVector(_v3A72, -dist); + tail.sub(_worldSpacePosition); + const length = tail.length(); + tail.multiplyScalar(this._worldSpaceBoneLength / length).add(_worldSpacePosition); } - }); - }); + } + } } /** * Calculate the {@link _worldSpaceBoneLength}. * Intended to be used in {@link update}. */ _calcWorldSpaceBoneLength() { - _v3A62.setFromMatrixPosition(this.bone.matrixWorld); + _v3A72.setFromMatrixPosition(this.bone.matrixWorld); if (this.child) { _v3B23.setFromMatrixPosition(this.child.matrixWorld); } else { _v3B23.copy(this._initialLocalChildPosition); _v3B23.applyMatrix4(this.bone.matrixWorld); } - this._worldSpaceBoneLength = _v3A62.sub(_v3B23).length(); + this._worldSpaceBoneLength = _v3A72.sub(_v3B23).length(); } /** * Create a matrix that converts center space into world space. - * @param target Target matrix */ - _getMatrixCenterToWorld(target) { - if (this._center) { - target.copy(this._center.matrixWorld); - } else { - target.identity(); - } - return target; + _getMatrixCenterToWorld() { + return this._center ? this._center.matrixWorld : IDENTITY_MATRIX4; } /** * Create a matrix that converts world space into center space. - * @param target Target matrix */ - _getMatrixWorldToCenter(target) { - if (this._center) { - target.copy(this._center.userData.inverseCacheProxy.inverse); - } else { - target.identity(); - } - return target; + _getMatrixWorldToCenter() { + return this._center ? this._center.userData.inverseCacheProxy.inverse : IDENTITY_MATRIX4; } }; function traverseAncestorsFromRoot2(object, callback) { @@ -5500,11 +5530,30 @@ function traverseChildrenUntilConditionMet(object, callback) { } }); } +function lowestCommonAncestor(objects) { + var _a; + const sharedAncestors = /* @__PURE__ */ new Map(); + for (const object of objects) { + let current = object; + do { + const newValue = ((_a = sharedAncestors.get(current)) != null ? _a : 0) + 1; + if (newValue === objects.size) { + return current; + } + sharedAncestors.set(current, newValue); + current = current.parent; + } while (current !== null); + } + return null; +} var VRMSpringBoneManager = class { constructor() { this._joints = /* @__PURE__ */ new Set(); + this._sortedJoints = []; this._hasWarnedCircularDependency = false; + this._ancestors = []; this._objectSpringBonesMap = /* @__PURE__ */ new Map(); + this._relevantChildrenUpdated = this._relevantChildrenUpdated.bind(this); } get joints() { return this._joints; @@ -5542,6 +5591,7 @@ var VRMSpringBoneManager = class { this._objectSpringBonesMap.set(joint.bone, objectSet); } objectSet.add(joint); + this._sortJoints(); } /** * @deprecated Use {@link addJoint} instead. @@ -5554,6 +5604,7 @@ var VRMSpringBoneManager = class { this._joints.delete(joint); const objectSet = this._objectSpringBonesMap.get(joint.bone); objectSet.delete(joint); + this._sortJoints(); } /** * @deprecated Use {@link deleteJoint} instead. @@ -5563,117 +5614,99 @@ var VRMSpringBoneManager = class { this.deleteJoint(joint); } setInitState() { - const springBonesTried = /* @__PURE__ */ new Set(); - const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); - for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.setInitState() - ); + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.setInitState(); } } reset() { - const springBonesTried = /* @__PURE__ */ new Set(); - const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); - for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.reset() - ); + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.reset(); } } update(delta) { + for (let i = 0; i < this._ancestors.length; i++) { + this._ancestors[i].updateWorldMatrix(i === 0, false); + } + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.update(delta); + traverseChildrenUntilConditionMet(springBone.bone, this._relevantChildrenUpdated); + } + } + /** + * Sorts the joints ensuring they are updated in the correct order taking dependencies into account. + */ + _sortJoints() { + const springBoneOrder = []; const springBonesTried = /* @__PURE__ */ new Set(); const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); + const ancestors = /* @__PURE__ */ new Set(); for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.update(delta) - ); - traverseChildrenUntilConditionMet(springBone.bone, (object) => { + this._insertJointSort(springBone, springBonesTried, springBonesDone, springBoneOrder, ancestors); + } + this._sortedJoints = springBoneOrder; + const lca = lowestCommonAncestor(ancestors); + this._ancestors = []; + if (lca) { + this._ancestors.push(lca); + traverseChildrenUntilConditionMet(lca, (object) => { var _a, _b; if (((_b = (_a = this._objectSpringBonesMap.get(object)) == null ? void 0 : _a.size) != null ? _b : 0) > 0) { return true; } - object.updateWorldMatrix(false, false); + this._ancestors.push(object); return false; }); } } - /** - * Update a spring bone. - * If there are other spring bone that are dependant, it will try to update them recursively. - * It updates matrixWorld of all ancestors and myself. - * It might log an warning message if there are any circular dependencies. - * - * Intended to be used in {@link update} and {@link _processSpringBone} itself recursively. - * - * @param springBone A springBone you want to update - * @param springBonesTried Set of springBones that are already tried to be updated - * @param springBonesDone Set of springBones that are already up to date - * @param objectUpdated Set of object3D whose matrixWorld is updated - */ - _processSpringBone(springBone, springBonesTried, springBonesDone, objectUpdated, callback) { + _insertJointSort(springBone, springBonesTried, springBonesDone, springBoneOrder, ancestors) { if (springBonesDone.has(springBone)) { return; } if (springBonesTried.has(springBone)) { if (!this._hasWarnedCircularDependency) { - console.warn("VRMSpringBoneManager: Circular dependency detected while updating springbones"); + console.warn("VRMSpringBoneManager: Circular dependency detected"); this._hasWarnedCircularDependency = true; } return; } - springBonesTried.add(springBone); - const depObjects = this._getDependencies(springBone); + const depObjects = springBone.dependencies; for (const depObject of depObjects) { + let encounteredSpringBone = false; + let ancestor = null; traverseAncestorsFromRoot2(depObject, (depObjectAncestor) => { const objectSet = this._objectSpringBonesMap.get(depObjectAncestor); if (objectSet) { for (const depSpringBone of objectSet) { - this._processSpringBone(depSpringBone, springBonesTried, springBonesDone, objectUpdated, callback); + encounteredSpringBone = true; + this._insertJointSort(depSpringBone, springBonesTried, springBonesDone, springBoneOrder, ancestors); } - } else if (!objectUpdated.has(depObjectAncestor)) { - depObjectAncestor.updateWorldMatrix(false, false); - objectUpdated.add(depObjectAncestor); + } else if (!encounteredSpringBone) { + ancestor = depObjectAncestor; } }); + if (ancestor) { + ancestors.add(ancestor); + } } - springBone.bone.updateMatrix(); - springBone.bone.updateWorldMatrix(false, false); - callback(springBone); - objectUpdated.add(springBone.bone); + springBoneOrder.push(springBone); springBonesDone.add(springBone); } - /** - * Return a set of objects that are dependant of given spring bone. - * @param springBone A spring bone - * @return A set of objects that are dependant of given spring bone - */ - _getDependencies(springBone) { - const set = /* @__PURE__ */ new Set(); - const parent = springBone.bone.parent; - if (parent) { - set.add(parent); + _relevantChildrenUpdated(object) { + var _a, _b; + if (((_b = (_a = this._objectSpringBonesMap.get(object)) == null ? void 0 : _a.size) != null ? _b : 0) > 0) { + return true; } - springBone.colliderGroups.forEach((colliderGroup) => { - colliderGroup.colliders.forEach((collider) => { - set.add(collider); - }); - }); - return set; + object.updateWorldMatrix(false, false); + return false; } }; var EXTENSION_NAME_EXTENDED_COLLIDER = "VRMC_springBone_extended_collider"; @@ -6064,8 +6097,122 @@ var VRMLoaderPlugin = class { } }; -// src/VRMUtils/combineSkeletons.ts +// src/VRMUtils/combineMorphs.ts var THREE21 = __toESM(require("three"), 1); +function collectMeshes(scene) { + const meshes = /* @__PURE__ */ new Set(); + scene.traverse((obj) => { + if (!obj.isMesh) { + return; + } + const mesh = obj; + meshes.add(mesh); + }); + return meshes; +} +function combineMorph(positionAttributes, binds, morphTargetsRelative) { + const newArray = new Float32Array(positionAttributes[0].count * 3); + let weightSum = 0; + if (morphTargetsRelative) { + weightSum = 1; + } else { + for (const bind of binds) { + weightSum += bind.weight; + } + } + for (const bind of binds) { + const src = positionAttributes[bind.index]; + const weight = bind.weight / weightSum; + for (let i = 0; i < src.count; i++) { + newArray[i * 3 + 0] += src.getX(i) * weight; + newArray[i * 3 + 1] += src.getY(i) * weight; + newArray[i * 3 + 2] += src.getZ(i) * weight; + } + } + const newAttribute = new THREE21.BufferAttribute(newArray, 3); + return newAttribute; +} +function combineMorphs(vrm) { + var _a; + const meshes = collectMeshes(vrm.scene); + const meshNameBindSetMapMap = /* @__PURE__ */ new Map(); + const expressionMap = (_a = vrm.expressionManager) == null ? void 0 : _a.expressionMap; + if (expressionMap != null) { + for (const [expressionName, expression] of Object.entries(expressionMap)) { + const bindsToDeleteSet = /* @__PURE__ */ new Set(); + for (const bind of expression.binds) { + if (bind instanceof VRMExpressionMorphTargetBind) { + if (bind.weight !== 0) { + for (const mesh of bind.primitives) { + let nameBindSetMap = meshNameBindSetMapMap.get(mesh); + if (nameBindSetMap == null) { + nameBindSetMap = /* @__PURE__ */ new Map(); + meshNameBindSetMapMap.set(mesh, nameBindSetMap); + } + let bindSet = nameBindSetMap.get(expressionName); + if (bindSet == null) { + bindSet = /* @__PURE__ */ new Set(); + nameBindSetMap.set(expressionName, bindSet); + } + bindSet.add(bind); + } + } + bindsToDeleteSet.add(bind); + } + } + for (const bind of bindsToDeleteSet) { + expression.deleteBind(bind); + } + } + } + for (const mesh of meshes) { + const nameBindSetMap = meshNameBindSetMapMap.get(mesh); + if (nameBindSetMap == null) { + continue; + } + const geometry = mesh.geometry.clone(); + mesh.geometry = geometry; + const morphTargetsRelative = geometry.morphTargetsRelative; + const hasPMorph = geometry.morphAttributes.position != null; + const hasNMorph = geometry.morphAttributes.normal != null; + const morphAttributes = {}; + const morphTargetDictionary = {}; + const morphTargetInfluences = []; + if (hasPMorph || hasNMorph) { + if (hasPMorph) { + morphAttributes.position = []; + } + if (hasNMorph) { + morphAttributes.normal = []; + } + let i = 0; + for (const [name, bindSet] of nameBindSetMap) { + if (hasPMorph) { + morphAttributes.position[i] = combineMorph(geometry.morphAttributes.position, bindSet, morphTargetsRelative); + } + if (hasNMorph) { + morphAttributes.normal[i] = combineMorph(geometry.morphAttributes.normal, bindSet, morphTargetsRelative); + } + expressionMap == null ? void 0 : expressionMap[name].addBind( + new VRMExpressionMorphTargetBind({ + index: i, + weight: 1, + primitives: [mesh] + }) + ); + morphTargetDictionary[name] = i; + morphTargetInfluences.push(0); + i++; + } + } + geometry.morphAttributes = morphAttributes; + mesh.morphTargetDictionary = morphTargetDictionary; + mesh.morphTargetInfluences = morphTargetInfluences; + } +} + +// src/VRMUtils/combineSkeletons.ts +var THREE25 = __toESM(require("three"), 1); function combineSkeletons(root) { const skinnedMeshes = /* @__PURE__ */ new Set(); const geometryToSkinnedMesh = /* @__PURE__ */ new Map(); @@ -6113,8 +6260,8 @@ function combineSkeletons(root) { attribute.needsUpdate = true; }); for (const { bones, boneInverses, meshes } of newSkeletons) { - const newSkeleton = new THREE21.Skeleton(bones, boneInverses); - meshes.forEach((mesh) => mesh.bind(newSkeleton, new THREE21.Matrix4())); + const newSkeleton = new THREE25.Skeleton(bones, boneInverses); + meshes.forEach((mesh) => mesh.bind(newSkeleton, new THREE25.Matrix4())); } } function skeletonMatches(skeleton, candidate) { @@ -6185,7 +6332,7 @@ function deepDispose(object3D) { } // src/VRMUtils/removeUnnecessaryJoints.ts -var THREE25 = __toESM(require("three"), 1); +var THREE26 = __toESM(require("three"), 1); function removeUnnecessaryJoints(root, options) { var _a; console.warn( @@ -6230,13 +6377,13 @@ function removeUnnecessaryJoints(root, options) { boneInverses[i] = boneInverses[0]; } } - const skeleton = new THREE25.Skeleton(bones, boneInverses); - mesh.bind(skeleton, new THREE25.Matrix4()); + const skeleton = new THREE26.Skeleton(bones, boneInverses); + mesh.bind(skeleton, new THREE26.Matrix4()); } } // src/VRMUtils/removeUnnecessaryVertices.ts -var THREE26 = __toESM(require("three"), 1); +var THREE27 = __toESM(require("three"), 1); var import_three = require("three"); function removeUnnecessaryVertices(root) { const geometryMap = /* @__PURE__ */ new Map(); @@ -6280,7 +6427,7 @@ function removeUnnecessaryVertices(root) { newIndexOriginalIndexMap[newIndex] = i; } } - const newGeometry = new THREE26.BufferGeometry(); + const newGeometry = new THREE27.BufferGeometry(); newGeometry.name = geometry.name; newGeometry.morphTargetsRelative = geometry.morphTargetsRelative; geometry.groups.forEach((group) => { @@ -6368,13 +6515,14 @@ var VRMUtils = class { constructor() { } }; +VRMUtils.combineMorphs = combineMorphs; VRMUtils.combineSkeletons = combineSkeletons; VRMUtils.deepDispose = deepDispose; VRMUtils.removeUnnecessaryJoints = removeUnnecessaryJoints; VRMUtils.removeUnnecessaryVertices = removeUnnecessaryVertices; VRMUtils.rotateVRM0 = rotateVRM0; /*! - * @pixiv/three-vrm-core v3.2.0 + * @pixiv/three-vrm-core v3.3.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6382,7 +6530,7 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6390,7 +6538,7 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.0 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.3.0 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6398,7 +6546,7 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-v0compat v3.2.0 + * @pixiv/three-vrm-materials-v0compat v3.3.0 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6406,7 +6554,7 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-node-constraint v3.2.0 + * @pixiv/three-vrm-node-constraint v3.3.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6414,11 +6562,11 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-springbone v3.2.0 + * @pixiv/three-vrm-springbone v3.3.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. * @pixiv/three-vrm-springbone is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy91dGlscy9nbHRmRXh0cmFjdFByaW1pdGl2ZXNGcm9tTm9kZS50cyIsICIuLi8uLi90aHJlZS12cm0tY29yZS9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvblByZXNldE5hbWUudHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL3V0aWxzL3NhdHVyYXRlLnRzIiwgIi4uLy4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ubm9kZSA9PT0gdW5kZWZpbmVkIHx8IGJpbmQuaW5kZXggPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnN0IHByaW1pdGl2ZXMgPSAoYXdhaXQgZ2x0ZkV4dHJhY3RQcmltaXRpdmVzRnJvbU5vZGUoZ2x0ZiwgYmluZC5ub2RlKSkhO1xuICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIG1lc2ggaGFzIHRoZSB0YXJnZXQgbW9ycGggdGFyZ2V0XG4gICAgICAgICAgaWYgKFxuICAgICAgICAgICAgIXByaW1pdGl2ZXMuZXZlcnkoXG4gICAgICAgICAgICAgIChwcmltaXRpdmUpID0+XG4gICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzKSAmJlxuICAgICAgICAgICAgICAgIG1vcnBoVGFyZ2V0SW5kZXggPCBwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzLmxlbmd0aCxcbiAgICAgICAgICAgIClcbiAgICAgICAgICApIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46ICR7c2NoZW1hRXhwcmVzc2lvbi5uYW1lfSBhdHRlbXB0cyB0byBpbmRleCBtb3JwaCAjJHttb3JwaFRhcmdldEluZGV4fSBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgcHJpbWl0aX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HM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIG9mZnNldDogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5vZmZzZXQgPz8gWzAuMCwgMC4wXSksXG4gICAgICAgICAgICAgICAgICBzY2FsZTogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5zY2FsZSA/PyBbMS4wLCAxLjBdKSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1hbmFnZXI7XG4gIH1cblxuICBwcml2YXRlIGFzeW5jIF92MEltcG9ydChnbHRmOiBHTFRGKTogUHJvbWlzZTxWUk1FeHByZXNzaW9uTWFuYWdlciB8IG51bGw+IHtcbiAgICBjb25zdCBqc29uID0gdGhpcy5wYXJzZXIuanNvbiBhcyBHTFRGU2NoZW1hLklHTFRGO1xuXG4gICAgLy8gZWFybHkgYWJvcnQgaWYgaXQgZG9lc24ndCB1c2UgdnJtXG4gICAgY29uc3QgdnJtRXh0ID0ganNvbi5leHRlbnNpb25zPy5WUk0gYXMgVjBWUk0uVlJNIHwgdW5kZWZpbmVkO1xuICAgIGlmICgh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4gICAgICAgICAgICBjb25zdCBub2Rlc1VzaW5nTWVzaDogbnVtYmVyW10gPSBbXTtcbiAgICAgICAgICAgIGpzb24ubm9kZXM/LmZvckVhY2goKG5vZGUsIGkpID0+IHtcbiAgICAgICAgICAgICAgaWYgKG5vZGUubWVzaCA9PT0gYmluZC5tZXNoKSB7XG4gICAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gucHVzaChpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gubWFwKGFzeW5jIChub2RlSW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwcmltaXRpdmVzID0gKGF3YWl0IGdsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlKGdsdGYsIG5vZGVJbmRleCkpITtcblxuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUdyb3VwLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4ICR7bW9ycGhUYXJnZXRJbmRleH10aCBtb3JwaCBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIHdlaWdodDogMC4wMSAqIChiaW5kLndlaWdodCA/PyAxMDApLCAvLyBuYXJyb3dpbmcgdGhlIHJhbmdlIGZyb20gWyAwLjAgLSAxMDAuMCBdIHRvIFsgMC4wIC0gMS4wIF1cbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEJpbmQgTWF0ZXJpYWxDb2xvciBhbmQgVGV4dHVyZVRyYW5zZm9ybVxuICAgICAgICBjb25zdCBtYXRlcmlhbFZhbHVlcyA9IHNjaGVtYUdyb3VwLm1hdGVyaWFsVmFsdWVzO1xuICAgICAgICBpZiAobWF0ZXJpYWxWYWx1ZXMgJiYgbWF0ZXJpYWxWYWx1ZXMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgbWF0ZXJpYWxWYWx1ZXMuZm9yRWFjaCgobWF0ZXJpYWxWYWx1ZSkgPT4ge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICBtYXRlcm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UzMDhCXHUzMDAyXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsczogVEhSRUUuTWF0ZXJpYWxbXSA9IFtdO1xuICAgICAgICAgICAgZ2x0Zi5zY2VuZS50cmF2ZXJzZSgob2JqZWN0KSA9PiB7XG4gICAgICAgICAgICAgIGlmICgob2JqZWN0IGFzIGFueSkubWF0ZXJpYWwpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbDogVEhSRUUuTWF0ZXJpYWxbXSB8IFRIUkVFLk1hdGVyaWFsID0gKG9iamVjdCBhcyBhbnkpLm1hdGVyaWFsO1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG1hdGVyaWFsKSkge1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hdGVyaWFsLmZpbHRlcihcbiAgICAgICAgICAgICAgICAgICAgICAobXRsKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgKG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISArICcgKE91dGxpbmUpJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5pbmRleE9mKG10bCkgPT09IC0xLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGVyaWFsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lICYmIG1hdGVyaWFscy5pbmRleE9mKG1hdGVyaWFsKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5wdXNoKG1hdGVyaWFsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbFByb3BlcnR5TmFtZSA9IG1hdGVyaWFsVmFsdWUucHJvcGVydHlOYW1lO1xuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIC8vIFRleHR1cmVUcmFuc2Zvcm1CaW5kXG4gICAgICAgICAgICAgIGlmIChtYXRlcmlhbFByb3BlcnR5TmFtZSA9PT0gJ19NYWluVGV4X1NUJykge1xuICAgICAgICAgICAgICAgIGNvbnN0IHNjYWxlID0gbmV3IFRIUkVFLlZlY3RvcjIobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMF0sIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzFdKTtcbiAgICAgICAgICAgICAgICBjb25zdCBvZmZzZXQgPSBuZXcgVEhSRUUuVmVjdG9yMihtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVsyXSwgbWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbM10pO1xuXG4gICAgICAgICAgICAgICAgb2Zmc2V0LnkgPSAxLjAgLSBvZmZzZXQueSAtIHNjYWxlLnk7XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHNjYWxlLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gTWF0ZXJpYWxDb2xvckJpbmRcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxDb2xvclR5cGUgPSB2MEV4cHJlc3Npb25NYXRlcmlhbENvbG9yTWFwW21hdGVyaWFsUHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsQ29sb3JUeXBlKSB7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBtYXRlcmlhbENvbG9yVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlISksXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjb25zb2xlLndhcm4obWF0ZXJpYWxQcm9wZXJ0eU5hbWUgKyAnIGlzIG5vdCBzdXBwb3J0ZWQnKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1hbmFnZXI7XG4gIH1cbn1cbiIsICJpbXBvcnQgdHlwZSAqIGFzIFRIUkVFIGZyb20gJ3RocmVlJztcbmltcG9ydCB0eXBlIHsgR0xURiB9IGZyb20gJ3RocmVlL2V4YW1wbGVzL2pzbS9sb2FkZ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cbiAgICBjb25zdCBza2luSW5kZXggPSBbXTtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHNraW5JbmRleEF0dHJBcnJheS5sZW5ndGg7IGkgKz0gNCkge1xuICAgICAgc2tpbkluZGV4LnB1c2goW1xuICAgICAgICBza2luSW5kZXhBdHRyQXJyYXlbaV0sXG4gICAgICAgIHNraW5JbmRleEF0dHJBcnJheVtpICsgMV0sXG4gICAgICAgIHNraW5JbmRleEF0dHJBcnJheVtpICsgMl0sXG4gICAgICAgIHNraW5JbmRleEF0dHJBcnJheVtpICsgM10sXG4gICAgICBdKTtcbiAgICB9XG5cbiAgICBjb25zdCBza2luV2VpZ2h0QXR0ciA9IGdlb21ldHJ5LmdldEF0dHJpYnV0ZSgnc2tpbldlaWdodCcpO1xuICAgIGNvbnN0IHNraW5XZWlnaHRBdHRyQXJyYXkgPSBza2luV2VpZ2h0QXR0ciBpbnN0YW5jZW9mIFRIUkVFLkdMQnVmZmVyQXR0cmlidXRlID8gW10gOiBza2luV2VpZ2h0QXR0ci5hcnJheTtcbiAgICBjb25zdCBza2luV2VpZ2h0ID0gW107XG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBza2luV2VpZ2h0QXR0ckFycmF5Lmxlbmd0aDsgaSArPSA0KSB7XG4gICAgICBza2luV2VpZ2h0LnB1c2goW1xuICAgICAgICBza2luV2VpZ2h0QXR0ckFycmF5W2ldLFxuICAgICAgICBza2luV2VpZ2h0QXR0ckFycmF5W2kgKyAxXSxcbiAgICAgICAgc2tpbldlaWdodEF0dHJBcnJheVtpICsgMl0sXG4gICAgICAgIHNraW5XZWlnaHRBdHRyQXJyYXlbaSArIDNdLFxuICAgICAgXSk7XG4gICAgfVxuXG4gICAgY29uc3QgaW5kZXggPSBnZW9tZXRyeS5nZXRJbmRleCgpO1xuICAgIGlmICghaW5kZXgpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcihcIlRoZSBnZW9tZXRyeSBkb2Vzbid0IGhhdmUgYW4gaW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bDtcbiAgICB9XG5cbiAgICBjb25zdCBzY2hlbWFIdW1hbm9pZDogVjBWUk0uSHVtYW5vaWQgfCB1bmRlZmluZWQgPSB2cm1FeHQuaHVtYW5vaWQ7XG4gICAgaWYgKCFzY2hlbWFIdW1hbm9pZCkge1xuICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgY29uc3QgaHVtYW5Cb25lczogUGFydGlhbDxWUk1IdW1hbkJvbmVzPiA9IHt9O1xuICAgIGlmIChzY2hlbWFIdW1hbm9pZC5odW1hbkJvbmVzICE9IG51bGwpIHtcbiAgICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAgICBzY2hlbWFIdW1hbm9pZC5odW1hbkJvbmVzLm1hcChhc3luYyAoYm9uZSkgPT4ge1xuICAgICAgICAgIGNvbnN0IGJvbmVOYW1lID0gYm9uZS5ib25lO1xuICAgICAgICAgIGNvbnN0IGluZGV4ID0gYm9uZS5ub2RlO1xuXG4gICAgICAgICAgaWYgKGJvbmVOYW1lID09IG51bGwgfHwgaW5kZXggPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnN0IG5vZGUgPSBhd2FpdCB0aGlzLnBhcnNlci5nZXREZXBlbmRlbmN5KCdub2RlJywgaW5kZXgpO1xuXG4gICAgICAgICAgLy8gaWYgdGhlIHNwZWNpZmllZCBub2RlIGRvZXMgbm90IGV4aXN0LCBlbWl0IGEgd2FybmluZ1xuICAgICAgICAgIGlmIChub2RlID09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihgQSBnbFRGIG5vZGUgYm91bmQgdG8gdGhlIGh1bWFub2lkIGJvbmUgJHtib25lTmFtZX0gKGluZGV4ID0gJHtpbmRleH0pIGRvZXMgbm90IGV4aXN0YCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gbWFwIHRvIG5ldyBib25lIG5hbWV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nN0cmFpbnRzLmFkZChjb25zdHJhaW50KTtcblxuICAgIGxldCBvYmplY3RTZXQgPSB0aGlzLl9vYmplY3RDb25zdHJhaW50c01hcC5nZXQoY29uc3RyYWludC5kZXN0aW5hdGlvbik7XG4gICAgaWYgKG9iamVjdFNldCA9PSBudWxsKSB7XG4gICAgICBvYmplY3RTZXQgPSBuZXcgU2V0PFZSTU5vZGVDb25zdHJhaW50PigpO1xuICAgICAgdGhpcy5fb2JqZWN0Q29uc3RyYWludHNNYXAuc2V0KGNvbnN0cmFpbnQuZGVzdGluYXRpb24sIG9iamVjdFNldCk7XG4gICAgfVxuICAgIG9iamVjdFNldC5hZGQoY29uc3RyYWludCk7XG4gIH1cblxuICBwdWJsaWMgZGVsZXRlQ29uc3RyYWludChjb25zdHJhaW50OiBWUk1Ob2RlQ29uc3RyYWludCk6IHZvaWQge1xuICAgIHRoaXMuX2NvbnN0cmFpbnRzLmRlbGV0ZShjb25zdHJhaW50KTtcblxuICAgIGNvbnN0IG9iamVjdFNldCA9IHRoaXMuX29iamVjdENvbnN0cmFpbnRzTWFwLmdldChjb25zdHJhaW50LmRlc3RpbmF0aW9uKSE7XG4gICAgb2JqZWN0U2V0LmRlbGV0ZShjb25zdHJhaW50KTtcbiAgfVxuXG4gIHB1YmxpYyBzZXRJbml0U3RhdGUoKTogdm9pZCB7XG4gICAgY29uc3QgY29uc3RyYWludHNUcmllZCA9IG5ldyBTZXQ8VlJNTm9kZUNvbnN0cmFpbnQ+KCk7XG4gICAgY29uc3QgY29uc3RyYWludHNEb25lID0gbmV3IFNldDxWUk1Ob2RlQ29uc3RyYWludD4oKTtcblxuICAgIGZvciAoY29uc3QgY29uc3RyYWludCBvZiB0aGlzLl9jb25zdHJhaW50cykge1xuICAgICAgdGhpcy5fcHJvY2Vzc0NvbnN0cmFpbnQoY29uc3RyYWludCwgY29uc3RyYWludHNUcmllZCwgY29uc3RyYWludHNEb25lLCAoY29uc3RyYWludCkgPT4gY29uc3RyYWludC5zZXR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bnN0IGNvbnN0cmFpbnREZWYgPSBleHRlbnNpb24uY29uc3RyYWludDtcblxuICAgICAgLy8gaW1wb3J0IGNvbnN0cmFpbnRzXG4gICAgICBpZiAoY29uc3RyYWludERlZi5yb2xsICE9IG51bGwpIHtcbiAgICAgICAgY29uc3QgY29uc3RyYWludCA9IHRoaXMuX2ltcG9ydFJvbGxDb25zdHJhaW50KG5vZGUsIHRocmVlTm9kZXMsIGNvbnN0cmFpbnREZWYucm9sbCk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5haW0gIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb25zdHJhaW50ID0gdGhpcy5faW1wb3J0QWltQ29uc3RyYWludChub2RlLCB0aHJlZU5vZGVzLCBjb25zdHJhaW50RGVmLmFpbSk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5yb3RhdGlvbiAhPSBudWxsKSB7XG4gICAgICAgIGNvbnN0IGNvbnN0cmFpbnQgPSB0aGlzLl9pbXBvcnRSb3RhdGlvbkNvbnN0cmFpbnQobm9kZSwgdGhyZWVOb2RlcywgY29uc3RyYWludERlZi5yb3RhdGlvbik7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIC8vIGluaXQgY29uc3RyYWludHNcbiAgICBnbHRmLnNjZW5lLnVwZGF0ZU1hdHJpeFdvcmxkKCk7XG4gICAgbWFuYWdlci5zZXRJbml0U3RhdGUoKTtcblxuICAgIHJldHVybiBtYW5hZ2VyO1xuICB9XG5cbiAgcHJvdGVjdGVkIF9pbXBvcnRSb2xsQ29uc3RyYWludChcbiAgICBkZXN0aW5hdGlvbjogVEhSRUUuT2JqZWN0M0QsXG4gIC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MgdGhlIHRhcmdldCBtb3JwaCB0YXJnZXRcbiAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAhcHJpbWl0aXZlcy5ldmVyeShcbiAgICAgICAgICAgICAgKHByaW1pdGl2ZSkgPT5cbiAgICAgICAgICAgICAgICBBcnJheS5pc0FycmF5KHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMpICYmXG4gICAgICAgICAgICAgICAgbW9ycGhUYXJnZXRJbmRleCA8IHByaW1pdGl2ZS5tb3JwaFRhcmdldEluZmx1ZW5jZXMubGVuZ3RoLFxuICAgICAgICAgICAgKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICBgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogJHtzY2hlbWFFeHByZXNzaW9uLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4IG1vcnBoICMke21vcnBoVGFyZ2V0SW5kZXh9IGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgd2VpZ2h0OiBiaW5kLndlaWdodCA/PyAxLjAsXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICApO1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAoc2NoZW1hRXhwcmVzc2lvbi5tYXRlcmlhbENvbG9yQmluZHMgfHwgc2NoZW1hRXhwcmVzc2lvbi50ZXh0dXJlVHJhbnNmb3JtQmluZHMpIHtcbiAgICAgICAgICAvLyBsaXN0IHVwIGV2ZXJ5IG1hdGVyaWFsIGluIGB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kZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIHR5cGU6IGJpbmQudHlwZSxcbiAgICAgICAgICAgICAgICAgIHRhcmdldFZhbHVlOiBuZXcgVEhSRUUuQ29sb3IoKS5mcm9tQXJyYXkoYmluZC50YXJnZXRWYWx1ZSksXG4gICAgICAgICAgICAgICAgICB0YXJnZXRBbHBoYTogYmluZC50YXJnZXRWYWx1ZVszXSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgc2NoZW1hRXhwcmVzc2lvbi50ZXh0dXJlVHJhbnNmb3JtQmluZHM/LmZvckVhY2goYXN5bmMgKGJpbmQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFscyA9IGdsdGZNYXRlcmlhbHMuZmlsdGVyKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbEluZGV4ID0gdGhpcy5wYXJzZXIuYXNzb2NpYXRpb25zLmdldChtYXRlcmlhbCk/Lm1hdGVyaWFscztcbiAgICAgICAgICAgICAgcmV0dXJuIGJpbmQubWF0ZXJpYWwgPT09IG1hdGVyaWFsSW5kZXg7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBuZXcgVEhSRUUuVmVjdG9yMigpL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iBJZ25vcmluZyB0aGUgZXhwcmVzc2lvbmAsXG4gICAgICAgICAgKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBibGVuZFNoYXBlTmFtZVNldC5hZGQobmFtZSk7XG5cbiAgICAgICAgY29uc3QgZXhwcmVzc2lvbiA9IG5ldyBWUk1FeHByZXNzaW9uKG5hbWUpO1xuICAgICAgICBnbHRmLnNjZW5lLmFkZChleHByZXNzaW9uKTtcblxuICAgICAgICBleHByZXNzaW9uLmlzQmluYXJ5ID0gc2NoZW1hR3JvdXAuaXNCaW5hcnkgPz8gZmFsc2U7XG4gICAgICAgIC8vIHYwIGRvZXNuJ3QgaGF2ZSBpZ25vcmUgcHJvcGVydGllc1xuXG4gICAgICAgIC8vIEJpbmQgbW9ycGhUYXJnZXRcbiAgICAgICAgaWYgKHNjaGVtYUdyb3VwLmJpbmRzKSB7XG4gICAgICAgICAgc2NoZW1hR3JvdXAuYmluZHMuZm9yRWFjaChhc3luYyAoYmluZCkgPT4ge1xuICAgICAgICAgICAgaWYgKGJpbmQubWVzaCA9PT0gdW5kZWZpbmVkIHx8IGJpbmQuaW5kZXggPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IG5vZGVzVXNpbmdNZXNoOiBudW1iZXJbXSA9IFtdO1xuICAgICAgICAgICAganNvbi5ub2Rlcz8uZm9yRWFjaCgobm9kZSwgaSkgPT4ge1xuICAgICAgICAgICAgICBpZiAobm9kZS5tZXNoID09PSBiaW5kLm1lc2gpIHtcbiAgICAgICAgICAgICAgICBub2Rlc1VzaW5nTWVzaC5wdXNoKGkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY29uc3QgbW9ycGhUYXJnZXRJbmRleCA9IGJpbmQuaW5kZXg7XG5cbiAgICAgICAgICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAgICAgICAgICBub2Rlc1VzaW5nTWVzaC5tYXAoYXN5bmMgKG5vZGVJbmRleCkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IHByaW1pdGl2ZXMgPSAoYXdhaXQgZ2x0ZkV4dHJhY3RQcmltaXRpdmVzRnJvbU5vZGUoZ2x0Ziwgbm9kZUluZGV4KSkhO1xuXG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIG1lc2ggaGFzIHRoZSB0YXJnZXQgbW9ycGggdGFyZ2V0XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgIXByaW1pdGl2ZXMuZXZlcnkoXG4gICAgICAgICAgICAgICAgICAgIChwcmltaXRpdmUpID0+XG4gICAgICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzKSAmJlxuICAgICAgICAgICAgICAgICAgICAgIG1vcnBoVGFyZ2V0SW5kZXggPCBwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46ICR7c2NoZW1hR3JvdXAubmFtZX0gYXR0ZW1wdHMgdG8gaW5kZXggJHttb3JwaFRhcmdldEluZGV4fXRoIG1vcnBoIGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgICAgICAgd2VpZ2h0OiAwLjAxICogKGJpbmQud2VpZ2h0ID8/IDEwMCksIC8vIG5hcnJvd2luZyB0aGUgcmFuZ2UgZnJvbSBbIDAuMCAtIDEwMC4wIF0gdG8gWyAwLjAgLSAxLjAgXVxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmluZCBNYXRlcmlhbENvbG9yIGFuZCBUZXh0dXJlVHJhbnNmb3JtXG4gICAgICAgIGNvbnN0IG1hdGVyaWFsVmFsdWVzID0gc2NoZW1hR3JvdXAubWF0ZXJpYWxWYWx1ZXM7XG4gICAgICAgIGlmIChtYXRlcmlhbFZhbHVlcyAmJiBtYXRlcmlhbFZhbHVlcy5sZW5ndGggIT09IDApIHtcbiAgICAgICAgICBtYXRlcmlhbFZhbHVlcy5mb3JFYWNoKChtYXRlcmlhbFZhbHVlKSA9PiB7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgIG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAgICAgbWF0ZXJpYWxWYWx1ZS5wcm9wZXJ0eU5hbWUgPT09IHVuZGVmaW5lZCB8fFxuICAgICAgICAgICAgICBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlID09PSB1bmRlZmluZWRcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogXHUzMEEyXHUzMEQwXHUzMEJGXHUzMEZDXHUzMDZFXHUzMEFBXHUzMEQ2XHUzMEI4XHUzMEE3XHUzMEFG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B7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgLi4ubWF0ZXJpYWwuZmlsdGVyKFxuICAgICAgICAgICAgICAgICAgICAgIChtdGwpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAobXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICBtdGwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUhICsgJyAoT3V0bGluZSknKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLmluZGV4T2YobXRsKSA9PT0gLTEsXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0ZXJpYWwubmFtZSA9PT0gbWF0ZXJpYWxWYWx1ZS5tYXRlcmlhbE5hbWUgJiYgbWF0ZXJpYWxzLmluZGV4T2YobWF0ZXJpYWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLnB1c2gobWF0ZXJpYWwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsUHJvcGVydHlOYW1lID0gbWF0ZXJpYWxWYWx1ZS5wcm9wZXJ0eU5hbWU7XG4gICAgICAgICAgICBtYXRlcmlhbHMuZm9yRWFjaCgobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgLy8gVGV4dHVyZVRyYW5zZm9ybUJpbmRcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsUHJvcGVydHlOYW1lID09PSAnX01haW5UZXhfU1QnKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qgc2NhbGUgPSBuZXcgVEhSRUUuVmVjdG9yMihtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVswXSwgbWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMV0pO1xuICAgICAgICAgICAgICAgIGNvbnN0IG9mZnNldCA9IG5ldyBUSFJFRS5WZWN0b3IyKG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzJdLCBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSk7XG5cbiAgICAgICAgICAgICAgICBvZmZzZXQueSA9IDEuMCAtIG9mZnNldC55IC0gc2NhbGUueTtcblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uVGV4dHVyZVRyYW5zZm9ybUJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBNYXRlcmlhbENvbG9yQmluZFxuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbENvbG9yVHlwZSA9IHYwRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JNYXBbbWF0ZXJpYWxQcm9wZXJ0eU5hbWVdO1xuICAgICAgICAgICAgICBpZiAobWF0ZXJpYWxDb2xvclR5cGUpIHtcbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IG1hdGVyaWFsQ29sb3JUeXBlLFxuICAgICAgICAgICAgICAgICAgICB0Y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KHNraW4wWzNdKSkgY29udGludWU7XG5cbiAgICAgICAgY29uc3QgYncxID0gYndzW2JdO1xuICAgICAgICBjb25zdCBza2luMSA9IHNraW5JbmRleFtiXTtcbiAgICAgICAgaWYgKGJ3MVswXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMVswXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncxWzFdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4xWzFdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzFbMl0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjFbMl0pKSBjb250aW51ZTtcbiAgICAgICAgaWYgKGJ3MVszXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMVszXSkpIGNvbnRpbnVlO1xuXG4gICAgICAgIGNvbnN0IGJ3MiA9IGJ3c1tjXTtcbiAgICAgICAgY29uc3Qgc2tpbjIgPSBza2luSW5kZXhbY107XG4gICAgICAgIGlmIChidzJbMF0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjJbMF0pKSBjb250aW51ZTtcbiAgICAgICAgaWYgKGJ3MlsxXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMlsxXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncyWzJdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4yWzJdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzJbM10gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjJbM10pKSBjb250aW51ZTtcblxuICAgICAgICB0cmlhbmdsZXNbY291bnQrK10gPSBhO1xuICAgICAgICB0cmlhbmdsZXNbY291bnQrK10gPSBiO1xuICAgICAgICB0cmlhbmdsZXNbY291bnQrK10gPSBjO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gY291bnQ7XG4gIH1cblxuICBwcml2YXRlIF9jcmVhdGVFcmFzZWRNZ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ICAgICAgICAgY29uc3QgaW5kZXggPSBzY2hlbWFIdW1hbkJvbmUubm9kZTtcblxuICAgICAgICAgIC8vIGNvbXBhdDogMS4wLWJldGEgcHJldmlvdXMgdGh1bWIgYm9uZSBuYW1lc1xuICAgICAgICAgIGlmIChleGlzdHNQcmV2aW91c1RodW1iTmFtZSkge1xuICAgICAgICAgICAgY29uc3QgdGh1bWJCb25lTmFtZSA9IHRodW1iQm9uZU5hbWVNYXBbYm9uZU5hbWVdO1xuICAgICAgICAgICAgaWYgKHRodW1iQm9uZU5hbWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICBib25lTmFtZSA9IHRodW1iQm9uZU5hbWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29uc3Qgbm9kZSA9IGF3YWl0IHRoaXMucGFyc2VyLmdldERlcGVuZGVuY3koJ25vZGUnLCBpbmRleCk7XG5cbiAgICAgICAgICAvLyBpZiB0aGUgc3BlY2lmaWVkIG5vZGUgZG9lcyBub3QgZXhpc3QsIGVtaXQgYSB3YXJuaW5nXG4gICAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKGBBIGdsVEYgbm9kZSBib3VuZCB0byB0aGUgaHVtYW5vaWQgYm9uZSAke2JvbmVOYW1lfSAoaW5kZXggPSAke2luZGV4fSkgZG9lcyBub3QgZXhpc3RgKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyBzZXQgdG8gdGhlIGBodW1hbkJvbmVzYFxuICAgICAgICAgIGh1bWFuQm9uZXNbYm9uZU5hbWVdID0geyBub2RlIH07XG4gICAgICAgIH0pLFxuICAgICAgKTtcbiAgICB9XG5cbiAgICBjb25zdCBodW1hbm9pZCA9IG5ldyBWUk1IdW1hbm9pZCh0aGlzLl9lbnN1cmVSZXF1aXJlZEJvbmVzRXhpc3QoaHVtYW5Cb25lcyksIHtcbiAgICAg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2b2lkIHtcbiAgICBpZiAoY29uc3RyYWludHNEb25lLmhhcyhjb25zdHJhaW50KSkge1xuICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIGlmIChjb25zdHJhaW50c1RyaWVkLmhhcyhjb25zdHJhaW50KSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdWUk1Ob2RlQ29uc3RyYWludE1hbmFnZXI6IENpcmN1bGFyIGRlcGVuZGVuY3kgZGV0ZWN0ZWQgd2hpbGUgdXBkYXRpbmcgY29uc3RyYWludHMnKTtcbiAgICB9XG4gICAgY29uc3RyYWludHNUcmllZC5hZGQoY29uc3RyYWludCk7XG5cbiAgICBjb25zdCBkZXBPYmplY3RzID0gY29uc3RyYWludC5kZXBlbmRlbmNpZXM7XG4gICAgZm9yIChjb25zdCBkZXBPYmplY3Qgb2YgZGVwT2JqZWN0cykge1xuICAgICAgdHJhdmVyc2VBbmNlc3RvcnNGcm9tUm9vdChkZXBPYmplY3QsIChkZXBPYmplY3RBbmNlc3RvcikgPT4ge1xuICAgICAgICBjb25zdCBvYmplY3RTZXQgPSB0aGlzLl9vYmplY3RDb25zdHJhaW50c01hcC5nZXQoZGVwT2JqZWN0QW5jZXN0b3IpO1xuICAgICAgICBpZiAob2JqZWN0U2V0KSB7XG4gICAgICAgICAgZm9yIChjb25zdCBkZXBDb25zdHJhaW50IG9mIG9iamVjdFNldCkge1xuICAgICAgICAgICAgdGhpcy5fcHJvY2Vzc0NvbnN0cmFpbnQoZGVwQ29uc3RyYWludCwgY29uc3RyYWludHNUcmllZCwgY29uc3RyYWludHNEb25lLCBjYWxsYmFjayk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxsYmFjayhjb25zdHJhaW50KTtcblxuICAgIGNvbnN0cmFpbnRzRG9uZS5hZGQoY29uc3RyYWludCk7XG4gIH1cbn1cbiIsICJpbXBvcnQgKiBhcyBUSFJFRSBmcm9tICd0aHJlZSc7XG5pb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2RlQ29uc3RyYWludExvYWRlclBsdWdpbi5FWFRFTlNJT05fTkFNRV0gYXNcbiAgICAgICAgfCBDb25zdHJhaW50U2NoZW1hLlZSTUNOb2RlQ29uc3RyYWludFxuICAgICAgICB8IHVuZGVmaW5lZDtcblxuICAgICAgaWYgKGV4dGVuc2lvbiA9PSBudWxsKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgY29uc3Qgc3BlY1ZlcnNpb24gPSBleHRlbnNpb24uc3BlY1ZlcnNpb247XG4gICAgICBpZiAoIVBPU1NJQkxFX1NQRUNfVkVSU0lPTlMuaGFzKHNwZWNWZXJzaW9uKSkge1xuICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgYFZSTU5vZGVDb25zdHJhaW50TG9hZGVyUGx1Z2luOiBVbmtub3duICR7VlJNTm9kZUNvbnN0cmFpbnRMb2FkZXJQbHVnaW4uRVhURU5TSU9OX05BTUV9IHNwZWNWZXJzaW9uIFwiJHtzcGVjVmVyc2lvbn1cImAsXG4gICAgICAgICk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgY29uc3QgY29uc3RyYWludERlZiA9IGV4dGVuc2lvbi5jb25zdHJhaW50O1xuXG4gICAgICAvLyBpbXBvcnQgY29uc3RyYWludHNcbiAgICAgIGlmIChjb25zdHJhaW50RGVmLnJvbGwgIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb25zdHJhaW50ID0gdGhpcy5faW1wb3J0Um9sbENvbnN0cmFpbnQobm9kZSwgdGhyZWVOb2RlcywgY29uc3RyYWludERlZi5yb2xsKTtcbiAgICAgICAgbWFuYWdlci5hZGRDb25zdHJhaW50KGNvbnN0cmFpbnQpO1xuICAgICAgfSBlbHNlIGlmIChjb25zdHJhaW50RGVmLmFpbSAhPSBudWxsKSB7XG4gICAgICAgIGNvbnN0IGNvbnN0cmFpbnQgPSB0aGlzLl9pbXBvcnRBaW1Db25zdHJhaW50KG5vZGUsIHRocmV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W25vZGVJbmRleF07XG4gICAgICAgICAgY29uc3QgY2hpbGRJbmRleCA9IHNjaGVtYUpvaW50Lm5vZGU7XG4gICAgICAgICAgY29uc3QgY2hpbGQgPSB0aHJlZU5vZGVzW2NoaWxkSW5kZXhdO1xuXG4gICAgICAgICAgLy8gcHJlcGFyZSBzZXR0aW5nXG4gICAgICAgICAgY29uc3Qgc2V0dGluZzogUGFydGlhbDxWUk1TcHJpbmdCb25lSm9pbnRTZXR0aW5ncz4gPSB7XG4gICAgICAgICAgICBoaXRSYWRpdXM6IHByZXZTY2hlbWFKb2ludC5oaXRSYWRpdXMsXG4gICAgICAgICAgICBkcmFnRm9yY2U6IHByZXZTY2hlbWFKb2ludC5kcmFnRm9yY2UsXG4gICAgICAgICAgICBncmF2aXR5UG93ZXI6IHByZXZTY2hlbWFKb2ludC5ncmF2aXR5UG93ZXIsXG4gICAgICAgICAgICBzdGlmZm5lc3M6IHByZXZTY2hlbWFKb2ludC5zdGlmZm5lc3MsXG4gICAgICAgICAgICBncmF2aXR5RGlyOlxuICAgICAgICAgICAgICBwcmV2U2NoZW1hSm9pbnQuZ3Jhdml0eURpciAhPSBudWxsXG4gICAgICAgICAgICAgICAgPyBuZXcgVEhSRUUuVmVjdG9yMygpLmZyb21BcnJheShwcmV2U2NoZW1hSm9pbnQuZ3Jhdml0eURpcilcbiAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZCxcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgLy8gY3JlYXRlIHNwcmluZyBib25lc1xuICAgICAgICAgIGNvbnN0IGpvaW50ID0gdGhpcy5faW1wb3J0Sm9pbnQobm9kZSwgY2hpbGQsIHNldHRpbmcsIGNvbGxpZGVyR3JvdXBzRm9yU3ByaW5nKTtcbiAgICAgICAgICBpZiAoY2VudGVyKSB7XG4gICAgICAgICAgICBqb2ludC5jZW50ZXIgPSBjZW50ZXI7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbWFuYWdlci5hZGRKb2ludChqb2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fU1BFQ19WRVJTSU9OUyIsICJfVlJNU3ByaW5nQm9uZUxvYWRlclBsdWdpbiIsICJfX2FzeW5jIiwgIl9hIiwgIl9iIiwgIl9jIiwgIl9kIiwgIl9lIiwgIlRIUkVFIiwgIlRIUkVFIiwgIm1hdGVyaWFsIiwgIlRIUkVFIiwgIlRIUkVFIiwgIm9yaWdpbmFsSW5kZXhBcnJheSIsICJvcmlnaW5hbEluZGV4Il0KfQo= diff --git a/packages/three-vrm/lib/three-vrm.min.cjs b/packages/three-vrm/lib/three-vrm.min.cjs index 850fa1ad3..0a46033b7 100644 --- a/packages/three-vrm/lib/three-vrm.min.cjs +++ b/packages/three-vrm/lib/three-vrm.min.cjs @@ -1,5 +1,5 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -"use strict";var xr=Object.create;var Be=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Sr=Object.getPrototypeOf,Pr=Object.prototype.hasOwnProperty;var Ar=(t,e)=>{for(var n in e)Be(t,n,{get:e[n],enumerable:!0})},Tn=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wr(e))!Pr.call(t,r)&&r!==n&&Be(t,r,{get:()=>e[r],enumerable:!(i=yr(e,r))||i.enumerable});return t};var R=(t,e,n)=>(n=t!=null?xr(Sr(t)):{},Tn(e||!t||!t.__esModule?Be(n,"default",{value:t,enumerable:!0}):n,t)),Lr=t=>Tn(Be({},"__esModule",{value:!0}),t);var Se=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())});var es={};Ar(es,{MToonMaterial:()=>hi,MToonMaterialDebugMode:()=>ui,MToonMaterialLoaderPlugin:()=>It,MToonMaterialOutlineWidthMode:()=>Vt,VRM:()=>ve,VRMAimConstraint:()=>Ti,VRMCore:()=>$e,VRMCoreLoaderPlugin:()=>no,VRMExpression:()=>_t,VRMExpressionLoaderPlugin:()=>je,VRMExpressionManager:()=>gt,VRMExpressionMaterialColorBind:()=>vt,VRMExpressionMaterialColorType:()=>_e,VRMExpressionMorphTargetBind:()=>Et,VRMExpressionOverrideType:()=>Ir,VRMExpressionPresetName:()=>ze,VRMExpressionTextureTransformBind:()=>Mt,VRMFirstPerson:()=>Rt,VRMFirstPersonLoaderPlugin:()=>Qe,VRMFirstPersonMeshAnnotationType:()=>Ur,VRMHumanBoneList:()=>ke,VRMHumanBoneName:()=>Nr,VRMHumanBoneParentMap:()=>Yn,VRMHumanoid:()=>yt,VRMHumanoidHelper:()=>Tt,VRMHumanoidLoaderPlugin:()=>Ye,VRMLoaderPlugin:()=>at,VRMLookAt:()=>ni,VRMLookAtBoneApplier:()=>Ae,VRMLookAtExpressionApplier:()=>Ge,VRMLookAtHelper:()=>Kn,VRMLookAtLoaderPlugin:()=>qe,VRMLookAtRangeMap:()=>Pt,VRMLookAtTypeName:()=>Kr,VRMMetaLoaderPlugin:()=>Ze,VRMNodeConstraint:()=>nt,VRMNodeConstraintHelper:()=>et,VRMNodeConstraintLoaderPlugin:()=>Ot,VRMNodeConstraintManager:()=>xi,VRMRequiredHumanBoneName:()=>Jn,VRMRollConstraint:()=>wi,VRMRotationConstraint:()=>yi,VRMSpringBoneCollider:()=>ot,VRMSpringBoneColliderHelper:()=>rt,VRMSpringBoneColliderShape:()=>st,VRMSpringBoneColliderShapeCapsule:()=>Ft,VRMSpringBoneColliderShapePlane:()=>kt,VRMSpringBoneColliderShapeSphere:()=>Wt,VRMSpringBoneJoint:()=>Ni,VRMSpringBoneJointHelper:()=>Vi,VRMSpringBoneLoaderPlugin:()=>zt,VRMSpringBoneManager:()=>Dt,VRMUtils:()=>se});module.exports=Lr(es);var Nn=R(require("three"),1),ee=R(require("three"),1),At=R(require("three"),1),zn=R(require("three"),1),F=R(require("three"),1),q=R(require("three"),1),Xe=R(require("three"),1),k=R(require("three"),1),b=R(require("three"),1),Le=R(require("three"),1),te=R(require("three"),1),C=R(require("three"),1),Ht=R(require("three"),1),I=R(require("three"),1),St=R(require("three"),1),ii=R(require("three"),1);var x=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),_t=class extends Nn.Object3D{constructor(t){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${t}`,this.expressionName=t,this.type="VRMExpression",this.visible=!1}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(t){this._binds.push(t)}applyWeight(t){var e;let n=this.outputWeight;n*=(e=t==null?void 0:t.multiplier)!=null?e:1,this.isBinary&&n<1&&(n=0),this._binds.forEach(i=>i.applyWeight(n))}clearAppliedWeight(){this._binds.forEach(t=>t.clearAppliedWeight())}};function Bn(t,e,n){var i,r;let o=t.parser.json,a=(i=o.nodes)==null?void 0:i[e];if(a==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let l=a.mesh;if(l==null)return null;let s=(r=o.meshes)==null?void 0:r[l];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${l}] of glTF but the mesh doesn't exist`),null;let u=s.primitives.length,d=[];return n.traverse(h=>{d.length{let o=Bn(t,r,i);o!=null&&n.set(r,o)}),n})}var ze={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function Dn(t){return Math.max(Math.min(t,1),0)}var gt=class Fn{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},n=new Set(Object.values(ze));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)&&(e[i]=r)}),e}get customExpressionMap(){let e={},n=new Set(Object.values(ze));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)||(e[i]=r)}),e}copy(e){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),e._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new Fn().copy(this)}getExpression(e){var n;return(n=this._expressionMap[e])!=null?n:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let n=this._expressions.indexOf(e);n===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(n,1),delete this._expressionMap[e.expressionName]}getValue(e){var n;let i=this.getExpression(e);return(n=i==null?void 0:i.weight)!=null?n:null}setValue(e,n){let i=this.getExpression(e);i&&(i.weight=Dn(n))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let n=this.getExpression(e);return n?`${n.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(n=>{n.clearAppliedWeight()}),this._expressions.forEach(n=>{let i=1,r=n.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(i*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(i*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(i*=e.mouth),n.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let e=1,n=1,i=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,n-=r.overrideLookAtAmount,i-=r.overrideMouthAmount}),e=Math.max(0,e),n=Math.max(0,n),i=Math.max(0,i),{blink:e,lookAt:n,mouth:i}}},_e={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},Hr={_Color:_e.Color,_EmissionColor:_e.EmissionColor,_ShadeColor:_e.ShadeColor,_RimColor:_e.RimColor,_OutlineColor:_e.OutlineColor},br=new At.Color,kn=class Wn{constructor({material:e,type:n,targetValue:i,targetAlpha:r}){this.material=e,this.type=n,this.targetValue=i,this.targetAlpha=r!=null?r:1;let o=this._initColorBindState(),a=this._initAlphaBindState();this._state={color:o,alpha:a}}applyWeight(e){let{color:n,alpha:i}=this._state;if(n!=null){let{propertyName:r,deltaValue:o}=n,a=this.material[r];a!=null&&a.add(br.copy(o).multiplyScalar(e))}if(i!=null){let{propertyName:r,deltaValue:o}=i;this.material[r]!=null&&(this.material[r]+=o*e)}}clearAppliedWeight(){let{color:e,alpha:n}=this._state;if(e!=null){let{propertyName:i,initialValue:r}=e,o=this.material[i];o!=null&&o.copy(r)}if(n!=null){let{propertyName:i,initialValue:r}=n;this.material[i]!=null&&(this.material[i]=r)}}_initColorBindState(){var e,n,i;let{material:r,type:o,targetValue:a}=this,l=this._getPropertyNameMap(),s=(n=(e=l==null?void 0:l[o])==null?void 0:e[0])!=null?n:null;if(s==null)return console.warn(`Tried to add a material color bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type is not supported.`),null;let d=r[s].clone(),h=new At.Color(a.r-d.r,a.g-d.g,a.b-d.b);return{propertyName:s,initialValue:d,deltaValue:h}}_initAlphaBindState(){var e,n,i;let{material:r,type:o,targetAlpha:a}=this,l=this._getPropertyNameMap(),s=(n=(e=l==null?void 0:l[o])==null?void 0:e[1])!=null?n:null;if(s==null&&a!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type does not support alpha.`),null;if(s==null)return null;let u=r[s],d=a-u;return{propertyName:s,initialValue:u,deltaValue:d}}_getPropertyNameMap(){var e,n;return(n=(e=Object.entries(Wn._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:e[1])!=null?n:null}};kn._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var vt=kn,Et=class{constructor({primitives:t,index:e,weight:n}){this.primitives=t,this.index=e,this.weight=n}applyWeight(t){this.primitives.forEach(e=>{var n;((n=e.morphTargetInfluences)==null?void 0:n[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*t)})}clearAppliedWeight(){this.primitives.forEach(t=>{var e;((e=t.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(t.morphTargetInfluences[this.index]=0)})}},wn=new zn.Vector2,Gn=class jn{constructor({material:e,scale:n,offset:i}){var r,o;this.material=e,this.scale=n,this.offset=i;let a=(r=Object.entries(jn._propertyNamesMap).find(([l])=>e[l]===!0))==null?void 0:r[1];a==null?(console.warn(`Tried to add a texture transform bind to the material ${(o=e.name)!=null?o:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],a.forEach(l=>{var s;let u=(s=e[l])==null?void 0:s.clone();if(!u)return null;e[l]=u;let d=u.offset.clone(),h=u.repeat.clone(),p=i.clone().sub(d),m=n.clone().sub(h);this._properties.push({name:l,initialOffset:d,deltaOffset:p,initialScale:h,deltaScale:m})}))}applyWeight(e){this._properties.forEach(n=>{let i=this.material[n.name];i!==void 0&&(i.offset.add(wn.copy(n.deltaOffset).multiplyScalar(e)),i.repeat.add(wn.copy(n.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let n=this.material[e.name];n!==void 0&&(n.offset.copy(e.initialOffset),n.repeat.copy(e.initialScale))})}};Gn._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var Mt=Gn,Vr=new Set(["1.0","1.0-beta"]),Qn=class Xn{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return x(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return x(this,null,function*(){let n=yield this._v1Import(e);if(n)return n;let i=yield this._v0Import(e);return i||null})}_v1Import(e){return x(this,null,function*(){var n,i;let r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;let a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;let l=a.specVersion;if(!Vr.has(l))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.expressions;if(!s)return null;let u=new Set(Object.values(ze)),d=new Map;s.preset!=null&&Object.entries(s.preset).forEach(([p,m])=>{if(m!=null){if(!u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${p}" detected. Ignoring the expression`);return}d.set(p,m)}}),s.custom!=null&&Object.entries(s.custom).forEach(([p,m])=>{if(u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${p}". Ignoring the expression`);return}d.set(p,m)});let h=new gt;return yield Promise.all(Array.from(d.entries()).map(p=>x(this,[p],function*([m,c]){var f,g,M,V,y,_,v;let E=new _t(m);if(e.scene.add(E),E.isBinary=(f=c.isBinary)!=null?f:!1,E.overrideBlink=(g=c.overrideBlink)!=null?g:"none",E.overrideLookAt=(M=c.overrideLookAt)!=null?M:"none",E.overrideMouth=(V=c.overrideMouth)!=null?V:"none",(y=c.morphTargetBinds)==null||y.forEach(T=>x(this,null,function*(){var P;if(T.node===void 0||T.index===void 0)return;let L=yield xn(e,T.node),A=T.index;if(!L.every(S=>Array.isArray(S.morphTargetInfluences)&&A{let L=P.material;L&&(Array.isArray(L)?T.push(...L):T.push(L))}),(_=c.materialColorBinds)==null||_.forEach(P=>x(this,null,function*(){T.filter(A=>{var S;let H=(S=this.parser.associations.get(A))==null?void 0:S.materials;return P.material===H}).forEach(A=>{E.addBind(new vt({material:A,type:P.type,targetValue:new ee.Color().fromArray(P.targetValue),targetAlpha:P.targetValue[3]}))})})),(v=c.textureTransformBinds)==null||v.forEach(P=>x(this,null,function*(){T.filter(A=>{var S;let H=(S=this.parser.associations.get(A))==null?void 0:S.materials;return P.material===H}).forEach(A=>{var S,H;E.addBind(new Mt({material:A,offset:new ee.Vector2().fromArray((S=P.offset)!=null?S:[0,0]),scale:new ee.Vector2().fromArray((H=P.scale)!=null?H:[1,1])}))})}))}h.registerExpression(E)}))),h})}_v0Import(e){return x(this,null,function*(){var n;let i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.blendShapeMaster;if(!o)return null;let a=new gt,l=o.blendShapeGroups;if(!l)return a;let s=new Set;return yield Promise.all(l.map(u=>x(this,null,function*(){var d;let h=u.presetName,p=h!=null&&Xn.v0v1PresetNameMap[h]||null,m=p!=null?p:u.name;if(m==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(m)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${h} has duplicated entries. Ignoring the expression`);return}s.add(m);let c=new _t(m);e.scene.add(c),c.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(g=>x(this,null,function*(){var M;if(g.mesh===void 0||g.index===void 0)return;let V=[];(M=i.nodes)==null||M.forEach((_,v)=>{_.mesh===g.mesh&&V.push(v)});let y=g.index;yield Promise.all(V.map(_=>x(this,null,function*(){var v;let E=yield xn(e,_);if(!E.every(T=>Array.isArray(T.morphTargetInfluences)&&y{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;let M=[];e.scene.traverse(y=>{if(y.material){let _=y.material;Array.isArray(_)?M.push(..._.filter(v=>(v.name===g.materialName||v.name===g.materialName+" (Outline)")&&M.indexOf(v)===-1)):_.name===g.materialName&&M.indexOf(_)===-1&&M.push(_)}});let V=g.propertyName;M.forEach(y=>{if(V==="_MainTex_ST"){let v=new ee.Vector2(g.targetValue[0],g.targetValue[1]),E=new ee.Vector2(g.targetValue[2],g.targetValue[3]);E.y=1-E.y-v.y,c.addBind(new Mt({material:y,scale:v,offset:E}));return}let _=Hr[V];if(_){c.addBind(new vt({material:y,type:_,targetValue:new ee.Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(V+" is not supported")})}),a.registerExpression(c)}))),a})}};Qn.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var je=Qn,Ir={None:"none",Block:"block",Blend:"blend"},Lt=class ge{constructor(e,n){this._firstPersonOnlyLayer=ge.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=ge.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=n}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(n=>({meshes:n.meshes.concat(),type:n.type})),this}clone(){return new ge(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=ge.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=ge.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(i=>{i.meshes.forEach(r=>{i.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(o=>o.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(o=>o.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(e,n,i,r){let o=0;if(n!=null&&n.length>0)for(let a=0;a0&&r.includes(h[0])||d[1]>0&&r.includes(h[1])||d[2]>0&&r.includes(h[2])||d[3]>0&&r.includes(h[3]))continue;let p=n[s],m=i[s];if(p[0]>0&&r.includes(m[0])||p[1]>0&&r.includes(m[1])||p[2]>0&&r.includes(m[2])||p[3]>0&&r.includes(m[3]))continue;let c=n[u],f=i[u];c[0]>0&&r.includes(f[0])||c[1]>0&&r.includes(f[1])||c[2]>0&&r.includes(f[2])||c[3]>0&&r.includes(f[3])||(e[o++]=l,e[o++]=s,e[o++]=u)}return o}_createErasedMesh(e,n){let i=new F.SkinnedMesh(e.geometry.clone(),e.material);i.name=`${e.name}(erase)`,i.frustumCulled=e.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);let r=i.geometry,o=r.getAttribute("skinIndex"),a=o instanceof F.GLBufferAttribute?[]:o.array,l=[];for(let f=0;f{this._isEraseTarget(o)&&i.push(a)}),!i.length){n.layers.enable(this._thirdPersonOnlyLayer),n.layers.enable(this._firstPersonOnlyLayer);return}n.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(n,i);e.add(r)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer));else{let n=new F.Group;n.name=`_headless_${e.name}`,n.layers.set(this._firstPersonOnlyLayer),e.parent.add(n),e.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{let r=i;this._createHeadlessModelForSkinnedMesh(n,r)})}else if(e.type==="SkinnedMesh"){let n=e;this._createHeadlessModelForSkinnedMesh(e.parent,n)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};Lt.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;Lt.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var Rt=Lt,Cr=new Set(["1.0","1.0-beta"]),Qe=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return x(this,null,function*(){let e=t.userData.vrmHumanoid;if(e!==null){if(e===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");t.userData.vrmFirstPerson=yield this._import(t,e)}})}_import(t,e){return x(this,null,function*(){if(e==null)return null;let n=yield this._v1Import(t,e);if(n)return n;let i=yield this._v0Import(t,e);return i||null})}_v1Import(t,e){return x(this,null,function*(){var n,i;let r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;let a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;let l=a.specVersion;if(!Cr.has(l))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.firstPerson,u=[],d=yield yn(t);return Array.from(d.entries()).forEach(([h,p])=>{var m,c;let f=(m=s==null?void 0:s.meshAnnotations)==null?void 0:m.find(g=>g.node===h);u.push({meshes:p,type:(c=f==null?void 0:f.type)!=null?c:"auto"})}),new Rt(e,u)})}_v0Import(t,e){return x(this,null,function*(){var n;let i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.firstPerson;if(!o)return null;let a=[],l=yield yn(t);return Array.from(l.entries()).forEach(([s,u])=>{let d=i.nodes[s],h=o.meshAnnotations?o.meshAnnotations.find(p=>p.mesh===d.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(h==null?void 0:h.firstPersonFlag)})}),new Rt(e,a)})}_convertV0FlagToV1Type(t){return t==="FirstPersonOnly"?"firstPersonOnly":t==="ThirdPersonOnly"?"thirdPersonOnly":t==="Both"?"both":"auto"}},Ur={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"},Sn=new q.Vector3,Pn=new q.Vector3,Or=new q.Quaternion,Tt=class extends q.Group{constructor(t){super(),this.vrmHumanoid=t,this._boneAxesMap=new Map,Object.values(t.humanBones).forEach(e=>{let n=new q.AxesHelper(1);n.matrixAutoUpdate=!1,n.material.depthTest=!1,n.material.depthWrite=!1,this.add(n),this._boneAxesMap.set(e,n)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(t=>{t.geometry.dispose(),t.material.dispose()})}updateMatrixWorld(t){Array.from(this._boneAxesMap.entries()).forEach(([e,n])=>{e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(Sn,Or,Pn);let i=Sn.set(.1,.1,.1).divide(Pn);n.matrix.copy(e.node.matrixWorld).scale(i)}),super.updateMatrixWorld(t)}},ke=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],Nr={Hips:"hips",Spine:"spine",Chest:"chest",UpperChest:"upperChest",Neck:"neck",Head:"head",LeftEye:"leftEye",RightEye:"rightEye",Jaw:"jaw",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",LeftToes:"leftToes",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",RightToes:"rightToes",LeftShoulder:"leftShoulder",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightShoulder:"rightShoulder",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand",LeftThumbMetacarpal:"leftThumbMetacarpal",LeftThumbProximal:"leftThumbProximal",LeftThumbDistal:"leftThumbDistal",LeftIndexProximal:"leftIndexProximal",LeftIndexIntermediate:"leftIndexIntermediate",LeftIndexDistal:"leftIndexDistal",LeftMiddleProximal:"leftMiddleProximal",LeftMiddleIntermediate:"leftMiddleIntermediate",LeftMiddleDistal:"leftMiddleDistal",LeftRingProximal:"leftRingProximal",LeftRingIntermediate:"leftRingIntermediate",LeftRingDistal:"leftRingDistal",LeftLittleProximal:"leftLittleProximal",LeftLittleIntermediate:"leftLittleIntermediate",LeftLittleDistal:"leftLittleDistal",RightThumbMetacarpal:"rightThumbMetacarpal",RightThumbProximal:"rightThumbProximal",RightThumbDistal:"rightThumbDistal",RightIndexProximal:"rightIndexProximal",RightIndexIntermediate:"rightIndexIntermediate",RightIndexDistal:"rightIndexDistal",RightMiddleProximal:"rightMiddleProximal",RightMiddleIntermediate:"rightMiddleIntermediate",RightMiddleDistal:"rightMiddleDistal",RightRingProximal:"rightRingProximal",RightRingIntermediate:"rightRingIntermediate",RightRingDistal:"rightRingDistal",RightLittleProximal:"rightLittleProximal",RightLittleIntermediate:"rightLittleIntermediate",RightLittleDistal:"rightLittleDistal"},Yn={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function qn(t){return t.invert?t.invert():t.inverse(),t}var le=new Xe.Vector3,ue=new Xe.Quaternion,xt=class{constructor(t){this.humanBones=t,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);i&&(le.copy(i.position),ue.copy(i.quaternion),t[n]={position:le.toArray(),rotation:ue.toArray()})}),t}getPose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);if(!i)return;le.set(0,0,0),ue.identity();let r=this.restPose[n];r!=null&&r.position&&le.fromArray(r.position).negate(),r!=null&&r.rotation&&qn(ue.fromArray(r.rotation)),le.add(i.position),ue.premultiply(i.quaternion),t[n]={position:le.toArray(),rotation:ue.toArray()}}),t}setPose(t){Object.entries(t).forEach(([e,n])=>{let i=e,r=this.getBoneNode(i);if(!r)return;let o=this.restPose[i];o&&(n!=null&&n.position&&(r.position.fromArray(n.position),o.position&&r.position.add(le.fromArray(o.position))),n!=null&&n.rotation&&(r.quaternion.fromArray(n.rotation),o.rotation&&r.quaternion.multiply(ue.fromArray(o.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([t,e])=>{let n=this.getBoneNode(t);n&&(e!=null&&e.position&&n.position.fromArray(e.position),e!=null&&e.rotation&&n.quaternion.fromArray(e.rotation))})}getBone(t){var e;return(e=this.humanBones[t])!=null?e:void 0}getBoneNode(t){var e,n;return(n=(e=this.humanBones[t])==null?void 0:e.node)!=null?n:null}},pt=new k.Vector3,Br=new k.Quaternion,Dr=new k.Vector3,An=class Zn extends xt{static _setupTransforms(e){let n=new k.Object3D;n.name="VRMHumanoidRig";let i={},r={},o={},a={};ke.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let h=new k.Vector3,p=new k.Quaternion;d.updateWorldMatrix(!0,!1),d.matrixWorld.decompose(h,p,pt),i[s]=h,r[s]=p,o[s]=d.quaternion.clone();let m=new k.Quaternion;(u=d.parent)==null||u.matrixWorld.decompose(pt,m,pt),a[s]=m}});let l={};return ke.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let h=i[s],p=s,m;for(;m==null&&(p=Yn[p],p!=null);)m=i[p];let c=new k.Object3D;c.name="Normalized_"+d.name,(p?(u=l[p])==null?void 0:u.node:n).add(c),c.position.copy(h),m&&c.position.sub(m),l[s]={node:c}}}),{rigBones:l,root:n,parentWorldRotations:a,boneRotations:o}}constructor(e){let{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=Zn._setupTransforms(e);super(n),this.original=e,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){ke.forEach(e=>{let n=this.original.getBoneNode(e);if(n!=null){let i=this.getBoneNode(e),r=this._parentWorldRotations[e],o=Br.copy(r).invert(),a=this._boneRotations[e];if(n.quaternion.copy(i.quaternion).multiply(r).premultiply(o).multiply(a),e==="hips"){let l=i.getWorldPosition(Dr);n.parent.updateWorldMatrix(!0,!1);let s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},yt=class $n{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,n){var i;this.autoUpdateHumanBones=(i=n==null?void 0:n.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new xt(e),this._normalizedHumanBones=new An(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new xt(e.humanBones),this._normalizedHumanBones=new An(this._rawHumanBones),this}clone(){return new $n(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},Jn={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},Fr=new Set(["1.0","1.0-beta"]),Ln={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},Ye=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot,this.autoUpdateHumanBones=e==null?void 0:e.autoUpdateHumanBones}afterRoot(t){return x(this,null,function*(){t.userData.vrmHumanoid=yield this._import(t)})}_import(t){return x(this,null,function*(){let e=yield this._v1Import(t);if(e)return e;let n=yield this._v0Import(t);return n||null})}_v1Import(t){return x(this,null,function*(){var e,n;let i=this.parser.json;if(!(((e=i.extensionsUsed)==null?void 0:e.indexOf("VRMC_vrm"))!==-1))return null;let o=(n=i.extensions)==null?void 0:n.VRMC_vrm;if(!o)return null;let a=o.specVersion;if(!Fr.has(a))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;let l=o.humanoid;if(!l)return null;let s=l.humanBones.leftThumbIntermediate!=null||l.humanBones.rightThumbIntermediate!=null,u={};l.humanBones!=null&&(yield Promise.all(Object.entries(l.humanBones).map(h=>x(this,[h],function*([p,m]){let c=p,f=m.node;if(s){let M=Ln[c];M!=null&&(c=M)}let g=yield this.parser.getDependency("node",f);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${c} (index = ${f}) does not exist`);return}u[c]={node:g}}))));let d=new yt(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(d.normalizedHumanBonesRoot),this.helperRoot){let h=new Tt(d);this.helperRoot.add(h),h.renderOrder=this.helperRoot.renderOrder}return d})}_v0Import(t){return x(this,null,function*(){var e;let i=(e=this.parser.json.extensions)==null?void 0:e.VRM;if(!i)return null;let r=i.humanoid;if(!r)return null;let o={};r.humanBones!=null&&(yield Promise.all(r.humanBones.map(l=>x(this,null,function*(){let s=l.bone,u=l.node;if(s==null||u==null)return;let d=yield this.parser.getDependency("node",u);if(d==null){console.warn(`A glTF node bound to the humanoid bone ${s} (index = ${u}) does not exist`);return}let h=Ln[s],p=h!=null?h:s;if(o[p]!=null){console.warn(`Multiple bone entries for ${p} detected (index = ${u}), ignoring duplicated entries.`);return}o[p]={node:d}}))));let a=new yt(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){let l=new Tt(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(t){let e=Object.values(Jn).filter(n=>t[n]==null);if(e.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${e.join(", ")}`);return t}},Hn=class extends Le.BufferGeometry{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new Le.BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Le.BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,t=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let t=0;t<64;t++){let e=t/63*this._currentTheta;this._attrPos.setXYZ(t+1,this._currentRadius*Math.sin(e),0,this._currentRadius*Math.cos(e))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<63;t++)this._attrIndex.setXYZ(t*3,0,t+1,t+2);this._attrIndex.needsUpdate=!0}},kr=class extends te.BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new te.Vector3,this._currentTail=new te.Vector3,this._attrPos=new te.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new te.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},De=new b.Quaternion,bn=new b.Quaternion,Pe=new b.Vector3,Vn=new b.Vector3,In=Math.sqrt(2)/2,Wr=new b.Quaternion(0,0,-In,In),zr=new b.Vector3(0,1,0),Kn=class extends b.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=t;{let e=new Hn;e.radius=.5;let n=new b.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:b.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new b.Mesh(e,n),this.add(this._meshPitch)}{let e=new Hn;e.radius=.5;let n=new b.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:b.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new b.Mesh(e,n),this.add(this._meshYaw)}{let e=new kr;e.radius=.1;let n=new b.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new b.LineSegments(e,n),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(t){let e=b.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=e,this._meshYaw.geometry.update();let n=b.MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(Pe),this.vrmLookAt.getLookAtWorldQuaternion(De),De.multiply(this.vrmLookAt.getFaceFrontQuaternion(bn)),this._meshYaw.position.copy(Pe),this._meshYaw.quaternion.copy(De),this._meshPitch.position.copy(Pe),this._meshPitch.quaternion.copy(De),this._meshPitch.quaternion.multiply(bn.setFromAxisAngle(zr,e)),this._meshPitch.quaternion.multiply(Wr);let{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(Vn).sub(Pe),this._lineTarget.geometry.tail.copy(Vn),this._lineTarget.geometry.update(),this._lineTarget.position.copy(Pe)),super.updateMatrixWorld(t)}},Gr=new Ht.Vector3,jr=new Ht.Vector3;function wt(t,e){return t.matrixWorld.decompose(Gr,e,jr),e}function We(t){return[Math.atan2(-t.z,t.x),Math.atan2(t.y,Math.sqrt(t.x*t.x+t.z*t.z))]}function Cn(t){let e=Math.round(t/2/Math.PI);return t-2*Math.PI*e}var Un=new C.Vector3(0,0,1),Qr=new C.Vector3,Xr=new C.Vector3,Yr=new C.Vector3,qr=new C.Quaternion,mt=new C.Quaternion,On=new C.Quaternion,Zr=new C.Quaternion,ft=new C.Euler,ei=class ti{constructor(e,n){this.offsetFromHeadBone=new C.Vector3,this.autoUpdate=!0,this.faceFront=new C.Vector3(0,0,1),this.humanoid=e,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new C.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new C.Euler)}getEuler(e){return e.set(C.MathUtils.DEG2RAD*this._pitch,C.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new ti(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let n=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(e){let n=this.humanoid.getRawBoneNode("head");return wt(n,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Un)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[n,i]=We(this.faceFront);return ft.set(0,.5*Math.PI+n,i,"YZX"),e.setFromEuler(ft).premultiply(Zr.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(mt),this.getFaceFrontQuaternion(On),e.copy(Un).applyQuaternion(mt).applyQuaternion(On).applyEuler(this.getEuler(ft))}lookAt(e){let n=qr.copy(this._restHeadWorldQuaternion).multiply(qn(this.getLookAtWorldQuaternion(mt))),i=this.getLookAtWorldPosition(Xr),r=Yr.copy(e).sub(i).applyQuaternion(n).normalize(),[o,a]=We(this.faceFront),[l,s]=We(r),u=Cn(l-o),d=Cn(a-s);this._yaw=C.MathUtils.RAD2DEG*u,this._pitch=C.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Qr)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};ei.EULER_ORDER="YXZ";var ni=ei,$r=new I.Vector3(0,0,1),j=new I.Quaternion,fe=new I.Quaternion,B=new I.Euler(0,0,0,"YXZ"),Ae=class{constructor(t,e,n,i,r){this.humanoid=t,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r,this.faceFront=new I.Vector3(0,0,1),this._restQuatLeftEye=new I.Quaternion,this._restQuatRightEye=new I.Quaternion,this._restLeftEyeParentWorldQuat=new I.Quaternion,this._restRightEyeParentWorldQuat=new I.Quaternion;let o=this.humanoid.getRawBoneNode("leftEye"),a=this.humanoid.getRawBoneNode("rightEye");o&&(this._restQuatLeftEye.copy(o.quaternion),wt(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),wt(a.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(t,e){let n=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),o=this.humanoid.getNormalizedBoneNode("rightEye");n&&(e<0?B.x=-I.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):B.x=I.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?B.y=-I.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-t):B.y=I.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(t),j.setFromEuler(B),this._getWorldFaceFrontQuat(fe),r.quaternion.copy(fe).multiply(j).multiply(fe.invert()),j.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(j).premultiply(j.invert()).multiply(this._restQuatLeftEye)),i&&(e<0?B.x=-I.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):B.x=I.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?B.y=-I.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-t):B.y=I.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(t),j.setFromEuler(B),this._getWorldFaceFrontQuat(fe),o.quaternion.copy(fe).multiply(j).multiply(fe.invert()),j.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(j).premultiply(j.invert()).multiply(this._restQuatRightEye))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=I.MathUtils.RAD2DEG*t.y,n=I.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}_getWorldFaceFrontQuat(t){if(this.faceFront.distanceToSquared($r)<.01)return t.identity();let[e,n]=We(this.faceFront);return B.set(0,.5*Math.PI+e,n,"YZX"),t.setFromEuler(B)}};Ae.type="bone";var Ge=class{constructor(t,e,n,i,r){this.expressions=t,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r}applyYawPitch(t,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),t<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-t))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(t)))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=St.MathUtils.RAD2DEG*t.y,n=St.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}};Ge.type="expression";var Pt=class{constructor(t,e){this.inputMaxValue=t,this.outputScale=e}map(t){return this.outputScale*Dn(t/this.inputMaxValue)}},Jr=new Set(["1.0","1.0-beta"]),Fe=.01,qe=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot}afterRoot(t){return x(this,null,function*(){let e=t.userData.vrmHumanoid;if(e===null)return;if(e===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");let n=t.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");t.userData.vrmLookAt=yield this._import(t,e,n)}})}_import(t,e,n){return x(this,null,function*(){if(e==null||n==null)return null;let i=yield this._v1Import(t,e,n);if(i)return i;let r=yield this._v0Import(t,e,n);return r||null})}_v1Import(t,e,n){return x(this,null,function*(){var i,r,o;let a=this.parser.json;if(!(((i=a.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;let s=(r=a.extensions)==null?void 0:r.VRMC_vrm;if(!s)return null;let u=s.specVersion;if(!Jr.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;let d=s.lookAt;if(!d)return null;let h=d.type==="expression"?1:10,p=this._v1ImportRangeMap(d.rangeMapHorizontalInner,h),m=this._v1ImportRangeMap(d.rangeMapHorizontalOuter,h),c=this._v1ImportRangeMap(d.rangeMapVerticalDown,h),f=this._v1ImportRangeMap(d.rangeMapVerticalUp,h),g;d.type==="expression"?g=new Ge(n,p,m,c,f):g=new Ae(e,p,m,c,f);let M=this._importLookAt(e,g);return M.offsetFromHeadBone.fromArray((o=d.offsetFromHeadBone)!=null?o:[0,.06,0]),M})}_v1ImportRangeMap(t,e){var n,i;let r=(n=t==null?void 0:t.inputMaxValue)!=null?n:90,o=(i=t==null?void 0:t.outputScale)!=null?i:e;return r(console.error(a),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},$e=class{constructor(t){this.scene=t.scene,this.meta=t.meta,this.humanoid=t.humanoid,this.expressionManager=t.expressionManager,this.firstPerson=t.firstPerson,this.lookAt=t.lookAt}update(t){this.humanoid.update(),this.lookAt&&this.lookAt.update(t),this.expressionManager&&this.expressionManager.update()}},no=class{get name(){return"VRMC_vrm"}constructor(t,e){var n,i,r,o,a;this.parser=t;let l=e==null?void 0:e.helperRoot,s=e==null?void 0:e.autoUpdateHumanBones;this.expressionPlugin=(n=e==null?void 0:e.expressionPlugin)!=null?n:new je(t),this.firstPersonPlugin=(i=e==null?void 0:e.firstPersonPlugin)!=null?i:new Qe(t),this.humanoidPlugin=(r=e==null?void 0:e.humanoidPlugin)!=null?r:new Ye(t,{helperRoot:l,autoUpdateHumanBones:s}),this.lookAtPlugin=(o=e==null?void 0:e.lookAtPlugin)!=null?o:new qe(t,{helperRoot:l}),this.metaPlugin=(a=e==null?void 0:e.metaPlugin)!=null?a:new Ze(t)}afterRoot(t){return x(this,null,function*(){yield this.metaPlugin.afterRoot(t),yield this.humanoidPlugin.afterRoot(t),yield this.expressionPlugin.afterRoot(t),yield this.lookAtPlugin.afterRoot(t),yield this.firstPersonPlugin.afterRoot(t);let e=t.userData.vrmMeta,n=t.userData.vrmHumanoid;if(e&&n){let i=new $e({scene:t.scene,expressionManager:t.userData.vrmExpressionManager,firstPerson:t.userData.vrmFirstPerson,humanoid:n,lookAt:t.userData.vrmLookAt,meta:e});t.userData.vrmCore=i}})}};var ve=class extends $e{constructor(e){super(e),this.materials=e.materials,this.springBoneManager=e.springBoneManager,this.nodeConstraintManager=e.nodeConstraintManager}update(e){super.update(e),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(e),this.materials&&this.materials.forEach(n=>{n.update&&n.update(e)})}};var Ke=R(require("three"),1),ai=R(require("three"),1),li=R(require("three"),1),w=R(require("three"),1),di=R(require("three"),1);var io=Object.defineProperty,ri=Object.getOwnPropertySymbols,ro=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,oi=(t,e,n)=>e in t?io(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,si=(t,e)=>{for(var n in e||(e={}))ro.call(e,n)&&oi(t,n,e[n]);if(ri)for(var n of ri(e))oo.call(e,n)&&oi(t,n,e[n]);return t},de=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),so={"":3e3,srgb:3001};function ao(t,e){parseInt(li.REVISION,10)>=152?t.colorSpace=e:t.encoding=so[e]}var lo=class{get pending(){return Promise.all(this._pendings)}constructor(t,e){this._parser=t,this._materialParams=e,this._pendings=[]}assignPrimitive(t,e){e!=null&&(this._materialParams[t]=e)}assignColor(t,e,n){e!=null&&(this._materialParams[t]=new ai.Color().fromArray(e),n&&this._materialParams[t].convertSRGBToLinear())}assignTexture(t,e,n){return de(this,null,function*(){let i=de(this,null,function*(){e!=null&&(yield this._parser.assignTexture(this._materialParams,t,e),n&&ao(this._materialParams[t],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(t,e,n){return de(this,null,function*(){return this.assignTexture(t,e!=null?{index:e}:void 0,n)})}},uo=`// #define PHONG +"use strict";var xr=Object.create;var Be=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Sr=Object.getPrototypeOf,Pr=Object.prototype.hasOwnProperty;var Ar=(t,e)=>{for(var n in e)Be(t,n,{get:e[n],enumerable:!0})},wn=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wr(e))!Pr.call(t,r)&&r!==n&&Be(t,r,{get:()=>e[r],enumerable:!(i=yr(e,r))||i.enumerable});return t};var M=(t,e,n)=>(n=t!=null?xr(Sr(t)):{},wn(e||!t||!t.__esModule?Be(n,"default",{value:t,enumerable:!0}):n,t)),Lr=t=>wn(Be({},"__esModule",{value:!0}),t);var we=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())});var is={};Ar(is,{MToonMaterial:()=>mi,MToonMaterialDebugMode:()=>ci,MToonMaterialLoaderPlugin:()=>It,MToonMaterialOutlineWidthMode:()=>Vt,VRM:()=>ve,VRMAimConstraint:()=>wi,VRMCore:()=>$e,VRMCoreLoaderPlugin:()=>no,VRMExpression:()=>gt,VRMExpressionLoaderPlugin:()=>je,VRMExpressionManager:()=>vt,VRMExpressionMaterialColorBind:()=>Et,VRMExpressionMaterialColorType:()=>fe,VRMExpressionMorphTargetBind:()=>ge,VRMExpressionOverrideType:()=>Ir,VRMExpressionPresetName:()=>ze,VRMExpressionTextureTransformBind:()=>Mt,VRMFirstPerson:()=>Rt,VRMFirstPersonLoaderPlugin:()=>Xe,VRMFirstPersonMeshAnnotationType:()=>Ur,VRMHumanBoneList:()=>ke,VRMHumanBoneName:()=>Nr,VRMHumanBoneParentMap:()=>$n,VRMHumanoid:()=>yt,VRMHumanoidHelper:()=>Tt,VRMHumanoidLoaderPlugin:()=>Ye,VRMLoaderPlugin:()=>lt,VRMLookAt:()=>oi,VRMLookAtBoneApplier:()=>Pe,VRMLookAtExpressionApplier:()=>Ge,VRMLookAtHelper:()=>ni,VRMLookAtLoaderPlugin:()=>qe,VRMLookAtRangeMap:()=>Pt,VRMLookAtTypeName:()=>Kr,VRMMetaLoaderPlugin:()=>Ze,VRMNodeConstraint:()=>nt,VRMNodeConstraintHelper:()=>et,VRMNodeConstraintLoaderPlugin:()=>Ot,VRMNodeConstraintManager:()=>Si,VRMRequiredHumanBoneName:()=>ti,VRMRollConstraint:()=>Ai,VRMRotationConstraint:()=>Pi,VRMSpringBoneCollider:()=>ot,VRMSpringBoneColliderHelper:()=>rt,VRMSpringBoneColliderShape:()=>st,VRMSpringBoneColliderShapeCapsule:()=>Wt,VRMSpringBoneColliderShapePlane:()=>zt,VRMSpringBoneColliderShapeSphere:()=>jt,VRMSpringBoneJoint:()=>Ui,VRMSpringBoneJointHelper:()=>Vi,VRMSpringBoneLoaderPlugin:()=>Xt,VRMSpringBoneManager:()=>kt,VRMUtils:()=>J});module.exports=Lr(is);var Fn=M(require("three"),1),ee=M(require("three"),1),At=M(require("three"),1),Xn=M(require("three"),1),F=M(require("three"),1),q=M(require("three"),1),Qe=M(require("three"),1),k=M(require("three"),1),b=M(require("three"),1),Ae=M(require("three"),1),te=M(require("three"),1),C=M(require("three"),1),Ht=M(require("three"),1),I=M(require("three"),1),St=M(require("three"),1),si=M(require("three"),1);var x=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),gt=class extends Fn.Object3D{constructor(t){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${t}`,this.expressionName=t,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(t){this._binds.push(t)}deleteBind(t){let e=this._binds.indexOf(t);e>=0&&this._binds.splice(e,1)}applyWeight(t){var e;let n=this.outputWeight;n*=(e=t==null?void 0:t.multiplier)!=null?e:1,this.isBinary&&n<1&&(n=0),this._binds.forEach(i=>i.applyWeight(n))}clearAppliedWeight(){this._binds.forEach(t=>t.clearAppliedWeight())}};function kn(t,e,n){var i,r;let o=t.parser.json,a=(i=o.nodes)==null?void 0:i[e];if(a==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let l=a.mesh;if(l==null)return null;let s=(r=o.meshes)==null?void 0:r[l];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${l}] of glTF but the mesh doesn't exist`),null;let u=s.primitives.length,d=[];return n.traverse(h=>{d.length{let o=kn(t,r,i);o!=null&&n.set(r,o)}),n})}var ze={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function Wn(t){return Math.max(Math.min(t,1),0)}var vt=class zn{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},n=new Set(Object.values(ze));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)&&(e[i]=r)}),e}get customExpressionMap(){let e={},n=new Set(Object.values(ze));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)||(e[i]=r)}),e}copy(e){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),e._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new zn().copy(this)}getExpression(e){var n;return(n=this._expressionMap[e])!=null?n:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let n=this._expressions.indexOf(e);n===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(n,1),delete this._expressionMap[e.expressionName]}getValue(e){var n;let i=this.getExpression(e);return(n=i==null?void 0:i.weight)!=null?n:null}setValue(e,n){let i=this.getExpression(e);i&&(i.weight=Wn(n))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let n=this.getExpression(e);return n?`${n.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(n=>{n.clearAppliedWeight()}),this._expressions.forEach(n=>{let i=1,r=n.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(i*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(i*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(i*=e.mouth),n.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let e=1,n=1,i=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,n-=r.overrideLookAtAmount,i-=r.overrideMouthAmount}),e=Math.max(0,e),n=Math.max(0,n),i=Math.max(0,i),{blink:e,lookAt:n,mouth:i}}},fe={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},Hr={_Color:fe.Color,_EmissionColor:fe.EmissionColor,_ShadeColor:fe.ShadeColor,_RimColor:fe.RimColor,_OutlineColor:fe.OutlineColor},br=new At.Color,Gn=class jn{constructor({material:e,type:n,targetValue:i,targetAlpha:r}){this.material=e,this.type=n,this.targetValue=i,this.targetAlpha=r!=null?r:1;let o=this._initColorBindState(),a=this._initAlphaBindState();this._state={color:o,alpha:a}}applyWeight(e){let{color:n,alpha:i}=this._state;if(n!=null){let{propertyName:r,deltaValue:o}=n,a=this.material[r];a!=null&&a.add(br.copy(o).multiplyScalar(e))}if(i!=null){let{propertyName:r,deltaValue:o}=i;this.material[r]!=null&&(this.material[r]+=o*e)}}clearAppliedWeight(){let{color:e,alpha:n}=this._state;if(e!=null){let{propertyName:i,initialValue:r}=e,o=this.material[i];o!=null&&o.copy(r)}if(n!=null){let{propertyName:i,initialValue:r}=n;this.material[i]!=null&&(this.material[i]=r)}}_initColorBindState(){var e,n,i;let{material:r,type:o,targetValue:a}=this,l=this._getPropertyNameMap(),s=(n=(e=l==null?void 0:l[o])==null?void 0:e[0])!=null?n:null;if(s==null)return console.warn(`Tried to add a material color bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type is not supported.`),null;let d=r[s].clone(),h=new At.Color(a.r-d.r,a.g-d.g,a.b-d.b);return{propertyName:s,initialValue:d,deltaValue:h}}_initAlphaBindState(){var e,n,i;let{material:r,type:o,targetAlpha:a}=this,l=this._getPropertyNameMap(),s=(n=(e=l==null?void 0:l[o])==null?void 0:e[1])!=null?n:null;if(s==null&&a!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type does not support alpha.`),null;if(s==null)return null;let u=r[s],d=a-u;return{propertyName:s,initialValue:u,deltaValue:d}}_getPropertyNameMap(){var e,n;return(n=(e=Object.entries(jn._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:e[1])!=null?n:null}};Gn._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var Et=Gn,ge=class{constructor({primitives:t,index:e,weight:n}){this.primitives=t,this.index=e,this.weight=n}applyWeight(t){this.primitives.forEach(e=>{var n;((n=e.morphTargetInfluences)==null?void 0:n[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*t)})}clearAppliedWeight(){this.primitives.forEach(t=>{var e;((e=t.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(t.morphTargetInfluences[this.index]=0)})}},An=new Xn.Vector2,Qn=class Yn{constructor({material:e,scale:n,offset:i}){var r,o;this.material=e,this.scale=n,this.offset=i;let a=(r=Object.entries(Yn._propertyNamesMap).find(([l])=>e[l]===!0))==null?void 0:r[1];a==null?(console.warn(`Tried to add a texture transform bind to the material ${(o=e.name)!=null?o:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],a.forEach(l=>{var s;let u=(s=e[l])==null?void 0:s.clone();if(!u)return null;e[l]=u;let d=u.offset.clone(),h=u.repeat.clone(),p=i.clone().sub(d),m=n.clone().sub(h);this._properties.push({name:l,initialOffset:d,deltaOffset:p,initialScale:h,deltaScale:m})}))}applyWeight(e){this._properties.forEach(n=>{let i=this.material[n.name];i!==void 0&&(i.offset.add(An.copy(n.deltaOffset).multiplyScalar(e)),i.repeat.add(An.copy(n.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let n=this.material[e.name];n!==void 0&&(n.offset.copy(e.initialOffset),n.repeat.copy(e.initialScale))})}};Qn._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var Mt=Qn,Vr=new Set(["1.0","1.0-beta"]),qn=class Zn{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return x(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return x(this,null,function*(){let n=yield this._v1Import(e);if(n)return n;let i=yield this._v0Import(e);return i||null})}_v1Import(e){return x(this,null,function*(){var n,i;let r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;let a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;let l=a.specVersion;if(!Vr.has(l))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.expressions;if(!s)return null;let u=new Set(Object.values(ze)),d=new Map;s.preset!=null&&Object.entries(s.preset).forEach(([p,m])=>{if(m!=null){if(!u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${p}" detected. Ignoring the expression`);return}d.set(p,m)}}),s.custom!=null&&Object.entries(s.custom).forEach(([p,m])=>{if(u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${p}". Ignoring the expression`);return}d.set(p,m)});let h=new vt;return yield Promise.all(Array.from(d.entries()).map(p=>x(this,[p],function*([m,c]){var f,g,R,V,y,_,v;let E=new gt(m);if(e.scene.add(E),E.isBinary=(f=c.isBinary)!=null?f:!1,E.overrideBlink=(g=c.overrideBlink)!=null?g:"none",E.overrideLookAt=(R=c.overrideLookAt)!=null?R:"none",E.overrideMouth=(V=c.overrideMouth)!=null?V:"none",(y=c.morphTargetBinds)==null||y.forEach(T=>x(this,null,function*(){var P;if(T.node===void 0||T.index===void 0)return;let L=yield Sn(e,T.node),A=T.index;if(!L.every(S=>Array.isArray(S.morphTargetInfluences)&&A{let L=P.material;L&&(Array.isArray(L)?T.push(...L):T.push(L))}),(_=c.materialColorBinds)==null||_.forEach(P=>x(this,null,function*(){T.filter(A=>{var S;let H=(S=this.parser.associations.get(A))==null?void 0:S.materials;return P.material===H}).forEach(A=>{E.addBind(new Et({material:A,type:P.type,targetValue:new ee.Color().fromArray(P.targetValue),targetAlpha:P.targetValue[3]}))})})),(v=c.textureTransformBinds)==null||v.forEach(P=>x(this,null,function*(){T.filter(A=>{var S;let H=(S=this.parser.associations.get(A))==null?void 0:S.materials;return P.material===H}).forEach(A=>{var S,H;E.addBind(new Mt({material:A,offset:new ee.Vector2().fromArray((S=P.offset)!=null?S:[0,0]),scale:new ee.Vector2().fromArray((H=P.scale)!=null?H:[1,1])}))})}))}h.registerExpression(E)}))),h})}_v0Import(e){return x(this,null,function*(){var n;let i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.blendShapeMaster;if(!o)return null;let a=new vt,l=o.blendShapeGroups;if(!l)return a;let s=new Set;return yield Promise.all(l.map(u=>x(this,null,function*(){var d;let h=u.presetName,p=h!=null&&Zn.v0v1PresetNameMap[h]||null,m=p!=null?p:u.name;if(m==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(m)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${h} has duplicated entries. Ignoring the expression`);return}s.add(m);let c=new gt(m);e.scene.add(c),c.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(g=>x(this,null,function*(){var R;if(g.mesh===void 0||g.index===void 0)return;let V=[];(R=i.nodes)==null||R.forEach((_,v)=>{_.mesh===g.mesh&&V.push(v)});let y=g.index;yield Promise.all(V.map(_=>x(this,null,function*(){var v;let E=yield Sn(e,_);if(!E.every(T=>Array.isArray(T.morphTargetInfluences)&&y{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;let R=[];e.scene.traverse(y=>{if(y.material){let _=y.material;Array.isArray(_)?R.push(..._.filter(v=>(v.name===g.materialName||v.name===g.materialName+" (Outline)")&&R.indexOf(v)===-1)):_.name===g.materialName&&R.indexOf(_)===-1&&R.push(_)}});let V=g.propertyName;R.forEach(y=>{if(V==="_MainTex_ST"){let v=new ee.Vector2(g.targetValue[0],g.targetValue[1]),E=new ee.Vector2(g.targetValue[2],g.targetValue[3]);E.y=1-E.y-v.y,c.addBind(new Mt({material:y,scale:v,offset:E}));return}let _=Hr[V];if(_){c.addBind(new Et({material:y,type:_,targetValue:new ee.Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(V+" is not supported")})}),a.registerExpression(c)}))),a})}};qn.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var je=qn,Ir={None:"none",Block:"block",Blend:"blend"},Lt=class _e{constructor(e,n){this._firstPersonOnlyLayer=_e.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=_e.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=n}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(n=>({meshes:n.meshes.concat(),type:n.type})),this}clone(){return new _e(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=_e.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=_e.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(i=>{i.meshes.forEach(r=>{i.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(o=>o.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(o=>o.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(e,n,i,r){let o=0;if(n!=null&&n.length>0)for(let a=0;a0&&r.includes(h[0])||d[1]>0&&r.includes(h[1])||d[2]>0&&r.includes(h[2])||d[3]>0&&r.includes(h[3]))continue;let p=n[s],m=i[s];if(p[0]>0&&r.includes(m[0])||p[1]>0&&r.includes(m[1])||p[2]>0&&r.includes(m[2])||p[3]>0&&r.includes(m[3]))continue;let c=n[u],f=i[u];c[0]>0&&r.includes(f[0])||c[1]>0&&r.includes(f[1])||c[2]>0&&r.includes(f[2])||c[3]>0&&r.includes(f[3])||(e[o++]=l,e[o++]=s,e[o++]=u)}return o}_createErasedMesh(e,n){let i=new F.SkinnedMesh(e.geometry.clone(),e.material);i.name=`${e.name}(erase)`,i.frustumCulled=e.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);let r=i.geometry,o=r.getAttribute("skinIndex"),a=o instanceof F.GLBufferAttribute?[]:o.array,l=[];for(let f=0;f{this._isEraseTarget(o)&&i.push(a)}),!i.length){n.layers.enable(this._thirdPersonOnlyLayer),n.layers.enable(this._firstPersonOnlyLayer);return}n.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(n,i);e.add(r)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer));else{let n=new F.Group;n.name=`_headless_${e.name}`,n.layers.set(this._firstPersonOnlyLayer),e.parent.add(n),e.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{let r=i;this._createHeadlessModelForSkinnedMesh(n,r)})}else if(e.type==="SkinnedMesh"){let n=e;this._createHeadlessModelForSkinnedMesh(e.parent,n)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};Lt.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;Lt.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var Rt=Lt,Cr=new Set(["1.0","1.0-beta"]),Xe=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return x(this,null,function*(){let e=t.userData.vrmHumanoid;if(e!==null){if(e===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");t.userData.vrmFirstPerson=yield this._import(t,e)}})}_import(t,e){return x(this,null,function*(){if(e==null)return null;let n=yield this._v1Import(t,e);if(n)return n;let i=yield this._v0Import(t,e);return i||null})}_v1Import(t,e){return x(this,null,function*(){var n,i;let r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;let a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;let l=a.specVersion;if(!Cr.has(l))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.firstPerson,u=[],d=yield Pn(t);return Array.from(d.entries()).forEach(([h,p])=>{var m,c;let f=(m=s==null?void 0:s.meshAnnotations)==null?void 0:m.find(g=>g.node===h);u.push({meshes:p,type:(c=f==null?void 0:f.type)!=null?c:"auto"})}),new Rt(e,u)})}_v0Import(t,e){return x(this,null,function*(){var n;let i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.firstPerson;if(!o)return null;let a=[],l=yield Pn(t);return Array.from(l.entries()).forEach(([s,u])=>{let d=i.nodes[s],h=o.meshAnnotations?o.meshAnnotations.find(p=>p.mesh===d.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(h==null?void 0:h.firstPersonFlag)})}),new Rt(e,a)})}_convertV0FlagToV1Type(t){return t==="FirstPersonOnly"?"firstPersonOnly":t==="ThirdPersonOnly"?"thirdPersonOnly":t==="Both"?"both":"auto"}},Ur={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"},Ln=new q.Vector3,Hn=new q.Vector3,Or=new q.Quaternion,Tt=class extends q.Group{constructor(t){super(),this.vrmHumanoid=t,this._boneAxesMap=new Map,Object.values(t.humanBones).forEach(e=>{let n=new q.AxesHelper(1);n.matrixAutoUpdate=!1,n.material.depthTest=!1,n.material.depthWrite=!1,this.add(n),this._boneAxesMap.set(e,n)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(t=>{t.geometry.dispose(),t.material.dispose()})}updateMatrixWorld(t){Array.from(this._boneAxesMap.entries()).forEach(([e,n])=>{e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(Ln,Or,Hn);let i=Ln.set(.1,.1,.1).divide(Hn);n.matrix.copy(e.node.matrixWorld).scale(i)}),super.updateMatrixWorld(t)}},ke=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],Nr={Hips:"hips",Spine:"spine",Chest:"chest",UpperChest:"upperChest",Neck:"neck",Head:"head",LeftEye:"leftEye",RightEye:"rightEye",Jaw:"jaw",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",LeftToes:"leftToes",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",RightToes:"rightToes",LeftShoulder:"leftShoulder",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightShoulder:"rightShoulder",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand",LeftThumbMetacarpal:"leftThumbMetacarpal",LeftThumbProximal:"leftThumbProximal",LeftThumbDistal:"leftThumbDistal",LeftIndexProximal:"leftIndexProximal",LeftIndexIntermediate:"leftIndexIntermediate",LeftIndexDistal:"leftIndexDistal",LeftMiddleProximal:"leftMiddleProximal",LeftMiddleIntermediate:"leftMiddleIntermediate",LeftMiddleDistal:"leftMiddleDistal",LeftRingProximal:"leftRingProximal",LeftRingIntermediate:"leftRingIntermediate",LeftRingDistal:"leftRingDistal",LeftLittleProximal:"leftLittleProximal",LeftLittleIntermediate:"leftLittleIntermediate",LeftLittleDistal:"leftLittleDistal",RightThumbMetacarpal:"rightThumbMetacarpal",RightThumbProximal:"rightThumbProximal",RightThumbDistal:"rightThumbDistal",RightIndexProximal:"rightIndexProximal",RightIndexIntermediate:"rightIndexIntermediate",RightIndexDistal:"rightIndexDistal",RightMiddleProximal:"rightMiddleProximal",RightMiddleIntermediate:"rightMiddleIntermediate",RightMiddleDistal:"rightMiddleDistal",RightRingProximal:"rightRingProximal",RightRingIntermediate:"rightRingIntermediate",RightRingDistal:"rightRingDistal",RightLittleProximal:"rightLittleProximal",RightLittleIntermediate:"rightLittleIntermediate",RightLittleDistal:"rightLittleDistal"},$n={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function Jn(t){return t.invert?t.invert():t.inverse(),t}var ae=new Qe.Vector3,le=new Qe.Quaternion,xt=class{constructor(t){this.humanBones=t,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);i&&(ae.copy(i.position),le.copy(i.quaternion),t[n]={position:ae.toArray(),rotation:le.toArray()})}),t}getPose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);if(!i)return;ae.set(0,0,0),le.identity();let r=this.restPose[n];r!=null&&r.position&&ae.fromArray(r.position).negate(),r!=null&&r.rotation&&Jn(le.fromArray(r.rotation)),ae.add(i.position),le.premultiply(i.quaternion),t[n]={position:ae.toArray(),rotation:le.toArray()}}),t}setPose(t){Object.entries(t).forEach(([e,n])=>{let i=e,r=this.getBoneNode(i);if(!r)return;let o=this.restPose[i];o&&(n!=null&&n.position&&(r.position.fromArray(n.position),o.position&&r.position.add(ae.fromArray(o.position))),n!=null&&n.rotation&&(r.quaternion.fromArray(n.rotation),o.rotation&&r.quaternion.multiply(le.fromArray(o.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([t,e])=>{let n=this.getBoneNode(t);n&&(e!=null&&e.position&&n.position.fromArray(e.position),e!=null&&e.rotation&&n.quaternion.fromArray(e.rotation))})}getBone(t){var e;return(e=this.humanBones[t])!=null?e:void 0}getBoneNode(t){var e,n;return(n=(e=this.humanBones[t])==null?void 0:e.node)!=null?n:null}},mt=new k.Vector3,Br=new k.Quaternion,Dr=new k.Vector3,bn=class Kn extends xt{static _setupTransforms(e){let n=new k.Object3D;n.name="VRMHumanoidRig";let i={},r={},o={},a={};ke.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let h=new k.Vector3,p=new k.Quaternion;d.updateWorldMatrix(!0,!1),d.matrixWorld.decompose(h,p,mt),i[s]=h,r[s]=p,o[s]=d.quaternion.clone();let m=new k.Quaternion;(u=d.parent)==null||u.matrixWorld.decompose(mt,m,mt),a[s]=m}});let l={};return ke.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let h=i[s],p=s,m;for(;m==null&&(p=$n[p],p!=null);)m=i[p];let c=new k.Object3D;c.name="Normalized_"+d.name,(p?(u=l[p])==null?void 0:u.node:n).add(c),c.position.copy(h),m&&c.position.sub(m),l[s]={node:c}}}),{rigBones:l,root:n,parentWorldRotations:a,boneRotations:o}}constructor(e){let{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=Kn._setupTransforms(e);super(n),this.original=e,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){ke.forEach(e=>{let n=this.original.getBoneNode(e);if(n!=null){let i=this.getBoneNode(e),r=this._parentWorldRotations[e],o=Br.copy(r).invert(),a=this._boneRotations[e];if(n.quaternion.copy(i.quaternion).multiply(r).premultiply(o).multiply(a),e==="hips"){let l=i.getWorldPosition(Dr);n.parent.updateWorldMatrix(!0,!1);let s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},yt=class ei{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,n){var i;this.autoUpdateHumanBones=(i=n==null?void 0:n.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new xt(e),this._normalizedHumanBones=new bn(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new xt(e.humanBones),this._normalizedHumanBones=new bn(this._rawHumanBones),this}clone(){return new ei(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},ti={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},Fr=new Set(["1.0","1.0-beta"]),Vn={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},Ye=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot,this.autoUpdateHumanBones=e==null?void 0:e.autoUpdateHumanBones}afterRoot(t){return x(this,null,function*(){t.userData.vrmHumanoid=yield this._import(t)})}_import(t){return x(this,null,function*(){let e=yield this._v1Import(t);if(e)return e;let n=yield this._v0Import(t);return n||null})}_v1Import(t){return x(this,null,function*(){var e,n;let i=this.parser.json;if(!(((e=i.extensionsUsed)==null?void 0:e.indexOf("VRMC_vrm"))!==-1))return null;let o=(n=i.extensions)==null?void 0:n.VRMC_vrm;if(!o)return null;let a=o.specVersion;if(!Fr.has(a))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;let l=o.humanoid;if(!l)return null;let s=l.humanBones.leftThumbIntermediate!=null||l.humanBones.rightThumbIntermediate!=null,u={};l.humanBones!=null&&(yield Promise.all(Object.entries(l.humanBones).map(h=>x(this,[h],function*([p,m]){let c=p,f=m.node;if(s){let R=Vn[c];R!=null&&(c=R)}let g=yield this.parser.getDependency("node",f);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${c} (index = ${f}) does not exist`);return}u[c]={node:g}}))));let d=new yt(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(d.normalizedHumanBonesRoot),this.helperRoot){let h=new Tt(d);this.helperRoot.add(h),h.renderOrder=this.helperRoot.renderOrder}return d})}_v0Import(t){return x(this,null,function*(){var e;let i=(e=this.parser.json.extensions)==null?void 0:e.VRM;if(!i)return null;let r=i.humanoid;if(!r)return null;let o={};r.humanBones!=null&&(yield Promise.all(r.humanBones.map(l=>x(this,null,function*(){let s=l.bone,u=l.node;if(s==null||u==null)return;let d=yield this.parser.getDependency("node",u);if(d==null){console.warn(`A glTF node bound to the humanoid bone ${s} (index = ${u}) does not exist`);return}let h=Vn[s],p=h!=null?h:s;if(o[p]!=null){console.warn(`Multiple bone entries for ${p} detected (index = ${u}), ignoring duplicated entries.`);return}o[p]={node:d}}))));let a=new yt(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){let l=new Tt(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(t){let e=Object.values(ti).filter(n=>t[n]==null);if(e.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${e.join(", ")}`);return t}},In=class extends Ae.BufferGeometry{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new Ae.BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Ae.BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,t=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let t=0;t<64;t++){let e=t/63*this._currentTheta;this._attrPos.setXYZ(t+1,this._currentRadius*Math.sin(e),0,this._currentRadius*Math.cos(e))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<63;t++)this._attrIndex.setXYZ(t*3,0,t+1,t+2);this._attrIndex.needsUpdate=!0}},kr=class extends te.BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new te.Vector3,this._currentTail=new te.Vector3,this._attrPos=new te.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new te.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},De=new b.Quaternion,Cn=new b.Quaternion,Se=new b.Vector3,Un=new b.Vector3,On=Math.sqrt(2)/2,Wr=new b.Quaternion(0,0,-On,On),zr=new b.Vector3(0,1,0),ni=class extends b.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=t;{let e=new In;e.radius=.5;let n=new b.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:b.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new b.Mesh(e,n),this.add(this._meshPitch)}{let e=new In;e.radius=.5;let n=new b.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:b.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new b.Mesh(e,n),this.add(this._meshYaw)}{let e=new kr;e.radius=.1;let n=new b.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new b.LineSegments(e,n),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(t){let e=b.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=e,this._meshYaw.geometry.update();let n=b.MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(Se),this.vrmLookAt.getLookAtWorldQuaternion(De),De.multiply(this.vrmLookAt.getFaceFrontQuaternion(Cn)),this._meshYaw.position.copy(Se),this._meshYaw.quaternion.copy(De),this._meshPitch.position.copy(Se),this._meshPitch.quaternion.copy(De),this._meshPitch.quaternion.multiply(Cn.setFromAxisAngle(zr,e)),this._meshPitch.quaternion.multiply(Wr);let{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(Un).sub(Se),this._lineTarget.geometry.tail.copy(Un),this._lineTarget.geometry.update(),this._lineTarget.position.copy(Se)),super.updateMatrixWorld(t)}},Gr=new Ht.Vector3,jr=new Ht.Vector3;function wt(t,e){return t.matrixWorld.decompose(Gr,e,jr),e}function We(t){return[Math.atan2(-t.z,t.x),Math.atan2(t.y,Math.sqrt(t.x*t.x+t.z*t.z))]}function Nn(t){let e=Math.round(t/2/Math.PI);return t-2*Math.PI*e}var Bn=new C.Vector3(0,0,1),Xr=new C.Vector3,Qr=new C.Vector3,Yr=new C.Vector3,qr=new C.Quaternion,ft=new C.Quaternion,Dn=new C.Quaternion,Zr=new C.Quaternion,_t=new C.Euler,ii=class ri{constructor(e,n){this.offsetFromHeadBone=new C.Vector3,this.autoUpdate=!0,this.faceFront=new C.Vector3(0,0,1),this.humanoid=e,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new C.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new C.Euler)}getEuler(e){return e.set(C.MathUtils.DEG2RAD*this._pitch,C.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new ri(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let n=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(e){let n=this.humanoid.getRawBoneNode("head");return wt(n,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Bn)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[n,i]=We(this.faceFront);return _t.set(0,.5*Math.PI+n,i,"YZX"),e.setFromEuler(_t).premultiply(Zr.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(ft),this.getFaceFrontQuaternion(Dn),e.copy(Bn).applyQuaternion(ft).applyQuaternion(Dn).applyEuler(this.getEuler(_t))}lookAt(e){let n=qr.copy(this._restHeadWorldQuaternion).multiply(Jn(this.getLookAtWorldQuaternion(ft))),i=this.getLookAtWorldPosition(Qr),r=Yr.copy(e).sub(i).applyQuaternion(n).normalize(),[o,a]=We(this.faceFront),[l,s]=We(r),u=Nn(l-o),d=Nn(a-s);this._yaw=C.MathUtils.RAD2DEG*u,this._pitch=C.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Xr)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};ii.EULER_ORDER="YXZ";var oi=ii,$r=new I.Vector3(0,0,1),j=new I.Quaternion,me=new I.Quaternion,B=new I.Euler(0,0,0,"YXZ"),Pe=class{constructor(t,e,n,i,r){this.humanoid=t,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r,this.faceFront=new I.Vector3(0,0,1),this._restQuatLeftEye=new I.Quaternion,this._restQuatRightEye=new I.Quaternion,this._restLeftEyeParentWorldQuat=new I.Quaternion,this._restRightEyeParentWorldQuat=new I.Quaternion;let o=this.humanoid.getRawBoneNode("leftEye"),a=this.humanoid.getRawBoneNode("rightEye");o&&(this._restQuatLeftEye.copy(o.quaternion),wt(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),wt(a.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(t,e){let n=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),o=this.humanoid.getNormalizedBoneNode("rightEye");n&&(e<0?B.x=-I.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):B.x=I.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?B.y=-I.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-t):B.y=I.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(t),j.setFromEuler(B),this._getWorldFaceFrontQuat(me),r.quaternion.copy(me).multiply(j).multiply(me.invert()),j.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(j).premultiply(j.invert()).multiply(this._restQuatLeftEye)),i&&(e<0?B.x=-I.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):B.x=I.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?B.y=-I.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-t):B.y=I.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(t),j.setFromEuler(B),this._getWorldFaceFrontQuat(me),o.quaternion.copy(me).multiply(j).multiply(me.invert()),j.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(j).premultiply(j.invert()).multiply(this._restQuatRightEye))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=I.MathUtils.RAD2DEG*t.y,n=I.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}_getWorldFaceFrontQuat(t){if(this.faceFront.distanceToSquared($r)<.01)return t.identity();let[e,n]=We(this.faceFront);return B.set(0,.5*Math.PI+e,n,"YZX"),t.setFromEuler(B)}};Pe.type="bone";var Ge=class{constructor(t,e,n,i,r){this.expressions=t,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r}applyYawPitch(t,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),t<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-t))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(t)))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=St.MathUtils.RAD2DEG*t.y,n=St.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}};Ge.type="expression";var Pt=class{constructor(t,e){this.inputMaxValue=t,this.outputScale=e}map(t){return this.outputScale*Wn(t/this.inputMaxValue)}},Jr=new Set(["1.0","1.0-beta"]),Fe=.01,qe=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot}afterRoot(t){return x(this,null,function*(){let e=t.userData.vrmHumanoid;if(e===null)return;if(e===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");let n=t.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");t.userData.vrmLookAt=yield this._import(t,e,n)}})}_import(t,e,n){return x(this,null,function*(){if(e==null||n==null)return null;let i=yield this._v1Import(t,e,n);if(i)return i;let r=yield this._v0Import(t,e,n);return r||null})}_v1Import(t,e,n){return x(this,null,function*(){var i,r,o;let a=this.parser.json;if(!(((i=a.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;let s=(r=a.extensions)==null?void 0:r.VRMC_vrm;if(!s)return null;let u=s.specVersion;if(!Jr.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;let d=s.lookAt;if(!d)return null;let h=d.type==="expression"?1:10,p=this._v1ImportRangeMap(d.rangeMapHorizontalInner,h),m=this._v1ImportRangeMap(d.rangeMapHorizontalOuter,h),c=this._v1ImportRangeMap(d.rangeMapVerticalDown,h),f=this._v1ImportRangeMap(d.rangeMapVerticalUp,h),g;d.type==="expression"?g=new Ge(n,p,m,c,f):g=new Pe(e,p,m,c,f);let R=this._importLookAt(e,g);return R.offsetFromHeadBone.fromArray((o=d.offsetFromHeadBone)!=null?o:[0,.06,0]),R})}_v1ImportRangeMap(t,e){var n,i;let r=(n=t==null?void 0:t.inputMaxValue)!=null?n:90,o=(i=t==null?void 0:t.outputScale)!=null?i:e;return r(console.error(a),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},$e=class{constructor(t){this.scene=t.scene,this.meta=t.meta,this.humanoid=t.humanoid,this.expressionManager=t.expressionManager,this.firstPerson=t.firstPerson,this.lookAt=t.lookAt}update(t){this.humanoid.update(),this.lookAt&&this.lookAt.update(t),this.expressionManager&&this.expressionManager.update()}},no=class{get name(){return"VRMC_vrm"}constructor(t,e){var n,i,r,o,a;this.parser=t;let l=e==null?void 0:e.helperRoot,s=e==null?void 0:e.autoUpdateHumanBones;this.expressionPlugin=(n=e==null?void 0:e.expressionPlugin)!=null?n:new je(t),this.firstPersonPlugin=(i=e==null?void 0:e.firstPersonPlugin)!=null?i:new Xe(t),this.humanoidPlugin=(r=e==null?void 0:e.humanoidPlugin)!=null?r:new Ye(t,{helperRoot:l,autoUpdateHumanBones:s}),this.lookAtPlugin=(o=e==null?void 0:e.lookAtPlugin)!=null?o:new qe(t,{helperRoot:l}),this.metaPlugin=(a=e==null?void 0:e.metaPlugin)!=null?a:new Ze(t)}afterRoot(t){return x(this,null,function*(){yield this.metaPlugin.afterRoot(t),yield this.humanoidPlugin.afterRoot(t),yield this.expressionPlugin.afterRoot(t),yield this.lookAtPlugin.afterRoot(t),yield this.firstPersonPlugin.afterRoot(t);let e=t.userData.vrmMeta,n=t.userData.vrmHumanoid;if(e&&n){let i=new $e({scene:t.scene,expressionManager:t.userData.vrmExpressionManager,firstPerson:t.userData.vrmFirstPerson,humanoid:n,lookAt:t.userData.vrmLookAt,meta:e});t.userData.vrmCore=i}})}};var ve=class extends $e{constructor(e){super(e),this.materials=e.materials,this.springBoneManager=e.springBoneManager,this.nodeConstraintManager=e.nodeConstraintManager}update(e){super.update(e),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(e),this.materials&&this.materials.forEach(n=>{n.update&&n.update(e)})}};var Ke=M(require("three"),1),di=M(require("three"),1),hi=M(require("three"),1),w=M(require("three"),1),pi=M(require("three"),1);var io=Object.defineProperty,ai=Object.getOwnPropertySymbols,ro=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,li=(t,e,n)=>e in t?io(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ui=(t,e)=>{for(var n in e||(e={}))ro.call(e,n)&&li(t,n,e[n]);if(ai)for(var n of ai(e))oo.call(e,n)&&li(t,n,e[n]);return t},ue=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),so={"":3e3,srgb:3001};function ao(t,e){parseInt(hi.REVISION,10)>=152?t.colorSpace=e:t.encoding=so[e]}var lo=class{get pending(){return Promise.all(this._pendings)}constructor(t,e){this._parser=t,this._materialParams=e,this._pendings=[]}assignPrimitive(t,e){e!=null&&(this._materialParams[t]=e)}assignColor(t,e,n){e!=null&&(this._materialParams[t]=new di.Color().fromArray(e),n&&this._materialParams[t].convertSRGBToLinear())}assignTexture(t,e,n){return ue(this,null,function*(){let i=ue(this,null,function*(){e!=null&&(yield this._parser.assignTexture(this._materialParams,t,e),n&&ao(this._materialParams[t],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(t,e,n){return ue(this,null,function*(){return this.assignTexture(t,e!=null?{index:e}:void 0,n)})}},uo=`// #define PHONG varying vec3 vViewPosition; @@ -919,11 +919,11 @@ void main() { gl_FragColor = vec4( col, diffuseColor.a ); postCorrection(); } -`,ui={None:"none",Normal:"normal",LitShadeRate:"litShadeRate",UV:"uv"},Vt={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},co={3e3:"",3001:"srgb"};function bt(t){return parseInt(di.REVISION,10)>=152?t.colorSpace:co[t.encoding]}var hi=class extends w.ShaderMaterial{constructor(t={}){var e;super({vertexShader:uo,fragmentShader:ho}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=w.TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=ui.None,this._outlineWidthMode=Vt.None,this._isOutline=!1,t.transparentWithZWrite&&(t.depthWrite=!0),delete t.transparentWithZWrite,t.fog=!0,t.lights=!0,t.clipping=!0,this.uniforms=w.UniformsUtils.merge([w.UniformsLib.common,w.UniformsLib.normalmap,w.UniformsLib.emissivemap,w.UniformsLib.fog,w.UniformsLib.lights,{litFactor:{value:new w.Color(1,1,1)},mapUvTransform:{value:new w.Matrix3},colorAlpha:{value:1},normalMapUvTransform:{value:new w.Matrix3},shadeColorFactor:{value:new w.Color(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new w.Matrix3},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new w.Matrix3},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new w.Color(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new w.Matrix3},parametricRimColorFactor:{value:new w.Color(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new w.Matrix3},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new w.Color(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new w.Matrix3},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new w.Matrix3},outlineWidthFactor:{value:0},outlineColorFactor:{value:new w.Color(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new w.Matrix3},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(e=t.uniforms)!=null?e:{}]),this.setValues(t),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([n,i])=>`${n}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${bt(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${bt(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${bt(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{let i=parseInt(w.REVISION,10),r=Object.entries(si(si({},this._generateDefines()),this.defines)).filter(([o,a])=>!!a).map(([o,a])=>`#define ${o} ${a}`).join(` +`,ci={None:"none",Normal:"normal",LitShadeRate:"litShadeRate",UV:"uv"},Vt={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},co={3e3:"",3001:"srgb"};function bt(t){return parseInt(pi.REVISION,10)>=152?t.colorSpace:co[t.encoding]}var mi=class extends w.ShaderMaterial{constructor(t={}){var e;super({vertexShader:uo,fragmentShader:ho}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=w.TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=ci.None,this._outlineWidthMode=Vt.None,this._isOutline=!1,t.transparentWithZWrite&&(t.depthWrite=!0),delete t.transparentWithZWrite,t.fog=!0,t.lights=!0,t.clipping=!0,this.uniforms=w.UniformsUtils.merge([w.UniformsLib.common,w.UniformsLib.normalmap,w.UniformsLib.emissivemap,w.UniformsLib.fog,w.UniformsLib.lights,{litFactor:{value:new w.Color(1,1,1)},mapUvTransform:{value:new w.Matrix3},colorAlpha:{value:1},normalMapUvTransform:{value:new w.Matrix3},shadeColorFactor:{value:new w.Color(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new w.Matrix3},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new w.Matrix3},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new w.Color(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new w.Matrix3},parametricRimColorFactor:{value:new w.Color(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new w.Matrix3},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new w.Color(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new w.Matrix3},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new w.Matrix3},outlineWidthFactor:{value:0},outlineColorFactor:{value:new w.Color(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new w.Matrix3},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(e=t.uniforms)!=null?e:{}]),this.setValues(t),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([n,i])=>`${n}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${bt(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${bt(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${bt(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{let i=parseInt(w.REVISION,10),r=Object.entries(ui(ui({},this._generateDefines()),this.defines)).filter(([o,a])=>!!a).map(([o,a])=>`#define ${o} ${a}`).join(` `)+` -`;n.vertexShader=r+n.vertexShader,n.fragmentShader=r+n.fragmentShader,i<154&&(n.fragmentShader=n.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(t){this.uniforms.litFactor.value=t}get map(){return this.uniforms.map.value}set map(t){this.uniforms.map.value=t}get normalMap(){return this.uniforms.normalMap.value}set normalMap(t){this.uniforms.normalMap.value=t}get normalScale(){return this.uniforms.normalScale.value}set normalScale(t){this.uniforms.normalScale.value=t}get emissive(){return this.uniforms.emissive.value}set emissive(t){this.uniforms.emissive.value=t}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(t){this.uniforms.emissiveIntensity.value=t}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(t){this.uniforms.emissiveMap.value=t}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(t){this.uniforms.shadeColorFactor.value=t}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(t){this.uniforms.shadeMultiplyTexture.value=t}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(t){this.uniforms.shadingShiftFactor.value=t}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(t){this.uniforms.shadingShiftTexture.value=t}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(t){this.uniforms.shadingShiftTextureScale.value=t}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(t){this.uniforms.shadingToonyFactor.value=t}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(t){this.uniforms.giEqualizationFactor.value=t}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(t){this.uniforms.matcapFactor.value=t}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(t){this.uniforms.matcapTexture.value=t}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(t){this.uniforms.parametricRimColorFactor.value=t}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(t){this.uniforms.rimMultiplyTexture.value=t}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(t){this.uniforms.rimLightingMixFactor.value=t}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(t){this.uniforms.parametricRimFresnelPowerFactor.value=t}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(t){this.uniforms.parametricRimLiftFactor.value=t}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(t){this.uniforms.outlineWidthMultiplyTexture.value=t}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(t){this.uniforms.outlineWidthFactor.value=t}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(t){this.uniforms.outlineColorFactor.value=t}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(t){this.uniforms.outlineLightingMixFactor.value=t}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(t){this.uniforms.uvAnimationMaskTexture.value=t}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(t){this.uniforms.uvAnimationScrollXOffset.value=t}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(t){this.uniforms.uvAnimationScrollYOffset.value=t}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(t){this.uniforms.uvAnimationRotationPhase.value=t}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(t){this._ignoreVertexColor=t,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(t){this._v0CompatShade=t,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(t){this._debugMode=t,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(t){this._outlineWidthMode=t,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(t){this._isOutline=t,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(t){this._uploadUniformsWorkaround(),this._updateUVAnimation(t)}copy(t){return super.copy(t),this.map=t.map,this.normalMap=t.normalMap,this.emissiveMap=t.emissiveMap,this.shadeMultiplyTexture=t.shadeMultiplyTexture,this.shadingShiftTexture=t.shadingShiftTexture,this.matcapTexture=t.matcapTexture,this.rimMultiplyTexture=t.rimMultiplyTexture,this.outlineWidthMultiplyTexture=t.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=t.uvAnimationMaskTexture,this.normalMapType=t.normalMapType,this.uvAnimationScrollXSpeedFactor=t.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=t.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=t.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=t.ignoreVertexColor,this.v0CompatShade=t.v0CompatShade,this.debugMode=t.debugMode,this.outlineWidthMode=t.outlineWidthMode,this.isOutline=t.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(t){this.uniforms.uvAnimationScrollXOffset.value+=t*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=t*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=t*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){let t=parseInt(w.REVISION,10),e=this.outlineWidthMultiplyTexture!==null,n=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:t,OUTLINE:this._isOutline,MTOON_USE_UV:e||n,MTOON_UVS_VERTEX_ONLY:e&&!n,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===Vt.ScreenCoordinates}}_updateTextureMatrix(t,e){t.value&&(t.value.matrixAutoUpdate&&t.value.updateMatrix(),e.value.copy(t.value.matrix))}},po=new Set(["1.0","1.0-beta"]),ci=class Je{get name(){return Je.EXTENSION_NAME}constructor(e,n={}){var i,r,o,a;this.parser=e,this.materialType=(i=n.materialType)!=null?i:hi,this.renderOrderOffset=(r=n.renderOrderOffset)!=null?r:0,this.v0CompatShade=(o=n.v0CompatShade)!=null?o:!1,this.debugMode=(a=n.debugMode)!=null?a:"none",this._mToonMaterialSet=new Set}beforeRoot(){return de(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return de(this,null,function*(){e.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(e){return this._getMToonExtension(e)?this.materialType:null}extendMaterialParams(e,n){let i=this._getMToonExtension(e);return i?this._extendMaterialParams(i,n):null}loadMesh(e){return de(this,null,function*(){var n;let i=this.parser,o=(n=i.json.meshes)==null?void 0:n[e];if(o==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${e}] of glTF but the mesh doesn't exist`);let a=o.primitives,l=yield i.loadMesh(e);if(a.length===1){let s=l,u=a[0].material;u!=null&&this._setupPrimitive(s,u)}else{let s=l;for(let u=0;u{var a;this._getMToonExtension(o)&&((a=r.extensions)!=null&&a.KHR_materials_unlit)&&delete r.extensions.KHR_materials_unlit})}_getMToonExtension(e){var n,i;let a=(n=this.parser.json.materials)==null?void 0:n[e];if(a==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}let l=(i=a.extensions)==null?void 0:i[Je.EXTENSION_NAME];if(l==null)return;let s=l.specVersion;if(!po.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${Je.EXTENSION_NAME} specVersion "${s}"`);return}return l}_extendMaterialParams(e,n){return de(this,null,function*(){var i;delete n.metalness,delete n.roughness;let r=new lo(this.parser,n);r.assignPrimitive("transparentWithZWrite",e.transparentWithZWrite),r.assignColor("shadeColorFactor",e.shadeColorFactor),r.assignTexture("shadeMultiplyTexture",e.shadeMultiplyTexture,!0),r.assignPrimitive("shadingShiftFactor",e.shadingShiftFactor),r.assignTexture("shadingShiftTexture",e.shadingShiftTexture,!0),r.assignPrimitive("shadingShiftTextureScale",(i=e.shadingShiftTexture)==null?void 0:i.scale),r.assignPrimitive("shadingToonyFactor",e.shadingToonyFactor),r.assignPrimitive("giEqualizationFactor",e.giEqualizationFactor),r.assignColor("matcapFactor",e.matcapFactor),r.assignTexture("matcapTexture",e.matcapTexture,!0),r.assignColor("parametricRimColorFactor",e.parametricRimColorFactor),r.assignTexture("rimMultiplyTexture",e.rimMultiplyTexture,!0),r.assignPrimitive("rimLightingMixFactor",e.rimLightingMixFactor),r.assignPrimitive("parametricRimFresnelPowerFactor",e.parametricRimFresnelPowerFactor),r.assignPrimitive("parametricRimLiftFactor",e.parametricRimLiftFactor),r.assignPrimitive("outlineWidthMode",e.outlineWidthMode),r.assignPrimitive("outlineWidthFactor",e.outlineWidthFactor),r.assignTexture("outlineWidthMultiplyTexture",e.outlineWidthMultiplyTexture,!1),r.assignColor("outlineColorFactor",e.outlineColorFactor),r.assignPrimitive("outlineLightingMixFactor",e.outlineLightingMixFactor),r.assignTexture("uvAnimationMaskTexture",e.uvAnimationMaskTexture,!1),r.assignPrimitive("uvAnimationScrollXSpeedFactor",e.uvAnimationScrollXSpeedFactor),r.assignPrimitive("uvAnimationScrollYSpeedFactor",e.uvAnimationScrollYSpeedFactor),r.assignPrimitive("uvAnimationRotationSpeedFactor",e.uvAnimationRotationSpeedFactor),r.assignPrimitive("v0CompatShade",this.v0CompatShade),r.assignPrimitive("debugMode",this.debugMode),yield r.pending})}_setupPrimitive(e,n){let i=this._getMToonExtension(n);if(i){let r=this._parseRenderOrder(i);e.renderOrder=r+this.renderOrderOffset,this._generateOutline(e),this._addToMaterialSet(e);return}}_shouldGenerateOutline(e){return typeof e.outlineWidthMode=="string"&&e.outlineWidthMode!=="none"&&typeof e.outlineWidthFactor=="number"&&e.outlineWidthFactor>0}_generateOutline(e){let n=e.material;if(!(n instanceof Ke.Material)||!this._shouldGenerateOutline(n))return;e.material=[n];let i=n.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=Ke.BackSide,e.material.push(i);let r=e.geometry,o=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,o,0),r.addGroup(0,o,1)}_addToMaterialSet(e){let n=e.material,i=new Set;Array.isArray(n)?n.forEach(r=>i.add(r)):i.add(n);for(let r of i)this._mToonMaterialSet.add(r)}_parseRenderOrder(e){var n;return(e.transparentWithZWrite?0:19)+((n=e.renderQueueOffsetNumber)!=null?n:0)}};ci.EXTENSION_NAME="VRMC_materials_mtoon";var It=ci;var mo=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),pi=class Ct{get name(){return Ct.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,n){return mo(this,null,function*(){let i=this._getHDREmissiveMultiplierExtension(e);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");let r=i.emissiveMultiplier;n.emissiveIntensity=r})}_getHDREmissiveMultiplierExtension(e){var n,i;let a=(n=this.parser.json.materials)==null?void 0:n[e];if(a==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}let l=(i=a.extensions)==null?void 0:i[Ct.EXTENSION_NAME];if(l!=null)return l}};pi.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var mi=pi;var vi=R(require("three"),1);var fo=Object.defineProperty,_o=Object.defineProperties,go=Object.getOwnPropertyDescriptors,fi=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable,_i=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Q=(t,e)=>{for(var n in e||(e={}))vo.call(e,n)&&_i(t,n,e[n]);if(fi)for(var n of fi(e))Eo.call(e,n)&&_i(t,n,e[n]);return t},gi=(t,e)=>_o(t,go(e)),Mo=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())});function Ee(t){return Math.pow(t,2.2)}var Ei=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(t){var e;this.parser=t,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;let n=this.parser.json;n.extensionsUsed=(e=n.extensionsUsed)!=null?e:[],n.extensionsUsed.indexOf("KHR_texture_transform")===-1&&n.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return Mo(this,null,function*(){var t;let e=this.parser.json,n=(t=e.extensions)==null?void 0:t.VRM,i=n==null?void 0:n.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((r,o)=>{var a,l;let s=(a=e.materials)==null?void 0:a[o];if(s==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${o}] of glTF but the material doesn't exist`);return}if(r.shader==="VRM/MToon"){let u=this._parseV0MToonProperties(r,s);e.materials[o]=u}else if((l=r.shader)!=null&&l.startsWith("VRM/Unlit")){let u=this._parseV0UnlitProperties(r,s);e.materials[o]=u}else r.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${r.shader}`)}))})}_parseV0MToonProperties(t,e){var n,i,r,o,a,l,s,u,d,h,p,m,c,f,g,M,V,y,_,v,E,T,P,L,A,S,H,W,z,ye,K,G,me,we,O,Gt,jt,Qt,Xt,Yt,qt,Zt,$t,Jt,Kt,en,tn,nn,rn,on,sn,an,ln,un,dn;let hn=(i=(n=t.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,Xi=((r=t.floatProperties)==null?void 0:r._ZWrite)===1&&hn,Yi=this._v0ParseRenderQueue(t),cn=(a=(o=t.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,qi=hn?"BLEND":cn?"MASK":"OPAQUE",Zi=cn?(s=(l=t.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,$i=((d=(u=t.floatProperties)==null?void 0:u._CullMode)!=null?d:2)===0,ae=this._portTextureTransform(t),Ji=((p=(h=t.vectorProperties)==null?void 0:h._Color)!=null?p:[1,1,1,1]).map((Rn,Tr)=>Tr===3?Rn:Ee(Rn)),pn=(m=t.textureProperties)==null?void 0:m._MainTex,Ki=pn!=null?{index:pn,extensions:Q({},ae)}:void 0,er=(f=(c=t.floatProperties)==null?void 0:c._BumpScale)!=null?f:1,mn=(g=t.textureProperties)==null?void 0:g._BumpMap,tr=mn!=null?{index:mn,scale:er,extensions:Q({},ae)}:void 0,nr=((V=(M=t.vectorProperties)==null?void 0:M._EmissionColor)!=null?V:[0,0,0,1]).map(Ee),fn=(y=t.textureProperties)==null?void 0:y._EmissionMap,ir=fn!=null?{index:fn,extensions:Q({},ae)}:void 0,rr=((v=(_=t.vectorProperties)==null?void 0:_._ShadeColor)!=null?v:[.97,.81,.86,1]).map(Ee),_n=(E=t.textureProperties)==null?void 0:E._ShadeTexture,or=_n!=null?{index:_n,extensions:Q({},ae)}:void 0,Ue=(P=(T=t.floatProperties)==null?void 0:T._ShadeShift)!=null?P:0,Oe=(A=(L=t.floatProperties)==null?void 0:L._ShadeToony)!=null?A:.9;Oe=vi.MathUtils.lerp(Oe,1,.5+.5*Ue),Ue=-Ue-(1-Oe);let gn=(H=(S=t.floatProperties)==null?void 0:S._IndirectLightIntensity)!=null?H:.1,sr=gn?1-gn:void 0,ht=(W=t.textureProperties)==null?void 0:W._SphereAdd,ar=ht!=null?[1,1,1]:void 0,lr=ht!=null?{index:ht}:void 0,ur=(ye=(z=t.floatProperties)==null?void 0:z._RimLightingMix)!=null?ye:0,vn=(K=t.textureProperties)==null?void 0:K._RimTexture,dr=vn!=null?{index:vn,extensions:Q({},ae)}:void 0,hr=((me=(G=t.vectorProperties)==null?void 0:G._RimColor)!=null?me:[0,0,0,1]).map(Ee),cr=(O=(we=t.floatProperties)==null?void 0:we._RimFresnelPower)!=null?O:1,pr=(jt=(Gt=t.floatProperties)==null?void 0:Gt._RimLift)!=null?jt:0,mr=["none","worldCoordinates","screenCoordinates"][(Xt=(Qt=t.floatProperties)==null?void 0:Qt._OutlineWidthMode)!=null?Xt:0],ct=(qt=(Yt=t.floatProperties)==null?void 0:Yt._OutlineWidth)!=null?qt:0;ct=.01*ct;let En=(Zt=t.textureProperties)==null?void 0:Zt._OutlineWidthTexture,fr=En!=null?{index:En,extensions:Q({},ae)}:void 0,_r=((Jt=($t=t.vectorProperties)==null?void 0:$t._OutlineColor)!=null?Jt:[0,0,0]).map(Ee),gr=((en=(Kt=t.floatProperties)==null?void 0:Kt._OutlineColorMode)!=null?en:0)===1?(nn=(tn=t.floatProperties)==null?void 0:tn._OutlineLightingMix)!=null?nn:1:0,Mn=(rn=t.textureProperties)==null?void 0:rn._UvAnimMaskTexture,vr=Mn!=null?{index:Mn,extensions:Q({},ae)}:void 0,Er=(sn=(on=t.floatProperties)==null?void 0:on._UvAnimScrollX)!=null?sn:0,Ne=(ln=(an=t.floatProperties)==null?void 0:an._UvAnimScrollY)!=null?ln:0;Ne!=null&&(Ne=-Ne);let Mr=(dn=(un=t.floatProperties)==null?void 0:un._UvAnimRotation)!=null?dn:0,Rr={specVersion:"1.0",transparentWithZWrite:Xi,renderQueueOffsetNumber:Yi,shadeColorFactor:rr,shadeMultiplyTexture:or,shadingShiftFactor:Ue,shadingToonyFactor:Oe,giEqualizationFactor:sr,matcapFactor:ar,matcapTexture:lr,rimLightingMixFactor:ur,rimMultiplyTexture:dr,parametricRimColorFactor:hr,parametricRimFresnelPowerFactor:cr,parametricRimLiftFactor:pr,outlineWidthMode:mr,outlineWidthFactor:ct,outlineWidthMultiplyTexture:fr,outlineColorFactor:_r,outlineLightingMixFactor:gr,uvAnimationMaskTexture:vr,uvAnimationScrollXSpeedFactor:Er,uvAnimationScrollYSpeedFactor:Ne,uvAnimationRotationSpeedFactor:Mr};return gi(Q({},e),{pbrMetallicRoughness:{baseColorFactor:Ji,baseColorTexture:Ki},normalTexture:tr,emissiveTexture:ir,emissiveFactor:nr,alphaMode:qi,alphaCutoff:Zi,doubleSided:$i,extensions:{VRMC_materials_mtoon:Rr}})}_parseV0UnlitProperties(t,e){var n,i,r,o,a;let l=t.shader==="VRM/UnlitTransparentZWrite",s=t.shader==="VRM/UnlitTransparent"||l,u=this._v0ParseRenderQueue(t),d=t.shader==="VRM/UnlitCutout",h=s?"BLEND":d?"MASK":"OPAQUE",p=d?(i=(n=t.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,m=this._portTextureTransform(t),c=((o=(r=t.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(Ee),f=(a=t.textureProperties)==null?void 0:a._MainTex,g=f!=null?{index:f,extensions:Q({},m)}:void 0,M={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:c,shadeMultiplyTexture:g};return gi(Q({},e),{pbrMetallicRoughness:{baseColorFactor:c,baseColorTexture:g},alphaMode:h,alphaCutoff:p,extensions:{VRMC_materials_mtoon:M}})}_portTextureTransform(t){var e,n,i,r,o;let a=(e=t.vectorProperties)==null?void 0:e._MainTex;if(a==null)return{};let l=[(n=a==null?void 0:a[0])!=null?n:0,(i=a==null?void 0:a[1])!=null?i:0],s=[(r=a==null?void 0:a[2])!=null?r:1,(o=a==null?void 0:a[3])!=null?o:1];return l[1]=1-s[1]-l[1],{KHR_texture_transform:{offset:l,scale:s}}}_v0ParseRenderQueue(t){var e,n;let i=t.shader==="VRM/UnlitTransparentZWrite",r=((e=t.keywordMap)==null?void 0:e._ALPHABLEND_ON)!=null||t.shader==="VRM/UnlitTransparent"||i,o=((n=t.floatProperties)==null?void 0:n._ZWrite)===1||i,a=0;if(r){let l=t.renderQueue;l!=null&&(o?a=this._renderQueueMapTransparentZWrite.get(l):a=this._renderQueueMapTransparent.get(l))}return a}_populateRenderQueueMap(t){let e=new Set,n=new Set;t.forEach(i=>{var r,o;let a=i.shader==="VRM/UnlitTransparentZWrite",l=((r=i.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||a,s=((o=i.floatProperties)==null?void 0:o._ZWrite)===1||a;if(l){let u=i.renderQueue;u!=null&&(s?n.add(u):e.add(u))}}),e.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${e.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),n.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${n.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(e).sort().forEach((i,r)=>{let o=Math.min(Math.max(r-e.size+1,-9),0);this._renderQueueMapTransparent.set(i,o)}),Array.from(n).sort().forEach((i,r)=>{let o=Math.min(Math.max(r,0),9);this._renderQueueMapTransparentZWrite.set(i,o)})}};var N=R(require("three"),1),X=R(require("three"),1),Ut=R(require("three"),1),be=R(require("three"),1),Z=R(require("three"),1);var Mi=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),ne=new N.Vector3,et=class extends N.Group{constructor(t){super(),this._attrPosition=new N.BufferAttribute(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(N.DynamicDrawUsage);let e=new N.BufferGeometry;e.setAttribute("position",this._attrPosition);let n=new N.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new N.Line(e,n),this.add(this._line),this.constraint=t}updateMatrixWorld(t){ne.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,ne.x,ne.y,ne.z),this.constraint.source&&ne.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,ne.x,ne.y,ne.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(t)}};function Ri(t,e){return e.set(t.elements[12],t.elements[13],t.elements[14])}var Ro=new Ut.Vector3,To=new Ut.Vector3;function xo(t,e){return t.decompose(Ro,e,To),e}function tt(t){return t.invert?t.invert():t.inverse(),t}var nt=class{constructor(t,e){this.destination=t,this.source=e,this.weight=1}},yo=new X.Vector3,wo=new X.Vector3,So=new X.Vector3,Po=new X.Quaternion,Ao=new X.Quaternion,Lo=new X.Quaternion,Ti=class extends nt{get aimAxis(){return this._aimAxis}set aimAxis(t){this._aimAxis=t,this._v3AimAxis.set(t==="PositiveX"?1:t==="NegativeX"?-1:0,t==="PositiveY"?1:t==="NegativeY"?-1:0,t==="PositiveZ"?1:t==="NegativeZ"?-1:0)}get dependencies(){let t=new Set([this.source]);return this.destination.parent&&t.add(this.destination.parent),t}constructor(t,e){super(t,e),this._aimAxis="PositiveX",this._v3AimAxis=new X.Vector3(1,0,0),this._dstRestQuat=new X.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let t=Po.identity(),e=Ao.identity();this.destination.parent&&(xo(this.destination.parent.matrixWorld,t),tt(e.copy(t)));let n=yo.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(t),i=Ri(this.source.matrixWorld,wo).sub(Ri(this.destination.matrixWorld,So)).normalize(),r=Lo.setFromUnitVectors(n,i).premultiply(e).multiply(t).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function Ho(t,e){let n=[t],i=t.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}var xi=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(t){this._constraints.add(t);let e=this._objectConstraintsMap.get(t.destination);e==null&&(e=new Set,this._objectConstraintsMap.set(t.destination,e)),e.add(t)}deleteConstraint(t){this._constraints.delete(t),this._objectConstraintsMap.get(t.destination).delete(t)}setInitState(){let t=new Set,e=new Set;for(let n of this._constraints)this._processConstraint(n,t,e,i=>i.setInitState())}update(){let t=new Set,e=new Set;for(let n of this._constraints)this._processConstraint(n,t,e,i=>i.update())}_processConstraint(t,e,n,i){if(n.has(t))return;if(e.has(t))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");e.add(t);let r=t.dependencies;for(let o of r)Ho(o,a=>{let l=this._objectConstraintsMap.get(a);if(l)for(let s of l)this._processConstraint(s,e,n,i)});i(t),n.add(t)}},bo=new be.Quaternion,Vo=new be.Quaternion,yi=class extends nt{get dependencies(){return new Set([this.source])}constructor(t,e){super(t,e),this._dstRestQuat=new be.Quaternion,this._invSrcRestQuat=new be.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),tt(this._invSrcRestQuat.copy(this.source.quaternion))}update(){let t=bo.copy(this._invSrcRestQuat).multiply(this.source.quaternion),e=Vo.copy(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(e,this.weight)}},Io=new Z.Vector3,Co=new Z.Quaternion,Uo=new Z.Quaternion,wi=class extends nt{get rollAxis(){return this._rollAxis}set rollAxis(t){this._rollAxis=t,this._v3RollAxis.set(t==="X"?1:0,t==="Y"?1:0,t==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(t,e){super(t,e),this._rollAxis="X",this._v3RollAxis=new Z.Vector3(1,0,0),this._dstRestQuat=new Z.Quaternion,this._invDstRestQuat=new Z.Quaternion,this._invSrcRestQuatMulDstRestQuat=new Z.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),tt(this._invDstRestQuat.copy(this._dstRestQuat)),tt(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){let t=Co.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),e=Io.copy(this._v3RollAxis).applyQuaternion(t),i=Uo.setFromUnitVectors(e,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},Oo=new Set(["1.0","1.0-beta"]),Si=class He{get name(){return He.EXTENSION_NAME}constructor(e,n){this.parser=e,this.helperRoot=n==null?void 0:n.helperRoot}afterRoot(e){return Mi(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(e){return Mi(this,null,function*(){var n;let i=this.parser.json;if(!(((n=i.extensionsUsed)==null?void 0:n.indexOf(He.EXTENSION_NAME))!==-1))return null;let o=new xi,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;let d=i.nodes[s],h=(u=d==null?void 0:d.extensions)==null?void 0:u[He.EXTENSION_NAME];if(h==null)return;let p=h.specVersion;if(!Oo.has(p)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${He.EXTENSION_NAME} specVersion "${p}"`);return}let m=h.constraint;if(m.roll!=null){let c=this._importRollConstraint(l,a,m.roll);o.addConstraint(c)}else if(m.aim!=null){let c=this._importAimConstraint(l,a,m.aim);o.addConstraint(c)}else if(m.rotation!=null){let c=this._importRotationConstraint(l,a,m.rotation);o.addConstraint(c)}}),e.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(e,n,i){let{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new wi(e,l);if(o!=null&&(s.rollAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new et(s);this.helperRoot.add(u)}return s}_importAimConstraint(e,n,i){let{source:r,aimAxis:o,weight:a}=i,l=n[r],s=new Ti(e,l);if(o!=null&&(s.aimAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new et(s);this.helperRoot.add(u)}return s}_importRotationConstraint(e,n,i){let{source:r,weight:o}=i,a=n[r],l=new yi(e,a);if(o!=null&&(l.weight=o),this.helperRoot){let s=new et(l);this.helperRoot.add(s)}return l}};Si.EXTENSION_NAME="VRMC_node_constraint";var Ot=Si;var re=R(require("three"),1),Ce=R(require("three"),1),xe=R(require("three"),1),bi=R(require("three"),1),J=R(require("three"),1),ie=R(require("three"),1),ce=R(require("three"),1),oe=R(require("three"),1),pe=R(require("three"),1),Ii=R(require("three"),1),U=R(require("three"),1),Ci=R(require("three"),1),Oi=R(require("three"),1),D=R(require("three"),1);var it=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),st=class{},Nt=new Ce.Vector3,he=new Ce.Vector3,Ft=class extends st{get type(){return"capsule"}constructor(t){var e,n,i,r;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Ce.Vector3(0,0,0),this.tail=(n=t==null?void 0:t.tail)!=null?n:new Ce.Vector3(0,0,0),this.radius=(i=t==null?void 0:t.radius)!=null?i:0,this.inside=(r=t==null?void 0:t.inside)!=null?r:!1}calculateCollision(t,e,n,i){Nt.copy(this.offset).applyMatrix4(t),he.copy(this.tail).applyMatrix4(t),he.sub(Nt);let r=he.lengthSq();i.copy(e).sub(Nt);let o=he.dot(i);o<=0||(r<=o||he.multiplyScalar(o/r),i.sub(he));let a=this.inside?this.radius-n-i.length():i.length()-n-this.radius;return i.normalize(),this.inside&&i.negate(),a}},Bt=new xe.Vector3,Pi=new xe.Matrix3,kt=class extends st{get type(){return"plane"}constructor(t){var e,n;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new xe.Vector3(0,0,0),this.normal=(n=t==null?void 0:t.normal)!=null?n:new xe.Vector3(0,0,1)}calculateCollision(t,e,n,i){i.copy(this.offset).applyMatrix4(t),i.negate().add(e),Pi.getNormalMatrix(t),Bt.copy(this.normal).applyNormalMatrix(Pi).normalize();let r=i.dot(Bt)-n;return i.copy(Bt),r}},Wt=class extends st{get type(){return"sphere"}constructor(t){var e,n,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new bi.Vector3(0,0,0),this.radius=(n=t==null?void 0:t.radius)!=null?n:0,this.inside=(i=t==null?void 0:t.inside)!=null?i:!1}calculateCollision(t,e,n,i){i.copy(this.offset).applyMatrix4(t),i.negate().add(e);let r=this.inside?this.radius-n-i.length():i.length()-n-this.radius;return i.normalize(),this.inside&&i.negate(),r}},Y=new J.Vector3,No=class extends J.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new J.Vector3,this._currentTail=new J.Vector3,this._shape=t,this._attrPos=new J.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new J.BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0);let n=Y.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),t=!0),t&&this._buildPosition()}_buildPosition(){Y.copy(this._currentTail).sub(this._currentOffset);let t=Y.length()/this._currentRadius;for(let i=0;i<=16;i++){let r=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(r),-Math.cos(r),0),this._attrPos.setXYZ(17+i,t+Math.sin(r),Math.cos(r),0),this._attrPos.setXYZ(34+i,-Math.sin(r),0,-Math.cos(r)),this._attrPos.setXYZ(51+i,t+Math.sin(r),0,Math.cos(r))}for(let i=0;i<32;i++){let r=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(r),Math.cos(r)),this._attrPos.setXYZ(100+i,t,Math.sin(r),Math.cos(r))}let e=Math.atan2(Y.y,Math.sqrt(Y.x*Y.x+Y.z*Y.z)),n=-Math.atan2(Y.z,Y.x);this.rotateZ(e),this.rotateY(n),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<34;t++){let e=(t+1)%34;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(68+t*2,34+t,34+e)}for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(136+t*2,68+t,68+e),this._attrIndex.setXY(200+t*2,100+t,100+e)}this._attrIndex.needsUpdate=!0}},Bo=class extends ie.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentOffset=new ie.Vector3,this._currentNormal=new ie.Vector3,this._shape=t,this._attrPos=new ie.BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new ie.BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},Do=class extends ce.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new ce.Vector3,this._shape=t,this._attrPos=new ce.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new ce.BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.needsUpdate=!0}},Fo=new re.Vector3,rt=class extends re.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof Wt)this._geometry=new Do(this.collider.shape);else if(this.collider.shape instanceof Ft)this._geometry=new No(this.collider.shape);else if(this.collider.shape instanceof kt)this._geometry=new Bo(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");let e=new re.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new re.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=Fo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},ko=class extends pe.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new pe.Vector3,this._springBone=t,this._attrPos=new pe.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new pe.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},Wo=new oe.Vector3,Vi=class extends oe.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new ko(this.springBone);let e=new oe.LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new oe.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=Wo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},ot=class extends Ii.Object3D{constructor(t){super(),this.shape=t}},zo=new Ci.Matrix4;function Ui(t){return t.invert?t.invert():t.getInverse(zo.copy(t)),t}var Go=class{constructor(t){this._inverseCache=new Oi.Matrix4,this._shouldUpdateInverse=!0,this.matrix=t;let e={set:(n,i,r)=>(this._shouldUpdateInverse=!0,n[i]=r,!0)};this._originalElements=t.elements,t.elements=new Proxy(t.elements,e)}get inverse(){return this._shouldUpdateInverse&&(Ui(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},jo=new U.Matrix4,$=new U.Vector3,Ve=new U.Vector3,Qo=new U.Vector3,Me=new U.Vector3,Ai=new U.Vector3,Ie=new U.Vector3,Li=new U.Quaternion,Re=new U.Matrix4,Xo=new U.Matrix4,Ni=class{constructor(t,e,n={},i=[]){this._currentTail=new U.Vector3,this._prevTail=new U.Vector3,this._boneAxis=new U.Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new U.Matrix4,this._initialLocalRotation=new U.Quaternion,this._initialLocalChildPosition=new U.Vector3;var r,o,a,l,s,u;this.bone=t,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(r=n.hitRadius)!=null?r:0,stiffness:(o=n.stiffness)!=null?o:1,gravityPower:(a=n.gravityPower)!=null?a:0,gravityDir:(s=(l=n.gravityDir)==null?void 0:l.clone())!=null?s:new U.Vector3(0,-1,0),dragForce:(u=n.dragForce)!=null?u:.4},this.colliderGroups=i}get center(){return this._center}set center(t){var e;(e=this._center)!=null&&e.userData.inverseCacheProxy&&(this._center.userData.inverseCacheProxy.revert(),delete this._center.userData.inverseCacheProxy),this._center=t,this._center&&(this._center.userData.inverseCacheProxy||(this._center.userData.inverseCacheProxy=new Go(this._center.matrixWorld)))}get initialLocalChildPosition(){return this._initialLocalChildPosition}get _parentMatrixWorld(){return this.bone.parent?this.bone.parent.matrixWorld:jo}setInitState(){this._initialLocalMatrix.copy(this.bone.matrix),this._initialLocalRotation.copy(this.bone.quaternion),this.child?this._initialLocalChildPosition.copy(this.child.position):this._initialLocalChildPosition.copy(this.bone.position).normalize().multiplyScalar(.07);let t=this._getMatrixWorldToCenter(Re);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail),this._boneAxis.copy(this._initialLocalChildPosition).normalize()}reset(){this.bone.quaternion.copy(this._initialLocalRotation),this.bone.updateMatrix(),this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld,this.bone.matrix);let t=this._getMatrixWorldToCenter(Re);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail)}update(t){if(t<=0)return;this._calcWorldSpaceBoneLength(),Me.setFromMatrixPosition(this.bone.matrixWorld);let e=this._getMatrixWorldToCenter(Re);Ai.copy(Me).applyMatrix4(e);let n=Li.setFromRotationMatrix(e),i=Xo.copy(e).multiply(this._parentMatrixWorld),r=Ve.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(i).sub(Ai).normalize(),o=Qo.copy(this.settings.gravityDir).applyQuaternion(n).normalize(),a=this._getMatrixCenterToWorld(Re);Ie.copy(this._currentTail).add($.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1-this.settings.dragForce)).add($.copy(r).multiplyScalar(this.settings.stiffness*t)).add($.copy(o).multiplyScalar(this.settings.gravityPower*t)).applyMatrix4(a),Ie.sub(Me).normalize().multiplyScalar(this._worldSpaceBoneLength).add(Me),this._collision(Ie),e=this._getMatrixWorldToCenter(Re),this._prevTail.copy(this._currentTail),this._currentTail.copy($.copy(Ie).applyMatrix4(e));let l=Ui(Re.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix)),s=Li.setFromUnitVectors(this._boneAxis,$.copy(Ie).applyMatrix4(l).normalize());this.bone.quaternion.copy(this._initialLocalRotation).multiply(s),this.bone.updateMatrix(),this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld,this.bone.matrix)}_collision(t){this.colliderGroups.forEach(e=>{e.colliders.forEach(n=>{let i=n.shape.calculateCollision(n.matrixWorld,t,this.settings.hitRadius,$);i<0&&(t.add($.multiplyScalar(-i)),t.sub(Me).normalize().multiplyScalar(this._worldSpaceBoneLength).add(Me))})})}_calcWorldSpaceBoneLength(){$.setFromMatrixPosition(this.bone.matrixWorld),this.child?Ve.setFromMatrixPosition(this.child.matrixWorld):(Ve.copy(this._initialLocalChildPosition),Ve.applyMatrix4(this.bone.matrixWorld)),this._worldSpaceBoneLength=$.sub(Ve).length()}_getMatrixCenterToWorld(t){return this._center?t.copy(this._center.matrixWorld):t.identity(),t}_getMatrixWorldToCenter(t){return this._center?t.copy(this._center.userData.inverseCacheProxy.inverse):t.identity(),t}};function Yo(t,e){let n=[],i=t;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}function Bi(t,e){t.children.forEach(n=>{e(n)||Bi(n,e)})}var Dt=class{constructor(){this._joints=new Set,this._hasWarnedCircularDependency=!1,this._objectSpringBonesMap=new Map}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){let t=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(n=>{t.add(n)})}),Array.from(t)}get colliders(){let t=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(n=>{t.add(n)})}),Array.from(t)}addJoint(t){this._joints.add(t);let e=this._objectSpringBonesMap.get(t.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(t.bone,e)),e.add(t)}addSpringBone(t){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(t)}deleteJoint(t){this._joints.delete(t),this._objectSpringBonesMap.get(t.bone).delete(t)}deleteSpringBone(t){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(t)}setInitState(){let t=new Set,e=new Set,n=new Set;for(let i of this._joints)this._processSpringBone(i,t,e,n,r=>r.setInitState())}reset(){let t=new Set,e=new Set,n=new Set;for(let i of this._joints)this._processSpringBone(i,t,e,n,r=>r.reset())}update(t){let e=new Set,n=new Set,i=new Set;for(let r of this._joints)this._processSpringBone(r,e,n,i,o=>o.update(t)),Bi(r.bone,o=>{var a,l;return((l=(a=this._objectSpringBonesMap.get(o))==null?void 0:a.size)!=null?l:0)>0?!0:(o.updateWorldMatrix(!1,!1),!1)})}_processSpringBone(t,e,n,i,r){if(n.has(t))return;if(e.has(t)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected while updating springbones"),this._hasWarnedCircularDependency=!0);return}e.add(t);let o=this._getDependencies(t);for(let a of o)Yo(a,l=>{let s=this._objectSpringBonesMap.get(l);if(s)for(let u of s)this._processSpringBone(u,e,n,i,r);else i.has(l)||(l.updateWorldMatrix(!1,!1),i.add(l))});t.bone.updateMatrix(),t.bone.updateWorldMatrix(!1,!1),r(t),i.add(t.bone),n.add(t)}_getDependencies(t){let e=new Set,n=t.bone.parent;return n&&e.add(n),t.colliderGroups.forEach(i=>{i.colliders.forEach(r=>{e.add(r)})}),e}},Hi="VRMC_springBone_extended_collider",qo=new Set(["1.0","1.0-beta"]),Zo=new Set(["1.0"]),Di=class Te{get name(){return Te.EXTENSION_NAME}constructor(e,n){var i;this.parser=e,this.jointHelperRoot=n==null?void 0:n.jointHelperRoot,this.colliderHelperRoot=n==null?void 0:n.colliderHelperRoot,this.useExtendedColliders=(i=n==null?void 0:n.useExtendedColliders)!=null?i:!0}afterRoot(e){return it(this,null,function*(){e.userData.vrmSpringBoneManager=yield this._import(e)})}_import(e){return it(this,null,function*(){let n=yield this._v1Import(e);if(n!=null)return n;let i=yield this._v0Import(e);return i!=null?i:null})}_v1Import(e){return it(this,null,function*(){var n,i,r,o,a;let l=e.parser.json;if(!(((n=l.extensionsUsed)==null?void 0:n.indexOf(Te.EXTENSION_NAME))!==-1))return null;let u=new Dt,d=yield e.parser.getDependencies("node"),h=(i=l.extensions)==null?void 0:i[Te.EXTENSION_NAME];if(!h)return null;let p=h.specVersion;if(!qo.has(p))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Te.EXTENSION_NAME} specVersion "${p}"`),null;let m=(r=h.colliders)==null?void 0:r.map((f,g)=>{var M,V,y,_,v,E,T,P,L,A,S,H,W,z,ye;let K=d[f.node],G=f.shape,me=(M=f.extensions)==null?void 0:M[Hi];if(this.useExtendedColliders&&me!=null){let we=me.specVersion;if(!Zo.has(we))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Hi} specVersion "${we}". Fallbacking to the ${Te.EXTENSION_NAME} definition`);else{let O=me.shape;if(O.sphere)return this._importSphereCollider(K,{offset:new D.Vector3().fromArray((V=O.sphere.offset)!=null?V:[0,0,0]),radius:(y=O.sphere.radius)!=null?y:0,inside:(_=O.sphere.inside)!=null?_:!1});if(O.capsule)return this._importCapsuleCollider(K,{offset:new D.Vector3().fromArray((v=O.capsule.offset)!=null?v:[0,0,0]),radius:(E=O.capsule.radius)!=null?E:0,tail:new D.Vector3().fromArray((T=O.capsule.tail)!=null?T:[0,0,0]),inside:(P=O.capsule.inside)!=null?P:!1});if(O.plane)return this._importPlaneCollider(K,{offset:new D.Vector3().fromArray((L=O.plane.offset)!=null?L:[0,0,0]),normal:new D.Vector3().fromArray((A=O.plane.normal)!=null?A:[0,0,1])})}}if(G.sphere)return this._importSphereCollider(K,{offset:new D.Vector3().fromArray((S=G.sphere.offset)!=null?S:[0,0,0]),radius:(H=G.sphere.radius)!=null?H:0,inside:!1});if(G.capsule)return this._importCapsuleCollider(K,{offset:new D.Vector3().fromArray((W=G.capsule.offset)!=null?W:[0,0,0]),radius:(z=G.capsule.radius)!=null?z:0,tail:new D.Vector3().fromArray((ye=G.capsule.tail)!=null?ye:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),c=(o=h.colliderGroups)==null?void 0:o.map((f,g)=>{var M;return{colliders:((M=f.colliders)!=null?M:[]).map(y=>{let _=m==null?void 0:m[y];if(_==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${y} but not found`);return _}),name:f.name}});return(a=h.springs)==null||a.forEach((f,g)=>{var M;let V=f.joints,y=(M=f.colliderGroups)==null?void 0:M.map(E=>{let T=c==null?void 0:c[E];if(T==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${E} but not found`);return T}),_=f.center!=null?d[f.center]:void 0,v;V.forEach(E=>{if(v){let T=v.node,P=d[T],L=E.node,A=d[L],S={hitRadius:v.hitRadius,dragForce:v.dragForce,gravityPower:v.gravityPower,stiffness:v.stiffness,gravityDir:v.gravityDir!=null?new D.Vector3().fromArray(v.gravityDir):void 0},H=this._importJoint(P,A,S,y);_&&(H.center=_),u.addJoint(H)}v=E})}),u.setInitState(),u})}_v0Import(e){return it(this,null,function*(){var n,i,r;let o=e.parser.json;if(!(((n=o.extensionsUsed)==null?void 0:n.indexOf("VRM"))!==-1))return null;let l=(i=o.extensions)==null?void 0:i.VRM,s=l==null?void 0:l.secondaryAnimation;if(!s)return null;let u=s==null?void 0:s.boneGroups;if(!u)return null;let d=new Dt,h=yield e.parser.getDependencies("node"),p=(r=s.colliderGroups)==null?void 0:r.map(m=>{var c;let f=h[m.node];return{colliders:((c=m.colliders)!=null?c:[]).map((M,V)=>{var y,_,v;let E=new D.Vector3(0,0,0);return M.offset&&E.set((y=M.offset.x)!=null?y:0,(_=M.offset.y)!=null?_:0,M.offset.z?-M.offset.z:0),this._importSphereCollider(f,{offset:E,radius:(v=M.radius)!=null?v:0,inside:!1})})}});return u==null||u.forEach((m,c)=>{let f=m.bones;f&&f.forEach(g=>{var M,V,y,_;let v=h[g],E=new D.Vector3;m.gravityDir?E.set((M=m.gravityDir.x)!=null?M:0,(V=m.gravityDir.y)!=null?V:0,(y=m.gravityDir.z)!=null?y:0):E.set(0,-1,0);let T=m.center!=null?h[m.center]:void 0,P={hitRadius:m.hitRadius,dragForce:m.dragForce,gravityPower:m.gravityPower,stiffness:m.stiffiness,gravityDir:E},L=(_=m.colliderGroups)==null?void 0:_.map(A=>{let S=p==null?void 0:p[A];if(S==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${c} attempted to use a colliderGroup ${A} but not found`);return S});v.traverse(A=>{var S;let H=(S=A.children[0])!=null?S:null,W=this._importJoint(A,H,P,L);T&&(W.center=T),d.addJoint(W)})})}),e.scene.updateMatrixWorld(),d.setInitState(),d})}_importJoint(e,n,i,r){let o=new Ni(e,n,i,r);if(this.jointHelperRoot){let a=new Vi(o);this.jointHelperRoot.add(a),a.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(e,n){let i=new Wt(n),r=new ot(i);if(e.add(r),this.colliderHelperRoot){let o=new rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importCapsuleCollider(e,n){let i=new Ft(n),r=new ot(i);if(e.add(r),this.colliderHelperRoot){let o=new rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importPlaneCollider(e,n){let i=new kt(n),r=new ot(i);if(e.add(r),this.colliderHelperRoot){let o=new rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}};Di.EXTENSION_NAME="VRMC_springBone";var zt=Di;var at=class{get name(){return"VRMLoaderPlugin"}constructor(e,n){var o,a,l,s,u,d,h,p,m,c;this.parser=e;let i=n==null?void 0:n.helperRoot,r=n==null?void 0:n.autoUpdateHumanBones;this.expressionPlugin=(o=n==null?void 0:n.expressionPlugin)!=null?o:new je(e),this.firstPersonPlugin=(a=n==null?void 0:n.firstPersonPlugin)!=null?a:new Qe(e),this.humanoidPlugin=(l=n==null?void 0:n.humanoidPlugin)!=null?l:new Ye(e,{helperRoot:i,autoUpdateHumanBones:r}),this.lookAtPlugin=(s=n==null?void 0:n.lookAtPlugin)!=null?s:new qe(e,{helperRoot:i}),this.metaPlugin=(u=n==null?void 0:n.metaPlugin)!=null?u:new Ze(e),this.mtoonMaterialPlugin=(d=n==null?void 0:n.mtoonMaterialPlugin)!=null?d:new It(e),this.materialsHDREmissiveMultiplierPlugin=(h=n==null?void 0:n.materialsHDREmissiveMultiplierPlugin)!=null?h:new mi(e),this.materialsV0CompatPlugin=(p=n==null?void 0:n.materialsV0CompatPlugin)!=null?p:new Ei(e),this.springBonePlugin=(m=n==null?void 0:n.springBonePlugin)!=null?m:new zt(e,{colliderHelperRoot:i,jointHelperRoot:i}),this.nodeConstraintPlugin=(c=n==null?void 0:n.nodeConstraintPlugin)!=null?c:new Ot(e,{helperRoot:i})}beforeRoot(){return Se(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return Se(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){let n=this.mtoonMaterialPlugin.getMaterialType(e);return n!=null?n:null}extendMaterialParams(e,n){return Se(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,n),yield this.mtoonMaterialPlugin.extendMaterialParams(e,n)})}afterRoot(e){return Se(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e),yield this.springBonePlugin.afterRoot(e),yield this.nodeConstraintPlugin.afterRoot(e),yield this.mtoonMaterialPlugin.afterRoot(e);let n=e.userData.vrmMeta,i=e.userData.vrmHumanoid;if(n&&i){let r=new ve({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:i,lookAt:e.userData.vrmLookAt,meta:n,materials:e.userData.vrmMToonMaterials,springBoneManager:e.userData.vrmSpringBoneManager,nodeConstraintManager:e.userData.vrmNodeConstraintManager});e.userData.vrm=r}})}};var lt=R(require("three"),1);function Fi(t){let e=new Set,n=new Map;t.traverse(r=>{if(r.type!=="SkinnedMesh")return;let o=r,a=n.get(o.geometry);a?e.delete(a):(n.set(o.geometry,o),e.add(o))});let i=[];e.forEach(r=>{let o=r.skeleton,a=i.find(h=>$o(o,h));a||(a={bones:[],boneInverses:[],meshes:[]},i.push(a)),a.meshes.push(r);let l=o.bones.map(h=>a.bones.indexOf(h)),s=r.geometry,u=s.getAttribute("skinIndex"),d=s.getAttribute("skinWeight");for(let h=0;hs.bind(l,new lt.Matrix4))}}function $o(t,e){return t.bones.every((n,i)=>{let r=e.bones.indexOf(n);return r!==-1?Jo(t.boneInverses[i],e.boneInverses[r]):!0})}function Jo(t,e,n){if(n=n||1e-4,t.elements.length!=e.elements.length)return!1;for(let i=0,r=t.elements.length;in)return!1;return!0}function ki(t){if(Object.values(t).forEach(e=>{e!=null&&e.isTexture&&e.dispose()}),t.isShaderMaterial){let e=t.uniforms;e&&Object.values(e).forEach(n=>{let i=n.value;i!=null&&i.isTexture&&i.dispose()})}t.dispose()}function Ko(t){let e=t.geometry;e&&e.dispose();let n=t.skeleton;n&&n.dispose();let i=t.material;i&&(Array.isArray(i)?i.forEach(r=>ki(r)):i&&ki(i))}function Wi(t){t.traverse(Ko)}var ut=R(require("three"),1);function zi(t,e){var a;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");let n=(a=e==null?void 0:e.experimentalSameBoneCounts)!=null?a:!1,i=[];t.traverse(l=>{l.type==="SkinnedMesh"&&i.push(l)});let r=new Map,o=0;for(let l of i){let u=l.geometry.getAttribute("skinIndex"),d=[],h=[],p={};for(let m=0;m{var g,M,V,y;if(!n.isMesh)return;let i=n,r=i.geometry,o=r.index;if(o==null)return;let a=e.get(r);if(a!=null){i.geometry=a;return}let l=Object.values(r.attributes)[0].count,s=new Array(l),u=0,d=o.array;for(let _=0;_{c.addGroup(_.start,_.count,_.materialIndex)}),c.boundingBox=(M=(g=r.boundingBox)==null?void 0:g.clone())!=null?M:null,c.boundingSphere=(y=(V=r.boundingSphere)==null?void 0:V.clone())!=null?y:null,c.setDrawRange(r.drawRange.start,r.drawRange.count),c.userData=r.userData,e.set(r,c);{let _=o.array,v=new _.constructor(_.length);for(let E=0;E<_.length;E++){let T=_[E],P=h[T];v[E]=P}c.setIndex(new dt.BufferAttribute(v,1,!1))}Object.keys(r.attributes).forEach(_=>{let v=r.attributes[_];if(v.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");let E=v.array,{itemSize:T,normalized:P}=v,L=new E.constructor(p.length*T);p.forEach((A,S)=>{for(let H=0;H{c.morphAttributes[_]=[];let v=r.morphAttributes[_];for(let E=0;E{for(let z=0;zH===0),c.morphAttributes[_][E]=new dt.BufferAttribute(S,L,A)}}),f&&(c.morphAttributes={}),i.geometry=c}),Array.from(e.keys()).forEach(n=>{n.dispose()})}function Qi(t){var e;((e=t.meta)==null?void 0:e.metaVersion)==="0"&&(t.scene.rotation.y=Math.PI)}var se=class{constructor(){}};se.combineSkeletons=Fi,se.deepDispose=Wi,se.removeUnnecessaryJoints=zi,se.removeUnnecessaryVertices=ji,se.rotateVRM0=Qi; +`;n.vertexShader=r+n.vertexShader,n.fragmentShader=r+n.fragmentShader,i<154&&(n.fragmentShader=n.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(t){this.uniforms.litFactor.value=t}get map(){return this.uniforms.map.value}set map(t){this.uniforms.map.value=t}get normalMap(){return this.uniforms.normalMap.value}set normalMap(t){this.uniforms.normalMap.value=t}get normalScale(){return this.uniforms.normalScale.value}set normalScale(t){this.uniforms.normalScale.value=t}get emissive(){return this.uniforms.emissive.value}set emissive(t){this.uniforms.emissive.value=t}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(t){this.uniforms.emissiveIntensity.value=t}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(t){this.uniforms.emissiveMap.value=t}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(t){this.uniforms.shadeColorFactor.value=t}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(t){this.uniforms.shadeMultiplyTexture.value=t}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(t){this.uniforms.shadingShiftFactor.value=t}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(t){this.uniforms.shadingShiftTexture.value=t}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(t){this.uniforms.shadingShiftTextureScale.value=t}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(t){this.uniforms.shadingToonyFactor.value=t}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(t){this.uniforms.giEqualizationFactor.value=t}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(t){this.uniforms.matcapFactor.value=t}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(t){this.uniforms.matcapTexture.value=t}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(t){this.uniforms.parametricRimColorFactor.value=t}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(t){this.uniforms.rimMultiplyTexture.value=t}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(t){this.uniforms.rimLightingMixFactor.value=t}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(t){this.uniforms.parametricRimFresnelPowerFactor.value=t}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(t){this.uniforms.parametricRimLiftFactor.value=t}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(t){this.uniforms.outlineWidthMultiplyTexture.value=t}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(t){this.uniforms.outlineWidthFactor.value=t}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(t){this.uniforms.outlineColorFactor.value=t}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(t){this.uniforms.outlineLightingMixFactor.value=t}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(t){this.uniforms.uvAnimationMaskTexture.value=t}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(t){this.uniforms.uvAnimationScrollXOffset.value=t}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(t){this.uniforms.uvAnimationScrollYOffset.value=t}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(t){this.uniforms.uvAnimationRotationPhase.value=t}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(t){this._ignoreVertexColor=t,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(t){this._v0CompatShade=t,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(t){this._debugMode=t,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(t){this._outlineWidthMode=t,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(t){this._isOutline=t,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(t){this._uploadUniformsWorkaround(),this._updateUVAnimation(t)}copy(t){return super.copy(t),this.map=t.map,this.normalMap=t.normalMap,this.emissiveMap=t.emissiveMap,this.shadeMultiplyTexture=t.shadeMultiplyTexture,this.shadingShiftTexture=t.shadingShiftTexture,this.matcapTexture=t.matcapTexture,this.rimMultiplyTexture=t.rimMultiplyTexture,this.outlineWidthMultiplyTexture=t.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=t.uvAnimationMaskTexture,this.normalMapType=t.normalMapType,this.uvAnimationScrollXSpeedFactor=t.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=t.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=t.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=t.ignoreVertexColor,this.v0CompatShade=t.v0CompatShade,this.debugMode=t.debugMode,this.outlineWidthMode=t.outlineWidthMode,this.isOutline=t.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(t){this.uniforms.uvAnimationScrollXOffset.value+=t*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=t*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=t*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){let t=parseInt(w.REVISION,10),e=this.outlineWidthMultiplyTexture!==null,n=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:t,OUTLINE:this._isOutline,MTOON_USE_UV:e||n,MTOON_UVS_VERTEX_ONLY:e&&!n,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===Vt.ScreenCoordinates}}_updateTextureMatrix(t,e){t.value&&(t.value.matrixAutoUpdate&&t.value.updateMatrix(),e.value.copy(t.value.matrix))}},po=new Set(["1.0","1.0-beta"]),fi=class Je{get name(){return Je.EXTENSION_NAME}constructor(e,n={}){var i,r,o,a;this.parser=e,this.materialType=(i=n.materialType)!=null?i:mi,this.renderOrderOffset=(r=n.renderOrderOffset)!=null?r:0,this.v0CompatShade=(o=n.v0CompatShade)!=null?o:!1,this.debugMode=(a=n.debugMode)!=null?a:"none",this._mToonMaterialSet=new Set}beforeRoot(){return ue(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return ue(this,null,function*(){e.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(e){return this._getMToonExtension(e)?this.materialType:null}extendMaterialParams(e,n){let i=this._getMToonExtension(e);return i?this._extendMaterialParams(i,n):null}loadMesh(e){return ue(this,null,function*(){var n;let i=this.parser,o=(n=i.json.meshes)==null?void 0:n[e];if(o==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${e}] of glTF but the mesh doesn't exist`);let a=o.primitives,l=yield i.loadMesh(e);if(a.length===1){let s=l,u=a[0].material;u!=null&&this._setupPrimitive(s,u)}else{let s=l;for(let u=0;u{var a;this._getMToonExtension(o)&&((a=r.extensions)!=null&&a.KHR_materials_unlit)&&delete r.extensions.KHR_materials_unlit})}_getMToonExtension(e){var n,i;let a=(n=this.parser.json.materials)==null?void 0:n[e];if(a==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}let l=(i=a.extensions)==null?void 0:i[Je.EXTENSION_NAME];if(l==null)return;let s=l.specVersion;if(!po.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${Je.EXTENSION_NAME} specVersion "${s}"`);return}return l}_extendMaterialParams(e,n){return ue(this,null,function*(){var i;delete n.metalness,delete n.roughness;let r=new lo(this.parser,n);r.assignPrimitive("transparentWithZWrite",e.transparentWithZWrite),r.assignColor("shadeColorFactor",e.shadeColorFactor),r.assignTexture("shadeMultiplyTexture",e.shadeMultiplyTexture,!0),r.assignPrimitive("shadingShiftFactor",e.shadingShiftFactor),r.assignTexture("shadingShiftTexture",e.shadingShiftTexture,!0),r.assignPrimitive("shadingShiftTextureScale",(i=e.shadingShiftTexture)==null?void 0:i.scale),r.assignPrimitive("shadingToonyFactor",e.shadingToonyFactor),r.assignPrimitive("giEqualizationFactor",e.giEqualizationFactor),r.assignColor("matcapFactor",e.matcapFactor),r.assignTexture("matcapTexture",e.matcapTexture,!0),r.assignColor("parametricRimColorFactor",e.parametricRimColorFactor),r.assignTexture("rimMultiplyTexture",e.rimMultiplyTexture,!0),r.assignPrimitive("rimLightingMixFactor",e.rimLightingMixFactor),r.assignPrimitive("parametricRimFresnelPowerFactor",e.parametricRimFresnelPowerFactor),r.assignPrimitive("parametricRimLiftFactor",e.parametricRimLiftFactor),r.assignPrimitive("outlineWidthMode",e.outlineWidthMode),r.assignPrimitive("outlineWidthFactor",e.outlineWidthFactor),r.assignTexture("outlineWidthMultiplyTexture",e.outlineWidthMultiplyTexture,!1),r.assignColor("outlineColorFactor",e.outlineColorFactor),r.assignPrimitive("outlineLightingMixFactor",e.outlineLightingMixFactor),r.assignTexture("uvAnimationMaskTexture",e.uvAnimationMaskTexture,!1),r.assignPrimitive("uvAnimationScrollXSpeedFactor",e.uvAnimationScrollXSpeedFactor),r.assignPrimitive("uvAnimationScrollYSpeedFactor",e.uvAnimationScrollYSpeedFactor),r.assignPrimitive("uvAnimationRotationSpeedFactor",e.uvAnimationRotationSpeedFactor),r.assignPrimitive("v0CompatShade",this.v0CompatShade),r.assignPrimitive("debugMode",this.debugMode),yield r.pending})}_setupPrimitive(e,n){let i=this._getMToonExtension(n);if(i){let r=this._parseRenderOrder(i);e.renderOrder=r+this.renderOrderOffset,this._generateOutline(e),this._addToMaterialSet(e);return}}_shouldGenerateOutline(e){return typeof e.outlineWidthMode=="string"&&e.outlineWidthMode!=="none"&&typeof e.outlineWidthFactor=="number"&&e.outlineWidthFactor>0}_generateOutline(e){let n=e.material;if(!(n instanceof Ke.Material)||!this._shouldGenerateOutline(n))return;e.material=[n];let i=n.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=Ke.BackSide,e.material.push(i);let r=e.geometry,o=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,o,0),r.addGroup(0,o,1)}_addToMaterialSet(e){let n=e.material,i=new Set;Array.isArray(n)?n.forEach(r=>i.add(r)):i.add(n);for(let r of i)this._mToonMaterialSet.add(r)}_parseRenderOrder(e){var n;return(e.transparentWithZWrite?0:19)+((n=e.renderQueueOffsetNumber)!=null?n:0)}};fi.EXTENSION_NAME="VRMC_materials_mtoon";var It=fi;var mo=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),_i=class Ct{get name(){return Ct.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,n){return mo(this,null,function*(){let i=this._getHDREmissiveMultiplierExtension(e);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");let r=i.emissiveMultiplier;n.emissiveIntensity=r})}_getHDREmissiveMultiplierExtension(e){var n,i;let a=(n=this.parser.json.materials)==null?void 0:n[e];if(a==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}let l=(i=a.extensions)==null?void 0:i[Ct.EXTENSION_NAME];if(l!=null)return l}};_i.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var gi=_i;var Ri=M(require("three"),1);var fo=Object.defineProperty,_o=Object.defineProperties,go=Object.getOwnPropertyDescriptors,vi=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable,Ei=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,X=(t,e)=>{for(var n in e||(e={}))vo.call(e,n)&&Ei(t,n,e[n]);if(vi)for(var n of vi(e))Eo.call(e,n)&&Ei(t,n,e[n]);return t},Mi=(t,e)=>_o(t,go(e)),Mo=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())});function Ee(t){return Math.pow(t,2.2)}var Ti=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(t){var e;this.parser=t,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;let n=this.parser.json;n.extensionsUsed=(e=n.extensionsUsed)!=null?e:[],n.extensionsUsed.indexOf("KHR_texture_transform")===-1&&n.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return Mo(this,null,function*(){var t;let e=this.parser.json,n=(t=e.extensions)==null?void 0:t.VRM,i=n==null?void 0:n.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((r,o)=>{var a,l;let s=(a=e.materials)==null?void 0:a[o];if(s==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${o}] of glTF but the material doesn't exist`);return}if(r.shader==="VRM/MToon"){let u=this._parseV0MToonProperties(r,s);e.materials[o]=u}else if((l=r.shader)!=null&&l.startsWith("VRM/Unlit")){let u=this._parseV0UnlitProperties(r,s);e.materials[o]=u}else r.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${r.shader}`)}))})}_parseV0MToonProperties(t,e){var n,i,r,o,a,l,s,u,d,h,p,m,c,f,g,R,V,y,_,v,E,T,P,L,A,S,H,W,z,xe,K,G,pe,ye,O,Qt,Yt,qt,Zt,$t,Jt,Kt,en,tn,nn,rn,on,sn,an,ln,un,dn,hn,cn,pn;let mn=(i=(n=t.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,Qi=((r=t.floatProperties)==null?void 0:r._ZWrite)===1&&mn,Yi=this._v0ParseRenderQueue(t),fn=(a=(o=t.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,qi=mn?"BLEND":fn?"MASK":"OPAQUE",Zi=fn?(s=(l=t.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,$i=((d=(u=t.floatProperties)==null?void 0:u._CullMode)!=null?d:2)===0,se=this._portTextureTransform(t),Ji=((p=(h=t.vectorProperties)==null?void 0:h._Color)!=null?p:[1,1,1,1]).map((yn,Tr)=>Tr===3?yn:Ee(yn)),_n=(m=t.textureProperties)==null?void 0:m._MainTex,Ki=_n!=null?{index:_n,extensions:X({},se)}:void 0,er=(f=(c=t.floatProperties)==null?void 0:c._BumpScale)!=null?f:1,gn=(g=t.textureProperties)==null?void 0:g._BumpMap,tr=gn!=null?{index:gn,scale:er,extensions:X({},se)}:void 0,nr=((V=(R=t.vectorProperties)==null?void 0:R._EmissionColor)!=null?V:[0,0,0,1]).map(Ee),vn=(y=t.textureProperties)==null?void 0:y._EmissionMap,ir=vn!=null?{index:vn,extensions:X({},se)}:void 0,rr=((v=(_=t.vectorProperties)==null?void 0:_._ShadeColor)!=null?v:[.97,.81,.86,1]).map(Ee),En=(E=t.textureProperties)==null?void 0:E._ShadeTexture,or=En!=null?{index:En,extensions:X({},se)}:void 0,Ue=(P=(T=t.floatProperties)==null?void 0:T._ShadeShift)!=null?P:0,Oe=(A=(L=t.floatProperties)==null?void 0:L._ShadeToony)!=null?A:.9;Oe=Ri.MathUtils.lerp(Oe,1,.5+.5*Ue),Ue=-Ue-(1-Oe);let Mn=(H=(S=t.floatProperties)==null?void 0:S._IndirectLightIntensity)!=null?H:.1,sr=Mn?1-Mn:void 0,ct=(W=t.textureProperties)==null?void 0:W._SphereAdd,ar=ct!=null?[1,1,1]:void 0,lr=ct!=null?{index:ct}:void 0,ur=(xe=(z=t.floatProperties)==null?void 0:z._RimLightingMix)!=null?xe:0,Rn=(K=t.textureProperties)==null?void 0:K._RimTexture,dr=Rn!=null?{index:Rn,extensions:X({},se)}:void 0,hr=((pe=(G=t.vectorProperties)==null?void 0:G._RimColor)!=null?pe:[0,0,0,1]).map(Ee),cr=(O=(ye=t.floatProperties)==null?void 0:ye._RimFresnelPower)!=null?O:1,pr=(Yt=(Qt=t.floatProperties)==null?void 0:Qt._RimLift)!=null?Yt:0,mr=["none","worldCoordinates","screenCoordinates"][(Zt=(qt=t.floatProperties)==null?void 0:qt._OutlineWidthMode)!=null?Zt:0],pt=(Jt=($t=t.floatProperties)==null?void 0:$t._OutlineWidth)!=null?Jt:0;pt=.01*pt;let Tn=(Kt=t.textureProperties)==null?void 0:Kt._OutlineWidthTexture,fr=Tn!=null?{index:Tn,extensions:X({},se)}:void 0,_r=((tn=(en=t.vectorProperties)==null?void 0:en._OutlineColor)!=null?tn:[0,0,0]).map(Ee),gr=((rn=(nn=t.floatProperties)==null?void 0:nn._OutlineColorMode)!=null?rn:0)===1?(sn=(on=t.floatProperties)==null?void 0:on._OutlineLightingMix)!=null?sn:1:0,xn=(an=t.textureProperties)==null?void 0:an._UvAnimMaskTexture,vr=xn!=null?{index:xn,extensions:X({},se)}:void 0,Er=(un=(ln=t.floatProperties)==null?void 0:ln._UvAnimScrollX)!=null?un:0,Ne=(hn=(dn=t.floatProperties)==null?void 0:dn._UvAnimScrollY)!=null?hn:0;Ne!=null&&(Ne=-Ne);let Mr=(pn=(cn=t.floatProperties)==null?void 0:cn._UvAnimRotation)!=null?pn:0,Rr={specVersion:"1.0",transparentWithZWrite:Qi,renderQueueOffsetNumber:Yi,shadeColorFactor:rr,shadeMultiplyTexture:or,shadingShiftFactor:Ue,shadingToonyFactor:Oe,giEqualizationFactor:sr,matcapFactor:ar,matcapTexture:lr,rimLightingMixFactor:ur,rimMultiplyTexture:dr,parametricRimColorFactor:hr,parametricRimFresnelPowerFactor:cr,parametricRimLiftFactor:pr,outlineWidthMode:mr,outlineWidthFactor:pt,outlineWidthMultiplyTexture:fr,outlineColorFactor:_r,outlineLightingMixFactor:gr,uvAnimationMaskTexture:vr,uvAnimationScrollXSpeedFactor:Er,uvAnimationScrollYSpeedFactor:Ne,uvAnimationRotationSpeedFactor:Mr};return Mi(X({},e),{pbrMetallicRoughness:{baseColorFactor:Ji,baseColorTexture:Ki},normalTexture:tr,emissiveTexture:ir,emissiveFactor:nr,alphaMode:qi,alphaCutoff:Zi,doubleSided:$i,extensions:{VRMC_materials_mtoon:Rr}})}_parseV0UnlitProperties(t,e){var n,i,r,o,a;let l=t.shader==="VRM/UnlitTransparentZWrite",s=t.shader==="VRM/UnlitTransparent"||l,u=this._v0ParseRenderQueue(t),d=t.shader==="VRM/UnlitCutout",h=s?"BLEND":d?"MASK":"OPAQUE",p=d?(i=(n=t.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,m=this._portTextureTransform(t),c=((o=(r=t.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(Ee),f=(a=t.textureProperties)==null?void 0:a._MainTex,g=f!=null?{index:f,extensions:X({},m)}:void 0,R={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:c,shadeMultiplyTexture:g};return Mi(X({},e),{pbrMetallicRoughness:{baseColorFactor:c,baseColorTexture:g},alphaMode:h,alphaCutoff:p,extensions:{VRMC_materials_mtoon:R}})}_portTextureTransform(t){var e,n,i,r,o;let a=(e=t.vectorProperties)==null?void 0:e._MainTex;if(a==null)return{};let l=[(n=a==null?void 0:a[0])!=null?n:0,(i=a==null?void 0:a[1])!=null?i:0],s=[(r=a==null?void 0:a[2])!=null?r:1,(o=a==null?void 0:a[3])!=null?o:1];return l[1]=1-s[1]-l[1],{KHR_texture_transform:{offset:l,scale:s}}}_v0ParseRenderQueue(t){var e,n;let i=t.shader==="VRM/UnlitTransparentZWrite",r=((e=t.keywordMap)==null?void 0:e._ALPHABLEND_ON)!=null||t.shader==="VRM/UnlitTransparent"||i,o=((n=t.floatProperties)==null?void 0:n._ZWrite)===1||i,a=0;if(r){let l=t.renderQueue;l!=null&&(o?a=this._renderQueueMapTransparentZWrite.get(l):a=this._renderQueueMapTransparent.get(l))}return a}_populateRenderQueueMap(t){let e=new Set,n=new Set;t.forEach(i=>{var r,o;let a=i.shader==="VRM/UnlitTransparentZWrite",l=((r=i.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||a,s=((o=i.floatProperties)==null?void 0:o._ZWrite)===1||a;if(l){let u=i.renderQueue;u!=null&&(s?n.add(u):e.add(u))}}),e.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${e.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),n.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${n.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(e).sort().forEach((i,r)=>{let o=Math.min(Math.max(r-e.size+1,-9),0);this._renderQueueMapTransparent.set(i,o)}),Array.from(n).sort().forEach((i,r)=>{let o=Math.min(Math.max(r,0),9);this._renderQueueMapTransparentZWrite.set(i,o)})}};var N=M(require("three"),1),Q=M(require("three"),1),Ut=M(require("three"),1),He=M(require("three"),1),Z=M(require("three"),1);var xi=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),ne=new N.Vector3,et=class extends N.Group{constructor(t){super(),this._attrPosition=new N.BufferAttribute(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(N.DynamicDrawUsage);let e=new N.BufferGeometry;e.setAttribute("position",this._attrPosition);let n=new N.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new N.Line(e,n),this.add(this._line),this.constraint=t}updateMatrixWorld(t){ne.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,ne.x,ne.y,ne.z),this.constraint.source&&ne.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,ne.x,ne.y,ne.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(t)}};function yi(t,e){return e.set(t.elements[12],t.elements[13],t.elements[14])}var Ro=new Ut.Vector3,To=new Ut.Vector3;function xo(t,e){return t.decompose(Ro,e,To),e}function tt(t){return t.invert?t.invert():t.inverse(),t}var nt=class{constructor(t,e){this.destination=t,this.source=e,this.weight=1}},yo=new Q.Vector3,wo=new Q.Vector3,So=new Q.Vector3,Po=new Q.Quaternion,Ao=new Q.Quaternion,Lo=new Q.Quaternion,wi=class extends nt{get aimAxis(){return this._aimAxis}set aimAxis(t){this._aimAxis=t,this._v3AimAxis.set(t==="PositiveX"?1:t==="NegativeX"?-1:0,t==="PositiveY"?1:t==="NegativeY"?-1:0,t==="PositiveZ"?1:t==="NegativeZ"?-1:0)}get dependencies(){let t=new Set([this.source]);return this.destination.parent&&t.add(this.destination.parent),t}constructor(t,e){super(t,e),this._aimAxis="PositiveX",this._v3AimAxis=new Q.Vector3(1,0,0),this._dstRestQuat=new Q.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let t=Po.identity(),e=Ao.identity();this.destination.parent&&(xo(this.destination.parent.matrixWorld,t),tt(e.copy(t)));let n=yo.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(t),i=yi(this.source.matrixWorld,wo).sub(yi(this.destination.matrixWorld,So)).normalize(),r=Lo.setFromUnitVectors(n,i).premultiply(e).multiply(t).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function Ho(t,e){let n=[t],i=t.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}var Si=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(t){this._constraints.add(t);let e=this._objectConstraintsMap.get(t.destination);e==null&&(e=new Set,this._objectConstraintsMap.set(t.destination,e)),e.add(t)}deleteConstraint(t){this._constraints.delete(t),this._objectConstraintsMap.get(t.destination).delete(t)}setInitState(){let t=new Set,e=new Set;for(let n of this._constraints)this._processConstraint(n,t,e,i=>i.setInitState())}update(){let t=new Set,e=new Set;for(let n of this._constraints)this._processConstraint(n,t,e,i=>i.update())}_processConstraint(t,e,n,i){if(n.has(t))return;if(e.has(t))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");e.add(t);let r=t.dependencies;for(let o of r)Ho(o,a=>{let l=this._objectConstraintsMap.get(a);if(l)for(let s of l)this._processConstraint(s,e,n,i)});i(t),n.add(t)}},bo=new He.Quaternion,Vo=new He.Quaternion,Pi=class extends nt{get dependencies(){return new Set([this.source])}constructor(t,e){super(t,e),this._dstRestQuat=new He.Quaternion,this._invSrcRestQuat=new He.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),tt(this._invSrcRestQuat.copy(this.source.quaternion))}update(){let t=bo.copy(this._invSrcRestQuat).multiply(this.source.quaternion),e=Vo.copy(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(e,this.weight)}},Io=new Z.Vector3,Co=new Z.Quaternion,Uo=new Z.Quaternion,Ai=class extends nt{get rollAxis(){return this._rollAxis}set rollAxis(t){this._rollAxis=t,this._v3RollAxis.set(t==="X"?1:0,t==="Y"?1:0,t==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(t,e){super(t,e),this._rollAxis="X",this._v3RollAxis=new Z.Vector3(1,0,0),this._dstRestQuat=new Z.Quaternion,this._invDstRestQuat=new Z.Quaternion,this._invSrcRestQuatMulDstRestQuat=new Z.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),tt(this._invDstRestQuat.copy(this._dstRestQuat)),tt(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){let t=Co.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),e=Io.copy(this._v3RollAxis).applyQuaternion(t),i=Uo.setFromUnitVectors(e,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},Oo=new Set(["1.0","1.0-beta"]),Li=class Le{get name(){return Le.EXTENSION_NAME}constructor(e,n){this.parser=e,this.helperRoot=n==null?void 0:n.helperRoot}afterRoot(e){return xi(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(e){return xi(this,null,function*(){var n;let i=this.parser.json;if(!(((n=i.extensionsUsed)==null?void 0:n.indexOf(Le.EXTENSION_NAME))!==-1))return null;let o=new Si,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;let d=i.nodes[s],h=(u=d==null?void 0:d.extensions)==null?void 0:u[Le.EXTENSION_NAME];if(h==null)return;let p=h.specVersion;if(!Oo.has(p)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Le.EXTENSION_NAME} specVersion "${p}"`);return}let m=h.constraint;if(m.roll!=null){let c=this._importRollConstraint(l,a,m.roll);o.addConstraint(c)}else if(m.aim!=null){let c=this._importAimConstraint(l,a,m.aim);o.addConstraint(c)}else if(m.rotation!=null){let c=this._importRotationConstraint(l,a,m.rotation);o.addConstraint(c)}}),e.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(e,n,i){let{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new Ai(e,l);if(o!=null&&(s.rollAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new et(s);this.helperRoot.add(u)}return s}_importAimConstraint(e,n,i){let{source:r,aimAxis:o,weight:a}=i,l=n[r],s=new wi(e,l);if(o!=null&&(s.aimAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new et(s);this.helperRoot.add(u)}return s}_importRotationConstraint(e,n,i){let{source:r,weight:o}=i,a=n[r],l=new Pi(e,a);if(o!=null&&(l.weight=o),this.helperRoot){let s=new et(l);this.helperRoot.add(s)}return l}};Li.EXTENSION_NAME="VRMC_node_constraint";var Ot=Li;var re=M(require("three"),1),Ce=M(require("three"),1),Te=M(require("three"),1),Gt=M(require("three"),1),$=M(require("three"),1),ie=M(require("three"),1),he=M(require("three"),1),oe=M(require("three"),1),ce=M(require("three"),1),at=M(require("three"),1),U=M(require("three"),1),Ii=M(require("three"),1),Ci=M(require("three"),1),D=M(require("three"),1);var it=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),st=class{},Nt=new Ce.Vector3,de=new Ce.Vector3,Wt=class extends st{get type(){return"capsule"}constructor(t){var e,n,i,r;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Ce.Vector3(0,0,0),this.tail=(n=t==null?void 0:t.tail)!=null?n:new Ce.Vector3(0,0,0),this.radius=(i=t==null?void 0:t.radius)!=null?i:0,this.inside=(r=t==null?void 0:t.inside)!=null?r:!1}calculateCollision(t,e,n,i){Nt.setFromMatrixPosition(t),de.subVectors(this.tail,this.offset).applyMatrix4(t),de.sub(Nt);let r=de.lengthSq();i.copy(e).sub(Nt);let o=de.dot(i);o<=0||(r<=o||de.multiplyScalar(o/r),i.sub(de));let a=i.length(),l=this.inside?this.radius-n-a:a-n-this.radius;return l<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),l}},Bt=new Te.Vector3,Hi=new Te.Matrix3,zt=class extends st{get type(){return"plane"}constructor(t){var e,n;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Te.Vector3(0,0,0),this.normal=(n=t==null?void 0:t.normal)!=null?n:new Te.Vector3(0,0,1)}calculateCollision(t,e,n,i){i.setFromMatrixPosition(t),i.negate().add(e),Hi.getNormalMatrix(t),Bt.copy(this.normal).applyNormalMatrix(Hi).normalize();let r=i.dot(Bt)-n;return i.copy(Bt),r}},No=new Gt.Vector3,jt=class extends st{get type(){return"sphere"}constructor(t){var e,n,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Gt.Vector3(0,0,0),this.radius=(n=t==null?void 0:t.radius)!=null?n:0,this.inside=(i=t==null?void 0:t.inside)!=null?i:!1}calculateCollision(t,e,n,i){i.subVectors(e,No.setFromMatrixPosition(t));let r=i.length(),o=this.inside?this.radius-n-r:r-n-this.radius;return o<0&&(i.multiplyScalar(1/r),this.inside&&i.negate()),o}},Y=new $.Vector3,Bo=class extends $.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new $.Vector3,this._currentTail=new $.Vector3,this._shape=t,this._attrPos=new $.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new $.BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0);let n=Y.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),t=!0),t&&this._buildPosition()}_buildPosition(){Y.copy(this._currentTail).sub(this._currentOffset);let t=Y.length()/this._currentRadius;for(let i=0;i<=16;i++){let r=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(r),-Math.cos(r),0),this._attrPos.setXYZ(17+i,t+Math.sin(r),Math.cos(r),0),this._attrPos.setXYZ(34+i,-Math.sin(r),0,-Math.cos(r)),this._attrPos.setXYZ(51+i,t+Math.sin(r),0,Math.cos(r))}for(let i=0;i<32;i++){let r=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(r),Math.cos(r)),this._attrPos.setXYZ(100+i,t,Math.sin(r),Math.cos(r))}let e=Math.atan2(Y.y,Math.sqrt(Y.x*Y.x+Y.z*Y.z)),n=-Math.atan2(Y.z,Y.x);this.rotateZ(e),this.rotateY(n),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<34;t++){let e=(t+1)%34;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(68+t*2,34+t,34+e)}for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(136+t*2,68+t,68+e),this._attrIndex.setXY(200+t*2,100+t,100+e)}this._attrIndex.needsUpdate=!0}},Do=class extends ie.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentOffset=new ie.Vector3,this._currentNormal=new ie.Vector3,this._shape=t,this._attrPos=new ie.BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new ie.BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},Fo=class extends he.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new he.Vector3,this._shape=t,this._attrPos=new he.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new he.BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.needsUpdate=!0}},ko=new re.Vector3,rt=class extends re.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof jt)this._geometry=new Fo(this.collider.shape);else if(this.collider.shape instanceof Wt)this._geometry=new Bo(this.collider.shape);else if(this.collider.shape instanceof zt)this._geometry=new Do(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");let e=new re.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new re.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=ko.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},Wo=class extends ce.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new ce.Vector3,this._springBone=t,this._attrPos=new ce.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new ce.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},zo=new oe.Vector3,Vi=class extends oe.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new Wo(this.springBone);let e=new oe.LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new oe.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=zo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},ot=class extends at.Object3D{constructor(t){super(),this.colliderMatrix=new at.Matrix4,this.shape=t}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),Go(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function Go(t,e,n){let i=e.elements;t.copy(e),n&&(t.elements[12]=i[0]*n.x+i[4]*n.y+i[8]*n.z+i[12],t.elements[13]=i[1]*n.x+i[5]*n.y+i[9]*n.z+i[13],t.elements[14]=i[2]*n.x+i[6]*n.y+i[10]*n.z+i[14])}var jo=new Ci.Matrix4;function Xo(t){return t.invert?t.invert():t.getInverse(jo.copy(t)),t}var Qo=class{constructor(t){this._inverseCache=new Ii.Matrix4,this._shouldUpdateInverse=!0,this.matrix=t;let e={set:(n,i,r)=>(this._shouldUpdateInverse=!0,n[i]=r,!0)};this._originalElements=t.elements,t.elements=new Proxy(t.elements,e)}get inverse(){return this._shouldUpdateInverse&&(Xo(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},Dt=new U.Matrix4,Me=new U.Vector3,be=new U.Vector3,Ve=new U.Vector3,Ie=new U.Vector3,Yo=new U.Matrix4,Ui=class{constructor(t,e,n={},i=[]){this._currentTail=new U.Vector3,this._prevTail=new U.Vector3,this._boneAxis=new U.Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new U.Matrix4,this._initialLocalRotation=new U.Quaternion,this._initialLocalChildPosition=new U.Vector3;var r,o,a,l,s,u;this.bone=t,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(r=n.hitRadius)!=null?r:0,stiffness:(o=n.stiffness)!=null?o:1,gravityPower:(a=n.gravityPower)!=null?a:0,gravityDir:(s=(l=n.gravityDir)==null?void 0:l.clone())!=null?s:new U.Vector3(0,-1,0),dragForce:(u=n.dragForce)!=null?u:.4},this.colliderGroups=i}get dependencies(){let t=new Set,e=this.bone.parent;e&&t.add(e);for(let n=0;n{e(r)})}function Ft(t,e){t.children.forEach(n=>{e(n)||Ft(n,e)})}function Zo(t){var e;let n=new Map;for(let i of t){let r=i;do{let o=((e=n.get(r))!=null?e:0)+1;if(o===t.size)return r;n.set(r,o),r=r.parent}while(r!==null)}return null}var kt=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){let t=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(n=>{t.add(n)})}),Array.from(t)}get colliders(){let t=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(n=>{t.add(n)})}),Array.from(t)}addJoint(t){this._joints.add(t);let e=this._objectSpringBonesMap.get(t.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(t.bone,e)),e.add(t),this._sortJoints()}addSpringBone(t){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(t)}deleteJoint(t){this._joints.delete(t),this._objectSpringBonesMap.get(t.bone).delete(t),this._sortJoints()}deleteSpringBone(t){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(t)}setInitState(){for(let t=0;t{var a,l;return((l=(a=this._objectSpringBonesMap.get(o))==null?void 0:a.size)!=null?l:0)>0?!0:(this._ancestors.push(o),!1)}))}_insertJointSort(t,e,n,i,r){if(n.has(t))return;if(e.has(t)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}let o=t.dependencies;for(let a of o){let l=!1,s=null;qo(a,u=>{let d=this._objectSpringBonesMap.get(u);if(d)for(let h of d)l=!0,this._insertJointSort(h,e,n,i,r);else l||(s=u)}),s&&r.add(s)}i.push(t),n.add(t)}_relevantChildrenUpdated(t){var e,n;return((n=(e=this._objectSpringBonesMap.get(t))==null?void 0:e.size)!=null?n:0)>0?!0:(t.updateWorldMatrix(!1,!1),!1)}},bi="VRMC_springBone_extended_collider",$o=new Set(["1.0","1.0-beta"]),Jo=new Set(["1.0"]),Oi=class Re{get name(){return Re.EXTENSION_NAME}constructor(e,n){var i;this.parser=e,this.jointHelperRoot=n==null?void 0:n.jointHelperRoot,this.colliderHelperRoot=n==null?void 0:n.colliderHelperRoot,this.useExtendedColliders=(i=n==null?void 0:n.useExtendedColliders)!=null?i:!0}afterRoot(e){return it(this,null,function*(){e.userData.vrmSpringBoneManager=yield this._import(e)})}_import(e){return it(this,null,function*(){let n=yield this._v1Import(e);if(n!=null)return n;let i=yield this._v0Import(e);return i!=null?i:null})}_v1Import(e){return it(this,null,function*(){var n,i,r,o,a;let l=e.parser.json;if(!(((n=l.extensionsUsed)==null?void 0:n.indexOf(Re.EXTENSION_NAME))!==-1))return null;let u=new kt,d=yield e.parser.getDependencies("node"),h=(i=l.extensions)==null?void 0:i[Re.EXTENSION_NAME];if(!h)return null;let p=h.specVersion;if(!$o.has(p))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Re.EXTENSION_NAME} specVersion "${p}"`),null;let m=(r=h.colliders)==null?void 0:r.map((f,g)=>{var R,V,y,_,v,E,T,P,L,A,S,H,W,z,xe;let K=d[f.node],G=f.shape,pe=(R=f.extensions)==null?void 0:R[bi];if(this.useExtendedColliders&&pe!=null){let ye=pe.specVersion;if(!Jo.has(ye))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${bi} specVersion "${ye}". Fallbacking to the ${Re.EXTENSION_NAME} definition`);else{let O=pe.shape;if(O.sphere)return this._importSphereCollider(K,{offset:new D.Vector3().fromArray((V=O.sphere.offset)!=null?V:[0,0,0]),radius:(y=O.sphere.radius)!=null?y:0,inside:(_=O.sphere.inside)!=null?_:!1});if(O.capsule)return this._importCapsuleCollider(K,{offset:new D.Vector3().fromArray((v=O.capsule.offset)!=null?v:[0,0,0]),radius:(E=O.capsule.radius)!=null?E:0,tail:new D.Vector3().fromArray((T=O.capsule.tail)!=null?T:[0,0,0]),inside:(P=O.capsule.inside)!=null?P:!1});if(O.plane)return this._importPlaneCollider(K,{offset:new D.Vector3().fromArray((L=O.plane.offset)!=null?L:[0,0,0]),normal:new D.Vector3().fromArray((A=O.plane.normal)!=null?A:[0,0,1])})}}if(G.sphere)return this._importSphereCollider(K,{offset:new D.Vector3().fromArray((S=G.sphere.offset)!=null?S:[0,0,0]),radius:(H=G.sphere.radius)!=null?H:0,inside:!1});if(G.capsule)return this._importCapsuleCollider(K,{offset:new D.Vector3().fromArray((W=G.capsule.offset)!=null?W:[0,0,0]),radius:(z=G.capsule.radius)!=null?z:0,tail:new D.Vector3().fromArray((xe=G.capsule.tail)!=null?xe:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),c=(o=h.colliderGroups)==null?void 0:o.map((f,g)=>{var R;return{colliders:((R=f.colliders)!=null?R:[]).map(y=>{let _=m==null?void 0:m[y];if(_==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${y} but not found`);return _}),name:f.name}});return(a=h.springs)==null||a.forEach((f,g)=>{var R;let V=f.joints,y=(R=f.colliderGroups)==null?void 0:R.map(E=>{let T=c==null?void 0:c[E];if(T==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${E} but not found`);return T}),_=f.center!=null?d[f.center]:void 0,v;V.forEach(E=>{if(v){let T=v.node,P=d[T],L=E.node,A=d[L],S={hitRadius:v.hitRadius,dragForce:v.dragForce,gravityPower:v.gravityPower,stiffness:v.stiffness,gravityDir:v.gravityDir!=null?new D.Vector3().fromArray(v.gravityDir):void 0},H=this._importJoint(P,A,S,y);_&&(H.center=_),u.addJoint(H)}v=E})}),u.setInitState(),u})}_v0Import(e){return it(this,null,function*(){var n,i,r;let o=e.parser.json;if(!(((n=o.extensionsUsed)==null?void 0:n.indexOf("VRM"))!==-1))return null;let l=(i=o.extensions)==null?void 0:i.VRM,s=l==null?void 0:l.secondaryAnimation;if(!s)return null;let u=s==null?void 0:s.boneGroups;if(!u)return null;let d=new kt,h=yield e.parser.getDependencies("node"),p=(r=s.colliderGroups)==null?void 0:r.map(m=>{var c;let f=h[m.node];return{colliders:((c=m.colliders)!=null?c:[]).map((R,V)=>{var y,_,v;let E=new D.Vector3(0,0,0);return R.offset&&E.set((y=R.offset.x)!=null?y:0,(_=R.offset.y)!=null?_:0,R.offset.z?-R.offset.z:0),this._importSphereCollider(f,{offset:E,radius:(v=R.radius)!=null?v:0,inside:!1})})}});return u==null||u.forEach((m,c)=>{let f=m.bones;f&&f.forEach(g=>{var R,V,y,_;let v=h[g],E=new D.Vector3;m.gravityDir?E.set((R=m.gravityDir.x)!=null?R:0,(V=m.gravityDir.y)!=null?V:0,(y=m.gravityDir.z)!=null?y:0):E.set(0,-1,0);let T=m.center!=null?h[m.center]:void 0,P={hitRadius:m.hitRadius,dragForce:m.dragForce,gravityPower:m.gravityPower,stiffness:m.stiffiness,gravityDir:E},L=(_=m.colliderGroups)==null?void 0:_.map(A=>{let S=p==null?void 0:p[A];if(S==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${c} attempted to use a colliderGroup ${A} but not found`);return S});v.traverse(A=>{var S;let H=(S=A.children[0])!=null?S:null,W=this._importJoint(A,H,P,L);T&&(W.center=T),d.addJoint(W)})})}),e.scene.updateMatrixWorld(),d.setInitState(),d})}_importJoint(e,n,i,r){let o=new Ui(e,n,i,r);if(this.jointHelperRoot){let a=new Vi(o);this.jointHelperRoot.add(a),a.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(e,n){let i=new jt(n),r=new ot(i);if(e.add(r),this.colliderHelperRoot){let o=new rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importCapsuleCollider(e,n){let i=new Wt(n),r=new ot(i);if(e.add(r),this.colliderHelperRoot){let o=new rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importPlaneCollider(e,n){let i=new zt(n),r=new ot(i);if(e.add(r),this.colliderHelperRoot){let o=new rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}};Oi.EXTENSION_NAME="VRMC_springBone";var Xt=Oi;var lt=class{get name(){return"VRMLoaderPlugin"}constructor(e,n){var o,a,l,s,u,d,h,p,m,c;this.parser=e;let i=n==null?void 0:n.helperRoot,r=n==null?void 0:n.autoUpdateHumanBones;this.expressionPlugin=(o=n==null?void 0:n.expressionPlugin)!=null?o:new je(e),this.firstPersonPlugin=(a=n==null?void 0:n.firstPersonPlugin)!=null?a:new Xe(e),this.humanoidPlugin=(l=n==null?void 0:n.humanoidPlugin)!=null?l:new Ye(e,{helperRoot:i,autoUpdateHumanBones:r}),this.lookAtPlugin=(s=n==null?void 0:n.lookAtPlugin)!=null?s:new qe(e,{helperRoot:i}),this.metaPlugin=(u=n==null?void 0:n.metaPlugin)!=null?u:new Ze(e),this.mtoonMaterialPlugin=(d=n==null?void 0:n.mtoonMaterialPlugin)!=null?d:new It(e),this.materialsHDREmissiveMultiplierPlugin=(h=n==null?void 0:n.materialsHDREmissiveMultiplierPlugin)!=null?h:new gi(e),this.materialsV0CompatPlugin=(p=n==null?void 0:n.materialsV0CompatPlugin)!=null?p:new Ti(e),this.springBonePlugin=(m=n==null?void 0:n.springBonePlugin)!=null?m:new Xt(e,{colliderHelperRoot:i,jointHelperRoot:i}),this.nodeConstraintPlugin=(c=n==null?void 0:n.nodeConstraintPlugin)!=null?c:new Ot(e,{helperRoot:i})}beforeRoot(){return we(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return we(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){let n=this.mtoonMaterialPlugin.getMaterialType(e);return n!=null?n:null}extendMaterialParams(e,n){return we(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,n),yield this.mtoonMaterialPlugin.extendMaterialParams(e,n)})}afterRoot(e){return we(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e),yield this.springBonePlugin.afterRoot(e),yield this.nodeConstraintPlugin.afterRoot(e),yield this.mtoonMaterialPlugin.afterRoot(e);let n=e.userData.vrmMeta,i=e.userData.vrmHumanoid;if(n&&i){let r=new ve({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:i,lookAt:e.userData.vrmLookAt,meta:n,materials:e.userData.vrmMToonMaterials,springBoneManager:e.userData.vrmSpringBoneManager,nodeConstraintManager:e.userData.vrmNodeConstraintManager});e.userData.vrm=r}})}};var Bi=M(require("three"),1);function Ko(t){let e=new Set;return t.traverse(n=>{if(!n.isMesh)return;let i=n;e.add(i)}),e}function Ni(t,e,n){let i=new Float32Array(t[0].count*3),r=0;if(n)r=1;else for(let a of e)r+=a.weight;for(let a of e){let l=t[a.index],s=a.weight/r;for(let u=0;u{if(r.type!=="SkinnedMesh")return;let o=r,a=n.get(o.geometry);a?e.delete(a):(n.set(o.geometry,o),e.add(o))});let i=[];e.forEach(r=>{let o=r.skeleton,a=i.find(h=>es(o,h));a||(a={bones:[],boneInverses:[],meshes:[]},i.push(a)),a.meshes.push(r);let l=o.bones.map(h=>a.bones.indexOf(h)),s=r.geometry,u=s.getAttribute("skinIndex"),d=s.getAttribute("skinWeight");for(let h=0;hs.bind(l,new ut.Matrix4))}}function es(t,e){return t.bones.every((n,i)=>{let r=e.bones.indexOf(n);return r!==-1?ts(t.boneInverses[i],e.boneInverses[r]):!0})}function ts(t,e,n){if(n=n||1e-4,t.elements.length!=e.elements.length)return!1;for(let i=0,r=t.elements.length;in)return!1;return!0}function ki(t){if(Object.values(t).forEach(e=>{e!=null&&e.isTexture&&e.dispose()}),t.isShaderMaterial){let e=t.uniforms;e&&Object.values(e).forEach(n=>{let i=n.value;i!=null&&i.isTexture&&i.dispose()})}t.dispose()}function ns(t){let e=t.geometry;e&&e.dispose();let n=t.skeleton;n&&n.dispose();let i=t.material;i&&(Array.isArray(i)?i.forEach(r=>ki(r)):i&&ki(i))}function Wi(t){t.traverse(ns)}var dt=M(require("three"),1);function zi(t,e){var a;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");let n=(a=e==null?void 0:e.experimentalSameBoneCounts)!=null?a:!1,i=[];t.traverse(l=>{l.type==="SkinnedMesh"&&i.push(l)});let r=new Map,o=0;for(let l of i){let u=l.geometry.getAttribute("skinIndex"),d=[],h=[],p={};for(let m=0;m{var g,R,V,y;if(!n.isMesh)return;let i=n,r=i.geometry,o=r.index;if(o==null)return;let a=e.get(r);if(a!=null){i.geometry=a;return}let l=Object.values(r.attributes)[0].count,s=new Array(l),u=0,d=o.array;for(let _=0;_{c.addGroup(_.start,_.count,_.materialIndex)}),c.boundingBox=(R=(g=r.boundingBox)==null?void 0:g.clone())!=null?R:null,c.boundingSphere=(y=(V=r.boundingSphere)==null?void 0:V.clone())!=null?y:null,c.setDrawRange(r.drawRange.start,r.drawRange.count),c.userData=r.userData,e.set(r,c);{let _=o.array,v=new _.constructor(_.length);for(let E=0;E<_.length;E++){let T=_[E],P=h[T];v[E]=P}c.setIndex(new ht.BufferAttribute(v,1,!1))}Object.keys(r.attributes).forEach(_=>{let v=r.attributes[_];if(v.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");let E=v.array,{itemSize:T,normalized:P}=v,L=new E.constructor(p.length*T);p.forEach((A,S)=>{for(let H=0;H{c.morphAttributes[_]=[];let v=r.morphAttributes[_];for(let E=0;E{for(let z=0;zH===0),c.morphAttributes[_][E]=new ht.BufferAttribute(S,L,A)}}),f&&(c.morphAttributes={}),i.geometry=c}),Array.from(e.keys()).forEach(n=>{n.dispose()})}function Xi(t){var e;((e=t.meta)==null?void 0:e.metaVersion)==="0"&&(t.scene.rotation.y=Math.PI)}var J=class{constructor(){}};J.combineMorphs=Di,J.combineSkeletons=Fi,J.deepDispose=Wi,J.removeUnnecessaryJoints=zi,J.removeUnnecessaryVertices=ji,J.rotateVRM0=Xi; /*! - * @pixiv/three-vrm-core v3.2.0 + * @pixiv/three-vrm-core v3.3.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -931,7 +931,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -939,7 +939,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.0 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.3.0 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -947,7 +947,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-v0compat v3.2.0 + * @pixiv/three-vrm-materials-v0compat v3.3.0 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -955,7 +955,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-node-constraint v3.2.0 + * @pixiv/three-vrm-node-constraint v3.3.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -963,7 +963,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-springbone v3.2.0 + * @pixiv/three-vrm-springbone v3.3.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm/lib/three-vrm.module.js b/packages/three-vrm/lib/three-vrm.module.js index cb5a5c432..99f67d296 100644 --- a/packages/three-vrm/lib/three-vrm.module.js +++ b/packages/three-vrm/lib/three-vrm.module.js @@ -1,5 +1,5 @@ /*! - * @pixiv/three-vrm v3.2.0 + * @pixiv/three-vrm v3.3.0 * VRM file loader for three.js. * * Copyright (c) 2019-2024 pixiv Inc. @@ -78,6 +78,12 @@ var VRMExpression = class extends THREE.Object3D { this.type = "VRMExpression"; this.visible = false; } + /** + * Binds that this expression influences. + */ + get binds() { + return this._binds; + } /** * A value represents how much it should override blink expressions. * `0.0` == no override at all, `1.0` == completely block the expressions. @@ -126,9 +132,25 @@ var VRMExpression = class extends THREE.Object3D { } return this.weight; } + /** + * Add an expression bind to the expression. + * + * @param bind A bind to add + */ addBind(bind) { this._binds.push(bind); } + /** + * Delete an expression bind from the expression. + * + * @param bind A bind to delete + */ + deleteBind(bind) { + const index = this._binds.indexOf(bind); + if (index >= 0) { + this._binds.splice(index, 1); + } + } /** * Apply weight to every assigned blend shapes. * Should be called every frame. @@ -4770,8 +4792,8 @@ import * as THREE92 from "three"; import * as THREE82 from "three"; import * as THREE102 from "three"; import * as THREE132 from "three"; -import * as THREE112 from "three"; import * as THREE122 from "three"; +import * as THREE112 from "three"; import * as THREE142 from "three"; var __async7 = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { @@ -4810,8 +4832,8 @@ var VRMSpringBoneColliderShapeCapsule = class extends VRMSpringBoneColliderShape this.inside = (_d = params == null ? void 0 : params.inside) != null ? _d : false; } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - _v3A7.copy(this.offset).applyMatrix4(colliderMatrix); - _v3B5.copy(this.tail).applyMatrix4(colliderMatrix); + _v3A7.setFromMatrixPosition(colliderMatrix); + _v3B5.subVectors(this.tail, this.offset).applyMatrix4(colliderMatrix); _v3B5.sub(_v3A7); const lengthSqCapsule = _v3B5.lengthSq(); target.copy(objectPosition).sub(_v3A7); @@ -4823,10 +4845,13 @@ var VRMSpringBoneColliderShapeCapsule = class extends VRMSpringBoneColliderShape _v3B5.multiplyScalar(dot / lengthSqCapsule); target.sub(_v3B5); } - const distance = this.inside ? this.radius - objectRadius - target.length() : target.length() - objectRadius - this.radius; - target.normalize(); - if (this.inside) { - target.negate(); + const length = target.length(); + const distance = this.inside ? this.radius - objectRadius - length : length - objectRadius - this.radius; + if (distance < 0) { + target.multiplyScalar(1 / length); + if (this.inside) { + target.negate(); + } } return distance; } @@ -4844,7 +4869,7 @@ var VRMSpringBoneColliderShapePlane = class extends VRMSpringBoneColliderShape { this.normal = (_b = params == null ? void 0 : params.normal) != null ? _b : new THREE24.Vector3(0, 0, 1); } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - target.copy(this.offset).applyMatrix4(colliderMatrix); + target.setFromMatrixPosition(colliderMatrix); target.negate().add(objectPosition); _mat3A.getNormalMatrix(colliderMatrix); _v3A23.copy(this.normal).applyNormalMatrix(_mat3A).normalize(); @@ -4853,6 +4878,7 @@ var VRMSpringBoneColliderShapePlane = class extends VRMSpringBoneColliderShape { return distance; } }; +var _v3A33 = new THREE34.Vector3(); var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape { get type() { return "sphere"; @@ -4865,17 +4891,19 @@ var VRMSpringBoneColliderShapeSphere = class extends VRMSpringBoneColliderShape this.inside = (_c = params == null ? void 0 : params.inside) != null ? _c : false; } calculateCollision(colliderMatrix, objectPosition, objectRadius, target) { - target.copy(this.offset).applyMatrix4(colliderMatrix); - target.negate().add(objectPosition); - const distance = this.inside ? this.radius - objectRadius - target.length() : target.length() - objectRadius - this.radius; - target.normalize(); - if (this.inside) { - target.negate(); + target.subVectors(objectPosition, _v3A33.setFromMatrixPosition(colliderMatrix)); + const length = target.length(); + const distance = this.inside ? this.radius - objectRadius - length : length - objectRadius - this.radius; + if (distance < 0) { + target.multiplyScalar(1 / length); + if (this.inside) { + target.negate(); + } } return distance; } }; -var _v3A33 = new THREE44.Vector3(); +var _v3A43 = new THREE44.Vector3(); var ColliderShapeCapsuleBufferGeometry = class extends THREE44.BufferGeometry { constructor(shape) { super(); @@ -4902,7 +4930,7 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE44.BufferGeometry { this._currentOffset.copy(this._shape.offset); shouldUpdateGeometry = true; } - const tail = _v3A33.copy(this._shape.tail).divideScalar(this.worldScale); + const tail = _v3A43.copy(this._shape.tail).divideScalar(this.worldScale); if (this._currentTail.distanceToSquared(tail) > 1e-10) { this._currentTail.copy(tail); shouldUpdateGeometry = true; @@ -4912,8 +4940,8 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE44.BufferGeometry { } } _buildPosition() { - _v3A33.copy(this._currentTail).sub(this._currentOffset); - const l = _v3A33.length() / this._currentRadius; + _v3A43.copy(this._currentTail).sub(this._currentOffset); + const l = _v3A43.length() / this._currentRadius; for (let i = 0; i <= 16; i++) { const t = i / 16 * Math.PI; this._attrPos.setXYZ(i, -Math.sin(t), -Math.cos(t), 0); @@ -4926,8 +4954,8 @@ var ColliderShapeCapsuleBufferGeometry = class extends THREE44.BufferGeometry { this._attrPos.setXYZ(68 + i, 0, Math.sin(t), Math.cos(t)); this._attrPos.setXYZ(100 + i, l, Math.sin(t), Math.cos(t)); } - const theta = Math.atan2(_v3A33.y, Math.sqrt(_v3A33.x * _v3A33.x + _v3A33.z * _v3A33.z)); - const phi = -Math.atan2(_v3A33.z, _v3A33.x); + const theta = Math.atan2(_v3A43.y, Math.sqrt(_v3A43.x * _v3A43.x + _v3A43.z * _v3A43.z)); + const phi = -Math.atan2(_v3A43.z, _v3A43.x); this.rotateZ(theta); this.rotateY(phi); this.scale(this._currentRadius, this._currentRadius, this._currentRadius); @@ -5046,7 +5074,7 @@ var ColliderShapeSphereBufferGeometry = class extends THREE62.BufferGeometry { this._attrIndex.needsUpdate = true; } }; -var _v3A43 = new THREE72.Vector3(); +var _v3A52 = new THREE72.Vector3(); var VRMSpringBoneColliderHelper = class extends THREE72.Group { constructor(collider) { super(); @@ -5076,7 +5104,7 @@ var VRMSpringBoneColliderHelper = class extends THREE72.Group { this.collider.updateWorldMatrix(true, false); this.matrix.copy(this.collider.matrixWorld); const matrixWorldElements = this.matrix.elements; - this._geometry.worldScale = _v3A43.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); + this._geometry.worldScale = _v3A52.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); this._geometry.update(); super.updateMatrixWorld(force); } @@ -5134,7 +5162,7 @@ var SpringBoneBufferGeometry = class extends THREE82.BufferGeometry { this._attrIndex.needsUpdate = true; } }; -var _v3A52 = new THREE92.Vector3(); +var _v3A62 = new THREE92.Vector3(); var VRMSpringBoneJointHelper = class extends THREE92.Group { constructor(springBone) { super(); @@ -5156,7 +5184,7 @@ var VRMSpringBoneJointHelper = class extends THREE92.Group { this.springBone.bone.updateWorldMatrix(true, false); this.matrix.copy(this.springBone.bone.matrixWorld); const matrixWorldElements = this.matrix.elements; - this._geometry.worldScale = _v3A52.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); + this._geometry.worldScale = _v3A62.set(matrixWorldElements[0], matrixWorldElements[1], matrixWorldElements[2]).length(); this._geometry.update(); super.updateMatrixWorld(force); } @@ -5164,9 +5192,23 @@ var VRMSpringBoneJointHelper = class extends THREE92.Group { var VRMSpringBoneCollider = class extends THREE102.Object3D { constructor(shape) { super(); + this.colliderMatrix = new THREE102.Matrix4(); this.shape = shape; } + updateWorldMatrix(updateParents, updateChildren) { + super.updateWorldMatrix(updateParents, updateChildren); + updateColliderMatrix(this.colliderMatrix, this.matrixWorld, this.shape.offset); + } }; +function updateColliderMatrix(colliderMatrix, matrixWorld, offset) { + const me = matrixWorld.elements; + colliderMatrix.copy(matrixWorld); + if (offset) { + colliderMatrix.elements[12] = me[0] * offset.x + me[4] * offset.y + me[8] * offset.z + me[12]; + colliderMatrix.elements[13] = me[1] * offset.x + me[5] * offset.y + me[9] * offset.z + me[13]; + colliderMatrix.elements[14] = me[2] * offset.x + me[6] * offset.y + me[10] * offset.z + me[14]; + } +} var _matA = new THREE112.Matrix4(); function mat4InvertCompat(target) { if (target.invert) { @@ -5208,15 +5250,11 @@ var Matrix4InverseCache = class { } }; var IDENTITY_MATRIX4 = new THREE132.Matrix4(); -var _v3A62 = new THREE132.Vector3(); +var _v3A72 = new THREE132.Vector3(); var _v3B23 = new THREE132.Vector3(); -var _v3C3 = new THREE132.Vector3(); var _worldSpacePosition = new THREE132.Vector3(); -var _centerSpacePosition = new THREE132.Vector3(); var _nextTail = new THREE132.Vector3(); -var _quatA8 = new THREE132.Quaternion(); var _matA2 = new THREE132.Matrix4(); -var _matB = new THREE132.Matrix4(); var VRMSpringBoneJoint = class { /** * Create a new VRMSpringBone. @@ -5248,6 +5286,22 @@ var VRMSpringBoneJoint = class { }; this.colliderGroups = colliderGroups; } + /** + * Set of dependencies that need to be updated before this joint. + */ + get dependencies() { + const set = /* @__PURE__ */ new Set(); + const parent = this.bone.parent; + if (parent) { + set.add(parent); + } + for (let cg = 0; cg < this.colliderGroups.length; cg++) { + for (let c = 0; c < this.colliderGroups[cg].colliders.length; c++) { + set.add(this.colliderGroups[cg].colliders[c]); + } + } + return set; + } get center() { return this._center; } @@ -5286,7 +5340,7 @@ var VRMSpringBoneJoint = class { } else { this._initialLocalChildPosition.copy(this.bone.position).normalize().multiplyScalar(0.07); } - const matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); + const matrixWorldToCenter = this._getMatrixWorldToCenter(); this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(matrixWorldToCenter); this._prevTail.copy(this._currentTail); this._boneAxis.copy(this._initialLocalChildPosition).normalize(); @@ -5299,7 +5353,7 @@ var VRMSpringBoneJoint = class { this.bone.quaternion.copy(this._initialLocalRotation); this.bone.updateMatrix(); this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld, this.bone.matrix); - const matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); + const matrixWorldToCenter = this._getMatrixWorldToCenter(); this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(matrixWorldToCenter); this._prevTail.copy(this._currentTail); } @@ -5312,30 +5366,15 @@ var VRMSpringBoneJoint = class { update(delta) { if (delta <= 0) return; this._calcWorldSpaceBoneLength(); + const worldSpaceBoneAxis = _v3B23.copy(this._boneAxis).transformDirection(this._initialLocalMatrix).transformDirection(this._parentMatrixWorld); + _nextTail.copy(this._currentTail).add(_v3A72.subVectors(this._currentTail, this._prevTail).multiplyScalar(1 - this.settings.dragForce)).applyMatrix4(this._getMatrixCenterToWorld()).addScaledVector(worldSpaceBoneAxis, this.settings.stiffness * delta).addScaledVector(this.settings.gravityDir, this.settings.gravityPower * delta); _worldSpacePosition.setFromMatrixPosition(this.bone.matrixWorld); - let matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); - _centerSpacePosition.copy(_worldSpacePosition).applyMatrix4(matrixWorldToCenter); - const quatWorldToCenter = _quatA8.setFromRotationMatrix(matrixWorldToCenter); - const centerSpaceParentMatrix = _matB.copy(matrixWorldToCenter).multiply(this._parentMatrixWorld); - const centerSpaceBoneAxis = _v3B23.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(centerSpaceParentMatrix).sub(_centerSpacePosition).normalize(); - const centerSpaceGravity = _v3C3.copy(this.settings.gravityDir).applyQuaternion(quatWorldToCenter).normalize(); - const matrixCenterToWorld = this._getMatrixCenterToWorld(_matA2); - _nextTail.copy(this._currentTail).add( - _v3A62.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1 - this.settings.dragForce) - ).add(_v3A62.copy(centerSpaceBoneAxis).multiplyScalar(this.settings.stiffness * delta)).add(_v3A62.copy(centerSpaceGravity).multiplyScalar(this.settings.gravityPower * delta)).applyMatrix4(matrixCenterToWorld); _nextTail.sub(_worldSpacePosition).normalize().multiplyScalar(this._worldSpaceBoneLength).add(_worldSpacePosition); this._collision(_nextTail); - matrixWorldToCenter = this._getMatrixWorldToCenter(_matA2); this._prevTail.copy(this._currentTail); - this._currentTail.copy(_v3A62.copy(_nextTail).applyMatrix4(matrixWorldToCenter)); - const worldSpaceInitialMatrixInv = mat4InvertCompat( - _matA2.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix) - ); - const applyRotation = _quatA8.setFromUnitVectors( - this._boneAxis, - _v3A62.copy(_nextTail).applyMatrix4(worldSpaceInitialMatrixInv).normalize() - ); - this.bone.quaternion.copy(this._initialLocalRotation).multiply(applyRotation); + this._currentTail.copy(_nextTail).applyMatrix4(this._getMatrixWorldToCenter()); + const worldSpaceInitialMatrixInv = _matA2.multiplyMatrices(this._parentMatrixWorld, this._initialLocalMatrix).invert(); + this.bone.quaternion.setFromUnitVectors(this._boneAxis, _v3A72.copy(_nextTail).applyMatrix4(worldSpaceInitialMatrixInv).normalize()).premultiply(this._initialLocalRotation); this.bone.updateMatrix(); this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld, this.bone.matrix); } @@ -5345,53 +5384,44 @@ var VRMSpringBoneJoint = class { * @param tail The tail you want to process */ _collision(tail) { - this.colliderGroups.forEach((colliderGroup) => { - colliderGroup.colliders.forEach((collider) => { - const dist = collider.shape.calculateCollision(collider.matrixWorld, tail, this.settings.hitRadius, _v3A62); + for (let cg = 0; cg < this.colliderGroups.length; cg++) { + for (let c = 0; c < this.colliderGroups[cg].colliders.length; c++) { + const collider = this.colliderGroups[cg].colliders[c]; + const dist = collider.shape.calculateCollision(collider.colliderMatrix, tail, this.settings.hitRadius, _v3A72); if (dist < 0) { - tail.add(_v3A62.multiplyScalar(-dist)); - tail.sub(_worldSpacePosition).normalize().multiplyScalar(this._worldSpaceBoneLength).add(_worldSpacePosition); + tail.addScaledVector(_v3A72, -dist); + tail.sub(_worldSpacePosition); + const length = tail.length(); + tail.multiplyScalar(this._worldSpaceBoneLength / length).add(_worldSpacePosition); } - }); - }); + } + } } /** * Calculate the {@link _worldSpaceBoneLength}. * Intended to be used in {@link update}. */ _calcWorldSpaceBoneLength() { - _v3A62.setFromMatrixPosition(this.bone.matrixWorld); + _v3A72.setFromMatrixPosition(this.bone.matrixWorld); if (this.child) { _v3B23.setFromMatrixPosition(this.child.matrixWorld); } else { _v3B23.copy(this._initialLocalChildPosition); _v3B23.applyMatrix4(this.bone.matrixWorld); } - this._worldSpaceBoneLength = _v3A62.sub(_v3B23).length(); + this._worldSpaceBoneLength = _v3A72.sub(_v3B23).length(); } /** * Create a matrix that converts center space into world space. - * @param target Target matrix */ - _getMatrixCenterToWorld(target) { - if (this._center) { - target.copy(this._center.matrixWorld); - } else { - target.identity(); - } - return target; + _getMatrixCenterToWorld() { + return this._center ? this._center.matrixWorld : IDENTITY_MATRIX4; } /** * Create a matrix that converts world space into center space. - * @param target Target matrix */ - _getMatrixWorldToCenter(target) { - if (this._center) { - target.copy(this._center.userData.inverseCacheProxy.inverse); - } else { - target.identity(); - } - return target; + _getMatrixWorldToCenter() { + return this._center ? this._center.userData.inverseCacheProxy.inverse : IDENTITY_MATRIX4; } }; function traverseAncestorsFromRoot2(object, callback) { @@ -5413,11 +5443,30 @@ function traverseChildrenUntilConditionMet(object, callback) { } }); } +function lowestCommonAncestor(objects) { + var _a; + const sharedAncestors = /* @__PURE__ */ new Map(); + for (const object of objects) { + let current = object; + do { + const newValue = ((_a = sharedAncestors.get(current)) != null ? _a : 0) + 1; + if (newValue === objects.size) { + return current; + } + sharedAncestors.set(current, newValue); + current = current.parent; + } while (current !== null); + } + return null; +} var VRMSpringBoneManager = class { constructor() { this._joints = /* @__PURE__ */ new Set(); + this._sortedJoints = []; this._hasWarnedCircularDependency = false; + this._ancestors = []; this._objectSpringBonesMap = /* @__PURE__ */ new Map(); + this._relevantChildrenUpdated = this._relevantChildrenUpdated.bind(this); } get joints() { return this._joints; @@ -5455,6 +5504,7 @@ var VRMSpringBoneManager = class { this._objectSpringBonesMap.set(joint.bone, objectSet); } objectSet.add(joint); + this._sortJoints(); } /** * @deprecated Use {@link addJoint} instead. @@ -5467,6 +5517,7 @@ var VRMSpringBoneManager = class { this._joints.delete(joint); const objectSet = this._objectSpringBonesMap.get(joint.bone); objectSet.delete(joint); + this._sortJoints(); } /** * @deprecated Use {@link deleteJoint} instead. @@ -5476,117 +5527,99 @@ var VRMSpringBoneManager = class { this.deleteJoint(joint); } setInitState() { - const springBonesTried = /* @__PURE__ */ new Set(); - const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); - for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.setInitState() - ); + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.setInitState(); } } reset() { - const springBonesTried = /* @__PURE__ */ new Set(); - const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); - for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.reset() - ); + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.reset(); } } update(delta) { + for (let i = 0; i < this._ancestors.length; i++) { + this._ancestors[i].updateWorldMatrix(i === 0, false); + } + for (let i = 0; i < this._sortedJoints.length; i++) { + const springBone = this._sortedJoints[i]; + springBone.bone.updateMatrix(); + springBone.bone.updateWorldMatrix(false, false); + springBone.update(delta); + traverseChildrenUntilConditionMet(springBone.bone, this._relevantChildrenUpdated); + } + } + /** + * Sorts the joints ensuring they are updated in the correct order taking dependencies into account. + */ + _sortJoints() { + const springBoneOrder = []; const springBonesTried = /* @__PURE__ */ new Set(); const springBonesDone = /* @__PURE__ */ new Set(); - const objectUpdated = /* @__PURE__ */ new Set(); + const ancestors = /* @__PURE__ */ new Set(); for (const springBone of this._joints) { - this._processSpringBone( - springBone, - springBonesTried, - springBonesDone, - objectUpdated, - (springBone2) => springBone2.update(delta) - ); - traverseChildrenUntilConditionMet(springBone.bone, (object) => { + this._insertJointSort(springBone, springBonesTried, springBonesDone, springBoneOrder, ancestors); + } + this._sortedJoints = springBoneOrder; + const lca = lowestCommonAncestor(ancestors); + this._ancestors = []; + if (lca) { + this._ancestors.push(lca); + traverseChildrenUntilConditionMet(lca, (object) => { var _a, _b; if (((_b = (_a = this._objectSpringBonesMap.get(object)) == null ? void 0 : _a.size) != null ? _b : 0) > 0) { return true; } - object.updateWorldMatrix(false, false); + this._ancestors.push(object); return false; }); } } - /** - * Update a spring bone. - * If there are other spring bone that are dependant, it will try to update them recursively. - * It updates matrixWorld of all ancestors and myself. - * It might log an warning message if there are any circular dependencies. - * - * Intended to be used in {@link update} and {@link _processSpringBone} itself recursively. - * - * @param springBone A springBone you want to update - * @param springBonesTried Set of springBones that are already tried to be updated - * @param springBonesDone Set of springBones that are already up to date - * @param objectUpdated Set of object3D whose matrixWorld is updated - */ - _processSpringBone(springBone, springBonesTried, springBonesDone, objectUpdated, callback) { + _insertJointSort(springBone, springBonesTried, springBonesDone, springBoneOrder, ancestors) { if (springBonesDone.has(springBone)) { return; } if (springBonesTried.has(springBone)) { if (!this._hasWarnedCircularDependency) { - console.warn("VRMSpringBoneManager: Circular dependency detected while updating springbones"); + console.warn("VRMSpringBoneManager: Circular dependency detected"); this._hasWarnedCircularDependency = true; } return; } - springBonesTried.add(springBone); - const depObjects = this._getDependencies(springBone); + const depObjects = springBone.dependencies; for (const depObject of depObjects) { + let encounteredSpringBone = false; + let ancestor = null; traverseAncestorsFromRoot2(depObject, (depObjectAncestor) => { const objectSet = this._objectSpringBonesMap.get(depObjectAncestor); if (objectSet) { for (const depSpringBone of objectSet) { - this._processSpringBone(depSpringBone, springBonesTried, springBonesDone, objectUpdated, callback); + encounteredSpringBone = true; + this._insertJointSort(depSpringBone, springBonesTried, springBonesDone, springBoneOrder, ancestors); } - } else if (!objectUpdated.has(depObjectAncestor)) { - depObjectAncestor.updateWorldMatrix(false, false); - objectUpdated.add(depObjectAncestor); + } else if (!encounteredSpringBone) { + ancestor = depObjectAncestor; } }); + if (ancestor) { + ancestors.add(ancestor); + } } - springBone.bone.updateMatrix(); - springBone.bone.updateWorldMatrix(false, false); - callback(springBone); - objectUpdated.add(springBone.bone); + springBoneOrder.push(springBone); springBonesDone.add(springBone); } - /** - * Return a set of objects that are dependant of given spring bone. - * @param springBone A spring bone - * @return A set of objects that are dependant of given spring bone - */ - _getDependencies(springBone) { - const set = /* @__PURE__ */ new Set(); - const parent = springBone.bone.parent; - if (parent) { - set.add(parent); + _relevantChildrenUpdated(object) { + var _a, _b; + if (((_b = (_a = this._objectSpringBonesMap.get(object)) == null ? void 0 : _a.size) != null ? _b : 0) > 0) { + return true; } - springBone.colliderGroups.forEach((colliderGroup) => { - colliderGroup.colliders.forEach((collider) => { - set.add(collider); - }); - }); - return set; + object.updateWorldMatrix(false, false); + return false; } }; var EXTENSION_NAME_EXTENDED_COLLIDER = "VRMC_springBone_extended_collider"; @@ -5977,8 +6010,122 @@ var VRMLoaderPlugin = class { } }; -// src/VRMUtils/combineSkeletons.ts +// src/VRMUtils/combineMorphs.ts import * as THREE21 from "three"; +function collectMeshes(scene) { + const meshes = /* @__PURE__ */ new Set(); + scene.traverse((obj) => { + if (!obj.isMesh) { + return; + } + const mesh = obj; + meshes.add(mesh); + }); + return meshes; +} +function combineMorph(positionAttributes, binds, morphTargetsRelative) { + const newArray = new Float32Array(positionAttributes[0].count * 3); + let weightSum = 0; + if (morphTargetsRelative) { + weightSum = 1; + } else { + for (const bind of binds) { + weightSum += bind.weight; + } + } + for (const bind of binds) { + const src = positionAttributes[bind.index]; + const weight = bind.weight / weightSum; + for (let i = 0; i < src.count; i++) { + newArray[i * 3 + 0] += src.getX(i) * weight; + newArray[i * 3 + 1] += src.getY(i) * weight; + newArray[i * 3 + 2] += src.getZ(i) * weight; + } + } + const newAttribute = new THREE21.BufferAttribute(newArray, 3); + return newAttribute; +} +function combineMorphs(vrm) { + var _a; + const meshes = collectMeshes(vrm.scene); + const meshNameBindSetMapMap = /* @__PURE__ */ new Map(); + const expressionMap = (_a = vrm.expressionManager) == null ? void 0 : _a.expressionMap; + if (expressionMap != null) { + for (const [expressionName, expression] of Object.entries(expressionMap)) { + const bindsToDeleteSet = /* @__PURE__ */ new Set(); + for (const bind of expression.binds) { + if (bind instanceof VRMExpressionMorphTargetBind) { + if (bind.weight !== 0) { + for (const mesh of bind.primitives) { + let nameBindSetMap = meshNameBindSetMapMap.get(mesh); + if (nameBindSetMap == null) { + nameBindSetMap = /* @__PURE__ */ new Map(); + meshNameBindSetMapMap.set(mesh, nameBindSetMap); + } + let bindSet = nameBindSetMap.get(expressionName); + if (bindSet == null) { + bindSet = /* @__PURE__ */ new Set(); + nameBindSetMap.set(expressionName, bindSet); + } + bindSet.add(bind); + } + } + bindsToDeleteSet.add(bind); + } + } + for (const bind of bindsToDeleteSet) { + expression.deleteBind(bind); + } + } + } + for (const mesh of meshes) { + const nameBindSetMap = meshNameBindSetMapMap.get(mesh); + if (nameBindSetMap == null) { + continue; + } + const geometry = mesh.geometry.clone(); + mesh.geometry = geometry; + const morphTargetsRelative = geometry.morphTargetsRelative; + const hasPMorph = geometry.morphAttributes.position != null; + const hasNMorph = geometry.morphAttributes.normal != null; + const morphAttributes = {}; + const morphTargetDictionary = {}; + const morphTargetInfluences = []; + if (hasPMorph || hasNMorph) { + if (hasPMorph) { + morphAttributes.position = []; + } + if (hasNMorph) { + morphAttributes.normal = []; + } + let i = 0; + for (const [name, bindSet] of nameBindSetMap) { + if (hasPMorph) { + morphAttributes.position[i] = combineMorph(geometry.morphAttributes.position, bindSet, morphTargetsRelative); + } + if (hasNMorph) { + morphAttributes.normal[i] = combineMorph(geometry.morphAttributes.normal, bindSet, morphTargetsRelative); + } + expressionMap == null ? void 0 : expressionMap[name].addBind( + new VRMExpressionMorphTargetBind({ + index: i, + weight: 1, + primitives: [mesh] + }) + ); + morphTargetDictionary[name] = i; + morphTargetInfluences.push(0); + i++; + } + } + geometry.morphAttributes = morphAttributes; + mesh.morphTargetDictionary = morphTargetDictionary; + mesh.morphTargetInfluences = morphTargetInfluences; + } +} + +// src/VRMUtils/combineSkeletons.ts +import * as THREE25 from "three"; function combineSkeletons(root) { const skinnedMeshes = /* @__PURE__ */ new Set(); const geometryToSkinnedMesh = /* @__PURE__ */ new Map(); @@ -6026,8 +6173,8 @@ function combineSkeletons(root) { attribute.needsUpdate = true; }); for (const { bones, boneInverses, meshes } of newSkeletons) { - const newSkeleton = new THREE21.Skeleton(bones, boneInverses); - meshes.forEach((mesh) => mesh.bind(newSkeleton, new THREE21.Matrix4())); + const newSkeleton = new THREE25.Skeleton(bones, boneInverses); + meshes.forEach((mesh) => mesh.bind(newSkeleton, new THREE25.Matrix4())); } } function skeletonMatches(skeleton, candidate) { @@ -6098,7 +6245,7 @@ function deepDispose(object3D) { } // src/VRMUtils/removeUnnecessaryJoints.ts -import * as THREE25 from "three"; +import * as THREE26 from "three"; function removeUnnecessaryJoints(root, options) { var _a; console.warn( @@ -6143,14 +6290,14 @@ function removeUnnecessaryJoints(root, options) { boneInverses[i] = boneInverses[0]; } } - const skeleton = new THREE25.Skeleton(bones, boneInverses); - mesh.bind(skeleton, new THREE25.Matrix4()); + const skeleton = new THREE26.Skeleton(bones, boneInverses); + mesh.bind(skeleton, new THREE26.Matrix4()); } } // src/VRMUtils/removeUnnecessaryVertices.ts -import * as THREE26 from "three"; -import { BufferAttribute as BufferAttribute8 } from "three"; +import * as THREE27 from "three"; +import { BufferAttribute as BufferAttribute9 } from "three"; function removeUnnecessaryVertices(root) { const geometryMap = /* @__PURE__ */ new Map(); root.traverse((obj) => { @@ -6193,7 +6340,7 @@ function removeUnnecessaryVertices(root) { newIndexOriginalIndexMap[newIndex] = i; } } - const newGeometry = new THREE26.BufferGeometry(); + const newGeometry = new THREE27.BufferGeometry(); newGeometry.name = geometry.name; newGeometry.morphTargetsRelative = geometry.morphTargetsRelative; geometry.groups.forEach((group) => { @@ -6212,7 +6359,7 @@ function removeUnnecessaryVertices(root) { const newIndex = originalIndexNewIndexMap[originalIndex2]; newIndexArray[i] = newIndex; } - newGeometry.setIndex(new BufferAttribute8(newIndexArray, 1, false)); + newGeometry.setIndex(new BufferAttribute9(newIndexArray, 1, false)); } Object.keys(geometry.attributes).forEach((attributeName) => { const originalAttribute = geometry.attributes[attributeName]; @@ -6229,7 +6376,7 @@ function removeUnnecessaryVertices(root) { newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex2 * itemSize + j]; } }); - newGeometry.setAttribute(attributeName, new BufferAttribute8(newAttributeArray, itemSize, normalized)); + newGeometry.setAttribute(attributeName, new BufferAttribute9(newAttributeArray, itemSize, normalized)); }); let isNullMorph = true; Object.keys(geometry.morphAttributes).forEach((attributeName) => { @@ -6251,7 +6398,7 @@ function removeUnnecessaryVertices(root) { } }); isNullMorph = isNullMorph && newAttributeArray.every((v) => v === 0); - newGeometry.morphAttributes[attributeName][iMorph] = new BufferAttribute8( + newGeometry.morphAttributes[attributeName][iMorph] = new BufferAttribute9( newAttributeArray, itemSize, normalized @@ -6281,6 +6428,7 @@ var VRMUtils = class { constructor() { } }; +VRMUtils.combineMorphs = combineMorphs; VRMUtils.combineSkeletons = combineSkeletons; VRMUtils.deepDispose = deepDispose; VRMUtils.removeUnnecessaryJoints = removeUnnecessaryJoints; @@ -6342,7 +6490,7 @@ export { VRMUtils }; /*! - * @pixiv/three-vrm-core v3.2.0 + * @pixiv/three-vrm-core v3.3.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6350,7 +6498,7 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6358,7 +6506,7 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.0 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.3.0 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6366,7 +6514,7 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-v0compat v3.2.0 + * @pixiv/three-vrm-materials-v0compat v3.3.0 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6374,7 +6522,7 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-node-constraint v3.2.0 + * @pixiv/three-vrm-node-constraint v3.3.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6382,11 +6530,11 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-springbone v3.2.0 + * @pixiv/three-vrm-springbone v3.3.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. * @pixiv/three-vrm-springbone is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb24udHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW4udHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL3V0aWxzL2dsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uUHJlc2V0TmFtZS50cyIsICIuLi8uLi90aHJlZS12cm0tY29yZS9zcmMvdXRpbHMvc2F0dXJhdGUudHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25NYW5hZ2VyLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTWF0ZXJpYWxDb2xvclR5cGUudHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZC50cyIsICIuLi8uLi90aHJlZS12cm0tY29yZS9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvbk1vcnBoVGFyZ2V0QmluZC50cyIsICIuLi8uLi90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WxzLmZpbHRlcigobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxJbmRleCA9IHRoaXMucGFyc2VyLmFzc29jaWF0aW9ucy5nZXQobWF0ZXJpYWwpPy5tYXRlcmlhbHM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIG9mZnNldDogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5vZmZzZXQgPz8gWzAuMCwgMC4wXSksXG4gICAgICAgICAgICAgICAgICBzY2FsZTogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5zY2FsZSA/PyBbMS4wLCAxLjBdKSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1hbmFnZXI7XG4gIH1cblxuICBwcml2YXRlIGFzeW5jIF92MEltcG9ydChnbHRmOiBHTFRGKTogUHJvbWlzZTxWUk1FeHByZXNzaW9uTWFuYWdlciB8IG51bGw+IHtcbiAgICBjb25zdCBqc29uID0gdGhpcy5wYXJzZXIuanNvbiBhcyBHTFRGU2NoZW1hLklHTFRGO1xuXG4gICAgLy8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+IHtcbiAgICAgICAgICAgIGlmIChiaW5kLm1lc2ggPT09IHVuZGVmaW5lZCB8fCBiaW5kLmluZGV4ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBub2Rlc1VzaW5nTWVzaDogbnVtYmVyW10gPSBbXTtcbiAgICAgICAgICAgIGpzb24ubm9kZXM/LmZvckVhY2goKG5vZGUsIGkpID0+IHtcbiAgICAgICAgICAgICAgaWYgKG5vZGUubWVzaCA9PT0gYmluZC5tZXNoKSB7XG4gICAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gucHVzaChpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gubWFwKGFzeW5jIChub2RlSW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwcmltaXRpdmVzID0gKGF3YWl0IGdsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlKGdsdGYsIG5vZGVJbmRleCkpITtcblxuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUdyb3VwLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4ICR7bW9ycGhUYXJnZXRJbmRleH10aCBtb3JwaCBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIHdlaWdodDogMC4wMSAqIChiaW5kLndlaWdodCA/PyAxMDApLCAvLyBuYXJyb3dpbmcgdGhlIHJhbmdlIGZyb20gWyAwLjAgLSAxMDAuMCBdIHRvIFsgMC4wIC0gMS4wIF1cbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEJpbmQgTWF0ZXJpYWxDb2xvciBhbmQgVGV4dHVyZVRyYW5zZm9ybVxuICAgICAgICBjb25zdCBtYXRlcmlhbFZhbHVlcyA9IHNjaGVtYUdyb3VwLm1hdGVyaWFsVmFsdWVzO1xuICAgICAgICBpZiAobWF0ZXJpYWxWYWx1ZXMgJiYgbWF0ZXJpYWxWYWx1Z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U5XHUzMEE0XHUzMEYzXHU2M0NGXHU3NTNCXHU3NTI4XHUzMDZFXHUzMERFXHUzMEM2XHUzMEVBXHUzMEEyXHUzMEVCXHUzMDgyXHU1NDBDXHU2NjQyXHUzMDZCXHU5NkM2XHUzMDgxXHUzMDhCXHUzMDAyXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsczogVEhSRUUuTWF0ZXJpYWxbXSA9IFtdO1xuICAgICAgICAgICAgZ2x0Zi5zY2VuZS50cmF2ZXJzZSgob2JqZWN0KSA9PiB7XG4gICAgICAgICAgICAgIGlmICgob2JqZWN0IGFzIGFueSkubWF0ZXJpYWwpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbDogVEhSRUUuTWF0ZXJpYWxbXSB8IFRIUkVFLk1hdGVyaWFsID0gKG9iamVjdCBhcyBhbnkpLm1hdGVyaWFsO1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG1hdGVyaWFsKSkge1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hdGVyaWFsLmZpbHRlcihcbiAgICAgICAgICAgICAgICAgICAgICAobXRsKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgKG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISArICcgKE91dGxpbmUpJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5pbmRleE9mKG10bCkgPT09IC0xLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGVyaWFsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0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ICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gTWF0ZXJpYWxDb2xvckJpbmRcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxDb2xvclR5cGUgPSB2MEV4cHJlc3Npb25NYXRlcmlhbENvbG9yTWFwW21hdGVyaWFsUHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsQ29sb3JUeXBlKSB7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBtYXRlcmlhbENvbG9yVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlISksXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjb25zb2xlLndhcm4obWF0ZXJpYWxQcm9wZXJ0eU5hbWUgKyAnIGlzIG5vdCBzdXBwb3J0ZWQnKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1h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Htib25lTmFtZX0gKGluZGV4ID0gJHtpbmRleH0pIGRvZXMgbm90IGV4aXN0YCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gbWFwIHRvIG5ldyBib25lIG5hbWVcbiAgICAgICAgICBjb25zdCB0aHVtYkJvbmVOYW1lID0gdGh1bWJCb25lTmFtZU1hcFtib25lTmFtZV07XG4gICAgICAgICAgY29uc3QgbmV3Qm9uZU5hbWUgPSAodGh1bWJCb25lTmFtZSA/PyBib25lTmFtZSkgYXMgVjFWUk1TY2hlbWEuSHVtYW5vaWRIdW1hbkJvbmVOYW1lO1xuXG4gICAgICAgICAgLy8gdjAgVlJNcyBtaWdodCBoYXZlIGEgbXVsdGlwbGUgbm9kZXMgYXR0YWNoZWQgdG8gYSBzaW5nbGUgYm9uZS4uLlxuICAgICAgICAgIC8vIHNvIGlmIHRoZXJlIGFscmVhZHkgaXMgYW4gZW50cnkgaW4gdGhlIGBodW1hbkJvbmVzYCwgc2hvdyBhIHdhcm5pbmcgYW5kIGlnbm9yZSBpdFxuICAgICAgICAgIGlmIChodW1hbkJvbmVzW25ld0JvbmVOYW1lXSAhPSBudWxsKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgIGBNdWx0aXBsZSBib25lIGVudHJpZXMgZm9yICR7bmV3Qm9uZU5hbWV9IGRldGVjdGVkIChpbmRleCA9ICR7aW5kZXh9KSwgaWdub3JpbmcgZHVwbGljYXRlZCBlbnRyaWVzLmAsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIHNldCB0byB0aGUgYGh1bWFuQm9uZXNgXG4gICAgICAgICAgaHVtYW5Cb25lc1tuZXdCb25lTmFtZV0gPSB7IG5vZGUgfTtcbiAgICAgICAgfSksXG4gICAgICApO1xuICAgIH1cblxuICAgIGNvbnN0IGh1bWFub2lkID0gbmV3IFZS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gTVRvb25NYXRlcmlhbC5wcm90b3R5cGUudW5pZm9ybXM7XG5cbiAgICAvLyA9PSBmaW5hbGx5IGNvbXBpbGUgdGhlIHNoYWRlciBwcm9ncmFtID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgICB0aGlzLnNldFZhbHVlcyhwYXJhbWV0ZXJzKTtcblxuICAgIC8vID09IHVwbG9hZCB1bmlmb3JtcyB0aGF0IG5lZWQgdG8gdXBsb2FkID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICAgIHRoaXMuX3VwbG9hZFVuaWZvcm1zV29ya2Fyb3VuZCgpO1xuXG4gICAgLy8gPT0gdXBkYXRlIHNoYWRlciBzdHVmZiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gICAgdGhpcy5jdXN0b21Qcm9ncmFtQ2FjaGVLZXkgPSAoKSA9PlxuICAgICAgW1xuICAgICAgICAuLi5PYmplY3QuZW50cmllcyh0aGlzLl9nZW5lcmF0ZURlZmluZXMoKSkubWFwKChbdG9rZW4sIG1hY3JvXSkgPT4gYCR7dG9rZW59OiR7bWFjcm99YCksXG4gICAgICAgIHRoaXMubWF0Y2FwVGV4dHVyZSA/IGBtYXRjYXBUZXh0dXJlQ29sb3JTcGFjZToke2dldFRleHR1cmVDb2xvclNwYWNlKHRoaXMubWF0Y2FwVGV4dHVyZSl9YCA6ICcnLFxuICAgICAgICB0aGlzLnNoYWRlTXVsdGlwbHlUZXh0dXJlXG4gICAgICAgICAgPyBgc2hhZGVNdWx0aXBseVRleHR1cmVDb2xvclNwYWNlOiR7Z2V0VGV4dHVyZUNvbG9yU3BhY2UodGhpcy5zaGFkZU11bHRpcGx5VGV4dHVyZSl9YFxuICAgICAgICAgIDogJycsXG4gICAgICAgIHRoaXMucmltTXVsdGlwbHlUZXh0dXJlID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haW50TG9hZGVyUGx1Z2luLkVYVEVOU0lPTl9OQU1FfSBzcGVjVmVyc2lvbiBcIiR7c3BlY1ZlcnNpb259XCJgLFxuICAgICAgICApO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IGNvbnN0cmFpbnREZWYgPSBleHRlbnNpb24uY29uc3RyYWludDtcblxuICAgICAgLy8gaW1wb3J0IGNvbnN0cmFpbnRzXG4gICAgICBpZiAoY29uc3RyYWludERlZi5yb2xsICE9IG51bGwpIHtcbiAgICAgICAgY29uc3QgY29uc3RyYWludCA9IHRoaXMuX2ltcG9ydFJvbGxDb25zdHJhaW50KG5vZGUsIHRocmVlTm9kZXMsIGNvbnN0cmFpbnREZWYucm9sbCk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5haW0gIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb25zdHJhaW50ID0gdGhpcy5faW1wb3J0QWltQ29uc3RyYWludChub2RlLCB0aHJlZU5vZGVzLCBjb25zdHJhaW50RGVmLmFpbSk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5yb3RhdGlvbiAhPSBudWxsKSB7XG4gICAgICAgIGNvbnN0IGNvbnN0cmFpbnQgPSB0aGlzLl9pbXBvcnRSb3RhdGlvbkNvbnN0cmFpbnQobm9kZSwgdGhyZWVOb2RlcywgY29uc3RyYWludERlZi5yb3RhdGlvbik7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIC8vIGluaXQgY29uc3RyYWludHNcbiAgICBnbHRmLnNjZW5lLnVwZGF0ZU1hdHJpeFdvcmxkKCk7XG4gICAgbWFuYWdlci5zZXRJbml0U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RhcmdldEluZmx1ZW5jZXMubGVuZ3RoLFxuICAgICAgICAgICAgKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICBgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogJHtzY2hlbWFFeHByZXNzaW9uLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4IG1vcnBoICMke21vcnBoVGFyZ2V0SW5kZXh9IGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgd2VpZ2h0OiBiaW5kLndlaWdodCA/PyAxLjAsXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICApO1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAoc2NoZW1hRXhwcmVzc2lvbi5tYXRlcmlhbENvbG9yQmluZHMgfHwgc2NoZW1hRXhwcmVzc2lvbi50ZXh0dXJlVHJhbnNmb3JtQmluZHMpIHtcbiAgICAgICAgICAvLyBsaXN0IHVwIGV2ZXJ5IG1hdGVyaWFsIGluIGBnbHRmLnNjZW5lYFxuICAgICAgICAgIGNvbnN0IGdsdGZNYXRlcmlhbHM6IFRIUkVFLk1hdGVyaWFsW10gPSBbXTtcbiAgICAgICAgICBnbHRmLnNjZW5lLnRyYXZlcnNlKChvYmplY3QpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsID0gKG9iamVjdCBhcyBhbnkpLm1hdGVyaWFsIGFzIFRIUkVFLk1hdGVyaWFsIHwgVEhSRUUuTWF0ZXJpYWxbXSB8IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChtYXRlcmlhbCkge1xuICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShtYXRlcmlhbCkpIHtcbiAgICAgICAgICAgICAgICBnbHRmTWF0ZXJpYWxzLnB1c2goLi4ubWF0ZXJpYWwpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGdsdGZNYXRlcmlhbHMucHVzaChtYXRlcmlhbCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNjaGVtYUV4cHJlc3Npb24ubWF0ZXJpYWxDb2xvckJpbmRzPy5mb3JFYWNoKGFzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbHMgPSBnbHRmTWF0ZXJpYWxzLmZpbHRlcigobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxJbmRleCA9IHRoaXMucGFyc2VyLmFzc29jaWF0aW9ucy5nZXQobWF0ZXJpYWwpPy5tYXRlcmlhbHM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIHR5cGU6IGJpbmQudHlwZSxcbiAgICAgICAgICAgICAgICAgIHRhcmdldFZhbHVlOiBuZXcgVEhSRUUuQ29sb3IoKS5mcm9tQXJyYXkoYmluZC50YXJnZXRWYWx1ZSksXG4gICAgICAgICAgICAgICAgICB0YXJnZXRBbHBoYTogYmluZC50YXJnZXRWYWx1ZVszXSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgc2NoZW1hRXhwcmVzc2lvbi50ZXh0dXJlVHJhbnNmb3JtQmluZHM/LmZvckVhY2goYXN5bmMgKGJpbmQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFscyA9IGdsdGZNYXRlcmlhbHMuZmlsdGVyKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbEluZGV4ID0gdGhpcy5wYXJzZXIuYXNzb2NpYXRpb25zLmdldChtYXRlcmlhbCk/Lm1hdGVyaWFscztcbiAgICAgICAgICAgICAgcmV0dXJuIGJpbmQubWF0ZXJpYWwgPT09IG1hdGVyaWFsSW5kZXg7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBuZXcgVEhSRUUuVmVjdG9yMigpLmZyb21BcnJheShiaW5kLm9mZnNldCA/PyBbMC4wLCAwLjBdKSxcbiAgICAgICAgICAgICAgICAgIHNjYWxlOiBuZXcgVEhSRUUuVmVjdG9yMigpLmZyb21BcnJheShiaW5kLnNjYWxlID8/IFsxLjAsIDEuMF0pLFxuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBtYW5hZ2VyLnJlZ2lzd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biAgICAgICAgY29uc3QgdjBQcmVzZXROYW1lID0gc2NoZW1hR3JvdXAucHJlc2V0TmFtZTtcbiAgICAgICAgY29uc3QgdjFQcmVzZXROYW1lID1cbiAgICAgICAgICAodjBQcmVzZXROYW1lICE9IG51bGwgJiYgVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbi52MHYxUHJlc2V0TmFtZU1hcFt2MFByZXNldE5hbWVdKSB8fCBudWxsO1xuICAgICAgICBjb25zdCBuYW1lID0gdjFQcmVzZXROYW1lID8/IHNjaGVtYUdyb3VwLm5hbWU7XG5cbiAgICAgICAgaWYgKG5hbWUgPT0gbnVsbCkge1xuICAgICAgICAgIGNvbnNvbGUud2FybignVlJNRXhwcmVzc2lvbkxvYWRlclBsdWdpbjogT25lIG9mIGN1c3RvbSBleHByZXNzaW9ucyBoYXMgbm8gbmFtZS4gSWdub3JpbmcgdGhlIGV4cHJlc3Npb24nKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICAvLyBkdXBsaWNhdGlvbiBjaGVja1xuICAgICAgICBpZiAoYmxlbmRTaGFwZU5hbWVTZXQuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46IEFuIGV4cHJlc3Npb24gcHJlc2V0ICR7djBQcmVzZXROYW1lfSBoYXMgZHVwbGljYXRlZCBlbnRyaWVzLiBJZ25vcmluZyB0aGUgZXhwcmVzc2lvbmAsXG4gICAgICAgICAgKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBibGVuZFNoYXBlTmFtZVNldC5hZGQobmFtZSk7XG5cbiAgICAgICAgY29uc3QgZXhwcmVzc2lvbiA9IG5ldyBWUk1FeHByZXNzaW9uKG5hbWUpO1xuICAgICAgICBnbHRmLnNjZW5lLmFkZChleHByZXNzaW9uKTtcblxuICAgICAgICBleHByZXNzaW9uLml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FyZ2V0XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgIXByaW1pdGl2ZXMuZXZlcnkoXG4gICAgICAgICAgICAgICAgICAgIChwcmltaXRpdmUpID0+XG4gICAgICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzKSAmJlxuICAgICAgICAgICAgICAgICAgICAgIG1vcnBoVGFyZ2V0SW5kZXggPCBwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46ICR7c2NoZW1hR3JvdXAubmFtZX0gYXR0ZW1wdHMgdG8gaW5kZXggJHttb3JwaFRhcmdldEluZGV4fXRoIG1vcnBoIGJ1dCBub3QgZm91bmQuYCxcbiAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBwcmltaXRpdmVzLFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogbW9ycGhUYXJnZXRJbmRleCxcbiAgICAgICAgICAgICAgICAgICAgd2VpZ2h0OiAwLjAxICogKGJpbmQud2VpZ2h0ID8/IDEwMCksIC8vIG5hcnJvd2luZyB0aGUgcmFuZ2UgZnJvbSBbIDAuMCAtIDEwMC4wIF0gdG8gWyAwLjAgLSAxLjAgXVxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAg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C0gc2NhbGUueTtcblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uVGV4dHVyZVRyYW5zZm9ybUJpbmQoe1xuICAgICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBNYXRlcmlhbENvbG9yQmluZFxuICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbENvbG9yVHlwZSA9IHYwRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JNYXBbbWF0ZXJpYWxQcm9wZXJ0eU5hbWVdO1xuICAgICAgICAgICAgICBpZiAobWF0ZXJpYWxDb2xvclR5cGUpIHtcbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IG1hdGVyaWFsQ29sb3JUeXBlLFxuICAgICAgICAgICAgICAgICAgICB0YXJnZXRWYWx1ZTogbmV3IFRIUkVFLkNvbG9yKCkuZnJvbUFycmF5KG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhKSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0QWxwaGE6IG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzNdLFxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4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VzKHRyaWFuZ2xlczogbnVtYmVyW10sIGJ3czogbnVtYmVyW11bXSwgc2tpbkluZGV4OiBudW1iZXJbXVtdLCBleGNsdWRlOiBudW1iZXJbXSk6IG51bWJlciB7XG4gICAgbGV0IGNvdW50ID0gMDtcbiAgICBpZiAoYndzICE9IG51bGwgJiYgYndzLmxlbmd0aCA+IDApIHtcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJpYW5nbGVzLmxlbmd0aDsgaSArPSAzKSB7XG4gICAgICAgIGNvbnN0IGEgPSB0cmlhbmdsZXNbaV07XG4gICAgICAgIGNvbnN0IGIgPSB0cmlhbmdsZXNbaSArIDFdO1xuICAgICAgICBjb25zdCBjID0gdHJpYW5nbGVzW2kgKyAyXTtcbiAgICAgICAgY29uc3QgYncwID0gYndzW2FdO1xuICAgICAgICBjb25zdCBza2luMCA9IHNraW5JbmRleFthXTtcblxuICAgICAgICBpZiAoYncwWzBdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4wWzBdKSkgY29udGludWU7XG4gICAgICAgIGlmIChidzBbMV0gPiAwICYmIGV4Y2x1ZGUuaW5jbHVkZXMoc2tpbjBbMV0pKSBjb250aW51ZTtcbiAgICAgICAgaWYgKGJ3MFsyXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMFsyXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncwWzNdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4wWzNdKSkgY29udGludWU7XG5cbiAgICAgICAgY29uc3QgYncxID0gYndzW2JdO1xuICAgICAgICBjb25zdCBza2luMSA9IHNraW5JbmRleFtiXTtcbiAgICAgICAgaWYgKGJ3MVswXSA+IDAgJiYgZXhjbHVkZS5pbmNsdWRlcyhza2luMVswXSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAoYncxWzFdID4gMCAmJiBleGNsdWRlLmluY2x1ZGVzKHNraW4xWzFdKSkgY29udGludWU7XG4gICAgICAgI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h0dXJlVXZUcmFuc2Zvcm06IHsgdmFsdWU6IG5ldyBUSFJFRS5NYXRyaXgzKCkgfSxcbiAgICAgICAgdXZBbmltYXRpb25TY3JvbGxYT2Zmc2V0OiB7IHZhbHVlOiAwLjAgfSxcbiAgICAgICAgdXZBbmltYXRpb25TY3JvbGxZT2Zmc2V0OiB7IHZhbHVlOiAwLjAgfSxcbiAgICAgICAgdXZBbmltYXRpb25Sb3RhdGlvblBoYXNlOiB7IHZhbHVlOiAwLjAgfSxcbiAgICAgIH0sXG4gICAgICBwYXJhbWV0ZXJzLnVuaWZvcm1zID8/IHt9LFxuICAgIF0pIGFzIHR5cGVvZiBNVG9vbk1hdGVyaWFsLnByb3RvdHlwZS51bmlmb3JtcztcblxuICAgIC8vID09IGZpbmFsbHkgY29tcGlsZSB0aGUgc2hhZGVyIHByb2dyYW0gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICAgIHRoaXMuc2V0VmFsdWVzKHBhcmFtZXRlcnMpO1xuXG4gICAgLy8gPT0gdXBsb2FkIHVuaWZvcm1zIHRoYXQgbmVlZCB0byB1cGxvYWQgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gICAgdGhpcy5fdXBsb2FkVW5pZm9ybXNXb3JrYXJvdW5kKCk7XG5cbiAgICAvLyA9PSB1cGRhdGUgc2hhZGVyIHN0dWZmID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgICB0aGlzLmN1c3RvbVByb2dyYW1DYWNoZUtleSA9ICgpID0+XG4gICAgICBbXG4gICAgICAgIC4uLk9iamVjdC5lbnRyaWVzKHRoaXMuX2dlbmVyYXRlRGVmaW5lcygpKS5tYXAoKFt0b2tlbiwgbWFjcm9dKSA9PiBgJHt0b2tlbn06JHttYWNyb31gKSxcbiAgICAgICAgdGhpcy5tY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b247XG4gICAgICBpZiAoIVBPU1NJQkxFX1NQRUNfVkVSU0lPTlMuaGFzKHNwZWNWZXJzaW9uKSkge1xuICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgYFZSTU5vZGVDb25zdHJhaW50TG9hZGVyUGx1Z2luOiBVbmtub3duICR7VlJNTm9kZUNvbnN0cmFpbnRMb2FkZXJQbHVnaW4uRVhURU5TSU9OX05BTUV9IHNwZWNWZXJzaW9uIFwiJHtzcGVjVmVyc2lvbn1cImAsXG4gICAgICAgICk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgY29uc3QgY29uc3RyYWludERlZiA9IGV4dGVuc2lvbi5jb25zdHJhaW50O1xuXG4gICAgICAvLyBpbXBvcnQgY29uc3RyYWludHNcbiAgICAgIGlmIChjb25zdHJhaW50RGVmLnJvbGwgIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb25zdHJhaW50ID0gdGhpcy5faW1wb3J0Um9sbENvbnN0cmFpbnQobm9kZSwgdGhyZWVOb2RlcywgY29uc3RyYWludERlZi5yb2xsKTtcbiAgICAgICAgbWFuYWdlci5hZGRDb25zdHJhaW50KGNvbnN0cmFpbnQpO1xuICAgICAgfSBlbHNlIGlmIChjb25zdHJhaW50RGVmLmFpbSAhPSBudWxsKSB7XG4gICAgICAgIGNvbnN0IGNvbnN0cmFpbnQgPSB0aGlzLl9pbXBvcnRBaW1Db25zdHJhaW50KG5vZGUsIHRocmVlTm9kZXMsIGNvbnN0cmFpbnREZWYuYWltKTtcbiAgICAgICAgbWFuYWdlci5hZGRDb25zdHJhaW50KGNvbnN0cmFpbnQpO1xuICAgICAgfSBlbHNlIGlmIChjb25zdHJhaW50RGVmLnJvdGF0aW9uICE9IG51bGwpIHtcbiAgICAgICAgY29uc3QgY29uc3RyYWludCA9IHRoaXMuX2ltcG9ydFJvdGF0aW9uQ29uc3RyYWludChub2RlLCB0aHJlZU5vZGVzLCBjb25zdHJhaW50RGVmLnJvdGF0a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TtcbiAgICB9XG5cbiAgICByZXR1cm4gY29uc3RyYWludDtcbiAgfVxuXG4gIHByb3RlY3RlZCBfaW1wb3J0QWltQ29uc3RyYWludChcbiAgICBkZXN0aW5hdGlvbjogVEhSRUUuT2JqZWN0M0QsXG4gICAgbm9kZXM6IFRIUkVFLk9iamVjdDNEW10sXG4gICAgYWltQ29uc3RyYWludERlZjogQ29uc3RyYWludFNjaGVtYS5BaW1Db25zdHJhaW50LFxuICApOiBWUk1BaW1Db25zdHJhaW50IHtcbiAgICBjb25zdCB7IHNvdXJjZTogc291cmNlSW5kZXgsIGFpbUF4aXMsIHdlaWdodCB9ID0gYWltQ29uc3RyYWludERlZjtcbiAgICBjb25zdCBzb3VyY2UgPSBub2Rlc1tzb3VyY2VJbmRleF07XG4gICAgY29uc3QgY29uc3RyYWludCA9IG5ldyBWUk1BaW1Db25zdHJhaW50KGRlc3RpbmF0aW9uLCBzb3VyY2UpO1xuXG4gICAgaWYgKGFpbUF4aXMgIT0gbnVsbCkge1xuICAgICAgY29uc3RyYWludC5haW1BeGlzID0gYWltQXhpcztcbiAgICB9XG4gICAgaWYgKHdlaWdodCAhPSBudWxsKSB7XG4gICAgICBjb25zdHJhaW50LndlaWdodCA9IHdlaWdodDtcbiAgICB9XG5cbiAgICBpZiAodGhpcy5oZWxwZXJSb290KSB7XG4gICAgICBjb25zdCBoZWxwZXIgPSBuZXcgVlJNTm9kZUNvbnN0cmFpbnRIZWxwZXIoY29uc3RyYWludCk7XG4gICAgICB0aGlzLmhlbHBlclJvb3QuYWRkKGhlbHBlcik7XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbnN0cmFpbnQ7XG4gIH1cblxuICBwcm90ZWN0ZWQgX2ltcG9ydFJvdGF0aW9uQ29uc3RyYWludChcbiAgICBkZXN0aW5hdGlvbjogVEhSRUUuT2JqZWN0M0QsXG4gICAgbm9kZXM6IFRIUkVFLk9iamVjdDNEW10sXG4gICAgcm90YXRpb25Db25zdHJhaW50RGVmOiBD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QyIsICJfcXVhdEEiLCAiX3F1YXRCIiwgIl9xdWF0QyIsICJjb25zdHJhaW50IiwgIlBPU1NJQkxFX1NQRUNfVkVSU0lPTlMiLCAiX1ZSTU5vZGVDb25zdHJhaW50TG9hZGVyUGx1Z2luIiwgIl9fYXN5bmMiLCAiX2EiLCAiVEhSRUUiLCAiX3YzQSIsICJfdjNCIiwgIl9tYXRBIiwgInRyYXZlcnNlQW5jZXN0b3JzRnJvbVJvb3QiLCAiUE9TU0lCTEVfU1BFQ19WRVJTSU9OUyIsICJfVlJNU3ByaW5nQm9uZUxvYWRlclBsdWdpbiIsICJfX2FzeW5jIiwgIl9hIiwgIl9iIiwgIl9jIiwgIl9kIiwgIl9lIiwgIlRIUkVFIiwgIlRIUkVFIiwgIm1hdGVyaWFsIiwgIlRIUkVFIiwgIlRIUkVFIiwgIkJ1ZmZlckF0dHJpYnV0ZSIsICJvcmlnaW5hbEluZGV4QXJyYXkiLCAib3JpZ2luYWxJbmRleCJdCn0K diff --git a/packages/three-vrm/lib/three-vrm.module.min.js b/packages/three-vrm/lib/three-vrm.module.min.js index df6bfdd40..ac51d1d68 100644 --- a/packages/three-vrm/lib/three-vrm.module.min.js +++ b/packages/three-vrm/lib/three-vrm.module.min.js @@ -1,5 +1,5 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -var xe=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())});import*as Sn from"three";import*as K from"three";import*as rt from"three";import*as Vn from"three";import*as D from"three";import*as Y from"three";import*as Fe from"three";import*as F from"three";import*as H from"three";import*as Se from"three";import*as ee from"three";import*as I from"three";import*as ut from"three";import*as V from"three";import*as nt from"three";import*as Wn from"three";var T=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),nn=class extends Sn.Object3D{constructor(t){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${t}`,this.expressionName=t,this.type="VRMExpression",this.visible=!1}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(t){this._binds.push(t)}applyWeight(t){var e;let n=this.outputWeight;n*=(e=t==null?void 0:t.multiplier)!=null?e:1,this.isBinary&&n<1&&(n=0),this._binds.forEach(i=>i.applyWeight(n))}clearAppliedWeight(){this._binds.forEach(t=>t.clearAppliedWeight())}};function Pn(t,e,n){var i,r;let o=t.parser.json,a=(i=o.nodes)==null?void 0:i[e];if(a==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let l=a.mesh;if(l==null)return null;let s=(r=o.meshes)==null?void 0:r[l];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${l}] of glTF but the mesh doesn't exist`),null;let u=s.primitives.length,d=[];return n.traverse(h=>{d.length{let o=Pn(t,r,i);o!=null&&n.set(r,o)}),n})}var Ke={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function An(t){return Math.max(Math.min(t,1),0)}var sn=class Ln{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},n=new Set(Object.values(Ke));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)&&(e[i]=r)}),e}get customExpressionMap(){let e={},n=new Set(Object.values(Ke));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)||(e[i]=r)}),e}copy(e){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),e._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new Ln().copy(this)}getExpression(e){var n;return(n=this._expressionMap[e])!=null?n:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let n=this._expressions.indexOf(e);n===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(n,1),delete this._expressionMap[e.expressionName]}getValue(e){var n;let i=this.getExpression(e);return(n=i==null?void 0:i.weight)!=null?n:null}setValue(e,n){let i=this.getExpression(e);i&&(i.weight=An(n))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let n=this.getExpression(e);return n?`${n.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(n=>{n.clearAppliedWeight()}),this._expressions.forEach(n=>{let i=1,r=n.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(i*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(i*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(i*=e.mouth),n.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let e=1,n=1,i=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,n-=r.overrideLookAtAmount,i-=r.overrideMouthAmount}),e=Math.max(0,e),n=Math.max(0,n),i=Math.max(0,i),{blink:e,lookAt:n,mouth:i}}},ye={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},lr={_Color:ye.Color,_EmissionColor:ye.EmissionColor,_ShadeColor:ye.ShadeColor,_RimColor:ye.RimColor,_OutlineColor:ye.OutlineColor},ur=new rt.Color,Hn=class bn{constructor({material:e,type:n,targetValue:i,targetAlpha:r}){this.material=e,this.type=n,this.targetValue=i,this.targetAlpha=r!=null?r:1;let o=this._initColorBindState(),a=this._initAlphaBindState();this._state={color:o,alpha:a}}applyWeight(e){let{color:n,alpha:i}=this._state;if(n!=null){let{propertyName:r,deltaValue:o}=n,a=this.material[r];a!=null&&a.add(ur.copy(o).multiplyScalar(e))}if(i!=null){let{propertyName:r,deltaValue:o}=i;this.material[r]!=null&&(this.material[r]+=o*e)}}clearAppliedWeight(){let{color:e,alpha:n}=this._state;if(e!=null){let{propertyName:i,initialValue:r}=e,o=this.material[i];o!=null&&o.copy(r)}if(n!=null){let{propertyName:i,initialValue:r}=n;this.material[i]!=null&&(this.material[i]=r)}}_initColorBindState(){var e,n,i;let{material:r,type:o,targetValue:a}=this,l=this._getPropertyNameMap(),s=(n=(e=l==null?void 0:l[o])==null?void 0:e[0])!=null?n:null;if(s==null)return console.warn(`Tried to add a material color bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type is not supported.`),null;let d=r[s].clone(),h=new rt.Color(a.r-d.r,a.g-d.g,a.b-d.b);return{propertyName:s,initialValue:d,deltaValue:h}}_initAlphaBindState(){var e,n,i;let{material:r,type:o,targetAlpha:a}=this,l=this._getPropertyNameMap(),s=(n=(e=l==null?void 0:l[o])==null?void 0:e[1])!=null?n:null;if(s==null&&a!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type does not support alpha.`),null;if(s==null)return null;let u=r[s],d=a-u;return{propertyName:s,initialValue:u,deltaValue:d}}_getPropertyNameMap(){var e,n;return(n=(e=Object.entries(bn._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:e[1])!=null?n:null}};Hn._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var an=Hn,ln=class{constructor({primitives:t,index:e,weight:n}){this.primitives=t,this.index=e,this.weight=n}applyWeight(t){this.primitives.forEach(e=>{var n;((n=e.morphTargetInfluences)==null?void 0:n[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*t)})}clearAppliedWeight(){this.primitives.forEach(t=>{var e;((e=t.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(t.morphTargetInfluences[this.index]=0)})}},un=new Vn.Vector2,In=class Cn{constructor({material:e,scale:n,offset:i}){var r,o;this.material=e,this.scale=n,this.offset=i;let a=(r=Object.entries(Cn._propertyNamesMap).find(([l])=>e[l]===!0))==null?void 0:r[1];a==null?(console.warn(`Tried to add a texture transform bind to the material ${(o=e.name)!=null?o:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],a.forEach(l=>{var s;let u=(s=e[l])==null?void 0:s.clone();if(!u)return null;e[l]=u;let d=u.offset.clone(),h=u.repeat.clone(),p=i.clone().sub(d),m=n.clone().sub(h);this._properties.push({name:l,initialOffset:d,deltaOffset:p,initialScale:h,deltaScale:m})}))}applyWeight(e){this._properties.forEach(n=>{let i=this.material[n.name];i!==void 0&&(i.offset.add(un.copy(n.deltaOffset).multiplyScalar(e)),i.repeat.add(un.copy(n.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let n=this.material[e.name];n!==void 0&&(n.offset.copy(e.initialOffset),n.repeat.copy(e.initialScale))})}};In._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var dn=In,dr=new Set(["1.0","1.0-beta"]),Un=class On{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return T(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return T(this,null,function*(){let n=yield this._v1Import(e);if(n)return n;let i=yield this._v0Import(e);return i||null})}_v1Import(e){return T(this,null,function*(){var n,i;let r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;let a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;let l=a.specVersion;if(!dr.has(l))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.expressions;if(!s)return null;let u=new Set(Object.values(Ke)),d=new Map;s.preset!=null&&Object.entries(s.preset).forEach(([p,m])=>{if(m!=null){if(!u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${p}" detected. Ignoring the expression`);return}d.set(p,m)}}),s.custom!=null&&Object.entries(s.custom).forEach(([p,m])=>{if(u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${p}". Ignoring the expression`);return}d.set(p,m)});let h=new sn;return yield Promise.all(Array.from(d.entries()).map(p=>T(this,[p],function*([m,c]){var f,g,M,b,x,_,v;let E=new nn(m);if(e.scene.add(E),E.isBinary=(f=c.isBinary)!=null?f:!1,E.overrideBlink=(g=c.overrideBlink)!=null?g:"none",E.overrideLookAt=(M=c.overrideLookAt)!=null?M:"none",E.overrideMouth=(b=c.overrideMouth)!=null?b:"none",(x=c.morphTargetBinds)==null||x.forEach(R=>T(this,null,function*(){var S;if(R.node===void 0||R.index===void 0)return;let A=yield rn(e,R.node),P=R.index;if(!A.every(w=>Array.isArray(w.morphTargetInfluences)&&P{let A=S.material;A&&(Array.isArray(A)?R.push(...A):R.push(A))}),(_=c.materialColorBinds)==null||_.forEach(S=>T(this,null,function*(){R.filter(P=>{var w;let L=(w=this.parser.associations.get(P))==null?void 0:w.materials;return S.material===L}).forEach(P=>{E.addBind(new an({material:P,type:S.type,targetValue:new K.Color().fromArray(S.targetValue),targetAlpha:S.targetValue[3]}))})})),(v=c.textureTransformBinds)==null||v.forEach(S=>T(this,null,function*(){R.filter(P=>{var w;let L=(w=this.parser.associations.get(P))==null?void 0:w.materials;return S.material===L}).forEach(P=>{var w,L;E.addBind(new dn({material:P,offset:new K.Vector2().fromArray((w=S.offset)!=null?w:[0,0]),scale:new K.Vector2().fromArray((L=S.scale)!=null?L:[1,1])}))})}))}h.registerExpression(E)}))),h})}_v0Import(e){return T(this,null,function*(){var n;let i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.blendShapeMaster;if(!o)return null;let a=new sn,l=o.blendShapeGroups;if(!l)return a;let s=new Set;return yield Promise.all(l.map(u=>T(this,null,function*(){var d;let h=u.presetName,p=h!=null&&On.v0v1PresetNameMap[h]||null,m=p!=null?p:u.name;if(m==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(m)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${h} has duplicated entries. Ignoring the expression`);return}s.add(m);let c=new nn(m);e.scene.add(c),c.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(g=>T(this,null,function*(){var M;if(g.mesh===void 0||g.index===void 0)return;let b=[];(M=i.nodes)==null||M.forEach((_,v)=>{_.mesh===g.mesh&&b.push(v)});let x=g.index;yield Promise.all(b.map(_=>T(this,null,function*(){var v;let E=yield rn(e,_);if(!E.every(R=>Array.isArray(R.morphTargetInfluences)&&x{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;let M=[];e.scene.traverse(x=>{if(x.material){let _=x.material;Array.isArray(_)?M.push(..._.filter(v=>(v.name===g.materialName||v.name===g.materialName+" (Outline)")&&M.indexOf(v)===-1)):_.name===g.materialName&&M.indexOf(_)===-1&&M.push(_)}});let b=g.propertyName;M.forEach(x=>{if(b==="_MainTex_ST"){let v=new K.Vector2(g.targetValue[0],g.targetValue[1]),E=new K.Vector2(g.targetValue[2],g.targetValue[3]);E.y=1-E.y-v.y,c.addBind(new dn({material:x,scale:v,offset:E}));return}let _=lr[b];if(_){c.addBind(new an({material:x,type:_,targetValue:new K.Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(b+" is not supported")})}),a.registerExpression(c)}))),a})}};Un.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var ot=Un,zo={None:"none",Block:"block",Blend:"blend"},st=class fe{constructor(e,n){this._firstPersonOnlyLayer=fe.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=fe.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=n}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(n=>({meshes:n.meshes.concat(),type:n.type})),this}clone(){return new fe(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=fe.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=fe.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(i=>{i.meshes.forEach(r=>{i.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(o=>o.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(o=>o.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(e,n,i,r){let o=0;if(n!=null&&n.length>0)for(let a=0;a0&&r.includes(h[0])||d[1]>0&&r.includes(h[1])||d[2]>0&&r.includes(h[2])||d[3]>0&&r.includes(h[3]))continue;let p=n[s],m=i[s];if(p[0]>0&&r.includes(m[0])||p[1]>0&&r.includes(m[1])||p[2]>0&&r.includes(m[2])||p[3]>0&&r.includes(m[3]))continue;let c=n[u],f=i[u];c[0]>0&&r.includes(f[0])||c[1]>0&&r.includes(f[1])||c[2]>0&&r.includes(f[2])||c[3]>0&&r.includes(f[3])||(e[o++]=l,e[o++]=s,e[o++]=u)}return o}_createErasedMesh(e,n){let i=new D.SkinnedMesh(e.geometry.clone(),e.material);i.name=`${e.name}(erase)`,i.frustumCulled=e.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);let r=i.geometry,o=r.getAttribute("skinIndex"),a=o instanceof D.GLBufferAttribute?[]:o.array,l=[];for(let f=0;f{this._isEraseTarget(o)&&i.push(a)}),!i.length){n.layers.enable(this._thirdPersonOnlyLayer),n.layers.enable(this._firstPersonOnlyLayer);return}n.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(n,i);e.add(r)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer));else{let n=new D.Group;n.name=`_headless_${e.name}`,n.layers.set(this._firstPersonOnlyLayer),e.parent.add(n),e.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{let r=i;this._createHeadlessModelForSkinnedMesh(n,r)})}else if(e.type==="SkinnedMesh"){let n=e;this._createHeadlessModelForSkinnedMesh(e.parent,n)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};st.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;st.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var hn=st,hr=new Set(["1.0","1.0-beta"]),at=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return T(this,null,function*(){let e=t.userData.vrmHumanoid;if(e!==null){if(e===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");t.userData.vrmFirstPerson=yield this._import(t,e)}})}_import(t,e){return T(this,null,function*(){if(e==null)return null;let n=yield this._v1Import(t,e);if(n)return n;let i=yield this._v0Import(t,e);return i||null})}_v1Import(t,e){return T(this,null,function*(){var n,i;let r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;let a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;let l=a.specVersion;if(!hr.has(l))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.firstPerson,u=[],d=yield on(t);return Array.from(d.entries()).forEach(([h,p])=>{var m,c;let f=(m=s==null?void 0:s.meshAnnotations)==null?void 0:m.find(g=>g.node===h);u.push({meshes:p,type:(c=f==null?void 0:f.type)!=null?c:"auto"})}),new hn(e,u)})}_v0Import(t,e){return T(this,null,function*(){var n;let i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.firstPerson;if(!o)return null;let a=[],l=yield on(t);return Array.from(l.entries()).forEach(([s,u])=>{let d=i.nodes[s],h=o.meshAnnotations?o.meshAnnotations.find(p=>p.mesh===d.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(h==null?void 0:h.firstPersonFlag)})}),new hn(e,a)})}_convertV0FlagToV1Type(t){return t==="FirstPersonOnly"?"firstPersonOnly":t==="ThirdPersonOnly"?"thirdPersonOnly":t==="Both"?"both":"auto"}},Go={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"},cn=new Y.Vector3,pn=new Y.Vector3,cr=new Y.Quaternion,mn=class extends Y.Group{constructor(t){super(),this.vrmHumanoid=t,this._boneAxesMap=new Map,Object.values(t.humanBones).forEach(e=>{let n=new Y.AxesHelper(1);n.matrixAutoUpdate=!1,n.material.depthTest=!1,n.material.depthWrite=!1,this.add(n),this._boneAxesMap.set(e,n)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(t=>{t.geometry.dispose(),t.material.dispose()})}updateMatrixWorld(t){Array.from(this._boneAxesMap.entries()).forEach(([e,n])=>{e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(cn,cr,pn);let i=cn.set(.1,.1,.1).divide(pn);n.matrix.copy(e.node.matrixWorld).scale(i)}),super.updateMatrixWorld(t)}},qe=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],jo={Hips:"hips",Spine:"spine",Chest:"chest",UpperChest:"upperChest",Neck:"neck",Head:"head",LeftEye:"leftEye",RightEye:"rightEye",Jaw:"jaw",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",LeftToes:"leftToes",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",RightToes:"rightToes",LeftShoulder:"leftShoulder",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightShoulder:"rightShoulder",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand",LeftThumbMetacarpal:"leftThumbMetacarpal",LeftThumbProximal:"leftThumbProximal",LeftThumbDistal:"leftThumbDistal",LeftIndexProximal:"leftIndexProximal",LeftIndexIntermediate:"leftIndexIntermediate",LeftIndexDistal:"leftIndexDistal",LeftMiddleProximal:"leftMiddleProximal",LeftMiddleIntermediate:"leftMiddleIntermediate",LeftMiddleDistal:"leftMiddleDistal",LeftRingProximal:"leftRingProximal",LeftRingIntermediate:"leftRingIntermediate",LeftRingDistal:"leftRingDistal",LeftLittleProximal:"leftLittleProximal",LeftLittleIntermediate:"leftLittleIntermediate",LeftLittleDistal:"leftLittleDistal",RightThumbMetacarpal:"rightThumbMetacarpal",RightThumbProximal:"rightThumbProximal",RightThumbDistal:"rightThumbDistal",RightIndexProximal:"rightIndexProximal",RightIndexIntermediate:"rightIndexIntermediate",RightIndexDistal:"rightIndexDistal",RightMiddleProximal:"rightMiddleProximal",RightMiddleIntermediate:"rightMiddleIntermediate",RightMiddleDistal:"rightMiddleDistal",RightRingProximal:"rightRingProximal",RightRingIntermediate:"rightRingIntermediate",RightRingDistal:"rightRingDistal",RightLittleProximal:"rightLittleProximal",RightLittleIntermediate:"rightLittleIntermediate",RightLittleDistal:"rightLittleDistal"},pr={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function Nn(t){return t.invert?t.invert():t.inverse(),t}var se=new Fe.Vector3,ae=new Fe.Quaternion,et=class{constructor(t){this.humanBones=t,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);i&&(se.copy(i.position),ae.copy(i.quaternion),t[n]={position:se.toArray(),rotation:ae.toArray()})}),t}getPose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);if(!i)return;se.set(0,0,0),ae.identity();let r=this.restPose[n];r!=null&&r.position&&se.fromArray(r.position).negate(),r!=null&&r.rotation&&Nn(ae.fromArray(r.rotation)),se.add(i.position),ae.premultiply(i.quaternion),t[n]={position:se.toArray(),rotation:ae.toArray()}}),t}setPose(t){Object.entries(t).forEach(([e,n])=>{let i=e,r=this.getBoneNode(i);if(!r)return;let o=this.restPose[i];o&&(n!=null&&n.position&&(r.position.fromArray(n.position),o.position&&r.position.add(se.fromArray(o.position))),n!=null&&n.rotation&&(r.quaternion.fromArray(n.rotation),o.rotation&&r.quaternion.multiply(ae.fromArray(o.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([t,e])=>{let n=this.getBoneNode(t);n&&(e!=null&&e.position&&n.position.fromArray(e.position),e!=null&&e.rotation&&n.quaternion.fromArray(e.rotation))})}getBone(t){var e;return(e=this.humanBones[t])!=null?e:void 0}getBoneNode(t){var e,n;return(n=(e=this.humanBones[t])==null?void 0:e.node)!=null?n:null}},Ze=new F.Vector3,mr=new F.Quaternion,fr=new F.Vector3,fn=class Bn extends et{static _setupTransforms(e){let n=new F.Object3D;n.name="VRMHumanoidRig";let i={},r={},o={},a={};qe.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let h=new F.Vector3,p=new F.Quaternion;d.updateWorldMatrix(!0,!1),d.matrixWorld.decompose(h,p,Ze),i[s]=h,r[s]=p,o[s]=d.quaternion.clone();let m=new F.Quaternion;(u=d.parent)==null||u.matrixWorld.decompose(Ze,m,Ze),a[s]=m}});let l={};return qe.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let h=i[s],p=s,m;for(;m==null&&(p=pr[p],p!=null);)m=i[p];let c=new F.Object3D;c.name="Normalized_"+d.name,(p?(u=l[p])==null?void 0:u.node:n).add(c),c.position.copy(h),m&&c.position.sub(m),l[s]={node:c}}}),{rigBones:l,root:n,parentWorldRotations:a,boneRotations:o}}constructor(e){let{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=Bn._setupTransforms(e);super(n),this.original=e,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){qe.forEach(e=>{let n=this.original.getBoneNode(e);if(n!=null){let i=this.getBoneNode(e),r=this._parentWorldRotations[e],o=mr.copy(r).invert(),a=this._boneRotations[e];if(n.quaternion.copy(i.quaternion).multiply(r).premultiply(o).multiply(a),e==="hips"){let l=i.getWorldPosition(fr);n.parent.updateWorldMatrix(!0,!1);let s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},_n=class Dn{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,n){var i;this.autoUpdateHumanBones=(i=n==null?void 0:n.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new et(e),this._normalizedHumanBones=new fn(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new et(e.humanBones),this._normalizedHumanBones=new fn(this._rawHumanBones),this}clone(){return new Dn(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},_r={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},gr=new Set(["1.0","1.0-beta"]),gn={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},lt=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot,this.autoUpdateHumanBones=e==null?void 0:e.autoUpdateHumanBones}afterRoot(t){return T(this,null,function*(){t.userData.vrmHumanoid=yield this._import(t)})}_import(t){return T(this,null,function*(){let e=yield this._v1Import(t);if(e)return e;let n=yield this._v0Import(t);return n||null})}_v1Import(t){return T(this,null,function*(){var e,n;let i=this.parser.json;if(!(((e=i.extensionsUsed)==null?void 0:e.indexOf("VRMC_vrm"))!==-1))return null;let o=(n=i.extensions)==null?void 0:n.VRMC_vrm;if(!o)return null;let a=o.specVersion;if(!gr.has(a))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;let l=o.humanoid;if(!l)return null;let s=l.humanBones.leftThumbIntermediate!=null||l.humanBones.rightThumbIntermediate!=null,u={};l.humanBones!=null&&(yield Promise.all(Object.entries(l.humanBones).map(h=>T(this,[h],function*([p,m]){let c=p,f=m.node;if(s){let M=gn[c];M!=null&&(c=M)}let g=yield this.parser.getDependency("node",f);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${c} (index = ${f}) does not exist`);return}u[c]={node:g}}))));let d=new _n(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(d.normalizedHumanBonesRoot),this.helperRoot){let h=new mn(d);this.helperRoot.add(h),h.renderOrder=this.helperRoot.renderOrder}return d})}_v0Import(t){return T(this,null,function*(){var e;let i=(e=this.parser.json.extensions)==null?void 0:e.VRM;if(!i)return null;let r=i.humanoid;if(!r)return null;let o={};r.humanBones!=null&&(yield Promise.all(r.humanBones.map(l=>T(this,null,function*(){let s=l.bone,u=l.node;if(s==null||u==null)return;let d=yield this.parser.getDependency("node",u);if(d==null){console.warn(`A glTF node bound to the humanoid bone ${s} (index = ${u}) does not exist`);return}let h=gn[s],p=h!=null?h:s;if(o[p]!=null){console.warn(`Multiple bone entries for ${p} detected (index = ${u}), ignoring duplicated entries.`);return}o[p]={node:d}}))));let a=new _n(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){let l=new mn(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(t){let e=Object.values(_r).filter(n=>t[n]==null);if(e.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${e.join(", ")}`);return t}},vn=class extends Se.BufferGeometry{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new Se.BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Se.BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,t=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let t=0;t<64;t++){let e=t/63*this._currentTheta;this._attrPos.setXYZ(t+1,this._currentRadius*Math.sin(e),0,this._currentRadius*Math.cos(e))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<63;t++)this._attrIndex.setXYZ(t*3,0,t+1,t+2);this._attrIndex.needsUpdate=!0}},vr=class extends ee.BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new ee.Vector3,this._currentTail=new ee.Vector3,this._attrPos=new ee.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new ee.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},Oe=new H.Quaternion,En=new H.Quaternion,we=new H.Vector3,Mn=new H.Vector3,Rn=Math.sqrt(2)/2,Er=new H.Quaternion(0,0,-Rn,Rn),Mr=new H.Vector3(0,1,0),Rr=class extends H.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=t;{let e=new vn;e.radius=.5;let n=new H.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:H.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new H.Mesh(e,n),this.add(this._meshPitch)}{let e=new vn;e.radius=.5;let n=new H.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:H.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new H.Mesh(e,n),this.add(this._meshYaw)}{let e=new vr;e.radius=.1;let n=new H.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new H.LineSegments(e,n),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(t){let e=H.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=e,this._meshYaw.geometry.update();let n=H.MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(we),this.vrmLookAt.getLookAtWorldQuaternion(Oe),Oe.multiply(this.vrmLookAt.getFaceFrontQuaternion(En)),this._meshYaw.position.copy(we),this._meshYaw.quaternion.copy(Oe),this._meshPitch.position.copy(we),this._meshPitch.quaternion.copy(Oe),this._meshPitch.quaternion.multiply(En.setFromAxisAngle(Mr,e)),this._meshPitch.quaternion.multiply(Er);let{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(Mn).sub(we),this._lineTarget.geometry.tail.copy(Mn),this._lineTarget.geometry.update(),this._lineTarget.position.copy(we)),super.updateMatrixWorld(t)}},Tr=new ut.Vector3,xr=new ut.Vector3;function tt(t,e){return t.matrixWorld.decompose(Tr,e,xr),e}function Be(t){return[Math.atan2(-t.z,t.x),Math.atan2(t.y,Math.sqrt(t.x*t.x+t.z*t.z))]}function Tn(t){let e=Math.round(t/2/Math.PI);return t-2*Math.PI*e}var xn=new I.Vector3(0,0,1),yr=new I.Vector3,wr=new I.Vector3,Sr=new I.Vector3,Pr=new I.Quaternion,$e=new I.Quaternion,yn=new I.Quaternion,Ar=new I.Quaternion,Je=new I.Euler,Fn=class kn{constructor(e,n){this.offsetFromHeadBone=new I.Vector3,this.autoUpdate=!0,this.faceFront=new I.Vector3(0,0,1),this.humanoid=e,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new I.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new I.Euler)}getEuler(e){return e.set(I.MathUtils.DEG2RAD*this._pitch,I.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new kn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let n=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(e){let n=this.humanoid.getRawBoneNode("head");return tt(n,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(xn)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[n,i]=Be(this.faceFront);return Je.set(0,.5*Math.PI+n,i,"YZX"),e.setFromEuler(Je).premultiply(Ar.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion($e),this.getFaceFrontQuaternion(yn),e.copy(xn).applyQuaternion($e).applyQuaternion(yn).applyEuler(this.getEuler(Je))}lookAt(e){let n=Pr.copy(this._restHeadWorldQuaternion).multiply(Nn(this.getLookAtWorldQuaternion($e))),i=this.getLookAtWorldPosition(wr),r=Sr.copy(e).sub(i).applyQuaternion(n).normalize(),[o,a]=Be(this.faceFront),[l,s]=Be(r),u=Tn(l-o),d=Tn(a-s);this._yaw=I.MathUtils.RAD2DEG*u,this._pitch=I.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(yr)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Fn.EULER_ORDER="YXZ";var Lr=Fn,Hr=new V.Vector3(0,0,1),G=new V.Quaternion,me=new V.Quaternion,N=new V.Euler(0,0,0,"YXZ"),De=class{constructor(t,e,n,i,r){this.humanoid=t,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r,this.faceFront=new V.Vector3(0,0,1),this._restQuatLeftEye=new V.Quaternion,this._restQuatRightEye=new V.Quaternion,this._restLeftEyeParentWorldQuat=new V.Quaternion,this._restRightEyeParentWorldQuat=new V.Quaternion;let o=this.humanoid.getRawBoneNode("leftEye"),a=this.humanoid.getRawBoneNode("rightEye");o&&(this._restQuatLeftEye.copy(o.quaternion),tt(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),tt(a.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(t,e){let n=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),o=this.humanoid.getNormalizedBoneNode("rightEye");n&&(e<0?N.x=-V.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):N.x=V.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?N.y=-V.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-t):N.y=V.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(t),G.setFromEuler(N),this._getWorldFaceFrontQuat(me),r.quaternion.copy(me).multiply(G).multiply(me.invert()),G.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(G).premultiply(G.invert()).multiply(this._restQuatLeftEye)),i&&(e<0?N.x=-V.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):N.x=V.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?N.y=-V.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-t):N.y=V.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(t),G.setFromEuler(N),this._getWorldFaceFrontQuat(me),o.quaternion.copy(me).multiply(G).multiply(me.invert()),G.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(G).premultiply(G.invert()).multiply(this._restQuatRightEye))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=V.MathUtils.RAD2DEG*t.y,n=V.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}_getWorldFaceFrontQuat(t){if(this.faceFront.distanceToSquared(Hr)<.01)return t.identity();let[e,n]=Be(this.faceFront);return N.set(0,.5*Math.PI+e,n,"YZX"),t.setFromEuler(N)}};De.type="bone";var it=class{constructor(t,e,n,i,r){this.expressions=t,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r}applyYawPitch(t,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),t<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-t))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(t)))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=nt.MathUtils.RAD2DEG*t.y,n=nt.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}};it.type="expression";var wn=class{constructor(t,e){this.inputMaxValue=t,this.outputScale=e}map(t){return this.outputScale*An(t/this.inputMaxValue)}},br=new Set(["1.0","1.0-beta"]),Ne=.01,dt=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot}afterRoot(t){return T(this,null,function*(){let e=t.userData.vrmHumanoid;if(e===null)return;if(e===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");let n=t.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");t.userData.vrmLookAt=yield this._import(t,e,n)}})}_import(t,e,n){return T(this,null,function*(){if(e==null||n==null)return null;let i=yield this._v1Import(t,e,n);if(i)return i;let r=yield this._v0Import(t,e,n);return r||null})}_v1Import(t,e,n){return T(this,null,function*(){var i,r,o;let a=this.parser.json;if(!(((i=a.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;let s=(r=a.extensions)==null?void 0:r.VRMC_vrm;if(!s)return null;let u=s.specVersion;if(!br.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;let d=s.lookAt;if(!d)return null;let h=d.type==="expression"?1:10,p=this._v1ImportRangeMap(d.rangeMapHorizontalInner,h),m=this._v1ImportRangeMap(d.rangeMapHorizontalOuter,h),c=this._v1ImportRangeMap(d.rangeMapVerticalDown,h),f=this._v1ImportRangeMap(d.rangeMapVerticalUp,h),g;d.type==="expression"?g=new it(n,p,m,c,f):g=new De(e,p,m,c,f);let M=this._importLookAt(e,g);return M.offsetFromHeadBone.fromArray((o=d.offsetFromHeadBone)!=null?o:[0,.06,0]),M})}_v1ImportRangeMap(t,e){var n,i;let r=(n=t==null?void 0:t.inputMaxValue)!=null?n:90,o=(i=t==null?void 0:t.outputScale)!=null?i:e;return r(console.error(a),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},ct=class{constructor(t){this.scene=t.scene,this.meta=t.meta,this.humanoid=t.humanoid,this.expressionManager=t.expressionManager,this.firstPerson=t.firstPerson,this.lookAt=t.lookAt}update(t){this.humanoid.update(),this.lookAt&&this.lookAt.update(t),this.expressionManager&&this.expressionManager.update()}},Xo=class{get name(){return"VRMC_vrm"}constructor(t,e){var n,i,r,o,a;this.parser=t;let l=e==null?void 0:e.helperRoot,s=e==null?void 0:e.autoUpdateHumanBones;this.expressionPlugin=(n=e==null?void 0:e.expressionPlugin)!=null?n:new ot(t),this.firstPersonPlugin=(i=e==null?void 0:e.firstPersonPlugin)!=null?i:new at(t),this.humanoidPlugin=(r=e==null?void 0:e.humanoidPlugin)!=null?r:new lt(t,{helperRoot:l,autoUpdateHumanBones:s}),this.lookAtPlugin=(o=e==null?void 0:e.lookAtPlugin)!=null?o:new dt(t,{helperRoot:l}),this.metaPlugin=(a=e==null?void 0:e.metaPlugin)!=null?a:new ht(t)}afterRoot(t){return T(this,null,function*(){yield this.metaPlugin.afterRoot(t),yield this.humanoidPlugin.afterRoot(t),yield this.expressionPlugin.afterRoot(t),yield this.lookAtPlugin.afterRoot(t),yield this.firstPersonPlugin.afterRoot(t);let e=t.userData.vrmMeta,n=t.userData.vrmHumanoid;if(e&&n){let i=new ct({scene:t.scene,expressionManager:t.userData.vrmExpressionManager,firstPerson:t.userData.vrmFirstPerson,humanoid:n,lookAt:t.userData.vrmLookAt,meta:e});t.userData.vrmCore=i}})}};var Pe=class extends ct{constructor(e){super(e),this.materials=e.materials,this.springBoneManager=e.springBoneManager,this.nodeConstraintManager=e.nodeConstraintManager}update(e){super.update(e),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(e),this.materials&&this.materials.forEach(n=>{n.update&&n.update(e)})}};import*as We from"three";import*as Xn from"three";import*as Yn from"three";import*as y from"three";import*as qn from"three";var Cr=Object.defineProperty,zn=Object.getOwnPropertySymbols,Ur=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,Gn=(t,e,n)=>e in t?Cr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,jn=(t,e)=>{for(var n in e||(e={}))Ur.call(e,n)&&Gn(t,n,e[n]);if(zn)for(var n of zn(e))Or.call(e,n)&&Gn(t,n,e[n]);return t},le=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),Nr={"":3e3,srgb:3001};function Br(t,e){parseInt(Yn.REVISION,10)>=152?t.colorSpace=e:t.encoding=Nr[e]}var Dr=class{get pending(){return Promise.all(this._pendings)}constructor(t,e){this._parser=t,this._materialParams=e,this._pendings=[]}assignPrimitive(t,e){e!=null&&(this._materialParams[t]=e)}assignColor(t,e,n){e!=null&&(this._materialParams[t]=new Xn.Color().fromArray(e),n&&this._materialParams[t].convertSRGBToLinear())}assignTexture(t,e,n){return le(this,null,function*(){let i=le(this,null,function*(){e!=null&&(yield this._parser.assignTexture(this._materialParams,t,e),n&&Br(this._materialParams[t],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(t,e,n){return le(this,null,function*(){return this.assignTexture(t,e!=null?{index:e}:void 0,n)})}},Fr=`// #define PHONG +var Re=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())});import*as Ln from"three";import*as J from"three";import*as ot from"three";import*as Un from"three";import*as D from"three";import*as Y from"three";import*as Fe from"three";import*as F from"three";import*as H from"three";import*as we from"three";import*as K from"three";import*as I from"three";import*as dt from"three";import*as V from"three";import*as it from"three";import*as jn from"three";var T=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),an=class extends Ln.Object3D{constructor(t){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${t}`,this.expressionName=t,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(t){this._binds.push(t)}deleteBind(t){let e=this._binds.indexOf(t);e>=0&&this._binds.splice(e,1)}applyWeight(t){var e;let n=this.outputWeight;n*=(e=t==null?void 0:t.multiplier)!=null?e:1,this.isBinary&&n<1&&(n=0),this._binds.forEach(i=>i.applyWeight(n))}clearAppliedWeight(){this._binds.forEach(t=>t.clearAppliedWeight())}};function Hn(t,e,n){var i,r;let o=t.parser.json,a=(i=o.nodes)==null?void 0:i[e];if(a==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${e}] of glTF but the node doesn't exist`),null;let l=a.mesh;if(l==null)return null;let s=(r=o.meshes)==null?void 0:r[l];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${l}] of glTF but the mesh doesn't exist`),null;let u=s.primitives.length,d=[];return n.traverse(h=>{d.length{let o=Hn(t,r,i);o!=null&&n.set(r,o)}),n})}var et={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function bn(t){return Math.max(Math.min(t,1),0)}var dn=class Vn{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},n=new Set(Object.values(et));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)&&(e[i]=r)}),e}get customExpressionMap(){let e={},n=new Set(Object.values(et));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)||(e[i]=r)}),e}copy(e){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),e._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new Vn().copy(this)}getExpression(e){var n;return(n=this._expressionMap[e])!=null?n:null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let n=this._expressions.indexOf(e);n===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(n,1),delete this._expressionMap[e.expressionName]}getValue(e){var n;let i=this.getExpression(e);return(n=i==null?void 0:i.weight)!=null?n:null}setValue(e,n){let i=this.getExpression(e);i&&(i.weight=bn(n))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let n=this.getExpression(e);return n?`${n.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(n=>{n.clearAppliedWeight()}),this._expressions.forEach(n=>{let i=1,r=n.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(i*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(i*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(i*=e.mouth),n.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let e=1,n=1,i=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,n-=r.overrideLookAtAmount,i-=r.overrideMouthAmount}),e=Math.max(0,e),n=Math.max(0,n),i=Math.max(0,i),{blink:e,lookAt:n,mouth:i}}},Te={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},lr={_Color:Te.Color,_EmissionColor:Te.EmissionColor,_ShadeColor:Te.ShadeColor,_RimColor:Te.RimColor,_OutlineColor:Te.OutlineColor},ur=new ot.Color,In=class Cn{constructor({material:e,type:n,targetValue:i,targetAlpha:r}){this.material=e,this.type=n,this.targetValue=i,this.targetAlpha=r!=null?r:1;let o=this._initColorBindState(),a=this._initAlphaBindState();this._state={color:o,alpha:a}}applyWeight(e){let{color:n,alpha:i}=this._state;if(n!=null){let{propertyName:r,deltaValue:o}=n,a=this.material[r];a!=null&&a.add(ur.copy(o).multiplyScalar(e))}if(i!=null){let{propertyName:r,deltaValue:o}=i;this.material[r]!=null&&(this.material[r]+=o*e)}}clearAppliedWeight(){let{color:e,alpha:n}=this._state;if(e!=null){let{propertyName:i,initialValue:r}=e,o=this.material[i];o!=null&&o.copy(r)}if(n!=null){let{propertyName:i,initialValue:r}=n;this.material[i]!=null&&(this.material[i]=r)}}_initColorBindState(){var e,n,i;let{material:r,type:o,targetValue:a}=this,l=this._getPropertyNameMap(),s=(n=(e=l==null?void 0:l[o])==null?void 0:e[0])!=null?n:null;if(s==null)return console.warn(`Tried to add a material color bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type is not supported.`),null;let d=r[s].clone(),h=new ot.Color(a.r-d.r,a.g-d.g,a.b-d.b);return{propertyName:s,initialValue:d,deltaValue:h}}_initAlphaBindState(){var e,n,i;let{material:r,type:o,targetAlpha:a}=this,l=this._getPropertyNameMap(),s=(n=(e=l==null?void 0:l[o])==null?void 0:e[1])!=null?n:null;if(s==null&&a!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type does not support alpha.`),null;if(s==null)return null;let u=r[s],d=a-u;return{propertyName:s,initialValue:u,deltaValue:d}}_getPropertyNameMap(){var e,n;return(n=(e=Object.entries(Cn._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:e[1])!=null?n:null}};In._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var hn=In,ye=class{constructor({primitives:t,index:e,weight:n}){this.primitives=t,this.index=e,this.weight=n}applyWeight(t){this.primitives.forEach(e=>{var n;((n=e.morphTargetInfluences)==null?void 0:n[this.index])!=null&&(e.morphTargetInfluences[this.index]+=this.weight*t)})}clearAppliedWeight(){this.primitives.forEach(t=>{var e;((e=t.morphTargetInfluences)==null?void 0:e[this.index])!=null&&(t.morphTargetInfluences[this.index]=0)})}},cn=new Un.Vector2,On=class Nn{constructor({material:e,scale:n,offset:i}){var r,o;this.material=e,this.scale=n,this.offset=i;let a=(r=Object.entries(Nn._propertyNamesMap).find(([l])=>e[l]===!0))==null?void 0:r[1];a==null?(console.warn(`Tried to add a texture transform bind to the material ${(o=e.name)!=null?o:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],a.forEach(l=>{var s;let u=(s=e[l])==null?void 0:s.clone();if(!u)return null;e[l]=u;let d=u.offset.clone(),h=u.repeat.clone(),p=i.clone().sub(d),m=n.clone().sub(h);this._properties.push({name:l,initialOffset:d,deltaOffset:p,initialScale:h,deltaScale:m})}))}applyWeight(e){this._properties.forEach(n=>{let i=this.material[n.name];i!==void 0&&(i.offset.add(cn.copy(n.deltaOffset).multiplyScalar(e)),i.repeat.add(cn.copy(n.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let n=this.material[e.name];n!==void 0&&(n.offset.copy(e.initialOffset),n.repeat.copy(e.initialScale))})}};On._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var pn=On,dr=new Set(["1.0","1.0-beta"]),Bn=class Dn{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return T(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return T(this,null,function*(){let n=yield this._v1Import(e);if(n)return n;let i=yield this._v0Import(e);return i||null})}_v1Import(e){return T(this,null,function*(){var n,i;let r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;let a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;let l=a.specVersion;if(!dr.has(l))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.expressions;if(!s)return null;let u=new Set(Object.values(et)),d=new Map;s.preset!=null&&Object.entries(s.preset).forEach(([p,m])=>{if(m!=null){if(!u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${p}" detected. Ignoring the expression`);return}d.set(p,m)}}),s.custom!=null&&Object.entries(s.custom).forEach(([p,m])=>{if(u.has(p)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${p}". Ignoring the expression`);return}d.set(p,m)});let h=new dn;return yield Promise.all(Array.from(d.entries()).map(p=>T(this,[p],function*([m,c]){var f,g,M,b,x,_,v;let E=new an(m);if(e.scene.add(E),E.isBinary=(f=c.isBinary)!=null?f:!1,E.overrideBlink=(g=c.overrideBlink)!=null?g:"none",E.overrideLookAt=(M=c.overrideLookAt)!=null?M:"none",E.overrideMouth=(b=c.overrideMouth)!=null?b:"none",(x=c.morphTargetBinds)==null||x.forEach(R=>T(this,null,function*(){var S;if(R.node===void 0||R.index===void 0)return;let A=yield ln(e,R.node),P=R.index;if(!A.every(w=>Array.isArray(w.morphTargetInfluences)&&P{let A=S.material;A&&(Array.isArray(A)?R.push(...A):R.push(A))}),(_=c.materialColorBinds)==null||_.forEach(S=>T(this,null,function*(){R.filter(P=>{var w;let L=(w=this.parser.associations.get(P))==null?void 0:w.materials;return S.material===L}).forEach(P=>{E.addBind(new hn({material:P,type:S.type,targetValue:new J.Color().fromArray(S.targetValue),targetAlpha:S.targetValue[3]}))})})),(v=c.textureTransformBinds)==null||v.forEach(S=>T(this,null,function*(){R.filter(P=>{var w;let L=(w=this.parser.associations.get(P))==null?void 0:w.materials;return S.material===L}).forEach(P=>{var w,L;E.addBind(new pn({material:P,offset:new J.Vector2().fromArray((w=S.offset)!=null?w:[0,0]),scale:new J.Vector2().fromArray((L=S.scale)!=null?L:[1,1])}))})}))}h.registerExpression(E)}))),h})}_v0Import(e){return T(this,null,function*(){var n;let i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.blendShapeMaster;if(!o)return null;let a=new dn,l=o.blendShapeGroups;if(!l)return a;let s=new Set;return yield Promise.all(l.map(u=>T(this,null,function*(){var d;let h=u.presetName,p=h!=null&&Dn.v0v1PresetNameMap[h]||null,m=p!=null?p:u.name;if(m==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(m)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${h} has duplicated entries. Ignoring the expression`);return}s.add(m);let c=new an(m);e.scene.add(c),c.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(g=>T(this,null,function*(){var M;if(g.mesh===void 0||g.index===void 0)return;let b=[];(M=i.nodes)==null||M.forEach((_,v)=>{_.mesh===g.mesh&&b.push(v)});let x=g.index;yield Promise.all(b.map(_=>T(this,null,function*(){var v;let E=yield ln(e,_);if(!E.every(R=>Array.isArray(R.morphTargetInfluences)&&x{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;let M=[];e.scene.traverse(x=>{if(x.material){let _=x.material;Array.isArray(_)?M.push(..._.filter(v=>(v.name===g.materialName||v.name===g.materialName+" (Outline)")&&M.indexOf(v)===-1)):_.name===g.materialName&&M.indexOf(_)===-1&&M.push(_)}});let b=g.propertyName;M.forEach(x=>{if(b==="_MainTex_ST"){let v=new J.Vector2(g.targetValue[0],g.targetValue[1]),E=new J.Vector2(g.targetValue[2],g.targetValue[3]);E.y=1-E.y-v.y,c.addBind(new pn({material:x,scale:v,offset:E}));return}let _=lr[b];if(_){c.addBind(new hn({material:x,type:_,targetValue:new J.Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(b+" is not supported")})}),a.registerExpression(c)}))),a})}};Bn.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var st=Bn,Xo={None:"none",Block:"block",Blend:"blend"},at=class me{constructor(e,n){this._firstPersonOnlyLayer=me.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=me.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=e,this.meshAnnotations=n}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=e.meshAnnotations.map(n=>({meshes:n.meshes.concat(),type:n.type})),this}clone(){return new me(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=me.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=me.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=e,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(i=>{i.meshes.forEach(r=>{i.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(o=>o.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(o=>o.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(e,n,i,r){let o=0;if(n!=null&&n.length>0)for(let a=0;a0&&r.includes(h[0])||d[1]>0&&r.includes(h[1])||d[2]>0&&r.includes(h[2])||d[3]>0&&r.includes(h[3]))continue;let p=n[s],m=i[s];if(p[0]>0&&r.includes(m[0])||p[1]>0&&r.includes(m[1])||p[2]>0&&r.includes(m[2])||p[3]>0&&r.includes(m[3]))continue;let c=n[u],f=i[u];c[0]>0&&r.includes(f[0])||c[1]>0&&r.includes(f[1])||c[2]>0&&r.includes(f[2])||c[3]>0&&r.includes(f[3])||(e[o++]=l,e[o++]=s,e[o++]=u)}return o}_createErasedMesh(e,n){let i=new D.SkinnedMesh(e.geometry.clone(),e.material);i.name=`${e.name}(erase)`,i.frustumCulled=e.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);let r=i.geometry,o=r.getAttribute("skinIndex"),a=o instanceof D.GLBufferAttribute?[]:o.array,l=[];for(let f=0;f{this._isEraseTarget(o)&&i.push(a)}),!i.length){n.layers.enable(this._thirdPersonOnlyLayer),n.layers.enable(this._firstPersonOnlyLayer);return}n.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(n,i);e.add(r)}_createHeadlessModel(e){if(e.type==="Group")if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer));else{let n=new D.Group;n.name=`_headless_${e.name}`,n.layers.set(this._firstPersonOnlyLayer),e.parent.add(n),e.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{let r=i;this._createHeadlessModelForSkinnedMesh(n,r)})}else if(e.type==="SkinnedMesh"){let n=e;this._createHeadlessModelForSkinnedMesh(e.parent,n)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode("head")?!0:e.parent?this._isEraseTarget(e.parent):!1}};at.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;at.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var mn=at,hr=new Set(["1.0","1.0-beta"]),lt=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return T(this,null,function*(){let e=t.userData.vrmHumanoid;if(e!==null){if(e===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");t.userData.vrmFirstPerson=yield this._import(t,e)}})}_import(t,e){return T(this,null,function*(){if(e==null)return null;let n=yield this._v1Import(t,e);if(n)return n;let i=yield this._v0Import(t,e);return i||null})}_v1Import(t,e){return T(this,null,function*(){var n,i;let r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;let a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;let l=a.specVersion;if(!hr.has(l))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.firstPerson,u=[],d=yield un(t);return Array.from(d.entries()).forEach(([h,p])=>{var m,c;let f=(m=s==null?void 0:s.meshAnnotations)==null?void 0:m.find(g=>g.node===h);u.push({meshes:p,type:(c=f==null?void 0:f.type)!=null?c:"auto"})}),new mn(e,u)})}_v0Import(t,e){return T(this,null,function*(){var n;let i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;let o=r.firstPerson;if(!o)return null;let a=[],l=yield un(t);return Array.from(l.entries()).forEach(([s,u])=>{let d=i.nodes[s],h=o.meshAnnotations?o.meshAnnotations.find(p=>p.mesh===d.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(h==null?void 0:h.firstPersonFlag)})}),new mn(e,a)})}_convertV0FlagToV1Type(t){return t==="FirstPersonOnly"?"firstPersonOnly":t==="ThirdPersonOnly"?"thirdPersonOnly":t==="Both"?"both":"auto"}},Qo={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"},fn=new Y.Vector3,_n=new Y.Vector3,cr=new Y.Quaternion,gn=class extends Y.Group{constructor(t){super(),this.vrmHumanoid=t,this._boneAxesMap=new Map,Object.values(t.humanBones).forEach(e=>{let n=new Y.AxesHelper(1);n.matrixAutoUpdate=!1,n.material.depthTest=!1,n.material.depthWrite=!1,this.add(n),this._boneAxesMap.set(e,n)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(t=>{t.geometry.dispose(),t.material.dispose()})}updateMatrixWorld(t){Array.from(this._boneAxesMap.entries()).forEach(([e,n])=>{e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(fn,cr,_n);let i=fn.set(.1,.1,.1).divide(_n);n.matrix.copy(e.node.matrixWorld).scale(i)}),super.updateMatrixWorld(t)}},Ze=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],Yo={Hips:"hips",Spine:"spine",Chest:"chest",UpperChest:"upperChest",Neck:"neck",Head:"head",LeftEye:"leftEye",RightEye:"rightEye",Jaw:"jaw",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",LeftToes:"leftToes",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",RightToes:"rightToes",LeftShoulder:"leftShoulder",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightShoulder:"rightShoulder",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand",LeftThumbMetacarpal:"leftThumbMetacarpal",LeftThumbProximal:"leftThumbProximal",LeftThumbDistal:"leftThumbDistal",LeftIndexProximal:"leftIndexProximal",LeftIndexIntermediate:"leftIndexIntermediate",LeftIndexDistal:"leftIndexDistal",LeftMiddleProximal:"leftMiddleProximal",LeftMiddleIntermediate:"leftMiddleIntermediate",LeftMiddleDistal:"leftMiddleDistal",LeftRingProximal:"leftRingProximal",LeftRingIntermediate:"leftRingIntermediate",LeftRingDistal:"leftRingDistal",LeftLittleProximal:"leftLittleProximal",LeftLittleIntermediate:"leftLittleIntermediate",LeftLittleDistal:"leftLittleDistal",RightThumbMetacarpal:"rightThumbMetacarpal",RightThumbProximal:"rightThumbProximal",RightThumbDistal:"rightThumbDistal",RightIndexProximal:"rightIndexProximal",RightIndexIntermediate:"rightIndexIntermediate",RightIndexDistal:"rightIndexDistal",RightMiddleProximal:"rightMiddleProximal",RightMiddleIntermediate:"rightMiddleIntermediate",RightMiddleDistal:"rightMiddleDistal",RightRingProximal:"rightRingProximal",RightRingIntermediate:"rightRingIntermediate",RightRingDistal:"rightRingDistal",RightLittleProximal:"rightLittleProximal",RightLittleIntermediate:"rightLittleIntermediate",RightLittleDistal:"rightLittleDistal"},pr={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function Fn(t){return t.invert?t.invert():t.inverse(),t}var se=new Fe.Vector3,ae=new Fe.Quaternion,tt=class{constructor(t){this.humanBones=t,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);i&&(se.copy(i.position),ae.copy(i.quaternion),t[n]={position:se.toArray(),rotation:ae.toArray()})}),t}getPose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);if(!i)return;se.set(0,0,0),ae.identity();let r=this.restPose[n];r!=null&&r.position&&se.fromArray(r.position).negate(),r!=null&&r.rotation&&Fn(ae.fromArray(r.rotation)),se.add(i.position),ae.premultiply(i.quaternion),t[n]={position:se.toArray(),rotation:ae.toArray()}}),t}setPose(t){Object.entries(t).forEach(([e,n])=>{let i=e,r=this.getBoneNode(i);if(!r)return;let o=this.restPose[i];o&&(n!=null&&n.position&&(r.position.fromArray(n.position),o.position&&r.position.add(se.fromArray(o.position))),n!=null&&n.rotation&&(r.quaternion.fromArray(n.rotation),o.rotation&&r.quaternion.multiply(ae.fromArray(o.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([t,e])=>{let n=this.getBoneNode(t);n&&(e!=null&&e.position&&n.position.fromArray(e.position),e!=null&&e.rotation&&n.quaternion.fromArray(e.rotation))})}getBone(t){var e;return(e=this.humanBones[t])!=null?e:void 0}getBoneNode(t){var e,n;return(n=(e=this.humanBones[t])==null?void 0:e.node)!=null?n:null}},$e=new F.Vector3,mr=new F.Quaternion,fr=new F.Vector3,vn=class kn extends tt{static _setupTransforms(e){let n=new F.Object3D;n.name="VRMHumanoidRig";let i={},r={},o={},a={};Ze.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let h=new F.Vector3,p=new F.Quaternion;d.updateWorldMatrix(!0,!1),d.matrixWorld.decompose(h,p,$e),i[s]=h,r[s]=p,o[s]=d.quaternion.clone();let m=new F.Quaternion;(u=d.parent)==null||u.matrixWorld.decompose($e,m,$e),a[s]=m}});let l={};return Ze.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let h=i[s],p=s,m;for(;m==null&&(p=pr[p],p!=null);)m=i[p];let c=new F.Object3D;c.name="Normalized_"+d.name,(p?(u=l[p])==null?void 0:u.node:n).add(c),c.position.copy(h),m&&c.position.sub(m),l[s]={node:c}}}),{rigBones:l,root:n,parentWorldRotations:a,boneRotations:o}}constructor(e){let{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=kn._setupTransforms(e);super(n),this.original=e,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){Ze.forEach(e=>{let n=this.original.getBoneNode(e);if(n!=null){let i=this.getBoneNode(e),r=this._parentWorldRotations[e],o=mr.copy(r).invert(),a=this._boneRotations[e];if(n.quaternion.copy(i.quaternion).multiply(r).premultiply(o).multiply(a),e==="hips"){let l=i.getWorldPosition(fr);n.parent.updateWorldMatrix(!0,!1);let s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},En=class Wn{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,n){var i;this.autoUpdateHumanBones=(i=n==null?void 0:n.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new tt(e),this._normalizedHumanBones=new vn(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new tt(e.humanBones),this._normalizedHumanBones=new vn(this._rawHumanBones),this}clone(){return new Wn(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},_r={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},gr=new Set(["1.0","1.0-beta"]),Mn={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},ut=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot,this.autoUpdateHumanBones=e==null?void 0:e.autoUpdateHumanBones}afterRoot(t){return T(this,null,function*(){t.userData.vrmHumanoid=yield this._import(t)})}_import(t){return T(this,null,function*(){let e=yield this._v1Import(t);if(e)return e;let n=yield this._v0Import(t);return n||null})}_v1Import(t){return T(this,null,function*(){var e,n;let i=this.parser.json;if(!(((e=i.extensionsUsed)==null?void 0:e.indexOf("VRMC_vrm"))!==-1))return null;let o=(n=i.extensions)==null?void 0:n.VRMC_vrm;if(!o)return null;let a=o.specVersion;if(!gr.has(a))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;let l=o.humanoid;if(!l)return null;let s=l.humanBones.leftThumbIntermediate!=null||l.humanBones.rightThumbIntermediate!=null,u={};l.humanBones!=null&&(yield Promise.all(Object.entries(l.humanBones).map(h=>T(this,[h],function*([p,m]){let c=p,f=m.node;if(s){let M=Mn[c];M!=null&&(c=M)}let g=yield this.parser.getDependency("node",f);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${c} (index = ${f}) does not exist`);return}u[c]={node:g}}))));let d=new En(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(d.normalizedHumanBonesRoot),this.helperRoot){let h=new gn(d);this.helperRoot.add(h),h.renderOrder=this.helperRoot.renderOrder}return d})}_v0Import(t){return T(this,null,function*(){var e;let i=(e=this.parser.json.extensions)==null?void 0:e.VRM;if(!i)return null;let r=i.humanoid;if(!r)return null;let o={};r.humanBones!=null&&(yield Promise.all(r.humanBones.map(l=>T(this,null,function*(){let s=l.bone,u=l.node;if(s==null||u==null)return;let d=yield this.parser.getDependency("node",u);if(d==null){console.warn(`A glTF node bound to the humanoid bone ${s} (index = ${u}) does not exist`);return}let h=Mn[s],p=h!=null?h:s;if(o[p]!=null){console.warn(`Multiple bone entries for ${p} detected (index = ${u}), ignoring duplicated entries.`);return}o[p]={node:d}}))));let a=new En(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){let l=new gn(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(t){let e=Object.values(_r).filter(n=>t[n]==null);if(e.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${e.join(", ")}`);return t}},Rn=class extends we.BufferGeometry{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new we.BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new we.BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,t=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let t=0;t<64;t++){let e=t/63*this._currentTheta;this._attrPos.setXYZ(t+1,this._currentRadius*Math.sin(e),0,this._currentRadius*Math.cos(e))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<63;t++)this._attrIndex.setXYZ(t*3,0,t+1,t+2);this._attrIndex.needsUpdate=!0}},vr=class extends K.BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new K.Vector3,this._currentTail=new K.Vector3,this._attrPos=new K.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new K.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,t=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},Oe=new H.Quaternion,Tn=new H.Quaternion,xe=new H.Vector3,xn=new H.Vector3,yn=Math.sqrt(2)/2,Er=new H.Quaternion(0,0,-yn,yn),Mr=new H.Vector3(0,1,0),Rr=class extends H.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=t;{let e=new Rn;e.radius=.5;let n=new H.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:H.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new H.Mesh(e,n),this.add(this._meshPitch)}{let e=new Rn;e.radius=.5;let n=new H.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:H.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new H.Mesh(e,n),this.add(this._meshYaw)}{let e=new vr;e.radius=.1;let n=new H.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new H.LineSegments(e,n),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(t){let e=H.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=e,this._meshYaw.geometry.update();let n=H.MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(xe),this.vrmLookAt.getLookAtWorldQuaternion(Oe),Oe.multiply(this.vrmLookAt.getFaceFrontQuaternion(Tn)),this._meshYaw.position.copy(xe),this._meshYaw.quaternion.copy(Oe),this._meshPitch.position.copy(xe),this._meshPitch.quaternion.copy(Oe),this._meshPitch.quaternion.multiply(Tn.setFromAxisAngle(Mr,e)),this._meshPitch.quaternion.multiply(Er);let{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(xn).sub(xe),this._lineTarget.geometry.tail.copy(xn),this._lineTarget.geometry.update(),this._lineTarget.position.copy(xe)),super.updateMatrixWorld(t)}},Tr=new dt.Vector3,xr=new dt.Vector3;function nt(t,e){return t.matrixWorld.decompose(Tr,e,xr),e}function Be(t){return[Math.atan2(-t.z,t.x),Math.atan2(t.y,Math.sqrt(t.x*t.x+t.z*t.z))]}function wn(t){let e=Math.round(t/2/Math.PI);return t-2*Math.PI*e}var Sn=new I.Vector3(0,0,1),yr=new I.Vector3,wr=new I.Vector3,Sr=new I.Vector3,Pr=new I.Quaternion,Je=new I.Quaternion,Pn=new I.Quaternion,Ar=new I.Quaternion,Ke=new I.Euler,zn=class Gn{constructor(e,n){this.offsetFromHeadBone=new I.Vector3,this.autoUpdate=!0,this.faceFront=new I.Vector3(0,0,1),this.humanoid=e,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new I.Quaternion)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new I.Euler)}getEuler(e){return e.set(I.MathUtils.DEG2RAD*this._pitch,I.MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(e){if(this.humanoid!==e.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new Gn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let n=this.humanoid.getRawBoneNode("head");return e.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(e){let n=this.humanoid.getRawBoneNode("head");return nt(n,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Sn)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[n,i]=Be(this.faceFront);return Ke.set(0,.5*Math.PI+n,i,"YZX"),e.setFromEuler(Ke).premultiply(Ar.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(Je),this.getFaceFrontQuaternion(Pn),e.copy(Sn).applyQuaternion(Je).applyQuaternion(Pn).applyEuler(this.getEuler(Ke))}lookAt(e){let n=Pr.copy(this._restHeadWorldQuaternion).multiply(Fn(this.getLookAtWorldQuaternion(Je))),i=this.getLookAtWorldPosition(wr),r=Sr.copy(e).sub(i).applyQuaternion(n).normalize(),[o,a]=Be(this.faceFront),[l,s]=Be(r),u=wn(l-o),d=wn(a-s);this._yaw=I.MathUtils.RAD2DEG*u,this._pitch=I.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(yr)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};zn.EULER_ORDER="YXZ";var Lr=zn,Hr=new V.Vector3(0,0,1),G=new V.Quaternion,pe=new V.Quaternion,N=new V.Euler(0,0,0,"YXZ"),De=class{constructor(t,e,n,i,r){this.humanoid=t,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r,this.faceFront=new V.Vector3(0,0,1),this._restQuatLeftEye=new V.Quaternion,this._restQuatRightEye=new V.Quaternion,this._restLeftEyeParentWorldQuat=new V.Quaternion,this._restRightEyeParentWorldQuat=new V.Quaternion;let o=this.humanoid.getRawBoneNode("leftEye"),a=this.humanoid.getRawBoneNode("rightEye");o&&(this._restQuatLeftEye.copy(o.quaternion),nt(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),nt(a.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(t,e){let n=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),o=this.humanoid.getNormalizedBoneNode("rightEye");n&&(e<0?N.x=-V.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):N.x=V.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?N.y=-V.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-t):N.y=V.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(t),G.setFromEuler(N),this._getWorldFaceFrontQuat(pe),r.quaternion.copy(pe).multiply(G).multiply(pe.invert()),G.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(G).premultiply(G.invert()).multiply(this._restQuatLeftEye)),i&&(e<0?N.x=-V.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):N.x=V.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?N.y=-V.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-t):N.y=V.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(t),G.setFromEuler(N),this._getWorldFaceFrontQuat(pe),o.quaternion.copy(pe).multiply(G).multiply(pe.invert()),G.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(G).premultiply(G.invert()).multiply(this._restQuatRightEye))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=V.MathUtils.RAD2DEG*t.y,n=V.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}_getWorldFaceFrontQuat(t){if(this.faceFront.distanceToSquared(Hr)<.01)return t.identity();let[e,n]=Be(this.faceFront);return N.set(0,.5*Math.PI+e,n,"YZX"),t.setFromEuler(N)}};De.type="bone";var rt=class{constructor(t,e,n,i,r){this.expressions=t,this.rangeMapHorizontalInner=e,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r}applyYawPitch(t,e){e<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-e))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(e))),t<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-t))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(t)))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=it.MathUtils.RAD2DEG*t.y,n=it.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}};rt.type="expression";var An=class{constructor(t,e){this.inputMaxValue=t,this.outputScale=e}map(t){return this.outputScale*bn(t/this.inputMaxValue)}},br=new Set(["1.0","1.0-beta"]),Ne=.01,ht=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot}afterRoot(t){return T(this,null,function*(){let e=t.userData.vrmHumanoid;if(e===null)return;if(e===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");let n=t.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");t.userData.vrmLookAt=yield this._import(t,e,n)}})}_import(t,e,n){return T(this,null,function*(){if(e==null||n==null)return null;let i=yield this._v1Import(t,e,n);if(i)return i;let r=yield this._v0Import(t,e,n);return r||null})}_v1Import(t,e,n){return T(this,null,function*(){var i,r,o;let a=this.parser.json;if(!(((i=a.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;let s=(r=a.extensions)==null?void 0:r.VRMC_vrm;if(!s)return null;let u=s.specVersion;if(!br.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;let d=s.lookAt;if(!d)return null;let h=d.type==="expression"?1:10,p=this._v1ImportRangeMap(d.rangeMapHorizontalInner,h),m=this._v1ImportRangeMap(d.rangeMapHorizontalOuter,h),c=this._v1ImportRangeMap(d.rangeMapVerticalDown,h),f=this._v1ImportRangeMap(d.rangeMapVerticalUp,h),g;d.type==="expression"?g=new rt(n,p,m,c,f):g=new De(e,p,m,c,f);let M=this._importLookAt(e,g);return M.offsetFromHeadBone.fromArray((o=d.offsetFromHeadBone)!=null?o:[0,.06,0]),M})}_v1ImportRangeMap(t,e){var n,i;let r=(n=t==null?void 0:t.inputMaxValue)!=null?n:90,o=(i=t==null?void 0:t.outputScale)!=null?i:e;return r(console.error(a),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},pt=class{constructor(t){this.scene=t.scene,this.meta=t.meta,this.humanoid=t.humanoid,this.expressionManager=t.expressionManager,this.firstPerson=t.firstPerson,this.lookAt=t.lookAt}update(t){this.humanoid.update(),this.lookAt&&this.lookAt.update(t),this.expressionManager&&this.expressionManager.update()}},Zo=class{get name(){return"VRMC_vrm"}constructor(t,e){var n,i,r,o,a;this.parser=t;let l=e==null?void 0:e.helperRoot,s=e==null?void 0:e.autoUpdateHumanBones;this.expressionPlugin=(n=e==null?void 0:e.expressionPlugin)!=null?n:new st(t),this.firstPersonPlugin=(i=e==null?void 0:e.firstPersonPlugin)!=null?i:new lt(t),this.humanoidPlugin=(r=e==null?void 0:e.humanoidPlugin)!=null?r:new ut(t,{helperRoot:l,autoUpdateHumanBones:s}),this.lookAtPlugin=(o=e==null?void 0:e.lookAtPlugin)!=null?o:new ht(t,{helperRoot:l}),this.metaPlugin=(a=e==null?void 0:e.metaPlugin)!=null?a:new ct(t)}afterRoot(t){return T(this,null,function*(){yield this.metaPlugin.afterRoot(t),yield this.humanoidPlugin.afterRoot(t),yield this.expressionPlugin.afterRoot(t),yield this.lookAtPlugin.afterRoot(t),yield this.firstPersonPlugin.afterRoot(t);let e=t.userData.vrmMeta,n=t.userData.vrmHumanoid;if(e&&n){let i=new pt({scene:t.scene,expressionManager:t.userData.vrmExpressionManager,firstPerson:t.userData.vrmFirstPerson,humanoid:n,lookAt:t.userData.vrmLookAt,meta:e});t.userData.vrmCore=i}})}};var Se=class extends pt{constructor(e){super(e),this.materials=e.materials,this.springBoneManager=e.springBoneManager,this.nodeConstraintManager=e.nodeConstraintManager}update(e){super.update(e),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(e),this.materials&&this.materials.forEach(n=>{n.update&&n.update(e)})}};import*as We from"three";import*as Zn from"three";import*as $n from"three";import*as y from"three";import*as Jn from"three";var Cr=Object.defineProperty,Xn=Object.getOwnPropertySymbols,Ur=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,Qn=(t,e,n)=>e in t?Cr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yn=(t,e)=>{for(var n in e||(e={}))Ur.call(e,n)&&Qn(t,n,e[n]);if(Xn)for(var n of Xn(e))Or.call(e,n)&&Qn(t,n,e[n]);return t},le=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),Nr={"":3e3,srgb:3001};function Br(t,e){parseInt($n.REVISION,10)>=152?t.colorSpace=e:t.encoding=Nr[e]}var Dr=class{get pending(){return Promise.all(this._pendings)}constructor(t,e){this._parser=t,this._materialParams=e,this._pendings=[]}assignPrimitive(t,e){e!=null&&(this._materialParams[t]=e)}assignColor(t,e,n){e!=null&&(this._materialParams[t]=new Zn.Color().fromArray(e),n&&this._materialParams[t].convertSRGBToLinear())}assignTexture(t,e,n){return le(this,null,function*(){let i=le(this,null,function*(){e!=null&&(yield this._parser.assignTexture(this._materialParams,t,e),n&&Br(this._materialParams[t],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(t,e,n){return le(this,null,function*(){return this.assignTexture(t,e!=null?{index:e}:void 0,n)})}},Fr=`// #define PHONG varying vec3 vViewPosition; @@ -919,11 +919,11 @@ void main() { gl_FragColor = vec4( col, diffuseColor.a ); postCorrection(); } -`,Wr={None:"none",Normal:"normal",LitShadeRate:"litShadeRate",UV:"uv"},Qn={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},zr={3e3:"",3001:"srgb"};function pt(t){return parseInt(qn.REVISION,10)>=152?t.colorSpace:zr[t.encoding]}var Gr=class extends y.ShaderMaterial{constructor(t={}){var e;super({vertexShader:Fr,fragmentShader:kr}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=y.TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=Wr.None,this._outlineWidthMode=Qn.None,this._isOutline=!1,t.transparentWithZWrite&&(t.depthWrite=!0),delete t.transparentWithZWrite,t.fog=!0,t.lights=!0,t.clipping=!0,this.uniforms=y.UniformsUtils.merge([y.UniformsLib.common,y.UniformsLib.normalmap,y.UniformsLib.emissivemap,y.UniformsLib.fog,y.UniformsLib.lights,{litFactor:{value:new y.Color(1,1,1)},mapUvTransform:{value:new y.Matrix3},colorAlpha:{value:1},normalMapUvTransform:{value:new y.Matrix3},shadeColorFactor:{value:new y.Color(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new y.Matrix3},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new y.Matrix3},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new y.Color(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new y.Matrix3},parametricRimColorFactor:{value:new y.Color(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new y.Matrix3},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new y.Color(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new y.Matrix3},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new y.Matrix3},outlineWidthFactor:{value:0},outlineColorFactor:{value:new y.Color(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new y.Matrix3},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(e=t.uniforms)!=null?e:{}]),this.setValues(t),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([n,i])=>`${n}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${pt(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${pt(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${pt(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{let i=parseInt(y.REVISION,10),r=Object.entries(jn(jn({},this._generateDefines()),this.defines)).filter(([o,a])=>!!a).map(([o,a])=>`#define ${o} ${a}`).join(` +`,Wr={None:"none",Normal:"normal",LitShadeRate:"litShadeRate",UV:"uv"},qn={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},zr={3e3:"",3001:"srgb"};function mt(t){return parseInt(Jn.REVISION,10)>=152?t.colorSpace:zr[t.encoding]}var Gr=class extends y.ShaderMaterial{constructor(t={}){var e;super({vertexShader:Fr,fragmentShader:kr}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=y.TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=Wr.None,this._outlineWidthMode=qn.None,this._isOutline=!1,t.transparentWithZWrite&&(t.depthWrite=!0),delete t.transparentWithZWrite,t.fog=!0,t.lights=!0,t.clipping=!0,this.uniforms=y.UniformsUtils.merge([y.UniformsLib.common,y.UniformsLib.normalmap,y.UniformsLib.emissivemap,y.UniformsLib.fog,y.UniformsLib.lights,{litFactor:{value:new y.Color(1,1,1)},mapUvTransform:{value:new y.Matrix3},colorAlpha:{value:1},normalMapUvTransform:{value:new y.Matrix3},shadeColorFactor:{value:new y.Color(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new y.Matrix3},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new y.Matrix3},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new y.Color(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new y.Matrix3},parametricRimColorFactor:{value:new y.Color(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new y.Matrix3},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new y.Color(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new y.Matrix3},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new y.Matrix3},outlineWidthFactor:{value:0},outlineColorFactor:{value:new y.Color(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new y.Matrix3},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(e=t.uniforms)!=null?e:{}]),this.setValues(t),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([n,i])=>`${n}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${mt(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${mt(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${mt(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{let i=parseInt(y.REVISION,10),r=Object.entries(Yn(Yn({},this._generateDefines()),this.defines)).filter(([o,a])=>!!a).map(([o,a])=>`#define ${o} ${a}`).join(` `)+` -`;n.vertexShader=r+n.vertexShader,n.fragmentShader=r+n.fragmentShader,i<154&&(n.fragmentShader=n.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(t){this.uniforms.litFactor.value=t}get map(){return this.uniforms.map.value}set map(t){this.uniforms.map.value=t}get normalMap(){return this.uniforms.normalMap.value}set normalMap(t){this.uniforms.normalMap.value=t}get normalScale(){return this.uniforms.normalScale.value}set normalScale(t){this.uniforms.normalScale.value=t}get emissive(){return this.uniforms.emissive.value}set emissive(t){this.uniforms.emissive.value=t}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(t){this.uniforms.emissiveIntensity.value=t}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(t){this.uniforms.emissiveMap.value=t}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(t){this.uniforms.shadeColorFactor.value=t}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(t){this.uniforms.shadeMultiplyTexture.value=t}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(t){this.uniforms.shadingShiftFactor.value=t}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(t){this.uniforms.shadingShiftTexture.value=t}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(t){this.uniforms.shadingShiftTextureScale.value=t}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(t){this.uniforms.shadingToonyFactor.value=t}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(t){this.uniforms.giEqualizationFactor.value=t}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(t){this.uniforms.matcapFactor.value=t}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(t){this.uniforms.matcapTexture.value=t}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(t){this.uniforms.parametricRimColorFactor.value=t}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(t){this.uniforms.rimMultiplyTexture.value=t}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(t){this.uniforms.rimLightingMixFactor.value=t}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(t){this.uniforms.parametricRimFresnelPowerFactor.value=t}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(t){this.uniforms.parametricRimLiftFactor.value=t}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(t){this.uniforms.outlineWidthMultiplyTexture.value=t}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(t){this.uniforms.outlineWidthFactor.value=t}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(t){this.uniforms.outlineColorFactor.value=t}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(t){this.uniforms.outlineLightingMixFactor.value=t}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(t){this.uniforms.uvAnimationMaskTexture.value=t}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(t){this.uniforms.uvAnimationScrollXOffset.value=t}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(t){this.uniforms.uvAnimationScrollYOffset.value=t}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(t){this.uniforms.uvAnimationRotationPhase.value=t}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(t){this._ignoreVertexColor=t,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(t){this._v0CompatShade=t,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(t){this._debugMode=t,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(t){this._outlineWidthMode=t,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(t){this._isOutline=t,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(t){this._uploadUniformsWorkaround(),this._updateUVAnimation(t)}copy(t){return super.copy(t),this.map=t.map,this.normalMap=t.normalMap,this.emissiveMap=t.emissiveMap,this.shadeMultiplyTexture=t.shadeMultiplyTexture,this.shadingShiftTexture=t.shadingShiftTexture,this.matcapTexture=t.matcapTexture,this.rimMultiplyTexture=t.rimMultiplyTexture,this.outlineWidthMultiplyTexture=t.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=t.uvAnimationMaskTexture,this.normalMapType=t.normalMapType,this.uvAnimationScrollXSpeedFactor=t.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=t.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=t.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=t.ignoreVertexColor,this.v0CompatShade=t.v0CompatShade,this.debugMode=t.debugMode,this.outlineWidthMode=t.outlineWidthMode,this.isOutline=t.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(t){this.uniforms.uvAnimationScrollXOffset.value+=t*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=t*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=t*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){let t=parseInt(y.REVISION,10),e=this.outlineWidthMultiplyTexture!==null,n=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:t,OUTLINE:this._isOutline,MTOON_USE_UV:e||n,MTOON_UVS_VERTEX_ONLY:e&&!n,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===Qn.ScreenCoordinates}}_updateTextureMatrix(t,e){t.value&&(t.value.matrixAutoUpdate&&t.value.updateMatrix(),e.value.copy(t.value.matrix))}},jr=new Set(["1.0","1.0-beta"]),Zn=class ke{get name(){return ke.EXTENSION_NAME}constructor(e,n={}){var i,r,o,a;this.parser=e,this.materialType=(i=n.materialType)!=null?i:Gr,this.renderOrderOffset=(r=n.renderOrderOffset)!=null?r:0,this.v0CompatShade=(o=n.v0CompatShade)!=null?o:!1,this.debugMode=(a=n.debugMode)!=null?a:"none",this._mToonMaterialSet=new Set}beforeRoot(){return le(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return le(this,null,function*(){e.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(e){return this._getMToonExtension(e)?this.materialType:null}extendMaterialParams(e,n){let i=this._getMToonExtension(e);return i?this._extendMaterialParams(i,n):null}loadMesh(e){return le(this,null,function*(){var n;let i=this.parser,o=(n=i.json.meshes)==null?void 0:n[e];if(o==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${e}] of glTF but the mesh doesn't exist`);let a=o.primitives,l=yield i.loadMesh(e);if(a.length===1){let s=l,u=a[0].material;u!=null&&this._setupPrimitive(s,u)}else{let s=l;for(let u=0;u{var a;this._getMToonExtension(o)&&((a=r.extensions)!=null&&a.KHR_materials_unlit)&&delete r.extensions.KHR_materials_unlit})}_getMToonExtension(e){var n,i;let a=(n=this.parser.json.materials)==null?void 0:n[e];if(a==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}let l=(i=a.extensions)==null?void 0:i[ke.EXTENSION_NAME];if(l==null)return;let s=l.specVersion;if(!jr.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${ke.EXTENSION_NAME} specVersion "${s}"`);return}return l}_extendMaterialParams(e,n){return le(this,null,function*(){var i;delete n.metalness,delete n.roughness;let r=new Dr(this.parser,n);r.assignPrimitive("transparentWithZWrite",e.transparentWithZWrite),r.assignColor("shadeColorFactor",e.shadeColorFactor),r.assignTexture("shadeMultiplyTexture",e.shadeMultiplyTexture,!0),r.assignPrimitive("shadingShiftFactor",e.shadingShiftFactor),r.assignTexture("shadingShiftTexture",e.shadingShiftTexture,!0),r.assignPrimitive("shadingShiftTextureScale",(i=e.shadingShiftTexture)==null?void 0:i.scale),r.assignPrimitive("shadingToonyFactor",e.shadingToonyFactor),r.assignPrimitive("giEqualizationFactor",e.giEqualizationFactor),r.assignColor("matcapFactor",e.matcapFactor),r.assignTexture("matcapTexture",e.matcapTexture,!0),r.assignColor("parametricRimColorFactor",e.parametricRimColorFactor),r.assignTexture("rimMultiplyTexture",e.rimMultiplyTexture,!0),r.assignPrimitive("rimLightingMixFactor",e.rimLightingMixFactor),r.assignPrimitive("parametricRimFresnelPowerFactor",e.parametricRimFresnelPowerFactor),r.assignPrimitive("parametricRimLiftFactor",e.parametricRimLiftFactor),r.assignPrimitive("outlineWidthMode",e.outlineWidthMode),r.assignPrimitive("outlineWidthFactor",e.outlineWidthFactor),r.assignTexture("outlineWidthMultiplyTexture",e.outlineWidthMultiplyTexture,!1),r.assignColor("outlineColorFactor",e.outlineColorFactor),r.assignPrimitive("outlineLightingMixFactor",e.outlineLightingMixFactor),r.assignTexture("uvAnimationMaskTexture",e.uvAnimationMaskTexture,!1),r.assignPrimitive("uvAnimationScrollXSpeedFactor",e.uvAnimationScrollXSpeedFactor),r.assignPrimitive("uvAnimationScrollYSpeedFactor",e.uvAnimationScrollYSpeedFactor),r.assignPrimitive("uvAnimationRotationSpeedFactor",e.uvAnimationRotationSpeedFactor),r.assignPrimitive("v0CompatShade",this.v0CompatShade),r.assignPrimitive("debugMode",this.debugMode),yield r.pending})}_setupPrimitive(e,n){let i=this._getMToonExtension(n);if(i){let r=this._parseRenderOrder(i);e.renderOrder=r+this.renderOrderOffset,this._generateOutline(e),this._addToMaterialSet(e);return}}_shouldGenerateOutline(e){return typeof e.outlineWidthMode=="string"&&e.outlineWidthMode!=="none"&&typeof e.outlineWidthFactor=="number"&&e.outlineWidthFactor>0}_generateOutline(e){let n=e.material;if(!(n instanceof We.Material)||!this._shouldGenerateOutline(n))return;e.material=[n];let i=n.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=We.BackSide,e.material.push(i);let r=e.geometry,o=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,o,0),r.addGroup(0,o,1)}_addToMaterialSet(e){let n=e.material,i=new Set;Array.isArray(n)?n.forEach(r=>i.add(r)):i.add(n);for(let r of i)this._mToonMaterialSet.add(r)}_parseRenderOrder(e){var n;return(e.transparentWithZWrite?0:19)+((n=e.renderQueueOffsetNumber)!=null?n:0)}};Zn.EXTENSION_NAME="VRMC_materials_mtoon";var $n=Zn;var Qr=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),Jn=class mt{get name(){return mt.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,n){return Qr(this,null,function*(){let i=this._getHDREmissiveMultiplierExtension(e);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");let r=i.emissiveMultiplier;n.emissiveIntensity=r})}_getHDREmissiveMultiplierExtension(e){var n,i;let a=(n=this.parser.json.materials)==null?void 0:n[e];if(a==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}let l=(i=a.extensions)==null?void 0:i[mt.EXTENSION_NAME];if(l!=null)return l}};Jn.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var Kn=Jn;import*as ii from"three";var Xr=Object.defineProperty,Yr=Object.defineProperties,qr=Object.getOwnPropertyDescriptors,ei=Object.getOwnPropertySymbols,Zr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,ti=(t,e,n)=>e in t?Xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j=(t,e)=>{for(var n in e||(e={}))Zr.call(e,n)&&ti(t,n,e[n]);if(ei)for(var n of ei(e))$r.call(e,n)&&ti(t,n,e[n]);return t},ni=(t,e)=>Yr(t,qr(e)),Jr=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())});function _e(t){return Math.pow(t,2.2)}var ri=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(t){var e;this.parser=t,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;let n=this.parser.json;n.extensionsUsed=(e=n.extensionsUsed)!=null?e:[],n.extensionsUsed.indexOf("KHR_texture_transform")===-1&&n.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return Jr(this,null,function*(){var t;let e=this.parser.json,n=(t=e.extensions)==null?void 0:t.VRM,i=n==null?void 0:n.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((r,o)=>{var a,l;let s=(a=e.materials)==null?void 0:a[o];if(s==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${o}] of glTF but the material doesn't exist`);return}if(r.shader==="VRM/MToon"){let u=this._parseV0MToonProperties(r,s);e.materials[o]=u}else if((l=r.shader)!=null&&l.startsWith("VRM/Unlit")){let u=this._parseV0UnlitProperties(r,s);e.materials[o]=u}else r.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${r.shader}`)}))})}_parseV0MToonProperties(t,e){var n,i,r,o,a,l,s,u,d,h,p,m,c,f,g,M,b,x,_,v,E,R,S,A,P,w,L,k,W,Re,J,z,pe,Te,U,wt,St,Pt,At,Lt,Ht,bt,Vt,It,Ct,Ut,Ot,Nt,Bt,Dt,Ft,kt,Wt,zt,Gt;let jt=(i=(n=t.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,Vi=((r=t.floatProperties)==null?void 0:r._ZWrite)===1&&jt,Ii=this._v0ParseRenderQueue(t),Qt=(a=(o=t.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,Ci=jt?"BLEND":Qt?"MASK":"OPAQUE",Ui=Qt?(s=(l=t.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,Oi=((d=(u=t.floatProperties)==null?void 0:u._CullMode)!=null?d:2)===0,oe=this._portTextureTransform(t),Ni=((p=(h=t.vectorProperties)==null?void 0:h._Color)!=null?p:[1,1,1,1]).map((tn,ar)=>ar===3?tn:_e(tn)),Xt=(m=t.textureProperties)==null?void 0:m._MainTex,Bi=Xt!=null?{index:Xt,extensions:j({},oe)}:void 0,Di=(f=(c=t.floatProperties)==null?void 0:c._BumpScale)!=null?f:1,Yt=(g=t.textureProperties)==null?void 0:g._BumpMap,Fi=Yt!=null?{index:Yt,scale:Di,extensions:j({},oe)}:void 0,ki=((b=(M=t.vectorProperties)==null?void 0:M._EmissionColor)!=null?b:[0,0,0,1]).map(_e),qt=(x=t.textureProperties)==null?void 0:x._EmissionMap,Wi=qt!=null?{index:qt,extensions:j({},oe)}:void 0,zi=((v=(_=t.vectorProperties)==null?void 0:_._ShadeColor)!=null?v:[.97,.81,.86,1]).map(_e),Zt=(E=t.textureProperties)==null?void 0:E._ShadeTexture,Gi=Zt!=null?{index:Zt,extensions:j({},oe)}:void 0,Ie=(S=(R=t.floatProperties)==null?void 0:R._ShadeShift)!=null?S:0,Ce=(P=(A=t.floatProperties)==null?void 0:A._ShadeToony)!=null?P:.9;Ce=ii.MathUtils.lerp(Ce,1,.5+.5*Ie),Ie=-Ie-(1-Ce);let $t=(L=(w=t.floatProperties)==null?void 0:w._IndirectLightIntensity)!=null?L:.1,ji=$t?1-$t:void 0,Xe=(k=t.textureProperties)==null?void 0:k._SphereAdd,Qi=Xe!=null?[1,1,1]:void 0,Xi=Xe!=null?{index:Xe}:void 0,Yi=(Re=(W=t.floatProperties)==null?void 0:W._RimLightingMix)!=null?Re:0,Jt=(J=t.textureProperties)==null?void 0:J._RimTexture,qi=Jt!=null?{index:Jt,extensions:j({},oe)}:void 0,Zi=((pe=(z=t.vectorProperties)==null?void 0:z._RimColor)!=null?pe:[0,0,0,1]).map(_e),$i=(U=(Te=t.floatProperties)==null?void 0:Te._RimFresnelPower)!=null?U:1,Ji=(St=(wt=t.floatProperties)==null?void 0:wt._RimLift)!=null?St:0,Ki=["none","worldCoordinates","screenCoordinates"][(At=(Pt=t.floatProperties)==null?void 0:Pt._OutlineWidthMode)!=null?At:0],Ye=(Ht=(Lt=t.floatProperties)==null?void 0:Lt._OutlineWidth)!=null?Ht:0;Ye=.01*Ye;let Kt=(bt=t.textureProperties)==null?void 0:bt._OutlineWidthTexture,er=Kt!=null?{index:Kt,extensions:j({},oe)}:void 0,tr=((It=(Vt=t.vectorProperties)==null?void 0:Vt._OutlineColor)!=null?It:[0,0,0]).map(_e),nr=((Ut=(Ct=t.floatProperties)==null?void 0:Ct._OutlineColorMode)!=null?Ut:0)===1?(Nt=(Ot=t.floatProperties)==null?void 0:Ot._OutlineLightingMix)!=null?Nt:1:0,en=(Bt=t.textureProperties)==null?void 0:Bt._UvAnimMaskTexture,ir=en!=null?{index:en,extensions:j({},oe)}:void 0,rr=(Ft=(Dt=t.floatProperties)==null?void 0:Dt._UvAnimScrollX)!=null?Ft:0,Ue=(Wt=(kt=t.floatProperties)==null?void 0:kt._UvAnimScrollY)!=null?Wt:0;Ue!=null&&(Ue=-Ue);let or=(Gt=(zt=t.floatProperties)==null?void 0:zt._UvAnimRotation)!=null?Gt:0,sr={specVersion:"1.0",transparentWithZWrite:Vi,renderQueueOffsetNumber:Ii,shadeColorFactor:zi,shadeMultiplyTexture:Gi,shadingShiftFactor:Ie,shadingToonyFactor:Ce,giEqualizationFactor:ji,matcapFactor:Qi,matcapTexture:Xi,rimLightingMixFactor:Yi,rimMultiplyTexture:qi,parametricRimColorFactor:Zi,parametricRimFresnelPowerFactor:$i,parametricRimLiftFactor:Ji,outlineWidthMode:Ki,outlineWidthFactor:Ye,outlineWidthMultiplyTexture:er,outlineColorFactor:tr,outlineLightingMixFactor:nr,uvAnimationMaskTexture:ir,uvAnimationScrollXSpeedFactor:rr,uvAnimationScrollYSpeedFactor:Ue,uvAnimationRotationSpeedFactor:or};return ni(j({},e),{pbrMetallicRoughness:{baseColorFactor:Ni,baseColorTexture:Bi},normalTexture:Fi,emissiveTexture:Wi,emissiveFactor:ki,alphaMode:Ci,alphaCutoff:Ui,doubleSided:Oi,extensions:{VRMC_materials_mtoon:sr}})}_parseV0UnlitProperties(t,e){var n,i,r,o,a;let l=t.shader==="VRM/UnlitTransparentZWrite",s=t.shader==="VRM/UnlitTransparent"||l,u=this._v0ParseRenderQueue(t),d=t.shader==="VRM/UnlitCutout",h=s?"BLEND":d?"MASK":"OPAQUE",p=d?(i=(n=t.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,m=this._portTextureTransform(t),c=((o=(r=t.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(_e),f=(a=t.textureProperties)==null?void 0:a._MainTex,g=f!=null?{index:f,extensions:j({},m)}:void 0,M={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:c,shadeMultiplyTexture:g};return ni(j({},e),{pbrMetallicRoughness:{baseColorFactor:c,baseColorTexture:g},alphaMode:h,alphaCutoff:p,extensions:{VRMC_materials_mtoon:M}})}_portTextureTransform(t){var e,n,i,r,o;let a=(e=t.vectorProperties)==null?void 0:e._MainTex;if(a==null)return{};let l=[(n=a==null?void 0:a[0])!=null?n:0,(i=a==null?void 0:a[1])!=null?i:0],s=[(r=a==null?void 0:a[2])!=null?r:1,(o=a==null?void 0:a[3])!=null?o:1];return l[1]=1-s[1]-l[1],{KHR_texture_transform:{offset:l,scale:s}}}_v0ParseRenderQueue(t){var e,n;let i=t.shader==="VRM/UnlitTransparentZWrite",r=((e=t.keywordMap)==null?void 0:e._ALPHABLEND_ON)!=null||t.shader==="VRM/UnlitTransparent"||i,o=((n=t.floatProperties)==null?void 0:n._ZWrite)===1||i,a=0;if(r){let l=t.renderQueue;l!=null&&(o?a=this._renderQueueMapTransparentZWrite.get(l):a=this._renderQueueMapTransparent.get(l))}return a}_populateRenderQueueMap(t){let e=new Set,n=new Set;t.forEach(i=>{var r,o;let a=i.shader==="VRM/UnlitTransparentZWrite",l=((r=i.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||a,s=((o=i.floatProperties)==null?void 0:o._ZWrite)===1||a;if(l){let u=i.renderQueue;u!=null&&(s?n.add(u):e.add(u))}}),e.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${e.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),n.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${n.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(e).sort().forEach((i,r)=>{let o=Math.min(Math.max(r-e.size+1,-9),0);this._renderQueueMapTransparent.set(i,o)}),Array.from(n).sort().forEach((i,r)=>{let o=Math.min(Math.max(r,0),9);this._renderQueueMapTransparentZWrite.set(i,o)})}};import*as O from"three";import*as Q from"three";import*as _t from"three";import*as Le from"three";import*as q from"three";var oi=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),te=new O.Vector3,ft=class extends O.Group{constructor(t){super(),this._attrPosition=new O.BufferAttribute(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(O.DynamicDrawUsage);let e=new O.BufferGeometry;e.setAttribute("position",this._attrPosition);let n=new O.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new O.Line(e,n),this.add(this._line),this.constraint=t}updateMatrixWorld(t){te.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,te.x,te.y,te.z),this.constraint.source&&te.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,te.x,te.y,te.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(t)}};function si(t,e){return e.set(t.elements[12],t.elements[13],t.elements[14])}var Kr=new _t.Vector3,eo=new _t.Vector3;function to(t,e){return t.decompose(Kr,e,eo),e}function ze(t){return t.invert?t.invert():t.inverse(),t}var gt=class{constructor(t,e){this.destination=t,this.source=e,this.weight=1}},no=new Q.Vector3,io=new Q.Vector3,ro=new Q.Vector3,oo=new Q.Quaternion,so=new Q.Quaternion,ao=new Q.Quaternion,lo=class extends gt{get aimAxis(){return this._aimAxis}set aimAxis(t){this._aimAxis=t,this._v3AimAxis.set(t==="PositiveX"?1:t==="NegativeX"?-1:0,t==="PositiveY"?1:t==="NegativeY"?-1:0,t==="PositiveZ"?1:t==="NegativeZ"?-1:0)}get dependencies(){let t=new Set([this.source]);return this.destination.parent&&t.add(this.destination.parent),t}constructor(t,e){super(t,e),this._aimAxis="PositiveX",this._v3AimAxis=new Q.Vector3(1,0,0),this._dstRestQuat=new Q.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let t=oo.identity(),e=so.identity();this.destination.parent&&(to(this.destination.parent.matrixWorld,t),ze(e.copy(t)));let n=no.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(t),i=si(this.source.matrixWorld,io).sub(si(this.destination.matrixWorld,ro)).normalize(),r=ao.setFromUnitVectors(n,i).premultiply(e).multiply(t).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function uo(t,e){let n=[t],i=t.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}var ho=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(t){this._constraints.add(t);let e=this._objectConstraintsMap.get(t.destination);e==null&&(e=new Set,this._objectConstraintsMap.set(t.destination,e)),e.add(t)}deleteConstraint(t){this._constraints.delete(t),this._objectConstraintsMap.get(t.destination).delete(t)}setInitState(){let t=new Set,e=new Set;for(let n of this._constraints)this._processConstraint(n,t,e,i=>i.setInitState())}update(){let t=new Set,e=new Set;for(let n of this._constraints)this._processConstraint(n,t,e,i=>i.update())}_processConstraint(t,e,n,i){if(n.has(t))return;if(e.has(t))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");e.add(t);let r=t.dependencies;for(let o of r)uo(o,a=>{let l=this._objectConstraintsMap.get(a);if(l)for(let s of l)this._processConstraint(s,e,n,i)});i(t),n.add(t)}},co=new Le.Quaternion,po=new Le.Quaternion,mo=class extends gt{get dependencies(){return new Set([this.source])}constructor(t,e){super(t,e),this._dstRestQuat=new Le.Quaternion,this._invSrcRestQuat=new Le.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),ze(this._invSrcRestQuat.copy(this.source.quaternion))}update(){let t=co.copy(this._invSrcRestQuat).multiply(this.source.quaternion),e=po.copy(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(e,this.weight)}},fo=new q.Vector3,_o=new q.Quaternion,go=new q.Quaternion,vo=class extends gt{get rollAxis(){return this._rollAxis}set rollAxis(t){this._rollAxis=t,this._v3RollAxis.set(t==="X"?1:0,t==="Y"?1:0,t==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(t,e){super(t,e),this._rollAxis="X",this._v3RollAxis=new q.Vector3(1,0,0),this._dstRestQuat=new q.Quaternion,this._invDstRestQuat=new q.Quaternion,this._invSrcRestQuatMulDstRestQuat=new q.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),ze(this._invDstRestQuat.copy(this._dstRestQuat)),ze(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){let t=_o.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),e=fo.copy(this._v3RollAxis).applyQuaternion(t),i=go.setFromUnitVectors(e,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},Eo=new Set(["1.0","1.0-beta"]),ai=class Ae{get name(){return Ae.EXTENSION_NAME}constructor(e,n){this.parser=e,this.helperRoot=n==null?void 0:n.helperRoot}afterRoot(e){return oi(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(e){return oi(this,null,function*(){var n;let i=this.parser.json;if(!(((n=i.extensionsUsed)==null?void 0:n.indexOf(Ae.EXTENSION_NAME))!==-1))return null;let o=new ho,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;let d=i.nodes[s],h=(u=d==null?void 0:d.extensions)==null?void 0:u[Ae.EXTENSION_NAME];if(h==null)return;let p=h.specVersion;if(!Eo.has(p)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Ae.EXTENSION_NAME} specVersion "${p}"`);return}let m=h.constraint;if(m.roll!=null){let c=this._importRollConstraint(l,a,m.roll);o.addConstraint(c)}else if(m.aim!=null){let c=this._importAimConstraint(l,a,m.aim);o.addConstraint(c)}else if(m.rotation!=null){let c=this._importRotationConstraint(l,a,m.rotation);o.addConstraint(c)}}),e.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(e,n,i){let{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new vo(e,l);if(o!=null&&(s.rollAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new ft(s);this.helperRoot.add(u)}return s}_importAimConstraint(e,n,i){let{source:r,aimAxis:o,weight:a}=i,l=n[r],s=new lo(e,l);if(o!=null&&(s.aimAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new ft(s);this.helperRoot.add(u)}return s}_importRotationConstraint(e,n,i){let{source:r,weight:o}=i,a=n[r],l=new mo(e,a);if(o!=null&&(l.weight=o),this.helperRoot){let s=new ft(l);this.helperRoot.add(s)}return l}};ai.EXTENSION_NAME="VRMC_node_constraint";var li=ai;import*as ie from"three";import*as Ve from"three";import*as Me from"three";import*as _i from"three";import*as $ from"three";import*as ne from"three";import*as de from"three";import*as re from"three";import*as he from"three";import*as vi from"three";import*as C from"three";import*as Ei from"three";import*as Ri from"three";import*as B from"three";var Ge=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),Tt=class{},vt=new Ve.Vector3,ue=new Ve.Vector3,mi=class extends Tt{get type(){return"capsule"}constructor(t){var e,n,i,r;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Ve.Vector3(0,0,0),this.tail=(n=t==null?void 0:t.tail)!=null?n:new Ve.Vector3(0,0,0),this.radius=(i=t==null?void 0:t.radius)!=null?i:0,this.inside=(r=t==null?void 0:t.inside)!=null?r:!1}calculateCollision(t,e,n,i){vt.copy(this.offset).applyMatrix4(t),ue.copy(this.tail).applyMatrix4(t),ue.sub(vt);let r=ue.lengthSq();i.copy(e).sub(vt);let o=ue.dot(i);o<=0||(r<=o||ue.multiplyScalar(o/r),i.sub(ue));let a=this.inside?this.radius-n-i.length():i.length()-n-this.radius;return i.normalize(),this.inside&&i.negate(),a}},Et=new Me.Vector3,ui=new Me.Matrix3,fi=class extends Tt{get type(){return"plane"}constructor(t){var e,n;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Me.Vector3(0,0,0),this.normal=(n=t==null?void 0:t.normal)!=null?n:new Me.Vector3(0,0,1)}calculateCollision(t,e,n,i){i.copy(this.offset).applyMatrix4(t),i.negate().add(e),ui.getNormalMatrix(t),Et.copy(this.normal).applyNormalMatrix(ui).normalize();let r=i.dot(Et)-n;return i.copy(Et),r}},gi=class extends Tt{get type(){return"sphere"}constructor(t){var e,n,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new _i.Vector3(0,0,0),this.radius=(n=t==null?void 0:t.radius)!=null?n:0,this.inside=(i=t==null?void 0:t.inside)!=null?i:!1}calculateCollision(t,e,n,i){i.copy(this.offset).applyMatrix4(t),i.negate().add(e);let r=this.inside?this.radius-n-i.length():i.length()-n-this.radius;return i.normalize(),this.inside&&i.negate(),r}},X=new $.Vector3,Mo=class extends $.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new $.Vector3,this._currentTail=new $.Vector3,this._shape=t,this._attrPos=new $.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new $.BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0);let n=X.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),t=!0),t&&this._buildPosition()}_buildPosition(){X.copy(this._currentTail).sub(this._currentOffset);let t=X.length()/this._currentRadius;for(let i=0;i<=16;i++){let r=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(r),-Math.cos(r),0),this._attrPos.setXYZ(17+i,t+Math.sin(r),Math.cos(r),0),this._attrPos.setXYZ(34+i,-Math.sin(r),0,-Math.cos(r)),this._attrPos.setXYZ(51+i,t+Math.sin(r),0,Math.cos(r))}for(let i=0;i<32;i++){let r=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(r),Math.cos(r)),this._attrPos.setXYZ(100+i,t,Math.sin(r),Math.cos(r))}let e=Math.atan2(X.y,Math.sqrt(X.x*X.x+X.z*X.z)),n=-Math.atan2(X.z,X.x);this.rotateZ(e),this.rotateY(n),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<34;t++){let e=(t+1)%34;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(68+t*2,34+t,34+e)}for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(136+t*2,68+t,68+e),this._attrIndex.setXY(200+t*2,100+t,100+e)}this._attrIndex.needsUpdate=!0}},Ro=class extends ne.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentOffset=new ne.Vector3,this._currentNormal=new ne.Vector3,this._shape=t,this._attrPos=new ne.BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new ne.BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},To=class extends de.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new de.Vector3,this._shape=t,this._attrPos=new de.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new de.BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.needsUpdate=!0}},xo=new ie.Vector3,Mt=class extends ie.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof gi)this._geometry=new To(this.collider.shape);else if(this.collider.shape instanceof mi)this._geometry=new Mo(this.collider.shape);else if(this.collider.shape instanceof fi)this._geometry=new Ro(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");let e=new ie.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new ie.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=xo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},yo=class extends he.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new he.Vector3,this._springBone=t,this._attrPos=new he.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new he.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},wo=new re.Vector3,So=class extends re.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new yo(this.springBone);let e=new re.LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new re.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=wo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},Rt=class extends vi.Object3D{constructor(t){super(),this.shape=t}},Po=new Ei.Matrix4;function Mi(t){return t.invert?t.invert():t.getInverse(Po.copy(t)),t}var Ao=class{constructor(t){this._inverseCache=new Ri.Matrix4,this._shouldUpdateInverse=!0,this.matrix=t;let e={set:(n,i,r)=>(this._shouldUpdateInverse=!0,n[i]=r,!0)};this._originalElements=t.elements,t.elements=new Proxy(t.elements,e)}get inverse(){return this._shouldUpdateInverse&&(Mi(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},Lo=new C.Matrix4,Z=new C.Vector3,He=new C.Vector3,Ho=new C.Vector3,ge=new C.Vector3,di=new C.Vector3,be=new C.Vector3,hi=new C.Quaternion,ve=new C.Matrix4,bo=new C.Matrix4,Vo=class{constructor(t,e,n={},i=[]){this._currentTail=new C.Vector3,this._prevTail=new C.Vector3,this._boneAxis=new C.Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new C.Matrix4,this._initialLocalRotation=new C.Quaternion,this._initialLocalChildPosition=new C.Vector3;var r,o,a,l,s,u;this.bone=t,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(r=n.hitRadius)!=null?r:0,stiffness:(o=n.stiffness)!=null?o:1,gravityPower:(a=n.gravityPower)!=null?a:0,gravityDir:(s=(l=n.gravityDir)==null?void 0:l.clone())!=null?s:new C.Vector3(0,-1,0),dragForce:(u=n.dragForce)!=null?u:.4},this.colliderGroups=i}get center(){return this._center}set center(t){var e;(e=this._center)!=null&&e.userData.inverseCacheProxy&&(this._center.userData.inverseCacheProxy.revert(),delete this._center.userData.inverseCacheProxy),this._center=t,this._center&&(this._center.userData.inverseCacheProxy||(this._center.userData.inverseCacheProxy=new Ao(this._center.matrixWorld)))}get initialLocalChildPosition(){return this._initialLocalChildPosition}get _parentMatrixWorld(){return this.bone.parent?this.bone.parent.matrixWorld:Lo}setInitState(){this._initialLocalMatrix.copy(this.bone.matrix),this._initialLocalRotation.copy(this.bone.quaternion),this.child?this._initialLocalChildPosition.copy(this.child.position):this._initialLocalChildPosition.copy(this.bone.position).normalize().multiplyScalar(.07);let t=this._getMatrixWorldToCenter(ve);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail),this._boneAxis.copy(this._initialLocalChildPosition).normalize()}reset(){this.bone.quaternion.copy(this._initialLocalRotation),this.bone.updateMatrix(),this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld,this.bone.matrix);let t=this._getMatrixWorldToCenter(ve);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail)}update(t){if(t<=0)return;this._calcWorldSpaceBoneLength(),ge.setFromMatrixPosition(this.bone.matrixWorld);let e=this._getMatrixWorldToCenter(ve);di.copy(ge).applyMatrix4(e);let n=hi.setFromRotationMatrix(e),i=bo.copy(e).multiply(this._parentMatrixWorld),r=He.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(i).sub(di).normalize(),o=Ho.copy(this.settings.gravityDir).applyQuaternion(n).normalize(),a=this._getMatrixCenterToWorld(ve);be.copy(this._currentTail).add(Z.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1-this.settings.dragForce)).add(Z.copy(r).multiplyScalar(this.settings.stiffness*t)).add(Z.copy(o).multiplyScalar(this.settings.gravityPower*t)).applyMatrix4(a),be.sub(ge).normalize().multiplyScalar(this._worldSpaceBoneLength).add(ge),this._collision(be),e=this._getMatrixWorldToCenter(ve),this._prevTail.copy(this._currentTail),this._currentTail.copy(Z.copy(be).applyMatrix4(e));let l=Mi(ve.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix)),s=hi.setFromUnitVectors(this._boneAxis,Z.copy(be).applyMatrix4(l).normalize());this.bone.quaternion.copy(this._initialLocalRotation).multiply(s),this.bone.updateMatrix(),this.bone.matrixWorld.multiplyMatrices(this._parentMatrixWorld,this.bone.matrix)}_collision(t){this.colliderGroups.forEach(e=>{e.colliders.forEach(n=>{let i=n.shape.calculateCollision(n.matrixWorld,t,this.settings.hitRadius,Z);i<0&&(t.add(Z.multiplyScalar(-i)),t.sub(ge).normalize().multiplyScalar(this._worldSpaceBoneLength).add(ge))})})}_calcWorldSpaceBoneLength(){Z.setFromMatrixPosition(this.bone.matrixWorld),this.child?He.setFromMatrixPosition(this.child.matrixWorld):(He.copy(this._initialLocalChildPosition),He.applyMatrix4(this.bone.matrixWorld)),this._worldSpaceBoneLength=Z.sub(He).length()}_getMatrixCenterToWorld(t){return this._center?t.copy(this._center.matrixWorld):t.identity(),t}_getMatrixWorldToCenter(t){return this._center?t.copy(this._center.userData.inverseCacheProxy.inverse):t.identity(),t}};function Io(t,e){let n=[],i=t;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}function Ti(t,e){t.children.forEach(n=>{e(n)||Ti(n,e)})}var ci=class{constructor(){this._joints=new Set,this._hasWarnedCircularDependency=!1,this._objectSpringBonesMap=new Map}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){let t=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(n=>{t.add(n)})}),Array.from(t)}get colliders(){let t=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(n=>{t.add(n)})}),Array.from(t)}addJoint(t){this._joints.add(t);let e=this._objectSpringBonesMap.get(t.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(t.bone,e)),e.add(t)}addSpringBone(t){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(t)}deleteJoint(t){this._joints.delete(t),this._objectSpringBonesMap.get(t.bone).delete(t)}deleteSpringBone(t){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(t)}setInitState(){let t=new Set,e=new Set,n=new Set;for(let i of this._joints)this._processSpringBone(i,t,e,n,r=>r.setInitState())}reset(){let t=new Set,e=new Set,n=new Set;for(let i of this._joints)this._processSpringBone(i,t,e,n,r=>r.reset())}update(t){let e=new Set,n=new Set,i=new Set;for(let r of this._joints)this._processSpringBone(r,e,n,i,o=>o.update(t)),Ti(r.bone,o=>{var a,l;return((l=(a=this._objectSpringBonesMap.get(o))==null?void 0:a.size)!=null?l:0)>0?!0:(o.updateWorldMatrix(!1,!1),!1)})}_processSpringBone(t,e,n,i,r){if(n.has(t))return;if(e.has(t)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected while updating springbones"),this._hasWarnedCircularDependency=!0);return}e.add(t);let o=this._getDependencies(t);for(let a of o)Io(a,l=>{let s=this._objectSpringBonesMap.get(l);if(s)for(let u of s)this._processSpringBone(u,e,n,i,r);else i.has(l)||(l.updateWorldMatrix(!1,!1),i.add(l))});t.bone.updateMatrix(),t.bone.updateWorldMatrix(!1,!1),r(t),i.add(t.bone),n.add(t)}_getDependencies(t){let e=new Set,n=t.bone.parent;return n&&e.add(n),t.colliderGroups.forEach(i=>{i.colliders.forEach(r=>{e.add(r)})}),e}},pi="VRMC_springBone_extended_collider",Co=new Set(["1.0","1.0-beta"]),Uo=new Set(["1.0"]),xi=class Ee{get name(){return Ee.EXTENSION_NAME}constructor(e,n){var i;this.parser=e,this.jointHelperRoot=n==null?void 0:n.jointHelperRoot,this.colliderHelperRoot=n==null?void 0:n.colliderHelperRoot,this.useExtendedColliders=(i=n==null?void 0:n.useExtendedColliders)!=null?i:!0}afterRoot(e){return Ge(this,null,function*(){e.userData.vrmSpringBoneManager=yield this._import(e)})}_import(e){return Ge(this,null,function*(){let n=yield this._v1Import(e);if(n!=null)return n;let i=yield this._v0Import(e);return i!=null?i:null})}_v1Import(e){return Ge(this,null,function*(){var n,i,r,o,a;let l=e.parser.json;if(!(((n=l.extensionsUsed)==null?void 0:n.indexOf(Ee.EXTENSION_NAME))!==-1))return null;let u=new ci,d=yield e.parser.getDependencies("node"),h=(i=l.extensions)==null?void 0:i[Ee.EXTENSION_NAME];if(!h)return null;let p=h.specVersion;if(!Co.has(p))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Ee.EXTENSION_NAME} specVersion "${p}"`),null;let m=(r=h.colliders)==null?void 0:r.map((f,g)=>{var M,b,x,_,v,E,R,S,A,P,w,L,k,W,Re;let J=d[f.node],z=f.shape,pe=(M=f.extensions)==null?void 0:M[pi];if(this.useExtendedColliders&&pe!=null){let Te=pe.specVersion;if(!Uo.has(Te))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${pi} specVersion "${Te}". Fallbacking to the ${Ee.EXTENSION_NAME} definition`);else{let U=pe.shape;if(U.sphere)return this._importSphereCollider(J,{offset:new B.Vector3().fromArray((b=U.sphere.offset)!=null?b:[0,0,0]),radius:(x=U.sphere.radius)!=null?x:0,inside:(_=U.sphere.inside)!=null?_:!1});if(U.capsule)return this._importCapsuleCollider(J,{offset:new B.Vector3().fromArray((v=U.capsule.offset)!=null?v:[0,0,0]),radius:(E=U.capsule.radius)!=null?E:0,tail:new B.Vector3().fromArray((R=U.capsule.tail)!=null?R:[0,0,0]),inside:(S=U.capsule.inside)!=null?S:!1});if(U.plane)return this._importPlaneCollider(J,{offset:new B.Vector3().fromArray((A=U.plane.offset)!=null?A:[0,0,0]),normal:new B.Vector3().fromArray((P=U.plane.normal)!=null?P:[0,0,1])})}}if(z.sphere)return this._importSphereCollider(J,{offset:new B.Vector3().fromArray((w=z.sphere.offset)!=null?w:[0,0,0]),radius:(L=z.sphere.radius)!=null?L:0,inside:!1});if(z.capsule)return this._importCapsuleCollider(J,{offset:new B.Vector3().fromArray((k=z.capsule.offset)!=null?k:[0,0,0]),radius:(W=z.capsule.radius)!=null?W:0,tail:new B.Vector3().fromArray((Re=z.capsule.tail)!=null?Re:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),c=(o=h.colliderGroups)==null?void 0:o.map((f,g)=>{var M;return{colliders:((M=f.colliders)!=null?M:[]).map(x=>{let _=m==null?void 0:m[x];if(_==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${x} but not found`);return _}),name:f.name}});return(a=h.springs)==null||a.forEach((f,g)=>{var M;let b=f.joints,x=(M=f.colliderGroups)==null?void 0:M.map(E=>{let R=c==null?void 0:c[E];if(R==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${E} but not found`);return R}),_=f.center!=null?d[f.center]:void 0,v;b.forEach(E=>{if(v){let R=v.node,S=d[R],A=E.node,P=d[A],w={hitRadius:v.hitRadius,dragForce:v.dragForce,gravityPower:v.gravityPower,stiffness:v.stiffness,gravityDir:v.gravityDir!=null?new B.Vector3().fromArray(v.gravityDir):void 0},L=this._importJoint(S,P,w,x);_&&(L.center=_),u.addJoint(L)}v=E})}),u.setInitState(),u})}_v0Import(e){return Ge(this,null,function*(){var n,i,r;let o=e.parser.json;if(!(((n=o.extensionsUsed)==null?void 0:n.indexOf("VRM"))!==-1))return null;let l=(i=o.extensions)==null?void 0:i.VRM,s=l==null?void 0:l.secondaryAnimation;if(!s)return null;let u=s==null?void 0:s.boneGroups;if(!u)return null;let d=new ci,h=yield e.parser.getDependencies("node"),p=(r=s.colliderGroups)==null?void 0:r.map(m=>{var c;let f=h[m.node];return{colliders:((c=m.colliders)!=null?c:[]).map((M,b)=>{var x,_,v;let E=new B.Vector3(0,0,0);return M.offset&&E.set((x=M.offset.x)!=null?x:0,(_=M.offset.y)!=null?_:0,M.offset.z?-M.offset.z:0),this._importSphereCollider(f,{offset:E,radius:(v=M.radius)!=null?v:0,inside:!1})})}});return u==null||u.forEach((m,c)=>{let f=m.bones;f&&f.forEach(g=>{var M,b,x,_;let v=h[g],E=new B.Vector3;m.gravityDir?E.set((M=m.gravityDir.x)!=null?M:0,(b=m.gravityDir.y)!=null?b:0,(x=m.gravityDir.z)!=null?x:0):E.set(0,-1,0);let R=m.center!=null?h[m.center]:void 0,S={hitRadius:m.hitRadius,dragForce:m.dragForce,gravityPower:m.gravityPower,stiffness:m.stiffiness,gravityDir:E},A=(_=m.colliderGroups)==null?void 0:_.map(P=>{let w=p==null?void 0:p[P];if(w==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${c} attempted to use a colliderGroup ${P} but not found`);return w});v.traverse(P=>{var w;let L=(w=P.children[0])!=null?w:null,k=this._importJoint(P,L,S,A);R&&(k.center=R),d.addJoint(k)})})}),e.scene.updateMatrixWorld(),d.setInitState(),d})}_importJoint(e,n,i,r){let o=new Vo(e,n,i,r);if(this.jointHelperRoot){let a=new So(o);this.jointHelperRoot.add(a),a.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(e,n){let i=new gi(n),r=new Rt(i);if(e.add(r),this.colliderHelperRoot){let o=new Mt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importCapsuleCollider(e,n){let i=new mi(n),r=new Rt(i);if(e.add(r),this.colliderHelperRoot){let o=new Mt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importPlaneCollider(e,n){let i=new fi(n),r=new Rt(i);if(e.add(r),this.colliderHelperRoot){let o=new Mt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}};xi.EXTENSION_NAME="VRMC_springBone";var yi=xi;var xt=class{get name(){return"VRMLoaderPlugin"}constructor(e,n){var o,a,l,s,u,d,h,p,m,c;this.parser=e;let i=n==null?void 0:n.helperRoot,r=n==null?void 0:n.autoUpdateHumanBones;this.expressionPlugin=(o=n==null?void 0:n.expressionPlugin)!=null?o:new ot(e),this.firstPersonPlugin=(a=n==null?void 0:n.firstPersonPlugin)!=null?a:new at(e),this.humanoidPlugin=(l=n==null?void 0:n.humanoidPlugin)!=null?l:new lt(e,{helperRoot:i,autoUpdateHumanBones:r}),this.lookAtPlugin=(s=n==null?void 0:n.lookAtPlugin)!=null?s:new dt(e,{helperRoot:i}),this.metaPlugin=(u=n==null?void 0:n.metaPlugin)!=null?u:new ht(e),this.mtoonMaterialPlugin=(d=n==null?void 0:n.mtoonMaterialPlugin)!=null?d:new $n(e),this.materialsHDREmissiveMultiplierPlugin=(h=n==null?void 0:n.materialsHDREmissiveMultiplierPlugin)!=null?h:new Kn(e),this.materialsV0CompatPlugin=(p=n==null?void 0:n.materialsV0CompatPlugin)!=null?p:new ri(e),this.springBonePlugin=(m=n==null?void 0:n.springBonePlugin)!=null?m:new yi(e,{colliderHelperRoot:i,jointHelperRoot:i}),this.nodeConstraintPlugin=(c=n==null?void 0:n.nodeConstraintPlugin)!=null?c:new li(e,{helperRoot:i})}beforeRoot(){return xe(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return xe(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){let n=this.mtoonMaterialPlugin.getMaterialType(e);return n!=null?n:null}extendMaterialParams(e,n){return xe(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,n),yield this.mtoonMaterialPlugin.extendMaterialParams(e,n)})}afterRoot(e){return xe(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e),yield this.springBonePlugin.afterRoot(e),yield this.nodeConstraintPlugin.afterRoot(e),yield this.mtoonMaterialPlugin.afterRoot(e);let n=e.userData.vrmMeta,i=e.userData.vrmHumanoid;if(n&&i){let r=new Pe({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:i,lookAt:e.userData.vrmLookAt,meta:n,materials:e.userData.vrmMToonMaterials,springBoneManager:e.userData.vrmSpringBoneManager,nodeConstraintManager:e.userData.vrmNodeConstraintManager});e.userData.vrm=r}})}};import*as je from"three";function wi(t){let e=new Set,n=new Map;t.traverse(r=>{if(r.type!=="SkinnedMesh")return;let o=r,a=n.get(o.geometry);a?e.delete(a):(n.set(o.geometry,o),e.add(o))});let i=[];e.forEach(r=>{let o=r.skeleton,a=i.find(h=>Oo(o,h));a||(a={bones:[],boneInverses:[],meshes:[]},i.push(a)),a.meshes.push(r);let l=o.bones.map(h=>a.bones.indexOf(h)),s=r.geometry,u=s.getAttribute("skinIndex"),d=s.getAttribute("skinWeight");for(let h=0;hs.bind(l,new je.Matrix4))}}function Oo(t,e){return t.bones.every((n,i)=>{let r=e.bones.indexOf(n);return r!==-1?No(t.boneInverses[i],e.boneInverses[r]):!0})}function No(t,e,n){if(n=n||1e-4,t.elements.length!=e.elements.length)return!1;for(let i=0,r=t.elements.length;in)return!1;return!0}function Si(t){if(Object.values(t).forEach(e=>{e!=null&&e.isTexture&&e.dispose()}),t.isShaderMaterial){let e=t.uniforms;e&&Object.values(e).forEach(n=>{let i=n.value;i!=null&&i.isTexture&&i.dispose()})}t.dispose()}function Bo(t){let e=t.geometry;e&&e.dispose();let n=t.skeleton;n&&n.dispose();let i=t.material;i&&(Array.isArray(i)?i.forEach(r=>Si(r)):i&&Si(i))}function Pi(t){t.traverse(Bo)}import*as Qe from"three";function Ai(t,e){var a;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");let n=(a=e==null?void 0:e.experimentalSameBoneCounts)!=null?a:!1,i=[];t.traverse(l=>{l.type==="SkinnedMesh"&&i.push(l)});let r=new Map,o=0;for(let l of i){let u=l.geometry.getAttribute("skinIndex"),d=[],h=[],p={};for(let m=0;m{var g,M,b,x;if(!n.isMesh)return;let i=n,r=i.geometry,o=r.index;if(o==null)return;let a=e.get(r);if(a!=null){i.geometry=a;return}let l=Object.values(r.attributes)[0].count,s=new Array(l),u=0,d=o.array;for(let _=0;_{c.addGroup(_.start,_.count,_.materialIndex)}),c.boundingBox=(M=(g=r.boundingBox)==null?void 0:g.clone())!=null?M:null,c.boundingSphere=(x=(b=r.boundingSphere)==null?void 0:b.clone())!=null?x:null,c.setDrawRange(r.drawRange.start,r.drawRange.count),c.userData=r.userData,e.set(r,c);{let _=o.array,v=new _.constructor(_.length);for(let E=0;E<_.length;E++){let R=_[E],S=h[R];v[E]=S}c.setIndex(new yt(v,1,!1))}Object.keys(r.attributes).forEach(_=>{let v=r.attributes[_];if(v.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");let E=v.array,{itemSize:R,normalized:S}=v,A=new E.constructor(p.length*R);p.forEach((P,w)=>{for(let L=0;L{c.morphAttributes[_]=[];let v=r.morphAttributes[_];for(let E=0;E{for(let W=0;WL===0),c.morphAttributes[_][E]=new yt(w,A,P)}}),f&&(c.morphAttributes={}),i.geometry=c}),Array.from(e.keys()).forEach(n=>{n.dispose()})}function bi(t){var e;((e=t.meta)==null?void 0:e.metaVersion)==="0"&&(t.scene.rotation.y=Math.PI)}var ce=class{constructor(){}};ce.combineSkeletons=wi,ce.deepDispose=Pi,ce.removeUnnecessaryJoints=Ai,ce.removeUnnecessaryVertices=Hi,ce.rotateVRM0=bi;export{Gr as MToonMaterial,Wr as MToonMaterialDebugMode,$n as MToonMaterialLoaderPlugin,Qn as MToonMaterialOutlineWidthMode,Pe as VRM,lo as VRMAimConstraint,ct as VRMCore,Xo as VRMCoreLoaderPlugin,nn as VRMExpression,ot as VRMExpressionLoaderPlugin,sn as VRMExpressionManager,an as VRMExpressionMaterialColorBind,ye as VRMExpressionMaterialColorType,ln as VRMExpressionMorphTargetBind,zo as VRMExpressionOverrideType,Ke as VRMExpressionPresetName,dn as VRMExpressionTextureTransformBind,hn as VRMFirstPerson,at as VRMFirstPersonLoaderPlugin,Go as VRMFirstPersonMeshAnnotationType,qe as VRMHumanBoneList,jo as VRMHumanBoneName,pr as VRMHumanBoneParentMap,_n as VRMHumanoid,mn as VRMHumanoidHelper,lt as VRMHumanoidLoaderPlugin,xt as VRMLoaderPlugin,Lr as VRMLookAt,De as VRMLookAtBoneApplier,it as VRMLookAtExpressionApplier,Rr as VRMLookAtHelper,dt as VRMLookAtLoaderPlugin,wn as VRMLookAtRangeMap,Qo as VRMLookAtTypeName,ht as VRMMetaLoaderPlugin,gt as VRMNodeConstraint,ft as VRMNodeConstraintHelper,li as VRMNodeConstraintLoaderPlugin,ho as VRMNodeConstraintManager,_r as VRMRequiredHumanBoneName,vo as VRMRollConstraint,mo as VRMRotationConstraint,Rt as VRMSpringBoneCollider,Mt as VRMSpringBoneColliderHelper,Tt as VRMSpringBoneColliderShape,mi as VRMSpringBoneColliderShapeCapsule,fi as VRMSpringBoneColliderShapePlane,gi as VRMSpringBoneColliderShapeSphere,Vo as VRMSpringBoneJoint,So as VRMSpringBoneJointHelper,yi as VRMSpringBoneLoaderPlugin,ci as VRMSpringBoneManager,ce as VRMUtils}; +`;n.vertexShader=r+n.vertexShader,n.fragmentShader=r+n.fragmentShader,i<154&&(n.fragmentShader=n.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(t){this.uniforms.litFactor.value=t}get map(){return this.uniforms.map.value}set map(t){this.uniforms.map.value=t}get normalMap(){return this.uniforms.normalMap.value}set normalMap(t){this.uniforms.normalMap.value=t}get normalScale(){return this.uniforms.normalScale.value}set normalScale(t){this.uniforms.normalScale.value=t}get emissive(){return this.uniforms.emissive.value}set emissive(t){this.uniforms.emissive.value=t}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(t){this.uniforms.emissiveIntensity.value=t}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(t){this.uniforms.emissiveMap.value=t}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(t){this.uniforms.shadeColorFactor.value=t}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(t){this.uniforms.shadeMultiplyTexture.value=t}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(t){this.uniforms.shadingShiftFactor.value=t}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(t){this.uniforms.shadingShiftTexture.value=t}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(t){this.uniforms.shadingShiftTextureScale.value=t}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(t){this.uniforms.shadingToonyFactor.value=t}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(t){this.uniforms.giEqualizationFactor.value=t}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(t){this.uniforms.matcapFactor.value=t}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(t){this.uniforms.matcapTexture.value=t}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(t){this.uniforms.parametricRimColorFactor.value=t}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(t){this.uniforms.rimMultiplyTexture.value=t}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(t){this.uniforms.rimLightingMixFactor.value=t}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(t){this.uniforms.parametricRimFresnelPowerFactor.value=t}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(t){this.uniforms.parametricRimLiftFactor.value=t}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(t){this.uniforms.outlineWidthMultiplyTexture.value=t}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(t){this.uniforms.outlineWidthFactor.value=t}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(t){this.uniforms.outlineColorFactor.value=t}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(t){this.uniforms.outlineLightingMixFactor.value=t}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(t){this.uniforms.uvAnimationMaskTexture.value=t}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(t){this.uniforms.uvAnimationScrollXOffset.value=t}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(t){this.uniforms.uvAnimationScrollYOffset.value=t}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(t){this.uniforms.uvAnimationRotationPhase.value=t}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(t){this._ignoreVertexColor=t,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(t){this._v0CompatShade=t,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(t){this._debugMode=t,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(t){this._outlineWidthMode=t,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(t){this._isOutline=t,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(t){this._uploadUniformsWorkaround(),this._updateUVAnimation(t)}copy(t){return super.copy(t),this.map=t.map,this.normalMap=t.normalMap,this.emissiveMap=t.emissiveMap,this.shadeMultiplyTexture=t.shadeMultiplyTexture,this.shadingShiftTexture=t.shadingShiftTexture,this.matcapTexture=t.matcapTexture,this.rimMultiplyTexture=t.rimMultiplyTexture,this.outlineWidthMultiplyTexture=t.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=t.uvAnimationMaskTexture,this.normalMapType=t.normalMapType,this.uvAnimationScrollXSpeedFactor=t.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=t.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=t.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=t.ignoreVertexColor,this.v0CompatShade=t.v0CompatShade,this.debugMode=t.debugMode,this.outlineWidthMode=t.outlineWidthMode,this.isOutline=t.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(t){this.uniforms.uvAnimationScrollXOffset.value+=t*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=t*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=t*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){let t=parseInt(y.REVISION,10),e=this.outlineWidthMultiplyTexture!==null,n=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:t,OUTLINE:this._isOutline,MTOON_USE_UV:e||n,MTOON_UVS_VERTEX_ONLY:e&&!n,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===qn.ScreenCoordinates}}_updateTextureMatrix(t,e){t.value&&(t.value.matrixAutoUpdate&&t.value.updateMatrix(),e.value.copy(t.value.matrix))}},jr=new Set(["1.0","1.0-beta"]),Kn=class ke{get name(){return ke.EXTENSION_NAME}constructor(e,n={}){var i,r,o,a;this.parser=e,this.materialType=(i=n.materialType)!=null?i:Gr,this.renderOrderOffset=(r=n.renderOrderOffset)!=null?r:0,this.v0CompatShade=(o=n.v0CompatShade)!=null?o:!1,this.debugMode=(a=n.debugMode)!=null?a:"none",this._mToonMaterialSet=new Set}beforeRoot(){return le(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return le(this,null,function*(){e.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(e){return this._getMToonExtension(e)?this.materialType:null}extendMaterialParams(e,n){let i=this._getMToonExtension(e);return i?this._extendMaterialParams(i,n):null}loadMesh(e){return le(this,null,function*(){var n;let i=this.parser,o=(n=i.json.meshes)==null?void 0:n[e];if(o==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${e}] of glTF but the mesh doesn't exist`);let a=o.primitives,l=yield i.loadMesh(e);if(a.length===1){let s=l,u=a[0].material;u!=null&&this._setupPrimitive(s,u)}else{let s=l;for(let u=0;u{var a;this._getMToonExtension(o)&&((a=r.extensions)!=null&&a.KHR_materials_unlit)&&delete r.extensions.KHR_materials_unlit})}_getMToonExtension(e){var n,i;let a=(n=this.parser.json.materials)==null?void 0:n[e];if(a==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}let l=(i=a.extensions)==null?void 0:i[ke.EXTENSION_NAME];if(l==null)return;let s=l.specVersion;if(!jr.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${ke.EXTENSION_NAME} specVersion "${s}"`);return}return l}_extendMaterialParams(e,n){return le(this,null,function*(){var i;delete n.metalness,delete n.roughness;let r=new Dr(this.parser,n);r.assignPrimitive("transparentWithZWrite",e.transparentWithZWrite),r.assignColor("shadeColorFactor",e.shadeColorFactor),r.assignTexture("shadeMultiplyTexture",e.shadeMultiplyTexture,!0),r.assignPrimitive("shadingShiftFactor",e.shadingShiftFactor),r.assignTexture("shadingShiftTexture",e.shadingShiftTexture,!0),r.assignPrimitive("shadingShiftTextureScale",(i=e.shadingShiftTexture)==null?void 0:i.scale),r.assignPrimitive("shadingToonyFactor",e.shadingToonyFactor),r.assignPrimitive("giEqualizationFactor",e.giEqualizationFactor),r.assignColor("matcapFactor",e.matcapFactor),r.assignTexture("matcapTexture",e.matcapTexture,!0),r.assignColor("parametricRimColorFactor",e.parametricRimColorFactor),r.assignTexture("rimMultiplyTexture",e.rimMultiplyTexture,!0),r.assignPrimitive("rimLightingMixFactor",e.rimLightingMixFactor),r.assignPrimitive("parametricRimFresnelPowerFactor",e.parametricRimFresnelPowerFactor),r.assignPrimitive("parametricRimLiftFactor",e.parametricRimLiftFactor),r.assignPrimitive("outlineWidthMode",e.outlineWidthMode),r.assignPrimitive("outlineWidthFactor",e.outlineWidthFactor),r.assignTexture("outlineWidthMultiplyTexture",e.outlineWidthMultiplyTexture,!1),r.assignColor("outlineColorFactor",e.outlineColorFactor),r.assignPrimitive("outlineLightingMixFactor",e.outlineLightingMixFactor),r.assignTexture("uvAnimationMaskTexture",e.uvAnimationMaskTexture,!1),r.assignPrimitive("uvAnimationScrollXSpeedFactor",e.uvAnimationScrollXSpeedFactor),r.assignPrimitive("uvAnimationScrollYSpeedFactor",e.uvAnimationScrollYSpeedFactor),r.assignPrimitive("uvAnimationRotationSpeedFactor",e.uvAnimationRotationSpeedFactor),r.assignPrimitive("v0CompatShade",this.v0CompatShade),r.assignPrimitive("debugMode",this.debugMode),yield r.pending})}_setupPrimitive(e,n){let i=this._getMToonExtension(n);if(i){let r=this._parseRenderOrder(i);e.renderOrder=r+this.renderOrderOffset,this._generateOutline(e),this._addToMaterialSet(e);return}}_shouldGenerateOutline(e){return typeof e.outlineWidthMode=="string"&&e.outlineWidthMode!=="none"&&typeof e.outlineWidthFactor=="number"&&e.outlineWidthFactor>0}_generateOutline(e){let n=e.material;if(!(n instanceof We.Material)||!this._shouldGenerateOutline(n))return;e.material=[n];let i=n.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=We.BackSide,e.material.push(i);let r=e.geometry,o=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,o,0),r.addGroup(0,o,1)}_addToMaterialSet(e){let n=e.material,i=new Set;Array.isArray(n)?n.forEach(r=>i.add(r)):i.add(n);for(let r of i)this._mToonMaterialSet.add(r)}_parseRenderOrder(e){var n;return(e.transparentWithZWrite?0:19)+((n=e.renderQueueOffsetNumber)!=null?n:0)}};Kn.EXTENSION_NAME="VRMC_materials_mtoon";var ei=Kn;var Xr=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),ti=class ft{get name(){return ft.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,n){return Xr(this,null,function*(){let i=this._getHDREmissiveMultiplierExtension(e);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");let r=i.emissiveMultiplier;n.emissiveIntensity=r})}_getHDREmissiveMultiplierExtension(e){var n,i;let a=(n=this.parser.json.materials)==null?void 0:n[e];if(a==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${e}] of glTF but the material doesn't exist`);return}let l=(i=a.extensions)==null?void 0:i[ft.EXTENSION_NAME];if(l!=null)return l}};ti.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var ni=ti;import*as si from"three";var Qr=Object.defineProperty,Yr=Object.defineProperties,qr=Object.getOwnPropertyDescriptors,ii=Object.getOwnPropertySymbols,Zr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,ri=(t,e,n)=>e in t?Qr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j=(t,e)=>{for(var n in e||(e={}))Zr.call(e,n)&&ri(t,n,e[n]);if(ii)for(var n of ii(e))$r.call(e,n)&&ri(t,n,e[n]);return t},oi=(t,e)=>Yr(t,qr(e)),Jr=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())});function fe(t){return Math.pow(t,2.2)}var ai=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(t){var e;this.parser=t,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;let n=this.parser.json;n.extensionsUsed=(e=n.extensionsUsed)!=null?e:[],n.extensionsUsed.indexOf("KHR_texture_transform")===-1&&n.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return Jr(this,null,function*(){var t;let e=this.parser.json,n=(t=e.extensions)==null?void 0:t.VRM,i=n==null?void 0:n.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((r,o)=>{var a,l;let s=(a=e.materials)==null?void 0:a[o];if(s==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${o}] of glTF but the material doesn't exist`);return}if(r.shader==="VRM/MToon"){let u=this._parseV0MToonProperties(r,s);e.materials[o]=u}else if((l=r.shader)!=null&&l.startsWith("VRM/Unlit")){let u=this._parseV0UnlitProperties(r,s);e.materials[o]=u}else r.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${r.shader}`)}))})}_parseV0MToonProperties(t,e){var n,i,r,o,a,l,s,u,d,h,p,m,c,f,g,M,b,x,_,v,E,R,S,A,P,w,L,k,W,Ee,$,z,ce,Me,U,Lt,Ht,bt,Vt,It,Ct,Ut,Ot,Nt,Bt,Dt,Ft,kt,Wt,zt,Gt,jt,Xt,Qt,Yt;let qt=(i=(n=t.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,Vi=((r=t.floatProperties)==null?void 0:r._ZWrite)===1&&qt,Ii=this._v0ParseRenderQueue(t),Zt=(a=(o=t.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,Ci=qt?"BLEND":Zt?"MASK":"OPAQUE",Ui=Zt?(s=(l=t.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,Oi=((d=(u=t.floatProperties)==null?void 0:u._CullMode)!=null?d:2)===0,oe=this._portTextureTransform(t),Ni=((p=(h=t.vectorProperties)==null?void 0:h._Color)!=null?p:[1,1,1,1]).map((sn,ar)=>ar===3?sn:fe(sn)),$t=(m=t.textureProperties)==null?void 0:m._MainTex,Bi=$t!=null?{index:$t,extensions:j({},oe)}:void 0,Di=(f=(c=t.floatProperties)==null?void 0:c._BumpScale)!=null?f:1,Jt=(g=t.textureProperties)==null?void 0:g._BumpMap,Fi=Jt!=null?{index:Jt,scale:Di,extensions:j({},oe)}:void 0,ki=((b=(M=t.vectorProperties)==null?void 0:M._EmissionColor)!=null?b:[0,0,0,1]).map(fe),Kt=(x=t.textureProperties)==null?void 0:x._EmissionMap,Wi=Kt!=null?{index:Kt,extensions:j({},oe)}:void 0,zi=((v=(_=t.vectorProperties)==null?void 0:_._ShadeColor)!=null?v:[.97,.81,.86,1]).map(fe),en=(E=t.textureProperties)==null?void 0:E._ShadeTexture,Gi=en!=null?{index:en,extensions:j({},oe)}:void 0,Ie=(S=(R=t.floatProperties)==null?void 0:R._ShadeShift)!=null?S:0,Ce=(P=(A=t.floatProperties)==null?void 0:A._ShadeToony)!=null?P:.9;Ce=si.MathUtils.lerp(Ce,1,.5+.5*Ie),Ie=-Ie-(1-Ce);let tn=(L=(w=t.floatProperties)==null?void 0:w._IndirectLightIntensity)!=null?L:.1,ji=tn?1-tn:void 0,Ye=(k=t.textureProperties)==null?void 0:k._SphereAdd,Xi=Ye!=null?[1,1,1]:void 0,Qi=Ye!=null?{index:Ye}:void 0,Yi=(Ee=(W=t.floatProperties)==null?void 0:W._RimLightingMix)!=null?Ee:0,nn=($=t.textureProperties)==null?void 0:$._RimTexture,qi=nn!=null?{index:nn,extensions:j({},oe)}:void 0,Zi=((ce=(z=t.vectorProperties)==null?void 0:z._RimColor)!=null?ce:[0,0,0,1]).map(fe),$i=(U=(Me=t.floatProperties)==null?void 0:Me._RimFresnelPower)!=null?U:1,Ji=(Ht=(Lt=t.floatProperties)==null?void 0:Lt._RimLift)!=null?Ht:0,Ki=["none","worldCoordinates","screenCoordinates"][(Vt=(bt=t.floatProperties)==null?void 0:bt._OutlineWidthMode)!=null?Vt:0],qe=(Ct=(It=t.floatProperties)==null?void 0:It._OutlineWidth)!=null?Ct:0;qe=.01*qe;let rn=(Ut=t.textureProperties)==null?void 0:Ut._OutlineWidthTexture,er=rn!=null?{index:rn,extensions:j({},oe)}:void 0,tr=((Nt=(Ot=t.vectorProperties)==null?void 0:Ot._OutlineColor)!=null?Nt:[0,0,0]).map(fe),nr=((Dt=(Bt=t.floatProperties)==null?void 0:Bt._OutlineColorMode)!=null?Dt:0)===1?(kt=(Ft=t.floatProperties)==null?void 0:Ft._OutlineLightingMix)!=null?kt:1:0,on=(Wt=t.textureProperties)==null?void 0:Wt._UvAnimMaskTexture,ir=on!=null?{index:on,extensions:j({},oe)}:void 0,rr=(Gt=(zt=t.floatProperties)==null?void 0:zt._UvAnimScrollX)!=null?Gt:0,Ue=(Xt=(jt=t.floatProperties)==null?void 0:jt._UvAnimScrollY)!=null?Xt:0;Ue!=null&&(Ue=-Ue);let or=(Yt=(Qt=t.floatProperties)==null?void 0:Qt._UvAnimRotation)!=null?Yt:0,sr={specVersion:"1.0",transparentWithZWrite:Vi,renderQueueOffsetNumber:Ii,shadeColorFactor:zi,shadeMultiplyTexture:Gi,shadingShiftFactor:Ie,shadingToonyFactor:Ce,giEqualizationFactor:ji,matcapFactor:Xi,matcapTexture:Qi,rimLightingMixFactor:Yi,rimMultiplyTexture:qi,parametricRimColorFactor:Zi,parametricRimFresnelPowerFactor:$i,parametricRimLiftFactor:Ji,outlineWidthMode:Ki,outlineWidthFactor:qe,outlineWidthMultiplyTexture:er,outlineColorFactor:tr,outlineLightingMixFactor:nr,uvAnimationMaskTexture:ir,uvAnimationScrollXSpeedFactor:rr,uvAnimationScrollYSpeedFactor:Ue,uvAnimationRotationSpeedFactor:or};return oi(j({},e),{pbrMetallicRoughness:{baseColorFactor:Ni,baseColorTexture:Bi},normalTexture:Fi,emissiveTexture:Wi,emissiveFactor:ki,alphaMode:Ci,alphaCutoff:Ui,doubleSided:Oi,extensions:{VRMC_materials_mtoon:sr}})}_parseV0UnlitProperties(t,e){var n,i,r,o,a;let l=t.shader==="VRM/UnlitTransparentZWrite",s=t.shader==="VRM/UnlitTransparent"||l,u=this._v0ParseRenderQueue(t),d=t.shader==="VRM/UnlitCutout",h=s?"BLEND":d?"MASK":"OPAQUE",p=d?(i=(n=t.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,m=this._portTextureTransform(t),c=((o=(r=t.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(fe),f=(a=t.textureProperties)==null?void 0:a._MainTex,g=f!=null?{index:f,extensions:j({},m)}:void 0,M={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:c,shadeMultiplyTexture:g};return oi(j({},e),{pbrMetallicRoughness:{baseColorFactor:c,baseColorTexture:g},alphaMode:h,alphaCutoff:p,extensions:{VRMC_materials_mtoon:M}})}_portTextureTransform(t){var e,n,i,r,o;let a=(e=t.vectorProperties)==null?void 0:e._MainTex;if(a==null)return{};let l=[(n=a==null?void 0:a[0])!=null?n:0,(i=a==null?void 0:a[1])!=null?i:0],s=[(r=a==null?void 0:a[2])!=null?r:1,(o=a==null?void 0:a[3])!=null?o:1];return l[1]=1-s[1]-l[1],{KHR_texture_transform:{offset:l,scale:s}}}_v0ParseRenderQueue(t){var e,n;let i=t.shader==="VRM/UnlitTransparentZWrite",r=((e=t.keywordMap)==null?void 0:e._ALPHABLEND_ON)!=null||t.shader==="VRM/UnlitTransparent"||i,o=((n=t.floatProperties)==null?void 0:n._ZWrite)===1||i,a=0;if(r){let l=t.renderQueue;l!=null&&(o?a=this._renderQueueMapTransparentZWrite.get(l):a=this._renderQueueMapTransparent.get(l))}return a}_populateRenderQueueMap(t){let e=new Set,n=new Set;t.forEach(i=>{var r,o;let a=i.shader==="VRM/UnlitTransparentZWrite",l=((r=i.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||a,s=((o=i.floatProperties)==null?void 0:o._ZWrite)===1||a;if(l){let u=i.renderQueue;u!=null&&(s?n.add(u):e.add(u))}}),e.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${e.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),n.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${n.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(e).sort().forEach((i,r)=>{let o=Math.min(Math.max(r-e.size+1,-9),0);this._renderQueueMapTransparent.set(i,o)}),Array.from(n).sort().forEach((i,r)=>{let o=Math.min(Math.max(r,0),9);this._renderQueueMapTransparentZWrite.set(i,o)})}};import*as O from"three";import*as X from"three";import*as gt from"three";import*as Ae from"three";import*as q from"three";var li=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),ee=new O.Vector3,_t=class extends O.Group{constructor(t){super(),this._attrPosition=new O.BufferAttribute(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(O.DynamicDrawUsage);let e=new O.BufferGeometry;e.setAttribute("position",this._attrPosition);let n=new O.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new O.Line(e,n),this.add(this._line),this.constraint=t}updateMatrixWorld(t){ee.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,ee.x,ee.y,ee.z),this.constraint.source&&ee.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,ee.x,ee.y,ee.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(t)}};function ui(t,e){return e.set(t.elements[12],t.elements[13],t.elements[14])}var Kr=new gt.Vector3,eo=new gt.Vector3;function to(t,e){return t.decompose(Kr,e,eo),e}function ze(t){return t.invert?t.invert():t.inverse(),t}var vt=class{constructor(t,e){this.destination=t,this.source=e,this.weight=1}},no=new X.Vector3,io=new X.Vector3,ro=new X.Vector3,oo=new X.Quaternion,so=new X.Quaternion,ao=new X.Quaternion,lo=class extends vt{get aimAxis(){return this._aimAxis}set aimAxis(t){this._aimAxis=t,this._v3AimAxis.set(t==="PositiveX"?1:t==="NegativeX"?-1:0,t==="PositiveY"?1:t==="NegativeY"?-1:0,t==="PositiveZ"?1:t==="NegativeZ"?-1:0)}get dependencies(){let t=new Set([this.source]);return this.destination.parent&&t.add(this.destination.parent),t}constructor(t,e){super(t,e),this._aimAxis="PositiveX",this._v3AimAxis=new X.Vector3(1,0,0),this._dstRestQuat=new X.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let t=oo.identity(),e=so.identity();this.destination.parent&&(to(this.destination.parent.matrixWorld,t),ze(e.copy(t)));let n=no.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(t),i=ui(this.source.matrixWorld,io).sub(ui(this.destination.matrixWorld,ro)).normalize(),r=ao.setFromUnitVectors(n,i).premultiply(e).multiply(t).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function uo(t,e){let n=[t],i=t.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}var ho=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(t){this._constraints.add(t);let e=this._objectConstraintsMap.get(t.destination);e==null&&(e=new Set,this._objectConstraintsMap.set(t.destination,e)),e.add(t)}deleteConstraint(t){this._constraints.delete(t),this._objectConstraintsMap.get(t.destination).delete(t)}setInitState(){let t=new Set,e=new Set;for(let n of this._constraints)this._processConstraint(n,t,e,i=>i.setInitState())}update(){let t=new Set,e=new Set;for(let n of this._constraints)this._processConstraint(n,t,e,i=>i.update())}_processConstraint(t,e,n,i){if(n.has(t))return;if(e.has(t))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");e.add(t);let r=t.dependencies;for(let o of r)uo(o,a=>{let l=this._objectConstraintsMap.get(a);if(l)for(let s of l)this._processConstraint(s,e,n,i)});i(t),n.add(t)}},co=new Ae.Quaternion,po=new Ae.Quaternion,mo=class extends vt{get dependencies(){return new Set([this.source])}constructor(t,e){super(t,e),this._dstRestQuat=new Ae.Quaternion,this._invSrcRestQuat=new Ae.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),ze(this._invSrcRestQuat.copy(this.source.quaternion))}update(){let t=co.copy(this._invSrcRestQuat).multiply(this.source.quaternion),e=po.copy(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(e,this.weight)}},fo=new q.Vector3,_o=new q.Quaternion,go=new q.Quaternion,vo=class extends vt{get rollAxis(){return this._rollAxis}set rollAxis(t){this._rollAxis=t,this._v3RollAxis.set(t==="X"?1:0,t==="Y"?1:0,t==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(t,e){super(t,e),this._rollAxis="X",this._v3RollAxis=new q.Vector3(1,0,0),this._dstRestQuat=new q.Quaternion,this._invDstRestQuat=new q.Quaternion,this._invSrcRestQuatMulDstRestQuat=new q.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),ze(this._invDstRestQuat.copy(this._dstRestQuat)),ze(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){let t=_o.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),e=fo.copy(this._v3RollAxis).applyQuaternion(t),i=go.setFromUnitVectors(e,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},Eo=new Set(["1.0","1.0-beta"]),di=class Pe{get name(){return Pe.EXTENSION_NAME}constructor(e,n){this.parser=e,this.helperRoot=n==null?void 0:n.helperRoot}afterRoot(e){return li(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(e){return li(this,null,function*(){var n;let i=this.parser.json;if(!(((n=i.extensionsUsed)==null?void 0:n.indexOf(Pe.EXTENSION_NAME))!==-1))return null;let o=new ho,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;let d=i.nodes[s],h=(u=d==null?void 0:d.extensions)==null?void 0:u[Pe.EXTENSION_NAME];if(h==null)return;let p=h.specVersion;if(!Eo.has(p)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Pe.EXTENSION_NAME} specVersion "${p}"`);return}let m=h.constraint;if(m.roll!=null){let c=this._importRollConstraint(l,a,m.roll);o.addConstraint(c)}else if(m.aim!=null){let c=this._importAimConstraint(l,a,m.aim);o.addConstraint(c)}else if(m.rotation!=null){let c=this._importRotationConstraint(l,a,m.rotation);o.addConstraint(c)}}),e.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(e,n,i){let{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new vo(e,l);if(o!=null&&(s.rollAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new _t(s);this.helperRoot.add(u)}return s}_importAimConstraint(e,n,i){let{source:r,aimAxis:o,weight:a}=i,l=n[r],s=new lo(e,l);if(o!=null&&(s.aimAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new _t(s);this.helperRoot.add(u)}return s}_importRotationConstraint(e,n,i){let{source:r,weight:o}=i,a=n[r],l=new mo(e,a);if(o!=null&&(l.weight=o),this.helperRoot){let s=new _t(l);this.helperRoot.add(s)}return l}};di.EXTENSION_NAME="VRMC_node_constraint";var hi=di;import*as ne from"three";import*as Ve from"three";import*as ve from"three";import*as St from"three";import*as Z from"three";import*as te from"three";import*as de from"three";import*as ie from"three";import*as he from"three";import*as je from"three";import*as C from"three";import*as vi from"three";import*as Ei from"three";import*as B from"three";var Ge=(t,e,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(t,e)).next())}),wt=class{},Et=new Ve.Vector3,ue=new Ve.Vector3,fi=class extends wt{get type(){return"capsule"}constructor(t){var e,n,i,r;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new Ve.Vector3(0,0,0),this.tail=(n=t==null?void 0:t.tail)!=null?n:new Ve.Vector3(0,0,0),this.radius=(i=t==null?void 0:t.radius)!=null?i:0,this.inside=(r=t==null?void 0:t.inside)!=null?r:!1}calculateCollision(t,e,n,i){Et.setFromMatrixPosition(t),ue.subVectors(this.tail,this.offset).applyMatrix4(t),ue.sub(Et);let r=ue.lengthSq();i.copy(e).sub(Et);let o=ue.dot(i);o<=0||(r<=o||ue.multiplyScalar(o/r),i.sub(ue));let a=i.length(),l=this.inside?this.radius-n-a:a-n-this.radius;return l<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),l}},Mt=new ve.Vector3,ci=new ve.Matrix3,_i=class extends wt{get type(){return"plane"}constructor(t){var e,n;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new ve.Vector3(0,0,0),this.normal=(n=t==null?void 0:t.normal)!=null?n:new ve.Vector3(0,0,1)}calculateCollision(t,e,n,i){i.setFromMatrixPosition(t),i.negate().add(e),ci.getNormalMatrix(t),Mt.copy(this.normal).applyNormalMatrix(ci).normalize();let r=i.dot(Mt)-n;return i.copy(Mt),r}},Mo=new St.Vector3,gi=class extends wt{get type(){return"sphere"}constructor(t){var e,n,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new St.Vector3(0,0,0),this.radius=(n=t==null?void 0:t.radius)!=null?n:0,this.inside=(i=t==null?void 0:t.inside)!=null?i:!1}calculateCollision(t,e,n,i){i.subVectors(e,Mo.setFromMatrixPosition(t));let r=i.length(),o=this.inside?this.radius-n-r:r-n-this.radius;return o<0&&(i.multiplyScalar(1/r),this.inside&&i.negate()),o}},Q=new Z.Vector3,Ro=class extends Z.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Z.Vector3,this._currentTail=new Z.Vector3,this._shape=t,this._attrPos=new Z.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new Z.BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0);let n=Q.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),t=!0),t&&this._buildPosition()}_buildPosition(){Q.copy(this._currentTail).sub(this._currentOffset);let t=Q.length()/this._currentRadius;for(let i=0;i<=16;i++){let r=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(r),-Math.cos(r),0),this._attrPos.setXYZ(17+i,t+Math.sin(r),Math.cos(r),0),this._attrPos.setXYZ(34+i,-Math.sin(r),0,-Math.cos(r)),this._attrPos.setXYZ(51+i,t+Math.sin(r),0,Math.cos(r))}for(let i=0;i<32;i++){let r=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(r),Math.cos(r)),this._attrPos.setXYZ(100+i,t,Math.sin(r),Math.cos(r))}let e=Math.atan2(Q.y,Math.sqrt(Q.x*Q.x+Q.z*Q.z)),n=-Math.atan2(Q.z,Q.x);this.rotateZ(e),this.rotateY(n),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<34;t++){let e=(t+1)%34;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(68+t*2,34+t,34+e)}for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(136+t*2,68+t,68+e),this._attrIndex.setXY(200+t*2,100+t,100+e)}this._attrIndex.needsUpdate=!0}},To=class extends te.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentOffset=new te.Vector3,this._currentNormal=new te.Vector3,this._shape=t,this._attrPos=new te.BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new te.BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),t=!0),t&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},xo=class extends de.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new de.Vector3,this._shape=t,this._attrPos=new de.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new de.BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._shape.radius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.needsUpdate=!0}},yo=new ne.Vector3,Rt=class extends ne.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof gi)this._geometry=new xo(this.collider.shape);else if(this.collider.shape instanceof fi)this._geometry=new Ro(this.collider.shape);else if(this.collider.shape instanceof _i)this._geometry=new To(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");let e=new ne.LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new ne.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=yo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},wo=class extends he.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new he.Vector3,this._springBone=t,this._attrPos=new he.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new he.BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let t=!1,e=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==e&&(this._currentRadius=e,t=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),t=!0),t&&this._buildPosition()}_buildPosition(){for(let t=0;t<32;t++){let e=t/16*Math.PI;this._attrPos.setXYZ(t,Math.cos(e),Math.sin(e),0),this._attrPos.setXYZ(32+t,0,Math.cos(e),Math.sin(e)),this._attrPos.setXYZ(64+t,Math.sin(e),0,Math.cos(e))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let t=0;t<32;t++){let e=(t+1)%32;this._attrIndex.setXY(t*2,t,e),this._attrIndex.setXY(64+t*2,32+t,32+e),this._attrIndex.setXY(128+t*2,64+t,64+e)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},So=new ie.Vector3,Po=class extends ie.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new wo(this.springBone);let e=new ie.LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new ie.LineSegments(this._geometry,e),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(t){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let e=this.matrix.elements;this._geometry.worldScale=So.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},Tt=class extends je.Object3D{constructor(t){super(),this.colliderMatrix=new je.Matrix4,this.shape=t}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),Ao(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function Ao(t,e,n){let i=e.elements;t.copy(e),n&&(t.elements[12]=i[0]*n.x+i[4]*n.y+i[8]*n.z+i[12],t.elements[13]=i[1]*n.x+i[5]*n.y+i[9]*n.z+i[13],t.elements[14]=i[2]*n.x+i[6]*n.y+i[10]*n.z+i[14])}var Lo=new Ei.Matrix4;function Ho(t){return t.invert?t.invert():t.getInverse(Lo.copy(t)),t}var bo=class{constructor(t){this._inverseCache=new vi.Matrix4,this._shouldUpdateInverse=!0,this.matrix=t;let e={set:(n,i,r)=>(this._shouldUpdateInverse=!0,n[i]=r,!0)};this._originalElements=t.elements,t.elements=new Proxy(t.elements,e)}get inverse(){return this._shouldUpdateInverse&&(Ho(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},xt=new C.Matrix4,_e=new C.Vector3,Le=new C.Vector3,He=new C.Vector3,be=new C.Vector3,Vo=new C.Matrix4,Io=class{constructor(t,e,n={},i=[]){this._currentTail=new C.Vector3,this._prevTail=new C.Vector3,this._boneAxis=new C.Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new C.Matrix4,this._initialLocalRotation=new C.Quaternion,this._initialLocalChildPosition=new C.Vector3;var r,o,a,l,s,u;this.bone=t,this.bone.matrixAutoUpdate=!1,this.child=e,this.settings={hitRadius:(r=n.hitRadius)!=null?r:0,stiffness:(o=n.stiffness)!=null?o:1,gravityPower:(a=n.gravityPower)!=null?a:0,gravityDir:(s=(l=n.gravityDir)==null?void 0:l.clone())!=null?s:new C.Vector3(0,-1,0),dragForce:(u=n.dragForce)!=null?u:.4},this.colliderGroups=i}get dependencies(){let t=new Set,e=this.bone.parent;e&&t.add(e);for(let n=0;n{e(r)})}function yt(t,e){t.children.forEach(n=>{e(n)||yt(n,e)})}function Uo(t){var e;let n=new Map;for(let i of t){let r=i;do{let o=((e=n.get(r))!=null?e:0)+1;if(o===t.size)return r;n.set(r,o),r=r.parent}while(r!==null)}return null}var pi=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){let t=new Set;return this._joints.forEach(e=>{e.colliderGroups.forEach(n=>{t.add(n)})}),Array.from(t)}get colliders(){let t=new Set;return this.colliderGroups.forEach(e=>{e.colliders.forEach(n=>{t.add(n)})}),Array.from(t)}addJoint(t){this._joints.add(t);let e=this._objectSpringBonesMap.get(t.bone);e==null&&(e=new Set,this._objectSpringBonesMap.set(t.bone,e)),e.add(t),this._sortJoints()}addSpringBone(t){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(t)}deleteJoint(t){this._joints.delete(t),this._objectSpringBonesMap.get(t.bone).delete(t),this._sortJoints()}deleteSpringBone(t){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(t)}setInitState(){for(let t=0;t{var a,l;return((l=(a=this._objectSpringBonesMap.get(o))==null?void 0:a.size)!=null?l:0)>0?!0:(this._ancestors.push(o),!1)}))}_insertJointSort(t,e,n,i,r){if(n.has(t))return;if(e.has(t)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}let o=t.dependencies;for(let a of o){let l=!1,s=null;Co(a,u=>{let d=this._objectSpringBonesMap.get(u);if(d)for(let h of d)l=!0,this._insertJointSort(h,e,n,i,r);else l||(s=u)}),s&&r.add(s)}i.push(t),n.add(t)}_relevantChildrenUpdated(t){var e,n;return((n=(e=this._objectSpringBonesMap.get(t))==null?void 0:e.size)!=null?n:0)>0?!0:(t.updateWorldMatrix(!1,!1),!1)}},mi="VRMC_springBone_extended_collider",Oo=new Set(["1.0","1.0-beta"]),No=new Set(["1.0"]),Mi=class ge{get name(){return ge.EXTENSION_NAME}constructor(e,n){var i;this.parser=e,this.jointHelperRoot=n==null?void 0:n.jointHelperRoot,this.colliderHelperRoot=n==null?void 0:n.colliderHelperRoot,this.useExtendedColliders=(i=n==null?void 0:n.useExtendedColliders)!=null?i:!0}afterRoot(e){return Ge(this,null,function*(){e.userData.vrmSpringBoneManager=yield this._import(e)})}_import(e){return Ge(this,null,function*(){let n=yield this._v1Import(e);if(n!=null)return n;let i=yield this._v0Import(e);return i!=null?i:null})}_v1Import(e){return Ge(this,null,function*(){var n,i,r,o,a;let l=e.parser.json;if(!(((n=l.extensionsUsed)==null?void 0:n.indexOf(ge.EXTENSION_NAME))!==-1))return null;let u=new pi,d=yield e.parser.getDependencies("node"),h=(i=l.extensions)==null?void 0:i[ge.EXTENSION_NAME];if(!h)return null;let p=h.specVersion;if(!Oo.has(p))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${ge.EXTENSION_NAME} specVersion "${p}"`),null;let m=(r=h.colliders)==null?void 0:r.map((f,g)=>{var M,b,x,_,v,E,R,S,A,P,w,L,k,W,Ee;let $=d[f.node],z=f.shape,ce=(M=f.extensions)==null?void 0:M[mi];if(this.useExtendedColliders&&ce!=null){let Me=ce.specVersion;if(!No.has(Me))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${mi} specVersion "${Me}". Fallbacking to the ${ge.EXTENSION_NAME} definition`);else{let U=ce.shape;if(U.sphere)return this._importSphereCollider($,{offset:new B.Vector3().fromArray((b=U.sphere.offset)!=null?b:[0,0,0]),radius:(x=U.sphere.radius)!=null?x:0,inside:(_=U.sphere.inside)!=null?_:!1});if(U.capsule)return this._importCapsuleCollider($,{offset:new B.Vector3().fromArray((v=U.capsule.offset)!=null?v:[0,0,0]),radius:(E=U.capsule.radius)!=null?E:0,tail:new B.Vector3().fromArray((R=U.capsule.tail)!=null?R:[0,0,0]),inside:(S=U.capsule.inside)!=null?S:!1});if(U.plane)return this._importPlaneCollider($,{offset:new B.Vector3().fromArray((A=U.plane.offset)!=null?A:[0,0,0]),normal:new B.Vector3().fromArray((P=U.plane.normal)!=null?P:[0,0,1])})}}if(z.sphere)return this._importSphereCollider($,{offset:new B.Vector3().fromArray((w=z.sphere.offset)!=null?w:[0,0,0]),radius:(L=z.sphere.radius)!=null?L:0,inside:!1});if(z.capsule)return this._importCapsuleCollider($,{offset:new B.Vector3().fromArray((k=z.capsule.offset)!=null?k:[0,0,0]),radius:(W=z.capsule.radius)!=null?W:0,tail:new B.Vector3().fromArray((Ee=z.capsule.tail)!=null?Ee:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),c=(o=h.colliderGroups)==null?void 0:o.map((f,g)=>{var M;return{colliders:((M=f.colliders)!=null?M:[]).map(x=>{let _=m==null?void 0:m[x];if(_==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${x} but not found`);return _}),name:f.name}});return(a=h.springs)==null||a.forEach((f,g)=>{var M;let b=f.joints,x=(M=f.colliderGroups)==null?void 0:M.map(E=>{let R=c==null?void 0:c[E];if(R==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${E} but not found`);return R}),_=f.center!=null?d[f.center]:void 0,v;b.forEach(E=>{if(v){let R=v.node,S=d[R],A=E.node,P=d[A],w={hitRadius:v.hitRadius,dragForce:v.dragForce,gravityPower:v.gravityPower,stiffness:v.stiffness,gravityDir:v.gravityDir!=null?new B.Vector3().fromArray(v.gravityDir):void 0},L=this._importJoint(S,P,w,x);_&&(L.center=_),u.addJoint(L)}v=E})}),u.setInitState(),u})}_v0Import(e){return Ge(this,null,function*(){var n,i,r;let o=e.parser.json;if(!(((n=o.extensionsUsed)==null?void 0:n.indexOf("VRM"))!==-1))return null;let l=(i=o.extensions)==null?void 0:i.VRM,s=l==null?void 0:l.secondaryAnimation;if(!s)return null;let u=s==null?void 0:s.boneGroups;if(!u)return null;let d=new pi,h=yield e.parser.getDependencies("node"),p=(r=s.colliderGroups)==null?void 0:r.map(m=>{var c;let f=h[m.node];return{colliders:((c=m.colliders)!=null?c:[]).map((M,b)=>{var x,_,v;let E=new B.Vector3(0,0,0);return M.offset&&E.set((x=M.offset.x)!=null?x:0,(_=M.offset.y)!=null?_:0,M.offset.z?-M.offset.z:0),this._importSphereCollider(f,{offset:E,radius:(v=M.radius)!=null?v:0,inside:!1})})}});return u==null||u.forEach((m,c)=>{let f=m.bones;f&&f.forEach(g=>{var M,b,x,_;let v=h[g],E=new B.Vector3;m.gravityDir?E.set((M=m.gravityDir.x)!=null?M:0,(b=m.gravityDir.y)!=null?b:0,(x=m.gravityDir.z)!=null?x:0):E.set(0,-1,0);let R=m.center!=null?h[m.center]:void 0,S={hitRadius:m.hitRadius,dragForce:m.dragForce,gravityPower:m.gravityPower,stiffness:m.stiffiness,gravityDir:E},A=(_=m.colliderGroups)==null?void 0:_.map(P=>{let w=p==null?void 0:p[P];if(w==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${c} attempted to use a colliderGroup ${P} but not found`);return w});v.traverse(P=>{var w;let L=(w=P.children[0])!=null?w:null,k=this._importJoint(P,L,S,A);R&&(k.center=R),d.addJoint(k)})})}),e.scene.updateMatrixWorld(),d.setInitState(),d})}_importJoint(e,n,i,r){let o=new Io(e,n,i,r);if(this.jointHelperRoot){let a=new Po(o);this.jointHelperRoot.add(a),a.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(e,n){let i=new gi(n),r=new Tt(i);if(e.add(r),this.colliderHelperRoot){let o=new Rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importCapsuleCollider(e,n){let i=new fi(n),r=new Tt(i);if(e.add(r),this.colliderHelperRoot){let o=new Rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importPlaneCollider(e,n){let i=new _i(n),r=new Tt(i);if(e.add(r),this.colliderHelperRoot){let o=new Rt(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}};Mi.EXTENSION_NAME="VRMC_springBone";var Ri=Mi;var Pt=class{get name(){return"VRMLoaderPlugin"}constructor(e,n){var o,a,l,s,u,d,h,p,m,c;this.parser=e;let i=n==null?void 0:n.helperRoot,r=n==null?void 0:n.autoUpdateHumanBones;this.expressionPlugin=(o=n==null?void 0:n.expressionPlugin)!=null?o:new st(e),this.firstPersonPlugin=(a=n==null?void 0:n.firstPersonPlugin)!=null?a:new lt(e),this.humanoidPlugin=(l=n==null?void 0:n.humanoidPlugin)!=null?l:new ut(e,{helperRoot:i,autoUpdateHumanBones:r}),this.lookAtPlugin=(s=n==null?void 0:n.lookAtPlugin)!=null?s:new ht(e,{helperRoot:i}),this.metaPlugin=(u=n==null?void 0:n.metaPlugin)!=null?u:new ct(e),this.mtoonMaterialPlugin=(d=n==null?void 0:n.mtoonMaterialPlugin)!=null?d:new ei(e),this.materialsHDREmissiveMultiplierPlugin=(h=n==null?void 0:n.materialsHDREmissiveMultiplierPlugin)!=null?h:new ni(e),this.materialsV0CompatPlugin=(p=n==null?void 0:n.materialsV0CompatPlugin)!=null?p:new ai(e),this.springBonePlugin=(m=n==null?void 0:n.springBonePlugin)!=null?m:new Ri(e,{colliderHelperRoot:i,jointHelperRoot:i}),this.nodeConstraintPlugin=(c=n==null?void 0:n.nodeConstraintPlugin)!=null?c:new hi(e,{helperRoot:i})}beforeRoot(){return Re(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return Re(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){let n=this.mtoonMaterialPlugin.getMaterialType(e);return n!=null?n:null}extendMaterialParams(e,n){return Re(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,n),yield this.mtoonMaterialPlugin.extendMaterialParams(e,n)})}afterRoot(e){return Re(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e),yield this.springBonePlugin.afterRoot(e),yield this.nodeConstraintPlugin.afterRoot(e),yield this.mtoonMaterialPlugin.afterRoot(e);let n=e.userData.vrmMeta,i=e.userData.vrmHumanoid;if(n&&i){let r=new Se({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:i,lookAt:e.userData.vrmLookAt,meta:n,materials:e.userData.vrmMToonMaterials,springBoneManager:e.userData.vrmSpringBoneManager,nodeConstraintManager:e.userData.vrmNodeConstraintManager});e.userData.vrm=r}})}};import*as xi from"three";function Bo(t){let e=new Set;return t.traverse(n=>{if(!n.isMesh)return;let i=n;e.add(i)}),e}function Ti(t,e,n){let i=new Float32Array(t[0].count*3),r=0;if(n)r=1;else for(let a of e)r+=a.weight;for(let a of e){let l=t[a.index],s=a.weight/r;for(let u=0;u{if(r.type!=="SkinnedMesh")return;let o=r,a=n.get(o.geometry);a?e.delete(a):(n.set(o.geometry,o),e.add(o))});let i=[];e.forEach(r=>{let o=r.skeleton,a=i.find(h=>Do(o,h));a||(a={bones:[],boneInverses:[],meshes:[]},i.push(a)),a.meshes.push(r);let l=o.bones.map(h=>a.bones.indexOf(h)),s=r.geometry,u=s.getAttribute("skinIndex"),d=s.getAttribute("skinWeight");for(let h=0;hs.bind(l,new Xe.Matrix4))}}function Do(t,e){return t.bones.every((n,i)=>{let r=e.bones.indexOf(n);return r!==-1?Fo(t.boneInverses[i],e.boneInverses[r]):!0})}function Fo(t,e,n){if(n=n||1e-4,t.elements.length!=e.elements.length)return!1;for(let i=0,r=t.elements.length;in)return!1;return!0}function Si(t){if(Object.values(t).forEach(e=>{e!=null&&e.isTexture&&e.dispose()}),t.isShaderMaterial){let e=t.uniforms;e&&Object.values(e).forEach(n=>{let i=n.value;i!=null&&i.isTexture&&i.dispose()})}t.dispose()}function ko(t){let e=t.geometry;e&&e.dispose();let n=t.skeleton;n&&n.dispose();let i=t.material;i&&(Array.isArray(i)?i.forEach(r=>Si(r)):i&&Si(i))}function Pi(t){t.traverse(ko)}import*as Qe from"three";function Ai(t,e){var a;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");let n=(a=e==null?void 0:e.experimentalSameBoneCounts)!=null?a:!1,i=[];t.traverse(l=>{l.type==="SkinnedMesh"&&i.push(l)});let r=new Map,o=0;for(let l of i){let u=l.geometry.getAttribute("skinIndex"),d=[],h=[],p={};for(let m=0;m{var g,M,b,x;if(!n.isMesh)return;let i=n,r=i.geometry,o=r.index;if(o==null)return;let a=e.get(r);if(a!=null){i.geometry=a;return}let l=Object.values(r.attributes)[0].count,s=new Array(l),u=0,d=o.array;for(let _=0;_{c.addGroup(_.start,_.count,_.materialIndex)}),c.boundingBox=(M=(g=r.boundingBox)==null?void 0:g.clone())!=null?M:null,c.boundingSphere=(x=(b=r.boundingSphere)==null?void 0:b.clone())!=null?x:null,c.setDrawRange(r.drawRange.start,r.drawRange.count),c.userData=r.userData,e.set(r,c);{let _=o.array,v=new _.constructor(_.length);for(let E=0;E<_.length;E++){let R=_[E],S=h[R];v[E]=S}c.setIndex(new At(v,1,!1))}Object.keys(r.attributes).forEach(_=>{let v=r.attributes[_];if(v.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");let E=v.array,{itemSize:R,normalized:S}=v,A=new E.constructor(p.length*R);p.forEach((P,w)=>{for(let L=0;L{c.morphAttributes[_]=[];let v=r.morphAttributes[_];for(let E=0;E{for(let W=0;WL===0),c.morphAttributes[_][E]=new At(w,A,P)}}),f&&(c.morphAttributes={}),i.geometry=c}),Array.from(e.keys()).forEach(n=>{n.dispose()})}function bi(t){var e;((e=t.meta)==null?void 0:e.metaVersion)==="0"&&(t.scene.rotation.y=Math.PI)}var re=class{constructor(){}};re.combineMorphs=yi,re.combineSkeletons=wi,re.deepDispose=Pi,re.removeUnnecessaryJoints=Ai,re.removeUnnecessaryVertices=Hi,re.rotateVRM0=bi;export{Gr as MToonMaterial,Wr as MToonMaterialDebugMode,ei as MToonMaterialLoaderPlugin,qn as MToonMaterialOutlineWidthMode,Se as VRM,lo as VRMAimConstraint,pt as VRMCore,Zo as VRMCoreLoaderPlugin,an as VRMExpression,st as VRMExpressionLoaderPlugin,dn as VRMExpressionManager,hn as VRMExpressionMaterialColorBind,Te as VRMExpressionMaterialColorType,ye as VRMExpressionMorphTargetBind,Xo as VRMExpressionOverrideType,et as VRMExpressionPresetName,pn as VRMExpressionTextureTransformBind,mn as VRMFirstPerson,lt as VRMFirstPersonLoaderPlugin,Qo as VRMFirstPersonMeshAnnotationType,Ze as VRMHumanBoneList,Yo as VRMHumanBoneName,pr as VRMHumanBoneParentMap,En as VRMHumanoid,gn as VRMHumanoidHelper,ut as VRMHumanoidLoaderPlugin,Pt as VRMLoaderPlugin,Lr as VRMLookAt,De as VRMLookAtBoneApplier,rt as VRMLookAtExpressionApplier,Rr as VRMLookAtHelper,ht as VRMLookAtLoaderPlugin,An as VRMLookAtRangeMap,qo as VRMLookAtTypeName,ct as VRMMetaLoaderPlugin,vt as VRMNodeConstraint,_t as VRMNodeConstraintHelper,hi as VRMNodeConstraintLoaderPlugin,ho as VRMNodeConstraintManager,_r as VRMRequiredHumanBoneName,vo as VRMRollConstraint,mo as VRMRotationConstraint,Tt as VRMSpringBoneCollider,Rt as VRMSpringBoneColliderHelper,wt as VRMSpringBoneColliderShape,fi as VRMSpringBoneColliderShapeCapsule,_i as VRMSpringBoneColliderShapePlane,gi as VRMSpringBoneColliderShapeSphere,Io as VRMSpringBoneJoint,Po as VRMSpringBoneJointHelper,Ri as VRMSpringBoneLoaderPlugin,pi as VRMSpringBoneManager,re as VRMUtils}; /*! - * @pixiv/three-vrm-core v3.2.0 + * @pixiv/three-vrm-core v3.3.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -931,7 +931,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-mtoon v3.2.0 + * @pixiv/three-vrm-materials-mtoon v3.3.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -939,7 +939,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.0 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.3.0 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -947,7 +947,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-v0compat v3.2.0 + * @pixiv/three-vrm-materials-v0compat v3.3.0 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -955,7 +955,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-node-constraint v3.2.0 + * @pixiv/three-vrm-node-constraint v3.3.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -963,7 +963,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-springbone v3.2.0 + * @pixiv/three-vrm-springbone v3.3.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm/types/VRMUtils/combineMorphs.d.ts b/packages/three-vrm/types/VRMUtils/combineMorphs.d.ts new file mode 100644 index 000000000..8b4dc696c --- /dev/null +++ b/packages/three-vrm/types/VRMUtils/combineMorphs.d.ts @@ -0,0 +1,9 @@ +import { VRMCore } from '@pixiv/three-vrm-core'; +/** + * Combine morph targets by VRM expressions. + * + * This function prevents crashes caused by the limitation of the number of morph targets, especially on mobile devices. + * + * @param vrm The VRM instance + */ +export declare function combineMorphs(vrm: VRMCore): void; diff --git a/packages/three-vrm/types/VRMUtils/index.d.ts b/packages/three-vrm/types/VRMUtils/index.d.ts index 64189935c..dc5e84fe8 100644 --- a/packages/three-vrm/types/VRMUtils/index.d.ts +++ b/packages/three-vrm/types/VRMUtils/index.d.ts @@ -1,3 +1,4 @@ +import { combineMorphs } from './combineMorphs'; import { combineSkeletons } from './combineSkeletons'; import { deepDispose } from './deepDispose'; import { removeUnnecessaryJoints } from './removeUnnecessaryJoints'; @@ -5,6 +6,7 @@ import { removeUnnecessaryVertices } from './removeUnnecessaryVertices'; import { rotateVRM0 } from './rotateVRM0'; export declare class VRMUtils { private constructor(); + static combineMorphs: typeof combineMorphs; static combineSkeletons: typeof combineSkeletons; static deepDispose: typeof deepDispose; static removeUnnecessaryJoints: typeof removeUnnecessaryJoints; diff --git a/packages/types-vrm-0.0/docs/interfaces/BlendShape.html b/packages/types-vrm-0.0/docs/interfaces/BlendShape.html index 51e7a5d8f..c858164d4 100644 --- a/packages/types-vrm-0.0/docs/interfaces/BlendShape.html +++ b/packages/types-vrm-0.0/docs/interfaces/BlendShape.html @@ -1,3 +1,3 @@ BlendShape | @pixiv/types-vrm-0.0

    Interface BlendShape

    BlendShapeAvatar of UniVRM

    -
    interface BlendShape {
        blendShapeGroups?: BlendShapeGroup[];
    }

    Properties

    Properties

    blendShapeGroups?: BlendShapeGroup[]
    +
    interface BlendShape {
        blendShapeGroups?: BlendShapeGroup[];
    }

    Properties

    Properties

    blendShapeGroups?: BlendShapeGroup[]
    diff --git a/packages/types-vrm-0.0/docs/interfaces/BlendShapeBind.html b/packages/types-vrm-0.0/docs/interfaces/BlendShapeBind.html index 0ce9053fa..2fc9757fa 100644 --- a/packages/types-vrm-0.0/docs/interfaces/BlendShapeBind.html +++ b/packages/types-vrm-0.0/docs/interfaces/BlendShapeBind.html @@ -1,5 +1,5 @@ -BlendShapeBind | @pixiv/types-vrm-0.0

    Interface BlendShapeBind

    interface BlendShapeBind {
        index?: number;
        mesh?: number;
        weight?: number;
    }

    Properties

    index? +BlendShapeBind | @pixiv/types-vrm-0.0

    Interface BlendShapeBind

    interface BlendShapeBind {
        index?: number;
        mesh?: number;
        weight?: number;
    }

    Properties

    Properties

    index?: number
    mesh?: number
    weight?: number

    SkinnedMeshRenderer.SetBlendShapeWeight

    -
    +

    Properties

    index?: number
    mesh?: number
    weight?: number

    SkinnedMeshRenderer.SetBlendShapeWeight

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/BlendShapeGroup.html b/packages/types-vrm-0.0/docs/interfaces/BlendShapeGroup.html index 81ff06752..9523b0248 100644 --- a/packages/types-vrm-0.0/docs/interfaces/BlendShapeGroup.html +++ b/packages/types-vrm-0.0/docs/interfaces/BlendShapeGroup.html @@ -1,11 +1,11 @@ -BlendShapeGroup | @pixiv/types-vrm-0.0

    Interface BlendShapeGroup

    interface BlendShapeGroup {
        binds?: BlendShapeBind[];
        isBinary?: boolean;
        materialValues?: BlendShapeMaterialbind[];
        name?: string;
        presetName?: BlendShapePresetName;
    }

    Properties

    binds? +BlendShapeGroup | @pixiv/types-vrm-0.0

    Interface BlendShapeGroup

    interface BlendShapeGroup {
        binds?: BlendShapeBind[];
        isBinary?: boolean;
        materialValues?: BlendShapeMaterialbind[];
        name?: string;
        presetName?: BlendShapePresetName;
    }

    Properties

    binds?: BlendShapeBind[]

    Low level blendshape references.

    -
    isBinary?: boolean

    0 or 1. Do not allow an intermediate value. Value should rounded

    -
    materialValues?: BlendShapeMaterialbind[]

    Material animation references.

    -
    name?: string

    Expression name

    -

    Predefined Expression name

    -
    +
    isBinary?: boolean

    0 or 1. Do not allow an intermediate value. Value should rounded

    +
    materialValues?: BlendShapeMaterialbind[]

    Material animation references.

    +
    name?: string

    Expression name

    +

    Predefined Expression name

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/BlendShapeMaterialbind.html b/packages/types-vrm-0.0/docs/interfaces/BlendShapeMaterialbind.html index f16965c5b..6e7340f20 100644 --- a/packages/types-vrm-0.0/docs/interfaces/BlendShapeMaterialbind.html +++ b/packages/types-vrm-0.0/docs/interfaces/BlendShapeMaterialbind.html @@ -1,4 +1,4 @@ -BlendShapeMaterialbind | @pixiv/types-vrm-0.0

    Interface BlendShapeMaterialbind

    interface BlendShapeMaterialbind {
        materialName?: string;
        propertyName?: string;
        targetValue?: number[];
    }

    Properties

    materialName? +BlendShapeMaterialbind | @pixiv/types-vrm-0.0

    Interface BlendShapeMaterialbind

    interface BlendShapeMaterialbind {
        materialName?: string;
        propertyName?: string;
        targetValue?: number[];
    }

    Properties

    materialName?: string
    propertyName?: string
    targetValue?: number[]
    +

    Properties

    materialName?: string
    propertyName?: string
    targetValue?: number[]
    diff --git a/packages/types-vrm-0.0/docs/interfaces/FirstPerson.html b/packages/types-vrm-0.0/docs/interfaces/FirstPerson.html index 68b4b8954..ab0a3596a 100644 --- a/packages/types-vrm-0.0/docs/interfaces/FirstPerson.html +++ b/packages/types-vrm-0.0/docs/interfaces/FirstPerson.html @@ -1,4 +1,4 @@ -FirstPerson | @pixiv/types-vrm-0.0

    Interface FirstPerson

    Properties

    firstPersonBone? +FirstPerson | @pixiv/types-vrm-0.0

    Interface FirstPerson

    Properties

    firstPersonBone?: number

    The bone whose rendering should be turned off in first-person view. Usually Head is specified.

    -
    firstPersonBoneOffset?: Vector3

    The target position of the VR headset in first-person view. It is assumed that an offset +

    firstPersonBoneOffset?: Vector3

    The target position of the VR headset in first-person view. It is assumed that an offset from the head bone to the VR headset is added.

    -
    lookAtHorizontalInner?: FirstPersonDegreeMap
    lookAtHorizontalOuter?: FirstPersonDegreeMap
    lookAtTypeName?: "Bone" | "BlendShape"

    Eye controller mode.

    -
    lookAtVerticalDown?: FirstPersonDegreeMap
    lookAtVerticalUp?: FirstPersonDegreeMap
    meshAnnotations?: FirstPersonMeshAnnotation[]

    Switch display / undisplay for each mesh in first-person view or the others.

    -
    +
    lookAtHorizontalInner?: FirstPersonDegreeMap
    lookAtHorizontalOuter?: FirstPersonDegreeMap
    lookAtTypeName?: "Bone" | "BlendShape"

    Eye controller mode.

    +
    lookAtVerticalDown?: FirstPersonDegreeMap
    lookAtVerticalUp?: FirstPersonDegreeMap
    meshAnnotations?: FirstPersonMeshAnnotation[]

    Switch display / undisplay for each mesh in first-person view or the others.

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/FirstPersonDegreeMap.html b/packages/types-vrm-0.0/docs/interfaces/FirstPersonDegreeMap.html index e87c26a96..0bd8eb169 100644 --- a/packages/types-vrm-0.0/docs/interfaces/FirstPersonDegreeMap.html +++ b/packages/types-vrm-0.0/docs/interfaces/FirstPersonDegreeMap.html @@ -1,8 +1,8 @@ FirstPersonDegreeMap | @pixiv/types-vrm-0.0

    Interface FirstPersonDegreeMap

    Eye controller setting.

    -
    interface FirstPersonDegreeMap {
        curve?: number[];
        xRange?: number;
        yRange?: number;
    }

    Properties

    interface FirstPersonDegreeMap {
        curve?: number[];
        xRange?: number;
        yRange?: number;
    }

    Properties

    curve?: number[]

    None linear mapping params. time, value, inTangent, outTangent

    -
    xRange?: number

    Look at input clamp range degree.

    -
    yRange?: number

    Look at map range degree from xRange.

    -
    +
    xRange?: number

    Look at input clamp range degree.

    +
    yRange?: number

    Look at map range degree from xRange.

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/FirstPersonMeshAnnotation.html b/packages/types-vrm-0.0/docs/interfaces/FirstPersonMeshAnnotation.html index 89e256c63..4d7b7dafa 100644 --- a/packages/types-vrm-0.0/docs/interfaces/FirstPersonMeshAnnotation.html +++ b/packages/types-vrm-0.0/docs/interfaces/FirstPersonMeshAnnotation.html @@ -1,3 +1,3 @@ -FirstPersonMeshAnnotation | @pixiv/types-vrm-0.0

    Interface FirstPersonMeshAnnotation

    interface FirstPersonMeshAnnotation {
        firstPersonFlag?: string;
        mesh?: number;
    }

    Properties

    firstPersonFlag? +FirstPersonMeshAnnotation | @pixiv/types-vrm-0.0

    Interface FirstPersonMeshAnnotation

    interface FirstPersonMeshAnnotation {
        firstPersonFlag?: string;
        mesh?: number;
    }

    Properties

    firstPersonFlag?: string
    mesh?: number
    +

    Properties

    firstPersonFlag?: string
    mesh?: number
    diff --git a/packages/types-vrm-0.0/docs/interfaces/Humanoid.html b/packages/types-vrm-0.0/docs/interfaces/Humanoid.html index 554626789..3117e0ab1 100644 --- a/packages/types-vrm-0.0/docs/interfaces/Humanoid.html +++ b/packages/types-vrm-0.0/docs/interfaces/Humanoid.html @@ -1,4 +1,4 @@ -Humanoid | @pixiv/types-vrm-0.0
    interface Humanoid {
        armStretch?: number;
        feetSpacing?: number;
        hasTranslationDoF?: boolean;
        humanBones?: HumanoidBone[];
        legStretch?: number;
        lowerArmTwist?: number;
        lowerLegTwist?: number;
        upperArmTwist?: number;
        upperLegTwist?: number;
    }

    Properties

    armStretch? +Humanoid | @pixiv/types-vrm-0.0
    interface Humanoid {
        armStretch?: number;
        feetSpacing?: number;
        hasTranslationDoF?: boolean;
        humanBones?: HumanoidBone[];
        legStretch?: number;
        lowerArmTwist?: number;
        lowerLegTwist?: number;
        upperArmTwist?: number;
        upperLegTwist?: number;
    }

    Properties

    armStretch?: number

    Unity's HumanDescription.armStretch

    -
    feetSpacing?: number

    Unity's HumanDescription.feetSpacing

    -
    hasTranslationDoF?: boolean

    Unity's HumanDescription.hasTranslationDoF

    -
    humanBones?: HumanoidBone[]
    legStretch?: number

    Unity's HumanDescription.legStretch

    -
    lowerArmTwist?: number

    Unity's HumanDescription.lowerArmTwist

    -
    lowerLegTwist?: number

    Unity's HumanDescription.lowerLegTwist

    -
    upperArmTwist?: number

    Unity's HumanDescription.upperArmTwist

    -
    upperLegTwist?: number

    Unity's HumanDescription.upperLegTwist

    -
    +
    feetSpacing?: number

    Unity's HumanDescription.feetSpacing

    +
    hasTranslationDoF?: boolean

    Unity's HumanDescription.hasTranslationDoF

    +
    humanBones?: HumanoidBone[]
    legStretch?: number

    Unity's HumanDescription.legStretch

    +
    lowerArmTwist?: number

    Unity's HumanDescription.lowerArmTwist

    +
    lowerLegTwist?: number

    Unity's HumanDescription.lowerLegTwist

    +
    upperArmTwist?: number

    Unity's HumanDescription.upperArmTwist

    +
    upperLegTwist?: number

    Unity's HumanDescription.upperLegTwist

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/HumanoidBone.html b/packages/types-vrm-0.0/docs/interfaces/HumanoidBone.html index 45f445540..356969047 100644 --- a/packages/types-vrm-0.0/docs/interfaces/HumanoidBone.html +++ b/packages/types-vrm-0.0/docs/interfaces/HumanoidBone.html @@ -1,4 +1,4 @@ -HumanoidBone | @pixiv/types-vrm-0.0

    Interface HumanoidBone

    interface HumanoidBone {
        axisLength?: number;
        bone?: HumanoidBoneName;
        center?: Vector3;
        max?: Vector3;
        min?: Vector3;
        node?: number;
        useDefaultValues?: boolean;
    }

    Properties

    axisLength? +HumanoidBone | @pixiv/types-vrm-0.0

    Interface HumanoidBone

    interface HumanoidBone {
        axisLength?: number;
        bone?: HumanoidBoneName;
        center?: Vector3;
        max?: Vector3;
        min?: Vector3;
        node?: number;
        useDefaultValues?: boolean;
    }

    Properties

    Properties

    axisLength?: number

    Unity's HumanLimit.axisLength

    -

    Human bone name.

    -
    center?: Vector3

    Unity's HumanLimit.center

    -
    max?: Vector3

    Unity's HumanLimit.max

    -
    min?: Vector3

    Unity's HumanLimit.min

    -
    node?: number

    Reference node index

    -
    useDefaultValues?: boolean

    Unity's HumanLimit.useDefaultValues

    -
    +

    Human bone name.

    +
    center?: Vector3

    Unity's HumanLimit.center

    +
    max?: Vector3

    Unity's HumanLimit.max

    +
    min?: Vector3

    Unity's HumanLimit.min

    +
    node?: number

    Reference node index

    +
    useDefaultValues?: boolean

    Unity's HumanLimit.useDefaultValues

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/Material.html b/packages/types-vrm-0.0/docs/interfaces/Material.html index c6b8412c6..c87d87996 100644 --- a/packages/types-vrm-0.0/docs/interfaces/Material.html +++ b/packages/types-vrm-0.0/docs/interfaces/Material.html @@ -1,4 +1,4 @@ -Material | @pixiv/types-vrm-0.0
    interface Material {
        floatProperties?: {
            [key: string]: any;
        };
        keywordMap?: {
            [key: string]: any;
        };
        name?: string;
        renderQueue?: number;
        shader?: string;
        tagMap?: {
            [key: string]: any;
        };
        textureProperties?: {
            [key: string]: any;
        };
        vectorProperties?: {
            [key: string]: any;
        };
    }

    Properties

    floatProperties? +Material | @pixiv/types-vrm-0.0
    interface Material {
        floatProperties?: {
            [key: string]: any;
        };
        keywordMap?: {
            [key: string]: any;
        };
        name?: string;
        renderQueue?: number;
        shader?: string;
        tagMap?: {
            [key: string]: any;
        };
        textureProperties?: {
            [key: string]: any;
        };
        vectorProperties?: {
            [key: string]: any;
        };
    }

    Properties

    floatProperties?: {
        [key: string]: any;
    }
    keywordMap?: {
        [key: string]: any;
    }
    name?: string
    renderQueue?: number
    shader?: string
    tagMap?: {
        [key: string]: any;
    }
    textureProperties?: {
        [key: string]: any;
    }
    vectorProperties?: {
        [key: string]: any;
    }
    +

    Properties

    floatProperties?: {
        [key: string]: any;
    }
    keywordMap?: {
        [key: string]: any;
    }
    name?: string
    renderQueue?: number
    shader?: string
    tagMap?: {
        [key: string]: any;
    }
    textureProperties?: {
        [key: string]: any;
    }
    vectorProperties?: {
        [key: string]: any;
    }
    diff --git a/packages/types-vrm-0.0/docs/interfaces/Meta.html b/packages/types-vrm-0.0/docs/interfaces/Meta.html index e1406eb39..8becbe3bc 100644 --- a/packages/types-vrm-0.0/docs/interfaces/Meta.html +++ b/packages/types-vrm-0.0/docs/interfaces/Meta.html @@ -1,4 +1,4 @@ -Meta | @pixiv/types-vrm-0.0
    interface Meta {
        allowedUserName?: "OnlyAuthor" | "ExplicitlyLicensedPerson" | "Everyone";
        author?: string;
        commercialUssageName?: "Disallow" | "Allow";
        contactInformation?: string;
        licenseName?:
            | "Redistribution_Prohibited"
            | "CC0"
            | "CC_BY"
            | "CC_BY_NC"
            | "CC_BY_SA"
            | "CC_BY_NC_SA"
            | "CC_BY_ND"
            | "CC_BY_NC_ND"
            | "Other";
        otherLicenseUrl?: string;
        otherPermissionUrl?: string;
        reference?: string;
        sexualUssageName?: "Disallow" | "Allow";
        texture?: number;
        title?: string;
        version?: string;
        violentUssageName?: "Disallow" | "Allow";
    }

    Properties

    allowedUserName? +Meta | @pixiv/types-vrm-0.0
    interface Meta {
        allowedUserName?: "OnlyAuthor" | "ExplicitlyLicensedPerson" | "Everyone";
        author?: string;
        commercialUssageName?: "Disallow" | "Allow";
        contactInformation?: string;
        licenseName?:
            | "Redistribution_Prohibited"
            | "CC0"
            | "CC_BY"
            | "CC_BY_NC"
            | "CC_BY_SA"
            | "CC_BY_NC_SA"
            | "CC_BY_ND"
            | "CC_BY_NC_ND"
            | "Other";
        otherLicenseUrl?: string;
        otherPermissionUrl?: string;
        reference?: string;
        sexualUssageName?: "Disallow" | "Allow";
        texture?: number;
        title?: string;
        version?: string;
        violentUssageName?: "Disallow" | "Allow";
    }

    Properties

    allowedUserName?: "OnlyAuthor" | "ExplicitlyLicensedPerson" | "Everyone"

    A person who can perform with this avatar

    -
    author?: string

    Author of VRM model

    -
    commercialUssageName?: "Disallow" | "Allow"

    For commercial use

    -
    contactInformation?: string

    Contact Information of VRM model author

    -
    licenseName?:
        | "Redistribution_Prohibited"
        | "CC0"
        | "CC_BY"
        | "CC_BY_NC"
        | "CC_BY_SA"
        | "CC_BY_NC_SA"
        | "CC_BY_ND"
        | "CC_BY_NC_ND"
        | "Other"

    License type

    -
    otherLicenseUrl?: string

    If “Other” is selected, put the URL link of the license document here.

    -
    otherPermissionUrl?: string

    If there are any conditions not mentioned above, put the URL link of the license document +

    author?: string

    Author of VRM model

    +
    commercialUssageName?: "Disallow" | "Allow"

    For commercial use

    +
    contactInformation?: string

    Contact Information of VRM model author

    +
    licenseName?:
        | "Redistribution_Prohibited"
        | "CC0"
        | "CC_BY"
        | "CC_BY_NC"
        | "CC_BY_SA"
        | "CC_BY_NC_SA"
        | "CC_BY_ND"
        | "CC_BY_NC_ND"
        | "Other"

    License type

    +
    otherLicenseUrl?: string

    If “Other” is selected, put the URL link of the license document here.

    +
    otherPermissionUrl?: string

    If there are any conditions not mentioned above, put the URL link of the license document here.

    -
    reference?: string

    Reference of VRM model

    -
    sexualUssageName?: "Disallow" | "Allow"

    Permission to perform sexual acts with this avatar

    -
    texture?: number

    Thumbnail of VRM model

    -
    title?: string

    Title of VRM model

    -
    version?: string

    Version of VRM model

    -
    violentUssageName?: "Disallow" | "Allow"

    Permission to perform violent acts with this avatar

    -
    +
    reference?: string

    Reference of VRM model

    +
    sexualUssageName?: "Disallow" | "Allow"

    Permission to perform sexual acts with this avatar

    +
    texture?: number

    Thumbnail of VRM model

    +
    title?: string

    Title of VRM model

    +
    version?: string

    Version of VRM model

    +
    violentUssageName?: "Disallow" | "Allow"

    Permission to perform violent acts with this avatar

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimation.html b/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimation.html index a0d91b63a..110854c72 100644 --- a/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimation.html +++ b/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimation.html @@ -1,4 +1,4 @@ SecondaryAnimation | @pixiv/types-vrm-0.0

    Interface SecondaryAnimation

    The setting of automatic animation of string-like objects such as tails and hairs.

    -
    interface SecondaryAnimation {
        boneGroups?: SecondaryAnimationSpring[];
        colliderGroups?: SecondaryAnimationColliderGroup[];
    }

    Properties

    interface SecondaryAnimation {
        boneGroups?: SecondaryAnimationSpring[];
        colliderGroups?: SecondaryAnimationColliderGroup[];
    }

    Properties

    +

    Properties

    diff --git a/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationCollider.html b/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationCollider.html index 8f2ed782e..91dfcc1e9 100644 --- a/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationCollider.html +++ b/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationCollider.html @@ -1,5 +1,5 @@ -SecondaryAnimationCollider | @pixiv/types-vrm-0.0

    Interface SecondaryAnimationCollider

    interface SecondaryAnimationCollider {
        offset?: Vector3;
        radius?: number;
    }

    Properties

    offset? +SecondaryAnimationCollider | @pixiv/types-vrm-0.0

    Interface SecondaryAnimationCollider

    interface SecondaryAnimationCollider {
        offset?: Vector3;
        radius?: number;
    }

    Properties

    Properties

    offset?: Vector3

    The local coordinate from the node of the collider group.

    -
    radius?: number

    The radius of the collider.

    -
    +
    radius?: number

    The radius of the collider.

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationColliderGroup.html b/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationColliderGroup.html index 4a4140895..b68cbbf6e 100644 --- a/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationColliderGroup.html +++ b/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationColliderGroup.html @@ -1,4 +1,4 @@ -SecondaryAnimationColliderGroup | @pixiv/types-vrm-0.0

    Interface SecondaryAnimationColliderGroup

    interface SecondaryAnimationColliderGroup {
        colliders?: SecondaryAnimationCollider[];
        node?: number;
    }

    Properties

    colliders? +SecondaryAnimationColliderGroup | @pixiv/types-vrm-0.0

    Interface SecondaryAnimationColliderGroup

    interface SecondaryAnimationColliderGroup {
        colliders?: SecondaryAnimationCollider[];
        node?: number;
    }

    Properties

    Properties

    node?: number

    The node of the collider group for setting up collision detections.

    -
    +

    Properties

    node?: number

    The node of the collider group for setting up collision detections.

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationSpring.html b/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationSpring.html index 755a378d3..5d9952054 100644 --- a/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationSpring.html +++ b/packages/types-vrm-0.0/docs/interfaces/SecondaryAnimationSpring.html @@ -1,4 +1,4 @@ -SecondaryAnimationSpring | @pixiv/types-vrm-0.0

    Interface SecondaryAnimationSpring

    interface SecondaryAnimationSpring {
        bones?: number[];
        center?: number;
        colliderGroups?: number[];
        comment?: string;
        dragForce?: number;
        gravityDir?: Vector3;
        gravityPower?: number;
        hitRadius?: number;
        stiffiness?: number;
    }

    Properties

    bones? +SecondaryAnimationSpring | @pixiv/types-vrm-0.0

    Interface SecondaryAnimationSpring

    interface SecondaryAnimationSpring {
        bones?: number[];
        center?: number;
        colliderGroups?: number[];
        comment?: string;
        dragForce?: number;
        gravityDir?: Vector3;
        gravityPower?: number;
        hitRadius?: number;
        stiffiness?: number;
    }

    Properties

    bones?: number[]

    Specify the node index of the root bone of the swaying object.

    -
    center?: number

    The reference point of a swaying object can be set at any location except the origin. +

    center?: number

    The reference point of a swaying object can be set at any location except the origin. When implementing UI moving with warp, the parent node to move with warp can be specified if you don't want to make the object swaying with warp movement.

    -
    colliderGroups?: number[]

    Specify the index of the collider group for collisions with swaying objects.

    -
    comment?: string

    Annotation comment

    -
    dragForce?: number

    The resistance (deceleration) of automatic animation.

    -
    gravityDir?: Vector3

    The direction of gravity. Set (0, -1, 0) for simulating the gravity. Set (1, 0, 0) for +

    colliderGroups?: number[]

    Specify the index of the collider group for collisions with swaying objects.

    +
    comment?: string

    Annotation comment

    +
    dragForce?: number

    The resistance (deceleration) of automatic animation.

    +
    gravityDir?: Vector3

    The direction of gravity. Set (0, -1, 0) for simulating the gravity. Set (1, 0, 0) for simulating the wind.

    -
    gravityPower?: number

    The strength of gravity.

    -
    hitRadius?: number

    The radius of the sphere used for the collision detection with colliders.

    -
    stiffiness?: number

    The resilience of the swaying object (the power of returning to the initial pose).

    -
    +
    gravityPower?: number

    The strength of gravity.

    +
    hitRadius?: number

    The radius of the sphere used for the collision detection with colliders.

    +
    stiffiness?: number

    The resilience of the swaying object (the power of returning to the initial pose).

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/VRM.html b/packages/types-vrm-0.0/docs/interfaces/VRM.html index 499f13bd2..d89418483 100644 --- a/packages/types-vrm-0.0/docs/interfaces/VRM.html +++ b/packages/types-vrm-0.0/docs/interfaces/VRM.html @@ -1,5 +1,5 @@ VRM | @pixiv/types-vrm-0.0

    VRM extension is for 3d humanoid avatars (and models) in VR applications.

    -
    interface VRM {
        blendShapeMaster?: BlendShape;
        exporterVersion?: string;
        firstPerson?: FirstPerson;
        humanoid?: Humanoid;
        materialProperties?: Material[];
        meta?: Meta;
        secondaryAnimation?: SecondaryAnimation;
        specVersion?: "0.0";
    }

    Properties

    interface VRM {
        blendShapeMaster?: BlendShape;
        exporterVersion?: string;
        firstPerson?: FirstPerson;
        humanoid?: Humanoid;
        materialProperties?: Material[];
        meta?: Meta;
        secondaryAnimation?: SecondaryAnimation;
        specVersion?: "0.0";
    }

    Properties

    blendShapeMaster?: BlendShape
    exporterVersion?: string

    Version of exporter that vrm created. UniVRM-0.46

    -
    firstPerson?: FirstPerson
    humanoid?: Humanoid
    materialProperties?: Material[]
    meta?: Meta
    secondaryAnimation?: SecondaryAnimation
    specVersion

    Version of VRM specification. 0.0

    -
    +

    Properties

    blendShapeMaster?: BlendShape
    exporterVersion?: string

    Version of exporter that vrm created. UniVRM-0.46

    +
    firstPerson?: FirstPerson
    humanoid?: Humanoid
    materialProperties?: Material[]
    meta?: Meta
    secondaryAnimation?: SecondaryAnimation
    specVersion

    Version of VRM specification. 0.0

    +
    diff --git a/packages/types-vrm-0.0/docs/interfaces/Vector3.html b/packages/types-vrm-0.0/docs/interfaces/Vector3.html index 13b83b132..1cf5a6978 100644 --- a/packages/types-vrm-0.0/docs/interfaces/Vector3.html +++ b/packages/types-vrm-0.0/docs/interfaces/Vector3.html @@ -1,4 +1,4 @@ -Vector3 | @pixiv/types-vrm-0.0
    interface Vector3 {
        x?: number;
        y?: number;
        z?: number;
    }

    Properties

    x? +Vector3 | @pixiv/types-vrm-0.0
    interface Vector3 {
        x?: number;
        y?: number;
        z?: number;
    }

    Properties

    x? y? z? -

    Properties

    x?: number
    y?: number
    z?: number
    +

    Properties

    x?: number
    y?: number
    z?: number
    diff --git a/packages/types-vrm-0.0/docs/types/BlendShapePresetName.html b/packages/types-vrm-0.0/docs/types/BlendShapePresetName.html index 6ee308cb6..64446dda4 100644 --- a/packages/types-vrm-0.0/docs/types/BlendShapePresetName.html +++ b/packages/types-vrm-0.0/docs/types/BlendShapePresetName.html @@ -1,2 +1,2 @@ BlendShapePresetName | @pixiv/types-vrm-0.0

    Type Alias BlendShapePresetName

    BlendShapePresetName:
        | "a"
        | "angry"
        | "blink"
        | "blink_l"
        | "blink_r"
        | "e"
        | "fun"
        | "i"
        | "joy"
        | "lookdown"
        | "lookleft"
        | "lookright"
        | "lookup"
        | "neutral"
        | "o"
        | "sorrow"
        | "u"
        | "unknown"

    Predefined Expression name

    -
    +
    diff --git a/packages/types-vrm-0.0/docs/types/HumanoidBoneName.html b/packages/types-vrm-0.0/docs/types/HumanoidBoneName.html index 944448520..65f5e8ee6 100644 --- a/packages/types-vrm-0.0/docs/types/HumanoidBoneName.html +++ b/packages/types-vrm-0.0/docs/types/HumanoidBoneName.html @@ -1,2 +1,2 @@ HumanoidBoneName | @pixiv/types-vrm-0.0

    Type Alias HumanoidBoneName

    HumanoidBoneName:
        | "chest"
        | "head"
        | "hips"
        | "jaw"
        | "leftEye"
        | "leftFoot"
        | "leftHand"
        | "leftIndexDistal"
        | "leftIndexIntermediate"
        | "leftIndexProximal"
        | "leftLittleDistal"
        | "leftLittleIntermediate"
        | "leftLittleProximal"
        | "leftLowerArm"
        | "leftLowerLeg"
        | "leftMiddleDistal"
        | "leftMiddleIntermediate"
        | "leftMiddleProximal"
        | "leftRingDistal"
        | "leftRingIntermediate"
        | "leftRingProximal"
        | "leftShoulder"
        | "leftThumbDistal"
        | "leftThumbIntermediate"
        | "leftThumbProximal"
        | "leftToes"
        | "leftUpperArm"
        | "leftUpperLeg"
        | "neck"
        | "rightEye"
        | "rightFoot"
        | "rightHand"
        | "rightIndexDistal"
        | "rightIndexIntermediate"
        | "rightIndexProximal"
        | "rightLittleDistal"
        | "rightLittleIntermediate"
        | "rightLittleProximal"
        | "rightLowerArm"
        | "rightLowerLeg"
        | "rightMiddleDistal"
        | "rightMiddleIntermediate"
        | "rightMiddleProximal"
        | "rightRingDistal"
        | "rightRingIntermediate"
        | "rightRingProximal"
        | "rightShoulder"
        | "rightThumbDistal"
        | "rightThumbIntermediate"
        | "rightThumbProximal"
        | "rightToes"
        | "rightUpperArm"
        | "rightUpperLeg"
        | "spine"
        | "upperChest"

    Human bone name.

    -
    +
    diff --git a/packages/types-vrmc-materials-hdr-emissive-multiplier-1.0/docs/interfaces/VRMCMaterialsHDREmissiveMultiplier.html b/packages/types-vrmc-materials-hdr-emissive-multiplier-1.0/docs/interfaces/VRMCMaterialsHDREmissiveMultiplier.html index eebcf9ee1..ffc512fb8 100644 --- a/packages/types-vrmc-materials-hdr-emissive-multiplier-1.0/docs/interfaces/VRMCMaterialsHDREmissiveMultiplier.html +++ b/packages/types-vrmc-materials-hdr-emissive-multiplier-1.0/docs/interfaces/VRMCMaterialsHDREmissiveMultiplier.html @@ -1,4 +1,4 @@ VRMCMaterialsHDREmissiveMultiplier | @pixiv/types-vrmc-materials-hdr-emissive-multiplier-1.0

    A multiplier for emissiveFactor

    -
    interface VRMCMaterialsHDREmissiveMultiplier {
        emissiveMultiplier: number;
    }

    Properties

    interface VRMCMaterialsHDREmissiveMultiplier {
        emissiveMultiplier: number;
    }

    Properties

    emissiveMultiplier: number

    A multiplier for emissiveFactor

    -
    +
    diff --git a/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/MaterialsMToonShadingShiftTextureInfo.html b/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/MaterialsMToonShadingShiftTextureInfo.html index dfe6cb619..ca09e5753 100644 --- a/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/MaterialsMToonShadingShiftTextureInfo.html +++ b/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/MaterialsMToonShadingShiftTextureInfo.html @@ -1,9 +1,9 @@ -MaterialsMToonShadingShiftTextureInfo | @pixiv/types-vrmc-materials-mtoon-1.0
    interface MaterialsMToonShadingShiftTextureInfo {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        index: number;
        scale?: number;
        texCoord?: number;
    }

    Hierarchy (view full)

    Properties

    extensions? +MaterialsMToonShadingShiftTextureInfo | @pixiv/types-vrmc-materials-mtoon-1.0
    interface MaterialsMToonShadingShiftTextureInfo {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        index: number;
        scale?: number;
        texCoord?: number;
    }

    Hierarchy (view full)

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    index: number

    The index of the texture.

    -
    scale?: number

    The scalar multiplier applied to the texture.

    -
    texCoord?: number

    This integer value is used to construct a string in the format TEXCOORD_<set index> which is a reference to a key in mesh.primitives.attributes (e.g. A value of 0 corresponds to TEXCOORD_0). Mesh must have corresponding texture coordinate attributes for the material to be applicable to it.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    index: number

    The index of the texture.

    +
    scale?: number

    The scalar multiplier applied to the texture.

    +
    texCoord?: number

    This integer value is used to construct a string in the format TEXCOORD_<set index> which is a reference to a key in mesh.primitives.attributes (e.g. A value of 0 corresponds to TEXCOORD_0). Mesh must have corresponding texture coordinate attributes for the material to be applicable to it.

    +
    diff --git a/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/MaterialsMToonTextureInfo.html b/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/MaterialsMToonTextureInfo.html index 210c90e27..dcf0f4f1e 100644 --- a/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/MaterialsMToonTextureInfo.html +++ b/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/MaterialsMToonTextureInfo.html @@ -1,7 +1,7 @@ -MaterialsMToonTextureInfo | @pixiv/types-vrmc-materials-mtoon-1.0
    interface MaterialsMToonTextureInfo {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        index: number;
        texCoord?: number;
    }

    Hierarchy (view full)

    Properties

    extensions? +MaterialsMToonTextureInfo | @pixiv/types-vrmc-materials-mtoon-1.0
    interface MaterialsMToonTextureInfo {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        index: number;
        texCoord?: number;
    }

    Hierarchy (view full)

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    index: number

    The index of the texture.

    -
    texCoord?: number

    This integer value is used to construct a string in the format TEXCOORD_<set index> which is a reference to a key in mesh.primitives.attributes (e.g. A value of 0 corresponds to TEXCOORD_0). Mesh must have corresponding texture coordinate attributes for the material to be applicable to it.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    index: number

    The index of the texture.

    +
    texCoord?: number

    This integer value is used to construct a string in the format TEXCOORD_<set index> which is a reference to a key in mesh.primitives.attributes (e.g. A value of 0 corresponds to TEXCOORD_0). Mesh must have corresponding texture coordinate attributes for the material to be applicable to it.

    +
    diff --git a/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/VRMCMaterialsMToon.html b/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/VRMCMaterialsMToon.html index 60fb7397a..8b8d3ef61 100644 --- a/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/VRMCMaterialsMToon.html +++ b/packages/types-vrmc-materials-mtoon-1.0/docs/interfaces/VRMCMaterialsMToon.html @@ -1,4 +1,4 @@ -VRMCMaterialsMToon | @pixiv/types-vrmc-materials-mtoon-1.0
    interface VRMCMaterialsMToon {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        giEqualizationFactor?: number;
        matcapFactor?: number[];
        matcapTexture?: MaterialsMToonTextureInfo;
        outlineColorFactor?: number[];
        outlineLightingMixFactor?: number;
        outlineWidthFactor?: number;
        outlineWidthMode?: MaterialsMToonOutlineWidthMode;
        outlineWidthMultiplyTexture?: MaterialsMToonTextureInfo;
        parametricRimColorFactor?: number[];
        parametricRimFresnelPowerFactor?: number;
        parametricRimLiftFactor?: number;
        renderQueueOffsetNumber?: number;
        rimLightingMixFactor?: number;
        rimMultiplyTexture?: MaterialsMToonTextureInfo;
        shadeColorFactor?: number[];
        shadeMultiplyTexture?: MaterialsMToonTextureInfo;
        shadingShiftFactor?: number;
        shadingShiftTexture?: MaterialsMToonShadingShiftTextureInfo;
        shadingToonyFactor?: number;
        specVersion: "1.0" | "1.0-beta";
        transparentWithZWrite?: boolean;
        uvAnimationMaskTexture?: MaterialsMToonTextureInfo;
        uvAnimationRotationSpeedFactor?: number;
        uvAnimationScrollXSpeedFactor?: number;
        uvAnimationScrollYSpeedFactor?: number;
    }

    Properties

    extensions? +VRMCMaterialsMToon | @pixiv/types-vrmc-materials-mtoon-1.0
    interface VRMCMaterialsMToon {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        giEqualizationFactor?: number;
        matcapFactor?: number[];
        matcapTexture?: MaterialsMToonTextureInfo;
        outlineColorFactor?: number[];
        outlineLightingMixFactor?: number;
        outlineWidthFactor?: number;
        outlineWidthMode?: MaterialsMToonOutlineWidthMode;
        outlineWidthMultiplyTexture?: MaterialsMToonTextureInfo;
        parametricRimColorFactor?: number[];
        parametricRimFresnelPowerFactor?: number;
        parametricRimLiftFactor?: number;
        renderQueueOffsetNumber?: number;
        rimLightingMixFactor?: number;
        rimMultiplyTexture?: MaterialsMToonTextureInfo;
        shadeColorFactor?: number[];
        shadeMultiplyTexture?: MaterialsMToonTextureInfo;
        shadingShiftFactor?: number;
        shadingShiftTexture?: MaterialsMToonShadingShiftTextureInfo;
        shadingToonyFactor?: number;
        specVersion: "1.0" | "1.0-beta";
        transparentWithZWrite?: boolean;
        uvAnimationMaskTexture?: MaterialsMToonTextureInfo;
        uvAnimationRotationSpeedFactor?: number;
        uvAnimationScrollXSpeedFactor?: number;
        uvAnimationScrollYSpeedFactor?: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    giEqualizationFactor?: number
    matcapFactor?: number[]

    MatCap

    -
    outlineColorFactor?: number[]
    outlineLightingMixFactor?: number
    outlineWidthFactor?: number

    Outline

    -
    outlineWidthMultiplyTexture?: MaterialsMToonTextureInfo
    parametricRimColorFactor?: number[]

    Rim

    -
    parametricRimFresnelPowerFactor?: number
    parametricRimLiftFactor?: number
    renderQueueOffsetNumber?: number
    rimLightingMixFactor?: number
    rimMultiplyTexture?: MaterialsMToonTextureInfo
    shadeColorFactor?: number[]
    shadeMultiplyTexture?: MaterialsMToonTextureInfo
    shadingShiftFactor?: number

    Lighting

    -
    shadingToonyFactor?: number
    specVersion: "1.0" | "1.0-beta"

    Specification version of VRMC_materials_mtoon

    -
    transparentWithZWrite?: boolean

    enable depth buffer when renderMode is transparent

    -
    uvAnimationMaskTexture?: MaterialsMToonTextureInfo
    uvAnimationRotationSpeedFactor?: number
    uvAnimationScrollXSpeedFactor?: number
    uvAnimationScrollYSpeedFactor?: number
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    giEqualizationFactor?: number
    matcapFactor?: number[]

    MatCap

    +
    outlineColorFactor?: number[]
    outlineLightingMixFactor?: number
    outlineWidthFactor?: number

    Outline

    +
    outlineWidthMultiplyTexture?: MaterialsMToonTextureInfo
    parametricRimColorFactor?: number[]

    Rim

    +
    parametricRimFresnelPowerFactor?: number
    parametricRimLiftFactor?: number
    renderQueueOffsetNumber?: number
    rimLightingMixFactor?: number
    rimMultiplyTexture?: MaterialsMToonTextureInfo
    shadeColorFactor?: number[]
    shadeMultiplyTexture?: MaterialsMToonTextureInfo
    shadingShiftFactor?: number

    Lighting

    +
    shadingToonyFactor?: number
    specVersion: "1.0" | "1.0-beta"

    Specification version of VRMC_materials_mtoon

    +
    transparentWithZWrite?: boolean

    enable depth buffer when renderMode is transparent

    +
    uvAnimationMaskTexture?: MaterialsMToonTextureInfo
    uvAnimationRotationSpeedFactor?: number
    uvAnimationScrollXSpeedFactor?: number
    uvAnimationScrollYSpeedFactor?: number
    diff --git a/packages/types-vrmc-materials-mtoon-1.0/docs/types/MaterialsMToonOutlineWidthMode.html b/packages/types-vrmc-materials-mtoon-1.0/docs/types/MaterialsMToonOutlineWidthMode.html index 016f18dd2..a5aa14b5f 100644 --- a/packages/types-vrmc-materials-mtoon-1.0/docs/types/MaterialsMToonOutlineWidthMode.html +++ b/packages/types-vrmc-materials-mtoon-1.0/docs/types/MaterialsMToonOutlineWidthMode.html @@ -1 +1 @@ -MaterialsMToonOutlineWidthMode | @pixiv/types-vrmc-materials-mtoon-1.0
    MaterialsMToonOutlineWidthMode: "none" | "worldCoordinates" | "screenCoordinates"
    +MaterialsMToonOutlineWidthMode | @pixiv/types-vrmc-materials-mtoon-1.0
    MaterialsMToonOutlineWidthMode: "none" | "worldCoordinates" | "screenCoordinates"
    diff --git a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/AimConstraint.html b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/AimConstraint.html index 3d0b22515..133a61eba 100644 --- a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/AimConstraint.html +++ b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/AimConstraint.html @@ -1,10 +1,10 @@ AimConstraint | @pixiv/types-vrmc-node-constraint-1.0

    A constraint that makes it look at a source object.

    -
    interface AimConstraint {
        aimAxis:
            | "PositiveX"
            | "NegativeX"
            | "PositiveY"
            | "NegativeY"
            | "PositiveZ"
            | "NegativeZ";
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        source: number;
        weight?: number;
    }

    Properties

    interface AimConstraint {
        aimAxis:
            | "PositiveX"
            | "NegativeX"
            | "PositiveY"
            | "NegativeY"
            | "PositiveZ"
            | "NegativeZ";
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        source: number;
        weight?: number;
    }

    Properties

    aimAxis:
        | "PositiveX"
        | "NegativeX"
        | "PositiveY"
        | "NegativeY"
        | "PositiveZ"
        | "NegativeZ"

    The aim axis of the constraint.

    -
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    source: number

    The index of the node constrains the node.

    -
    weight?: number

    The weight of the constraint.

    -
    +
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    source: number

    The index of the node constrains the node.

    +
    weight?: number

    The weight of the constraint.

    +
    diff --git a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/Constraint.html b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/Constraint.html index b0a35cf4e..b02acb9e2 100644 --- a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/Constraint.html +++ b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/Constraint.html @@ -1,7 +1,7 @@ Constraint | @pixiv/types-vrmc-node-constraint-1.0

    An object contains one of constraints.

    -
    interface Constraint {
        aim?: AimConstraint;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        roll?: RollConstraint;
        rotation?: RotationConstraint;
    }

    Properties

    interface Constraint {
        aim?: AimConstraint;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        roll?: RollConstraint;
        rotation?: RotationConstraint;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    diff --git a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/RollConstraint.html b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/RollConstraint.html index e41518a65..728fb4e76 100644 --- a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/RollConstraint.html +++ b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/RollConstraint.html @@ -1,10 +1,10 @@ RollConstraint | @pixiv/types-vrmc-node-constraint-1.0

    A constraint that transfers a rotation around one axis of a source.

    -
    interface RollConstraint {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        rollAxis: "X" | "Y" | "Z";
        source: number;
        weight?: number;
    }

    Properties

    interface RollConstraint {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        rollAxis: "X" | "Y" | "Z";
        source: number;
        weight?: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    rollAxis: "X" | "Y" | "Z"

    The roll axis of the constraint.

    -
    source: number

    The index of the node constrains the node.

    -
    weight?: number

    The weight of the constraint.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    rollAxis: "X" | "Y" | "Z"

    The roll axis of the constraint.

    +
    source: number

    The index of the node constrains the node.

    +
    weight?: number

    The weight of the constraint.

    +
    diff --git a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/RotationConstraint.html b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/RotationConstraint.html index b59400ea4..6642e326a 100644 --- a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/RotationConstraint.html +++ b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/RotationConstraint.html @@ -1,8 +1,8 @@ RotationConstraint | @pixiv/types-vrmc-node-constraint-1.0

    A constraint that links the rotation with a source.

    -
    interface RotationConstraint {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        source: number;
        weight?: number;
    }

    Properties

    interface RotationConstraint {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        source: number;
        weight?: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    source: number

    The index of the node constrains the node.

    -
    weight?: number

    The weight of the constraint.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    source: number

    The index of the node constrains the node.

    +
    weight?: number

    The weight of the constraint.

    +
    diff --git a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/VRMCNodeConstraint.html b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/VRMCNodeConstraint.html index e766fdea3..966b75f92 100644 --- a/packages/types-vrmc-node-constraint-1.0/docs/interfaces/VRMCNodeConstraint.html +++ b/packages/types-vrmc-node-constraint-1.0/docs/interfaces/VRMCNodeConstraint.html @@ -1,7 +1,7 @@ VRMCNodeConstraint | @pixiv/types-vrmc-node-constraint-1.0

    glTF extension that defines a node constraint.

    -
    interface VRMCNodeConstraint {
        constraint: Constraint;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        specVersion: "1.0" | "1.0-beta";
    }

    Properties

    interface VRMCNodeConstraint {
        constraint: Constraint;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        specVersion: "1.0" | "1.0-beta";
    }

    Properties

    constraint: Constraint
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    specVersion: "1.0" | "1.0-beta"

    Specification version of VRMC_node_constraint

    -
    +

    Properties

    constraint: Constraint
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    specVersion: "1.0" | "1.0-beta"

    Specification version of VRMC_node_constraint

    +
    diff --git a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneCollider.html b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneCollider.html index 4f447ed35..838b63685 100644 --- a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneCollider.html +++ b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneCollider.html @@ -1,6 +1,6 @@ SpringBoneCollider | @pixiv/types-vrmc-springbone-1.0

    collider definition for SpringBone

    -
    interface SpringBoneCollider {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node?: number;
        shape?: SpringBoneColliderShape;
    }

    Properties

    interface SpringBoneCollider {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node?: number;
        shape?: SpringBoneColliderShape;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node?: number
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node?: number
    diff --git a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderCapsule.html b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderCapsule.html index 7ffba1f8d..343c42d04 100644 --- a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderCapsule.html +++ b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderCapsule.html @@ -1,7 +1,7 @@ -SpringBoneColliderCapsule | @pixiv/types-vrmc-springbone-1.0
    interface SpringBoneColliderCapsule {
        offset?: [number, number, number];
        radius?: number;
        tail?: [number, number, number];
    }

    Properties

    offset? +SpringBoneColliderCapsule | @pixiv/types-vrmc-springbone-1.0
    interface SpringBoneColliderCapsule {
        offset?: [number, number, number];
        radius?: number;
        tail?: [number, number, number];
    }

    Properties

    Properties

    offset?: [number, number, number]

    The capsule head. vector3

    -
    radius?: number

    The capsule radius

    -
    tail?: [number, number, number]

    The capsule tail. vector3

    -
    +
    radius?: number

    The capsule radius

    +
    tail?: [number, number, number]

    The capsule tail. vector3

    +
    diff --git a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderGroup.html b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderGroup.html index 9b53df3de..3b84bfdd2 100644 --- a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderGroup.html +++ b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderGroup.html @@ -1,6 +1,6 @@ SpringBoneColliderGroup | @pixiv/types-vrmc-springbone-1.0

    collider group definition for SpringBone

    -
    interface SpringBoneColliderGroup {
        colliders?: number[];
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        name?: string;
    }

    Properties

    interface SpringBoneColliderGroup {
        colliders?: number[];
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        name?: string;
    }

    Properties

    colliders?: number[]
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    name?: string
    +

    Properties

    colliders?: number[]
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    name?: string
    diff --git a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderShape.html b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderShape.html index 184e7a603..de1bc2e2a 100644 --- a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderShape.html +++ b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderShape.html @@ -1,6 +1,6 @@ SpringBoneColliderShape | @pixiv/types-vrmc-springbone-1.0

    Shape of collider. Have one of sphere and capsule

    -
    interface SpringBoneColliderShape {
        capsule?: SpringBoneColliderCapsule;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        sphere?: SpringBoneColliderSphere;
    }

    Properties

    interface SpringBoneColliderShape {
        capsule?: SpringBoneColliderCapsule;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        sphere?: SpringBoneColliderSphere;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    diff --git a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderSphere.html b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderSphere.html index d4682bb30..d2e332c58 100644 --- a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderSphere.html +++ b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneColliderSphere.html @@ -1,5 +1,5 @@ -SpringBoneColliderSphere | @pixiv/types-vrmc-springbone-1.0
    interface SpringBoneColliderSphere {
        offset?: [number, number, number];
        radius?: number;
    }

    Properties

    offset? +SpringBoneColliderSphere | @pixiv/types-vrmc-springbone-1.0
    interface SpringBoneColliderSphere {
        offset?: [number, number, number];
        radius?: number;
    }

    Properties

    Properties

    offset?: [number, number, number]

    The sphere center. vector3

    -
    radius?: number

    The sphere radius

    -
    +
    radius?: number

    The sphere radius

    +
    diff --git a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneJoint.html b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneJoint.html index 0b08b6a3c..ddf6c1e88 100644 --- a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneJoint.html +++ b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneJoint.html @@ -1,5 +1,5 @@ SpringBoneJoint | @pixiv/types-vrmc-springbone-1.0

    A bone joint of VRMCSpringBone.

    -
    interface SpringBoneJoint {
        dragForce: number;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        gravityDir?: [number, number, number];
        gravityPower: number;
        hitRadius: number;
        node: number;
        stiffness: number;
    }

    Properties

    interface SpringBoneJoint {
        dragForce: number;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        gravityDir?: [number, number, number];
        gravityPower: number;
        hitRadius: number;
        node: number;
        stiffness: number;
    }

    Properties

    dragForce: number

    Air resistance. Deceleration force.

    -
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    gravityDir?: [number, number, number]

    gravityDir

    -
    gravityPower: number

    Gravitational acceleration.

    -
    hitRadius: number

    The radius of spring sphere.

    -
    node: number

    The node index.

    -
    stiffness: number

    The force to return to the initial pose.

    -
    +
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    gravityDir?: [number, number, number]

    gravityDir

    +
    gravityPower: number

    Gravitational acceleration.

    +
    hitRadius: number

    The radius of spring sphere.

    +
    node: number

    The node index.

    +
    stiffness: number

    The force to return to the initial pose.

    +
    diff --git a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneSpring.html b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneSpring.html index 88a46af0d..de34b3f20 100644 --- a/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneSpring.html +++ b/packages/types-vrmc-springbone-1.0/docs/interfaces/SpringBoneSpring.html @@ -1,12 +1,12 @@ SpringBoneSpring | @pixiv/types-vrmc-springbone-1.0

    A bone group of VRMCSpringBone.

    -
    interface SpringBoneSpring {
        center?: number;
        colliderGroups?: number[];
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        joints: SpringBoneJoint[];
        name?: string;
    }

    Properties

    interface SpringBoneSpring {
        center?: number;
        colliderGroups?: number[];
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        joints: SpringBoneJoint[];
        name?: string;
    }

    Properties

    center?: number

    An index of node which is used as a root of center space.

    -
    colliderGroups?: number[]

    Indices of ColliderGroups that detect collision with this spring.

    -
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    joints: SpringBoneJoint[]

    Joints of the spring. Except for the first element, a previous joint of the array must be an ancestor of the joint.

    -
    name?: string

    Name of the Spring

    -
    +
    colliderGroups?: number[]

    Indices of ColliderGroups that detect collision with this spring.

    +
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    joints: SpringBoneJoint[]

    Joints of the spring. Except for the first element, a previous joint of the array must be an ancestor of the joint.

    +
    name?: string

    Name of the Spring

    +
    diff --git a/packages/types-vrmc-springbone-1.0/docs/interfaces/VRMCSpringBone.html b/packages/types-vrmc-springbone-1.0/docs/interfaces/VRMCSpringBone.html index 95336f89b..81c44ac28 100644 --- a/packages/types-vrmc-springbone-1.0/docs/interfaces/VRMCSpringBone.html +++ b/packages/types-vrmc-springbone-1.0/docs/interfaces/VRMCSpringBone.html @@ -1,12 +1,12 @@ VRMCSpringBone | @pixiv/types-vrmc-springbone-1.0

    SpringBone makes objects such as costumes and hair swaying

    -
    interface VRMCSpringBone {
        colliderGroups?: SpringBoneColliderGroup[];
        colliders?: SpringBoneCollider[];
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        specVersion: "1.0" | "1.0-beta";
        springs?: SpringBoneSpring[];
    }

    Properties

    interface VRMCSpringBone {
        colliderGroups?: SpringBoneColliderGroup[];
        colliders?: SpringBoneCollider[];
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        specVersion: "1.0" | "1.0-beta";
        springs?: SpringBoneSpring[];
    }

    Properties

    colliderGroups?: SpringBoneColliderGroup[]

    An array of collider groups.

    -
    colliders?: SpringBoneCollider[]

    An array of colliders.

    -
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    specVersion: "1.0" | "1.0-beta"

    Specification version of VRMC_springBone

    -
    springs?: SpringBoneSpring[]

    An array of springs.

    -
    +
    colliders?: SpringBoneCollider[]

    An array of colliders.

    +
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    specVersion: "1.0" | "1.0-beta"

    Specification version of VRMC_springBone

    +
    springs?: SpringBoneSpring[]

    An array of springs.

    +
    diff --git a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShape.html b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShape.html index bff427f84..156badd41 100644 --- a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShape.html +++ b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShape.html @@ -1,7 +1,7 @@ SpringBoneExtendedColliderShape | @pixiv/types-vrmc-springbone-extended-collider-1.0

    The shape of the collider. One of sphere, capsule, or plane is defined.

    -
    interface SpringBoneExtendedColliderShape {
        capsule?: SpringBoneExtendedColliderShapeCapsule;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        plane?: SpringBoneExtendedColliderShapePlane;
        sphere?: SpringBoneExtendedColliderShapeSphere;
    }

    Properties

    interface SpringBoneExtendedColliderShape {
        capsule?: SpringBoneExtendedColliderShapeCapsule;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        plane?: SpringBoneExtendedColliderShapePlane;
        sphere?: SpringBoneExtendedColliderShapeSphere;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    diff --git a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapeCapsule.html b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapeCapsule.html index 2b626ae84..62678aa3b 100644 --- a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapeCapsule.html +++ b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapeCapsule.html @@ -1,9 +1,9 @@ -SpringBoneExtendedColliderShapeCapsule | @pixiv/types-vrmc-springbone-extended-collider-1.0
    interface SpringBoneExtendedColliderShapeCapsule {
        inside?: boolean;
        offset?: [number, number, number];
        radius?: number;
        tail?: [number, number, number];
    }

    Properties

    inside? +SpringBoneExtendedColliderShapeCapsule | @pixiv/types-vrmc-springbone-extended-collider-1.0
    interface SpringBoneExtendedColliderShapeCapsule {
        inside?: boolean;
        offset?: [number, number, number];
        radius?: number;
        tail?: [number, number, number];
    }

    Properties

    inside?: boolean

    If true, the collider prevents spring bones from going outside of the capsule instead.

    -
    offset?: [number, number, number]

    The offset of the capsule head from the origin in local space.

    -
    radius?: number

    The radius of the capsule.

    -
    tail?: [number, number, number]

    The offset of the capsule tail from the origin in local space.

    -
    +
    offset?: [number, number, number]

    The offset of the capsule head from the origin in local space.

    +
    radius?: number

    The radius of the capsule.

    +
    tail?: [number, number, number]

    The offset of the capsule tail from the origin in local space.

    +
    diff --git a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapePlane.html b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapePlane.html index a920be697..636dd30e8 100644 --- a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapePlane.html +++ b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapePlane.html @@ -1,5 +1,5 @@ -SpringBoneExtendedColliderShapePlane | @pixiv/types-vrmc-springbone-extended-collider-1.0
    interface SpringBoneExtendedColliderShapePlane {
        normal?: [number, number, number];
        offset?: [number, number, number];
    }

    Properties

    normal? +SpringBoneExtendedColliderShapePlane | @pixiv/types-vrmc-springbone-extended-collider-1.0
    interface SpringBoneExtendedColliderShapePlane {
        normal?: [number, number, number];
        offset?: [number, number, number];
    }

    Properties

    Properties

    normal?: [number, number, number]

    The normal of the plane in local space. Must be normalized.

    -
    offset?: [number, number, number]

    The offset of the plane from the origin in local space.

    -
    +
    offset?: [number, number, number]

    The offset of the plane from the origin in local space.

    +
    diff --git a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapeSphere.html b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapeSphere.html index 559f48d19..078520e6e 100644 --- a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapeSphere.html +++ b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/SpringBoneExtendedColliderShapeSphere.html @@ -1,7 +1,7 @@ -SpringBoneExtendedColliderShapeSphere | @pixiv/types-vrmc-springbone-extended-collider-1.0
    interface SpringBoneExtendedColliderShapeSphere {
        inside?: boolean;
        offset?: [number, number, number];
        radius?: number;
    }

    Properties

    inside? +SpringBoneExtendedColliderShapeSphere | @pixiv/types-vrmc-springbone-extended-collider-1.0
    interface SpringBoneExtendedColliderShapeSphere {
        inside?: boolean;
        offset?: [number, number, number];
        radius?: number;
    }

    Properties

    inside?: boolean

    If true, the collider prevents spring bones from going outside of the sphere instead.

    -
    offset?: [number, number, number]

    The offset of the sphere from the origin in local space.

    -
    radius?: number

    The radius of the sphere.

    -
    +
    offset?: [number, number, number]

    The offset of the sphere from the origin in local space.

    +
    radius?: number

    The radius of the sphere.

    +
    diff --git a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/VRMCSpringBoneExtendedCollider.html b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/VRMCSpringBoneExtendedCollider.html index f9e24f0d1..df0c2db8f 100644 --- a/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/VRMCSpringBoneExtendedCollider.html +++ b/packages/types-vrmc-springbone-extended-collider-1.0/docs/interfaces/VRMCSpringBoneExtendedCollider.html @@ -1,8 +1,8 @@ VRMCSpringBoneExtendedCollider | @pixiv/types-vrmc-springbone-extended-collider-1.0

    An extended collider for VRMC_springBone.

    -
    interface VRMCSpringBoneExtendedCollider {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        shape?: SpringBoneExtendedColliderShape;
        specVersion: "1.0";
    }

    Properties

    interface VRMCSpringBoneExtendedCollider {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        shape?: SpringBoneExtendedColliderShape;
        specVersion: "1.0";
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any

    The shape of the collider.

    -
    specVersion

    Specification version of VRMC_springBone_extended_collider.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any

    The shape of the collider.

    +
    specVersion

    Specification version of VRMC_springBone_extended_collider.

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/Expression.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/Expression.html index e78c4285a..6c3d013fe 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/Expression.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/Expression.html @@ -1,5 +1,5 @@ Expression | @pixiv/types-vrmc-vrm-1.0

    Definition of expression by weighted animation

    -
    interface Expression {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        isBinary?: boolean;
        materialColorBinds?: ExpressionMaterialColorBind[];
        morphTargetBinds?: ExpressionMorphTargetBind[];
        name?: string;
        overrideBlink?: ExpressionOverrideType;
        overrideLookAt?: ExpressionOverrideType;
        overrideMouth?: ExpressionOverrideType;
        preset: ExpressionPresetName;
        textureTransformBinds?: ExpressionTextureTransformBind[];
    }

    Properties

    interface Expression {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        isBinary?: boolean;
        materialColorBinds?: ExpressionMaterialColorBind[];
        morphTargetBinds?: ExpressionMorphTargetBind[];
        name?: string;
        overrideBlink?: ExpressionOverrideType;
        overrideLookAt?: ExpressionOverrideType;
        overrideMouth?: ExpressionOverrideType;
        preset: ExpressionPresetName;
        textureTransformBinds?: ExpressionTextureTransformBind[];
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    isBinary?: boolean

    A value greater than 0.5 is 1.0, otherwise 0.0

    -
    materialColorBinds?: ExpressionMaterialColorBind[]

    Material color animation references

    -
    morphTargetBinds?: ExpressionMorphTargetBind[]

    Specify a morph target

    -
    name?: string

    Use only if the preset is custom. Unique within the model

    -
    overrideBlink?: ExpressionOverrideType

    Override values of Blink expressions when this Expression is enabled

    -
    overrideLookAt?: ExpressionOverrideType

    Override values of LookAt expressions when this Expression is enabled

    -
    overrideMouth?: ExpressionOverrideType

    Override values of Mouth expressions when this Expression is enabled

    -

    Functions of Expression

    -
    textureTransformBinds?: ExpressionTextureTransformBind[]

    Texture transform animation references

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    isBinary?: boolean

    A value greater than 0.5 is 1.0, otherwise 0.0

    +
    materialColorBinds?: ExpressionMaterialColorBind[]

    Material color animation references

    +
    morphTargetBinds?: ExpressionMorphTargetBind[]

    Specify a morph target

    +
    name?: string

    Use only if the preset is custom. Unique within the model

    +
    overrideBlink?: ExpressionOverrideType

    Override values of Blink expressions when this Expression is enabled

    +
    overrideLookAt?: ExpressionOverrideType

    Override values of LookAt expressions when this Expression is enabled

    +
    overrideMouth?: ExpressionOverrideType

    Override values of Mouth expressions when this Expression is enabled

    +

    Functions of Expression

    +
    textureTransformBinds?: ExpressionTextureTransformBind[]

    Texture transform animation references

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionMaterialColorBind.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionMaterialColorBind.html index 779f2ccfd..c7ba5a414 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionMaterialColorBind.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionMaterialColorBind.html @@ -1,8 +1,8 @@ -ExpressionMaterialColorBind | @pixiv/types-vrmc-vrm-1.0

    Interface ExpressionMaterialColorBind

    interface ExpressionMaterialColorBind {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        material: number;
        targetValue: [number, number, number, number];
        type: ExpressionMaterialColorType;
    }

    Properties

    extensions? +ExpressionMaterialColorBind | @pixiv/types-vrmc-vrm-1.0

    Interface ExpressionMaterialColorBind

    interface ExpressionMaterialColorBind {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        material: number;
        targetValue: [number, number, number, number];
        type: ExpressionMaterialColorType;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    material: number

    target material

    -
    targetValue: [number, number, number, number]

    target color

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    material: number

    target material

    +
    targetValue: [number, number, number, number]

    target color

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionMorphTargetBind.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionMorphTargetBind.html index 3e503a169..b3c858563 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionMorphTargetBind.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionMorphTargetBind.html @@ -1,10 +1,10 @@ ExpressionMorphTargetBind | @pixiv/types-vrmc-vrm-1.0

    Interface ExpressionMorphTargetBind

    Morph target value associated with a expression

    -
    interface ExpressionMorphTargetBind {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        index: number;
        node: number;
        weight: number;
    }

    Properties

    interface ExpressionMorphTargetBind {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        index: number;
        node: number;
        weight: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    index: number

    The index of the morph target in the mesh.

    -
    node: number

    The index of the node that attached to target mesh.

    -
    weight: number

    The weight value of target morph target.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    index: number

    The index of the morph target in the mesh.

    +
    node: number

    The index of the node that attached to target mesh.

    +
    weight: number

    The weight value of target morph target.

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionTextureTransformBind.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionTextureTransformBind.html index 5aaf32287..e5a5828c2 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionTextureTransformBind.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/ExpressionTextureTransformBind.html @@ -1,9 +1,9 @@ -ExpressionTextureTransformBind | @pixiv/types-vrmc-vrm-1.0

    Interface ExpressionTextureTransformBind

    interface ExpressionTextureTransformBind {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        material: number;
        offset?: [number, number];
        scale?: [number, number];
    }

    Properties

    extensions? +ExpressionTextureTransformBind | @pixiv/types-vrmc-vrm-1.0

    Interface ExpressionTextureTransformBind

    interface ExpressionTextureTransformBind {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        material: number;
        offset?: [number, number];
        scale?: [number, number];
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    material: number

    target material

    -
    offset?: [number, number]

    uv offset for TEXCOORD_0

    -
    scale?: [number, number]

    uv scale for TEXCOORD_0

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    material: number

    target material

    +
    offset?: [number, number]

    uv offset for TEXCOORD_0

    +
    scale?: [number, number]

    uv scale for TEXCOORD_0

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/Expressions.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/Expressions.html index 48009b95c..6f5e02d07 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/Expressions.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/Expressions.html @@ -1,3 +1,3 @@ -Expressions | @pixiv/types-vrmc-vrm-1.0
    interface Expressions {
        custom?: {
            [key: string]: Expression;
        };
        preset?: {
            aa: undefined | Expression;
            angry: undefined | Expression;
            blink: undefined | Expression;
            blinkLeft: undefined | Expression;
            blinkRight: undefined | Expression;
            ee: undefined | Expression;
            happy: undefined | Expression;
            ih: undefined | Expression;
            lookDown: undefined | Expression;
            lookLeft: undefined | Expression;
            lookRight: undefined | Expression;
            lookUp: undefined | Expression;
            neutral: undefined | Expression;
            oh: undefined | Expression;
            ou: undefined | Expression;
            relaxed: undefined | Expression;
            sad: undefined | Expression;
            surprised: undefined | Expression;
        };
    }

    Properties

    custom? +Expressions | @pixiv/types-vrmc-vrm-1.0
    interface Expressions {
        custom?: {
            [key: string]: Expression;
        };
        preset?: {
            aa: undefined | Expression;
            angry: undefined | Expression;
            blink: undefined | Expression;
            blinkLeft: undefined | Expression;
            blinkRight: undefined | Expression;
            ee: undefined | Expression;
            happy: undefined | Expression;
            ih: undefined | Expression;
            lookDown: undefined | Expression;
            lookLeft: undefined | Expression;
            lookRight: undefined | Expression;
            lookUp: undefined | Expression;
            neutral: undefined | Expression;
            oh: undefined | Expression;
            ou: undefined | Expression;
            relaxed: undefined | Expression;
            sad: undefined | Expression;
            surprised: undefined | Expression;
        };
    }

    Properties

    Properties

    custom?: {
        [key: string]: Expression;
    }
    preset?: {
        aa: undefined | Expression;
        angry: undefined | Expression;
        blink: undefined | Expression;
        blinkLeft: undefined | Expression;
        blinkRight: undefined | Expression;
        ee: undefined | Expression;
        happy: undefined | Expression;
        ih: undefined | Expression;
        lookDown: undefined | Expression;
        lookLeft: undefined | Expression;
        lookRight: undefined | Expression;
        lookUp: undefined | Expression;
        neutral: undefined | Expression;
        oh: undefined | Expression;
        ou: undefined | Expression;
        relaxed: undefined | Expression;
        sad: undefined | Expression;
        surprised: undefined | Expression;
    }
    +

    Properties

    custom?: {
        [key: string]: Expression;
    }
    preset?: {
        aa: undefined | Expression;
        angry: undefined | Expression;
        blink: undefined | Expression;
        blinkLeft: undefined | Expression;
        blinkRight: undefined | Expression;
        ee: undefined | Expression;
        happy: undefined | Expression;
        ih: undefined | Expression;
        lookDown: undefined | Expression;
        lookLeft: undefined | Expression;
        lookRight: undefined | Expression;
        lookUp: undefined | Expression;
        neutral: undefined | Expression;
        oh: undefined | Expression;
        ou: undefined | Expression;
        relaxed: undefined | Expression;
        sad: undefined | Expression;
        surprised: undefined | Expression;
    }
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/FirstPerson.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/FirstPerson.html index 6f91682e9..bef43bb21 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/FirstPerson.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/FirstPerson.html @@ -1,6 +1,6 @@ FirstPerson | @pixiv/types-vrmc-vrm-1.0

    First-person perspective settings

    -
    interface FirstPerson {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        meshAnnotations?: FirstPersonMeshAnnotation[];
    }

    Properties

    interface FirstPerson {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        meshAnnotations?: FirstPersonMeshAnnotation[];
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    meshAnnotations?: FirstPersonMeshAnnotation[]

    Mesh rendering annotation for cameras

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    meshAnnotations?: FirstPersonMeshAnnotation[]

    Mesh rendering annotation for cameras

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/FirstPersonMeshAnnotation.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/FirstPersonMeshAnnotation.html index f75ecdeb6..e483a49b0 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/FirstPersonMeshAnnotation.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/FirstPersonMeshAnnotation.html @@ -1,8 +1,8 @@ FirstPersonMeshAnnotation | @pixiv/types-vrmc-vrm-1.0

    Interface FirstPersonMeshAnnotation

    Specify how the mesh should be interpreted by the camera

    -
    interface FirstPersonMeshAnnotation {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
        type:
            | "auto"
            | "both"
            | "thirdPersonOnly"
            | "firstPersonOnly";
    }

    Properties

    interface FirstPersonMeshAnnotation {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
        type:
            | "auto"
            | "both"
            | "thirdPersonOnly"
            | "firstPersonOnly";
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    The index of the node that attached to target mesh.

    -
    type:
        | "auto"
        | "both"
        | "thirdPersonOnly"
        | "firstPersonOnly"

    How the camera interprets the mesh.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    The index of the node that attached to target mesh.

    +
    type:
        | "auto"
        | "both"
        | "thirdPersonOnly"
        | "firstPersonOnly"

    How the camera interprets the mesh.

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/Humanoid.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/Humanoid.html index e61771ff6..08597a382 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/Humanoid.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/Humanoid.html @@ -1,5 +1,5 @@ Humanoid | @pixiv/types-vrmc-vrm-1.0

    Correspondence between nodes and human bones

    -
    interface Humanoid {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        humanBones: HumanoidHumanBones;
    }

    Properties

    interface Humanoid {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        humanBones: HumanoidHumanBones;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    humanBones: HumanoidHumanBones
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    humanBones: HumanoidHumanBones
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/HumanoidHumanBone.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/HumanoidHumanBone.html index 91a9b0d8b..c7d5eda30 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/HumanoidHumanBone.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/HumanoidHumanBone.html @@ -1,6 +1,6 @@ HumanoidHumanBone | @pixiv/types-vrmc-vrm-1.0

    Represents a single bone of a Humanoid.

    -
    interface HumanoidHumanBone {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
    }

    Properties

    interface HumanoidHumanBone {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    Represents a single glTF node tied to this humanBone.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    Represents a single glTF node tied to this humanBone.

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/LookAt.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/LookAt.html index d7b214d8a..1fa170c10 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/LookAt.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/LookAt.html @@ -1,5 +1,5 @@ LookAt | @pixiv/types-vrmc-vrm-1.0

    Eye gaze control

    -
    interface LookAt {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        offsetFromHeadBone?: number[];
        rangeMapHorizontalInner?: LookAtRangeMap;
        rangeMapHorizontalOuter?: LookAtRangeMap;
        rangeMapVerticalDown?: LookAtRangeMap;
        rangeMapVerticalUp?: LookAtRangeMap;
        type?: "bone" | "expression";
    }

    Properties

    interface LookAt {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        offsetFromHeadBone?: number[];
        rangeMapHorizontalInner?: LookAtRangeMap;
        rangeMapHorizontalOuter?: LookAtRangeMap;
        rangeMapVerticalDown?: LookAtRangeMap;
        rangeMapVerticalUp?: LookAtRangeMap;
        type?: "bone" | "expression";
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    offsetFromHeadBone?: number[]

    The origin of LookAt. Position offset from the head bone

    -
    rangeMapHorizontalInner?: LookAtRangeMap

    Horizontal inward movement. The left eye moves right. The right eye moves left.

    -
    rangeMapHorizontalOuter?: LookAtRangeMap

    Horizontal outward movement. The left eye moves left. The right eye moves right.

    -
    rangeMapVerticalDown?: LookAtRangeMap

    Vertical downward movement. Both eyes move upwards

    -
    rangeMapVerticalUp?: LookAtRangeMap

    Vertical upward movement. Both eyes move downwards

    -
    type?: "bone" | "expression"
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    offsetFromHeadBone?: number[]

    The origin of LookAt. Position offset from the head bone

    +
    rangeMapHorizontalInner?: LookAtRangeMap

    Horizontal inward movement. The left eye moves right. The right eye moves left.

    +
    rangeMapHorizontalOuter?: LookAtRangeMap

    Horizontal outward movement. The left eye moves left. The right eye moves right.

    +
    rangeMapVerticalDown?: LookAtRangeMap

    Vertical downward movement. Both eyes move upwards

    +
    rangeMapVerticalUp?: LookAtRangeMap

    Vertical upward movement. Both eyes move downwards

    +
    type?: "bone" | "expression"
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/LookAtRangeMap.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/LookAtRangeMap.html index 0cbececa7..5ed7b88a5 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/LookAtRangeMap.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/LookAtRangeMap.html @@ -1,8 +1,8 @@ LookAtRangeMap | @pixiv/types-vrmc-vrm-1.0

    Horizontal inward movement. The left eye moves right. The right eye moves left.

    -
    interface LookAtRangeMap {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        inputMaxValue?: number;
        outputScale?: number;
    }

    Properties

    interface LookAtRangeMap {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        inputMaxValue?: number;
        outputScale?: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    inputMaxValue?: number

    Yaw and pitch angles ( degrees ) between the head bone forward vector and the eye gaze LookAt vector

    -
    outputScale?: number

    Degree for type.bone, Weight for type.expressions

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    inputMaxValue?: number

    Yaw and pitch angles ( degrees ) between the head bone forward vector and the eye gaze LookAt vector

    +
    outputScale?: number

    Degree for type.bone, Weight for type.expressions

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/Meta.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/Meta.html index d297dbc30..3986f7f65 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/Meta.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/Meta.html @@ -1,4 +1,4 @@ -Meta | @pixiv/types-vrmc-vrm-1.0
    interface Meta {
        allowAntisocialOrHateUsage?: boolean;
        allowExcessivelySexualUsage?: boolean;
        allowExcessivelyViolentUsage?: boolean;
        allowPoliticalOrReligiousUsage?: boolean;
        allowRedistribution?: boolean;
        authors: string[];
        avatarPermission?: "onlyAuthor" | "onlySeparatelyLicensedPerson" | "everyone";
        commercialUsage?: "personalNonProfit" | "personalProfit" | "corporation";
        contactInformation?: string;
        copyrightInformation?: string;
        creditNotation?: "required" | "unnecessary";
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        licenseUrl: string;
        modification?: "prohibited" | "allowModification" | "allowModificationRedistribution";
        name: string;
        otherLicenseUrl?: string;
        references?: string[];
        thirdPartyLicenses?: string;
        thumbnailImage?: number;
        version?: string;
    }

    Properties

    allowAntisocialOrHateUsage? +Meta | @pixiv/types-vrmc-vrm-1.0
    interface Meta {
        allowAntisocialOrHateUsage?: boolean;
        allowExcessivelySexualUsage?: boolean;
        allowExcessivelyViolentUsage?: boolean;
        allowPoliticalOrReligiousUsage?: boolean;
        allowRedistribution?: boolean;
        authors: string[];
        avatarPermission?: "onlyAuthor" | "onlySeparatelyLicensedPerson" | "everyone";
        commercialUsage?: "personalNonProfit" | "personalProfit" | "corporation";
        contactInformation?: string;
        copyrightInformation?: string;
        creditNotation?: "required" | "unnecessary";
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        licenseUrl: string;
        modification?: "prohibited" | "allowModification" | "allowModificationRedistribution";
        name: string;
        otherLicenseUrl?: string;
        references?: string[];
        thirdPartyLicenses?: string;
        thumbnailImage?: number;
        version?: string;
    }

    Properties

    allowAntisocialOrHateUsage?: boolean

    A flag that permits to use this model in contents contain anti-social activities or hate speeches

    -
    allowExcessivelySexualUsage?: boolean

    A flag that permits to use this model in excessively sexual contents

    -
    allowExcessivelyViolentUsage?: boolean

    A flag that permits to use this model in excessively violent contents

    -
    allowPoliticalOrReligiousUsage?: boolean

    A flag that permits to use this model in political or religious contents

    -
    allowRedistribution?: boolean

    A flag that permits to redistribute this model

    -
    authors: string[]

    Authos of the model

    -
    avatarPermission?: "onlyAuthor" | "onlySeparatelyLicensedPerson" | "everyone"

    A person who can perform as an avatar with this model

    -
    commercialUsage?: "personalNonProfit" | "personalProfit" | "corporation"

    An option that permits to use this model in commercial products

    -
    contactInformation?: string

    An information that describes the contact information of the author

    -
    copyrightInformation?: string

    An information that describes the copyright of the model

    -
    creditNotation?: "required" | "unnecessary"

    An option that forces or abandons to display the credit of this model

    -
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    licenseUrl: string

    A URL towards the license document this model refers to

    -
    modification?: "prohibited" | "allowModification" | "allowModificationRedistribution"

    An option that controls the condition to modify this model

    -
    name: string

    The name of the model

    -
    otherLicenseUrl?: string

    Describe the URL links of other license

    -
    references?: string[]

    References / original works of the model

    -
    thirdPartyLicenses?: string

    Third party licenses of the model, if required. You can use line breaks

    -
    thumbnailImage?: number

    The index to the thumbnail image of the model in gltf.images

    -
    version?: string

    The version of the model

    -
    +
    allowExcessivelySexualUsage?: boolean

    A flag that permits to use this model in excessively sexual contents

    +
    allowExcessivelyViolentUsage?: boolean

    A flag that permits to use this model in excessively violent contents

    +
    allowPoliticalOrReligiousUsage?: boolean

    A flag that permits to use this model in political or religious contents

    +
    allowRedistribution?: boolean

    A flag that permits to redistribute this model

    +
    authors: string[]

    Authos of the model

    +
    avatarPermission?: "onlyAuthor" | "onlySeparatelyLicensedPerson" | "everyone"

    A person who can perform as an avatar with this model

    +
    commercialUsage?: "personalNonProfit" | "personalProfit" | "corporation"

    An option that permits to use this model in commercial products

    +
    contactInformation?: string

    An information that describes the contact information of the author

    +
    copyrightInformation?: string

    An information that describes the copyright of the model

    +
    creditNotation?: "required" | "unnecessary"

    An option that forces or abandons to display the credit of this model

    +
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    licenseUrl: string

    A URL towards the license document this model refers to

    +
    modification?: "prohibited" | "allowModification" | "allowModificationRedistribution"

    An option that controls the condition to modify this model

    +
    name: string

    The name of the model

    +
    otherLicenseUrl?: string

    Describe the URL links of other license

    +
    references?: string[]

    References / original works of the model

    +
    thirdPartyLicenses?: string

    Third party licenses of the model, if required. You can use line breaks

    +
    thumbnailImage?: number

    The index to the thumbnail image of the model in gltf.images

    +
    version?: string

    The version of the model

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/interfaces/VRMCVRM.html b/packages/types-vrmc-vrm-1.0/docs/interfaces/VRMCVRM.html index 96e496c36..9082d2f50 100644 --- a/packages/types-vrmc-vrm-1.0/docs/interfaces/VRMCVRM.html +++ b/packages/types-vrmc-vrm-1.0/docs/interfaces/VRMCVRM.html @@ -1,4 +1,4 @@ -VRMCVRM | @pixiv/types-vrmc-vrm-1.0
    interface VRMCVRM {
        expressions?: Expressions;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        firstPerson?: FirstPerson;
        humanoid: Humanoid;
        lookAt?: LookAt;
        meta: Meta;
        specVersion: "1.0" | "1.0-beta";
    }

    Properties

    expressions? +VRMCVRM | @pixiv/types-vrmc-vrm-1.0
    interface VRMCVRM {
        expressions?: Expressions;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        firstPerson?: FirstPerson;
        humanoid: Humanoid;
        lookAt?: LookAt;
        meta: Meta;
        specVersion: "1.0" | "1.0-beta";
    }

    Properties

    expressions?: Expressions
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    firstPerson?: FirstPerson

    First-person perspective settings

    -
    humanoid: Humanoid
    lookAt?: LookAt

    Eye gaze control

    -
    meta: Meta

    Meta informations of the VRM model

    -
    specVersion: "1.0" | "1.0-beta"

    Specification version of VRMC_vrm

    -
    +

    Properties

    expressions?: Expressions
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    firstPerson?: FirstPerson

    First-person perspective settings

    +
    humanoid: Humanoid
    lookAt?: LookAt

    Eye gaze control

    +
    meta: Meta

    Meta informations of the VRM model

    +
    specVersion: "1.0" | "1.0-beta"

    Specification version of VRMC_vrm

    +
    diff --git a/packages/types-vrmc-vrm-1.0/docs/types/ExpressionMaterialColorType.html b/packages/types-vrmc-vrm-1.0/docs/types/ExpressionMaterialColorType.html index 6df97ce79..99f6839cf 100644 --- a/packages/types-vrmc-vrm-1.0/docs/types/ExpressionMaterialColorType.html +++ b/packages/types-vrmc-vrm-1.0/docs/types/ExpressionMaterialColorType.html @@ -1 +1 @@ -ExpressionMaterialColorType | @pixiv/types-vrmc-vrm-1.0

    Type Alias ExpressionMaterialColorType

    ExpressionMaterialColorType:
        | "color"
        | "emissionColor"
        | "shadeColor"
        | "matcapColor"
        | "rimColor"
        | "outlineColor"
    +ExpressionMaterialColorType | @pixiv/types-vrmc-vrm-1.0

    Type Alias ExpressionMaterialColorType

    ExpressionMaterialColorType:
        | "color"
        | "emissionColor"
        | "shadeColor"
        | "matcapColor"
        | "rimColor"
        | "outlineColor"
    diff --git a/packages/types-vrmc-vrm-1.0/docs/types/ExpressionOverrideType.html b/packages/types-vrmc-vrm-1.0/docs/types/ExpressionOverrideType.html index 2a2812af8..8d404528a 100644 --- a/packages/types-vrmc-vrm-1.0/docs/types/ExpressionOverrideType.html +++ b/packages/types-vrmc-vrm-1.0/docs/types/ExpressionOverrideType.html @@ -1 +1 @@ -ExpressionOverrideType | @pixiv/types-vrmc-vrm-1.0

    Type Alias ExpressionOverrideType

    ExpressionOverrideType: "none" | "block" | "blend"
    +ExpressionOverrideType | @pixiv/types-vrmc-vrm-1.0

    Type Alias ExpressionOverrideType

    ExpressionOverrideType: "none" | "block" | "blend"
    diff --git a/packages/types-vrmc-vrm-1.0/docs/types/ExpressionPresetName.html b/packages/types-vrmc-vrm-1.0/docs/types/ExpressionPresetName.html index 27d1c2665..d51acad10 100644 --- a/packages/types-vrmc-vrm-1.0/docs/types/ExpressionPresetName.html +++ b/packages/types-vrmc-vrm-1.0/docs/types/ExpressionPresetName.html @@ -1 +1 @@ -ExpressionPresetName | @pixiv/types-vrmc-vrm-1.0

    Type Alias ExpressionPresetName

    ExpressionPresetName:
        | "happy"
        | "angry"
        | "sad"
        | "relaxed"
        | "surprised"
        | "aa"
        | "ih"
        | "ou"
        | "ee"
        | "oh"
        | "blink"
        | "blinkLeft"
        | "blinkRight"
        | "lookUp"
        | "lookDown"
        | "lookLeft"
        | "lookRight"
        | "neutral"
    +ExpressionPresetName | @pixiv/types-vrmc-vrm-1.0

    Type Alias ExpressionPresetName

    ExpressionPresetName:
        | "happy"
        | "angry"
        | "sad"
        | "relaxed"
        | "surprised"
        | "aa"
        | "ih"
        | "ou"
        | "ee"
        | "oh"
        | "blink"
        | "blinkLeft"
        | "blinkRight"
        | "lookUp"
        | "lookDown"
        | "lookLeft"
        | "lookRight"
        | "neutral"
    diff --git a/packages/types-vrmc-vrm-1.0/docs/types/HumanoidHumanBoneName.html b/packages/types-vrmc-vrm-1.0/docs/types/HumanoidHumanBoneName.html index 624a9f4b2..e129c8033 100644 --- a/packages/types-vrmc-vrm-1.0/docs/types/HumanoidHumanBoneName.html +++ b/packages/types-vrmc-vrm-1.0/docs/types/HumanoidHumanBoneName.html @@ -1 +1 @@ -HumanoidHumanBoneName | @pixiv/types-vrmc-vrm-1.0

    Type Alias HumanoidHumanBoneName

    HumanoidHumanBoneName:
        | "hips"
        | "spine"
        | "chest"
        | "upperChest"
        | "neck"
        | "head"
        | "leftEye"
        | "rightEye"
        | "jaw"
        | "leftUpperLeg"
        | "leftLowerLeg"
        | "leftFoot"
        | "leftToes"
        | "rightUpperLeg"
        | "rightLowerLeg"
        | "rightFoot"
        | "rightToes"
        | "leftShoulder"
        | "leftUpperArm"
        | "leftLowerArm"
        | "leftHand"
        | "rightShoulder"
        | "rightUpperArm"
        | "rightLowerArm"
        | "rightHand"
        | "leftThumbMetacarpal"
        | "leftThumbProximal"
        | "leftThumbDistal"
        | "leftIndexProximal"
        | "leftIndexIntermediate"
        | "leftIndexDistal"
        | "leftMiddleProximal"
        | "leftMiddleIntermediate"
        | "leftMiddleDistal"
        | "leftRingProximal"
        | "leftRingIntermediate"
        | "leftRingDistal"
        | "leftLittleProximal"
        | "leftLittleIntermediate"
        | "leftLittleDistal"
        | "rightThumbMetacarpal"
        | "rightThumbProximal"
        | "rightThumbDistal"
        | "rightIndexProximal"
        | "rightIndexIntermediate"
        | "rightIndexDistal"
        | "rightMiddleProximal"
        | "rightMiddleIntermediate"
        | "rightMiddleDistal"
        | "rightRingProximal"
        | "rightRingIntermediate"
        | "rightRingDistal"
        | "rightLittleProximal"
        | "rightLittleIntermediate"
        | "rightLittleDistal"
    +HumanoidHumanBoneName | @pixiv/types-vrmc-vrm-1.0

    Type Alias HumanoidHumanBoneName

    HumanoidHumanBoneName:
        | "hips"
        | "spine"
        | "chest"
        | "upperChest"
        | "neck"
        | "head"
        | "leftEye"
        | "rightEye"
        | "jaw"
        | "leftUpperLeg"
        | "leftLowerLeg"
        | "leftFoot"
        | "leftToes"
        | "rightUpperLeg"
        | "rightLowerLeg"
        | "rightFoot"
        | "rightToes"
        | "leftShoulder"
        | "leftUpperArm"
        | "leftLowerArm"
        | "leftHand"
        | "rightShoulder"
        | "rightUpperArm"
        | "rightLowerArm"
        | "rightHand"
        | "leftThumbMetacarpal"
        | "leftThumbProximal"
        | "leftThumbDistal"
        | "leftIndexProximal"
        | "leftIndexIntermediate"
        | "leftIndexDistal"
        | "leftMiddleProximal"
        | "leftMiddleIntermediate"
        | "leftMiddleDistal"
        | "leftRingProximal"
        | "leftRingIntermediate"
        | "leftRingDistal"
        | "leftLittleProximal"
        | "leftLittleIntermediate"
        | "leftLittleDistal"
        | "rightThumbMetacarpal"
        | "rightThumbProximal"
        | "rightThumbDistal"
        | "rightIndexProximal"
        | "rightIndexIntermediate"
        | "rightIndexDistal"
        | "rightMiddleProximal"
        | "rightMiddleIntermediate"
        | "rightMiddleDistal"
        | "rightRingProximal"
        | "rightRingIntermediate"
        | "rightRingDistal"
        | "rightLittleProximal"
        | "rightLittleIntermediate"
        | "rightLittleDistal"
    diff --git a/packages/types-vrmc-vrm-1.0/docs/types/HumanoidHumanBones.html b/packages/types-vrmc-vrm-1.0/docs/types/HumanoidHumanBones.html index a33003337..46c1b8918 100644 --- a/packages/types-vrmc-vrm-1.0/docs/types/HumanoidHumanBones.html +++ b/packages/types-vrmc-vrm-1.0/docs/types/HumanoidHumanBones.html @@ -1,2 +1,2 @@ HumanoidHumanBones | @pixiv/types-vrmc-vrm-1.0

    Type Alias HumanoidHumanBones

    HumanoidHumanBones: {
        [key in HumanoidHumanBoneName]?: HumanoidHumanBone
    }

    Represents a set of humanBones of a humanoid.

    -
    +
    diff --git a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Expression.html b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Expression.html index 9dcec9ca0..3476ef079 100644 --- a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Expression.html +++ b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Expression.html @@ -1,6 +1,6 @@ Expression | @pixiv/types-vrmc-vrm-animation-1.0

    Represents a single expression.

    -
    interface Expression {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
    }

    Properties

    interface Expression {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    Represents a single glTF node mapped to this expression.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    Represents a single glTF node mapped to this expression.

    +
    diff --git a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Expressions.html b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Expressions.html index 9f6b34f1d..57a338e61 100644 --- a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Expressions.html +++ b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Expressions.html @@ -1,6 +1,6 @@ Expressions | @pixiv/types-vrmc-vrm-animation-1.0

    An object which maps expressions to nodes.

    -
    interface Expressions {
        custom?: {
            [key: string]: Expression;
        };
        preset?: {
            aa: undefined | Expression;
            angry: undefined | Expression;
            blink: undefined | Expression;
            blinkLeft: undefined | Expression;
            blinkRight: undefined | Expression;
            ee: undefined | Expression;
            happy: undefined | Expression;
            ih: undefined | Expression;
            lookDown: undefined | Expression;
            lookLeft: undefined | Expression;
            lookRight: undefined | Expression;
            lookUp: undefined | Expression;
            neutral: undefined | Expression;
            oh: undefined | Expression;
            ou: undefined | Expression;
            relaxed: undefined | Expression;
            sad: undefined | Expression;
            surprised: undefined | Expression;
        };
    }

    Properties

    interface Expressions {
        custom?: {
            [key: string]: Expression;
        };
        preset?: {
            aa: undefined | Expression;
            angry: undefined | Expression;
            blink: undefined | Expression;
            blinkLeft: undefined | Expression;
            blinkRight: undefined | Expression;
            ee: undefined | Expression;
            happy: undefined | Expression;
            ih: undefined | Expression;
            lookDown: undefined | Expression;
            lookLeft: undefined | Expression;
            lookRight: undefined | Expression;
            lookUp: undefined | Expression;
            neutral: undefined | Expression;
            oh: undefined | Expression;
            ou: undefined | Expression;
            relaxed: undefined | Expression;
            sad: undefined | Expression;
            surprised: undefined | Expression;
        };
    }

    Properties

    Properties

    custom?: {
        [key: string]: Expression;
    }

    An object that contains definitions of custom expressions.

    -
    preset?: {
        aa: undefined | Expression;
        angry: undefined | Expression;
        blink: undefined | Expression;
        blinkLeft: undefined | Expression;
        blinkRight: undefined | Expression;
        ee: undefined | Expression;
        happy: undefined | Expression;
        ih: undefined | Expression;
        lookDown: undefined | Expression;
        lookLeft: undefined | Expression;
        lookRight: undefined | Expression;
        lookUp: undefined | Expression;
        neutral: undefined | Expression;
        oh: undefined | Expression;
        ou: undefined | Expression;
        relaxed: undefined | Expression;
        sad: undefined | Expression;
        surprised: undefined | Expression;
    }

    An object that contains definitions of preset expressions.

    -
    +
    preset?: {
        aa: undefined | Expression;
        angry: undefined | Expression;
        blink: undefined | Expression;
        blinkLeft: undefined | Expression;
        blinkRight: undefined | Expression;
        ee: undefined | Expression;
        happy: undefined | Expression;
        ih: undefined | Expression;
        lookDown: undefined | Expression;
        lookLeft: undefined | Expression;
        lookRight: undefined | Expression;
        lookUp: undefined | Expression;
        neutral: undefined | Expression;
        oh: undefined | Expression;
        ou: undefined | Expression;
        relaxed: undefined | Expression;
        sad: undefined | Expression;
        surprised: undefined | Expression;
    }

    An object that contains definitions of preset expressions.

    +
    diff --git a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Humanoid.html b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Humanoid.html index fc4feb341..fa51bc869 100644 --- a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Humanoid.html +++ b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/Humanoid.html @@ -1,4 +1,4 @@ Humanoid | @pixiv/types-vrmc-vrm-animation-1.0

    An object which describes about humanoid bones.

    -
    interface Humanoid {
        humanBones: HumanoidHumanBones;
    }

    Properties

    interface Humanoid {
        humanBones: HumanoidHumanBones;
    }

    Properties

    Properties

    humanBones: HumanoidHumanBones

    An object which maps humanoid bones to nodes.

    -
    +
    diff --git a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/HumanoidHumanBone.html b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/HumanoidHumanBone.html index 70aaf14bd..6a56273b9 100644 --- a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/HumanoidHumanBone.html +++ b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/HumanoidHumanBone.html @@ -1,6 +1,6 @@ HumanoidHumanBone | @pixiv/types-vrmc-vrm-animation-1.0

    Represents a single bone of a Humanoid.

    -
    interface HumanoidHumanBone {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
    }

    Properties

    interface HumanoidHumanBone {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    Represents a single glTF node mapped to this humanBone.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    Represents a single glTF node mapped to this humanBone.

    +
    diff --git a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/LookAt.html b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/LookAt.html index b2259568d..bb3613f4a 100644 --- a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/LookAt.html +++ b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/LookAt.html @@ -1,6 +1,6 @@ LookAt | @pixiv/types-vrmc-vrm-animation-1.0

    An object which maps a eye gaze point to a node.

    -
    interface LookAt {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
    }

    Properties

    interface LookAt {
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        node: number;
    }

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    Represents a single glTF node represents the eye gaze point.

    -
    +

    Properties

    extensions?: {
        [name: string]: any;
    }
    extras?: any
    node: number

    Represents a single glTF node represents the eye gaze point.

    +
    diff --git a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/VRMCVRMAnimation.html b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/VRMCVRMAnimation.html index e155dfe29..edcb3f59c 100644 --- a/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/VRMCVRMAnimation.html +++ b/packages/types-vrmc-vrm-animation-1.0/docs/interfaces/VRMCVRMAnimation.html @@ -1,12 +1,12 @@ VRMCVRMAnimation | @pixiv/types-vrmc-vrm-animation-1.0

    glTF extension that defines humanoid animations.

    -
    interface VRMCVRMAnimation {
        expressions?: Expressions;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        humanoid?: Humanoid;
        lookAt?: LookAt;
        specVersion: "1.0" | "1.0-draft";
    }

    Properties

    interface VRMCVRMAnimation {
        expressions?: Expressions;
        extensions?: {
            [name: string]: any;
        };
        extras?: any;
        humanoid?: Humanoid;
        lookAt?: LookAt;
        specVersion: "1.0" | "1.0-draft";
    }

    Properties

    expressions?: Expressions

    An object which maps expressions to nodes.

    -
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    humanoid?: Humanoid

    An object which describes about humanoid bones.

    -
    lookAt?: LookAt

    An object which maps a eye gaze point to a node.

    -
    specVersion: "1.0" | "1.0-draft"

    Specification version of VRMC_vrm_animation

    -
    +
    extensions?: {
        [name: string]: any;
    }
    extras?: any
    humanoid?: Humanoid

    An object which describes about humanoid bones.

    +
    lookAt?: LookAt

    An object which maps a eye gaze point to a node.

    +
    specVersion: "1.0" | "1.0-draft"

    Specification version of VRMC_vrm_animation

    +
    diff --git a/packages/types-vrmc-vrm-animation-1.0/docs/types/HumanoidHumanBones.html b/packages/types-vrmc-vrm-animation-1.0/docs/types/HumanoidHumanBones.html index d176a1e62..6b3a01d58 100644 --- a/packages/types-vrmc-vrm-animation-1.0/docs/types/HumanoidHumanBones.html +++ b/packages/types-vrmc-vrm-animation-1.0/docs/types/HumanoidHumanBones.html @@ -1,2 +1,2 @@ HumanoidHumanBones | @pixiv/types-vrmc-vrm-animation-1.0
    HumanoidHumanBones: {
        [key in HumanoidHumanBoneName]?: HumanoidHumanBone
    }

    An object which maps humanoid bones to nodes.

    -
    +