diff --git a/packages/three-vrm-animation/docs/classes/VRMAnimation.html b/packages/three-vrm-animation/docs/classes/VRMAnimation.html index 36be6b72c..6866fe390 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 45e6853b2..d752ba4f0 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 e0585d18d..4520f246e 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 4b2a5f541..cfa7bd3a9 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 dc7dbd3ca..d9797865b 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 3fa1279c6..9a4b32b10 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 c939a5141..236fe99de 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 f5590d5df..4f7a2deae 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.1.6 + * @pixiv/three-vrm-animation v3.2.0 * The implementation of VRM Animation * * Copyright (c) 2019-2024 pixiv Inc. @@ -2023,7 +2023,7 @@ var VRMAnimationLoaderPlugin = class { } }; /*! - * @pixiv/three-vrm-core v3.1.6 + * @pixiv/three-vrm-core v3.2.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. 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 8ab096d2f..fd3d0ac3c 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;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 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;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 b30014f7c..5d4e01a2e 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 24e77a13c..600de8c8b 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 +109,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 +142,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 +166,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,7 +178,7 @@
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

@@ -186,20 +186,20 @@ THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down).

new THREE.Vector3( 0, 1, 0)

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

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 4ef3b0a8c..092b2f26d 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 4879bf8b0..b448e5e90 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 65c3bb2d2..31cb4f85a 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 27918ca9f..e306c2056 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 dc09b51a5..fac8de67d 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 4c74e10d4..911713d79 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 879471535..d29c9fde7 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 e82b054cc..3767cb723 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 a9ae718bf..49f2e883c 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 fb51668c6..4a8158fd5 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 d79030de1..d59196291 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 3f2817b00..34aa1b34a 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 148f7b1eb..16ffe83f4 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 393d3c748..062541662 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 eb0a9099a..9d3870256 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 abf699d3e..7dbc5dec7 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 11d4fd689..2136f7617 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 a5d7692f5..275a1399a 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 938e9f1e0..31be62f7a 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 6814f40ad..62e511005 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 ee8e7e446..591779019 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 7a33b70d8..dac4ce1cc 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 227cfb42d..f07ff59ae 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 967b271f7..1c38c4c63 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 c94685a74..c1f03f173 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 2d9f0a5ad..1e1407bbe 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 b4d9adb9b..d63a73c45 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 d3c799f98..764fef0da 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 9603efb9b..e1934f6b6 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 3bb91bcfd..60fdfc780 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 a59cada97..cb91f0f36 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 12a7462c0..49133fa99 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 4251356df..768a280ec 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 95ec55b5e..1d064d784 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 8a26fa907..fbacec3e8 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 91114e681..a077e4bbd 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 1ee3e5dcb..91b6ff76f 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 7c31b86b7..5ea21d6f2 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 9e29385b8..98c631592 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 0b960e150..e724bc305 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 ebacaefb9..744761ab7 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 f1534e911..1cc5c84f8 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 54cdcc856..7b75a7c81 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 c1453cf88..511e1b2d5 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 31824d7d1..7915d92ff 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.1.6 + * @pixiv/three-vrm-core v3.2.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. 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 70925281f..9df36d8b0 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.1.6 + * @pixiv/three-vrm-core v3.2.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. 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 41b9ceefe..2cf67dc76 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 fcd4a664c..34d3d7c9e 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.1.6 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.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 d679d870f..0e2fb9711 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.1.6 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.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 eeac96941..7c594eca4 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 9f5cbb768..6ded2efc6 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 8fb805351..87d4a60df 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 a977e5aa9..90ac6c339 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 584b71a6e..4da98d391 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 1ea767791..44aff4386 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 fec3c6688..07b513d07 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 6646350a5..2a0683ebd 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 5bf02c00d..aed7dbf53 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.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -106,7 +106,7 @@ var MToonAnimatedUVNode = class extends THREE3.TempNode { uv2 = uv2.add(THREE3.vec2(0.5, 0.5)); const scroll = THREE3.vec2(refUVAnimationScrollXOffset, refUVAnimationScrollYOffset).mul(uvAnimationMask); uv2 = uv2.add(scroll); - return uv2.temp("AnimatedUV"); + return uv2.toVar("AnimatedUV"); } }; @@ -115,13 +115,13 @@ var THREE6 = __toESM(require("three/webgpu"), 1); // src/nodes/immutableNodes.ts var THREE4 = __toESM(require("three/webgpu"), 1); -var shadeColor = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("ShadeColor"); -var shadingShift = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("ShadingShift"); -var shadingToony = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("ShadingToony"); -var rimLightingMix = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("RimLightingMix"); -var rimMultiply = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("RimMultiply"); -var matcap = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("matcap"); -var parametricRim = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("ParametricRim"); +var shadeColor = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("ShadeColor"); +var shadingShift = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("ShadingShift"); +var shadingToony = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("ShadingToony"); +var rimLightingMix = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("RimLightingMix"); +var rimMultiply = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("RimMultiply"); +var matcap = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("matcap"); +var parametricRim = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("ParametricRim"); // src/nodes/utils/FnCompat.ts var THREE5 = __toESM(require("three/webgpu"), 1); @@ -543,4 +543,4 @@ var MToonNodeMaterial = class extends THREE8.NodeMaterial { }); } }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc3JjL25vZGVzL2luZGV4LnRzIiwgIi4uLy4uL3NyYy9ub2Rlcy93YXJuaW5nSWZQcmUxNjEudHMiLCAiLi4vLi4vc3JjL25vZGVzL01Ub29uQW5pbWF0ZWRVVk5vZGUud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LFdBQWEsWUFBSyxDQUFHO0FBQUEsRUFDdkI7QUFBQSxFQUVRLDBCQUEyQztBQUNqRCxVQUFNLHFCQUNKLEtBQUssMEJBQTBCLE9BQWEsWUFBSyxLQUFLLHNCQUFzQixJQUFJO0FBRWxGLFVBQU0sb0JBQ0osS0FBSyx5QkFBeUIsT0FBYSxhQUFNLEtBQUsscUJBQXFCLElBQUk7QUFFakYsVUFBTSw0QkFDSixLQUFLLGlDQUFpQyxPQUM1QixhQUFNLEtBQUssNkJBQTZCLElBQzlDO0FBRU4sV0FBTyxtQkFBbUI7QUFBQSxNQUN4QjtBQUFBLE1BQ0E7QUFBQSxNQUNBO0FBQUEsSUFDRixDQUFDO0FBQUEsRUFDSDtBQUNGOyIsCiAgIm5hbWVzIjogWyJUSFJFRSIsICJUSFJFRSIsICJ1diIsICJUSFJFRSIsICJUSFJFRSIsICJUSFJFRSIsICJ0aHJlZVJldmlzaW9uIiwgImRpZmZ1c2VDb2xvciIsICJUSFJFRSIsICJUSFJFRSIsICJ0aHJlZVJldmlzaW9uIiwgIm5vcm1hbExvY2FsIl0KfQo= diff --git a/packages/three-vrm-materials-mtoon/lib/nodes/index.min.cjs b/packages/three-vrm-materials-mtoon/lib/nodes/index.min.cjs index b1dfa2067..885fada37 100644 --- a/packages/three-vrm-materials-mtoon/lib/nodes/index.min.cjs +++ b/packages/three-vrm-materials-mtoon/lib/nodes/index.min.cjs @@ -1,2 +1,2 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -"use strict";var Ne=Object.create;var v=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var Se=(r,e)=>{for(var t in e)v(r,t,{get:e[t],enumerable:!0})},Y=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xe(e))!ge.call(r,n)&&n!==t&&v(r,n,{get:()=>e[n],enumerable:!(o=He(e,n))||o.enumerable});return r};var c=(r,e,t)=>(t=r!=null?Ne(Me(r)):{},Y(e||!r||!r.__esModule?v(t,"default",{value:r,enumerable:!0}):t,r)),be=r=>Y(v({},"__esModule",{value:!0}),r);var Ce={};Se(Ce,{MToonAnimatedUVNode:()=>p,MToonLightingModel:()=>f,MToonNodeMaterial:()=>L});module.exports=be(Ce);var B=c(require("three"),1),X=parseInt(B.REVISION,10);X<167&&console.warn(`MToonNodeMaterial requires Three.js r167 or higher (You are using r${X}). This would not work correctly.`);var s=c(require("three/webgpu"),1);var a=c(require("three/webgpu"),1),K=a.materialReference("color","color"),q=a.materialReference("map","texture"),Z=a.materialReference("normalMap","texture"),$=a.materialReference("normalScale","vec2"),G=a.materialReference("emissive","color"),J=a.materialReference("emissiveIntensity","float"),Q=a.materialReference("emissiveMap","texture"),ee=a.materialReference("shadeColorFactor","color"),te=a.materialReference("shadingShiftFactor","float"),P=a.materialReference("shadeMultiplyTexture","texture"),ie=a.materialReference("shadeMultiplyTextureScale","float"),oe=a.materialReference("shadingToonyFactor","float"),re=a.materialReference("rimLightingMixFactor","float"),ae=a.materialReference("rimMultiplyTexture","texture"),ne=a.materialReference("matcapFactor","color"),le=a.materialReference("matcapTexture","texture"),se=a.materialReference("parametricRimColorFactor","color"),de=a.materialReference("parametricRimLiftFactor","float"),ue=a.materialReference("parametricRimFresnelPowerFactor","float"),ce=a.materialReference("outlineWidthMultiplyTexture","texture"),me=a.materialReference("outlineWidthFactor","float"),w=a.materialReference("outlineColorFactor","color"),Ee=a.materialReference("outlineLightingMixFactor","float"),he=a.materialReference("uvAnimationMaskTexture","texture"),pe=a.materialReference("uvAnimationScrollXOffset","float"),Te=a.materialReference("uvAnimationScrollYOffset","float"),Re=a.materialReference("uvAnimationRotationPhase","float");var p=class extends s.TempNode{constructor(e){super("vec2"),this.hasMaskTexture=e}setup(){let e=1;this.hasMaskTexture&&(e=s.vec4(he).context({getUV:()=>s.uv()}).r);let t=s.uv(),o=Re.mul(e),n=s.cos(o),u=s.sin(o);t=t.sub(s.vec2(.5,.5)),t=t.mul(s.mat2(n,u,u.negate(),n)),t=t.add(s.vec2(.5,.5));let m=s.vec2(pe,Te).mul(e);return t=t.add(m),t.temp("AnimatedUV")}};var l=c(require("three/webgpu"),1);var d=c(require("three/webgpu"),1),y=d.nodeImmutable(d.PropertyNode,"vec3").temp("ShadeColor"),C=d.nodeImmutable(d.PropertyNode,"float").temp("ShadingShift"),O=d.nodeImmutable(d.PropertyNode,"float").temp("ShadingToony"),M=d.nodeImmutable(d.PropertyNode,"float").temp("RimLightingMix"),g=d.nodeImmutable(d.PropertyNode,"vec3").temp("RimMultiply"),S=d.nodeImmutable(d.PropertyNode,"vec3").temp("matcap"),b=d.nodeImmutable(d.PropertyNode,"vec3").temp("ParametricRim");var T=c(require("three/webgpu"),1),R=r=>parseInt(T.REVISION,10)>=168?T.Fn(r):T.tslFn(r);var Fe=R(({a:r,b:e,t})=>{let o=t.sub(r),n=e.sub(r);return o.div(n).clamp()}),ve=R(({dotNL:r})=>{let t=l.float(1).sub(O),o=r.add(C);return o=Fe({a:t.negate(),b:t,t:o}),o=o.mul(1),o}),ye=R(({shading:r,lightColor:e})=>{let t=l.mix(y,l.diffuseColor,r);return e.mul(l.BRDF_Lambert({diffuseColor:t}))}),f=class extends l.LightingModel{constructor(){super()}direct({lightDirection:e,lightColor:t,reflectedLight:o}){let n=l.transformedNormalView.dot(e).clamp(-1,1),u=ve({dotNL:n});o.directDiffuse.assign(o.directDiffuse.add(ye({shading:u,lightColor:t}))),o.directSpecular.assign(o.directSpecular.add(b.add(S).mul(g).mul(l.mix(l.vec3(0),l.BRDF_Lambert({diffuseColor:t}),M))))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e)}indirectDiffuse({irradiance:e,reflectedLight:t}){t.indirectDiffuse.assign(t.indirectDiffuse.add(e.mul(l.BRDF_Lambert({diffuseColor:l.diffuseColor}))))}indirectSpecular({reflectedLight:e}){e.indirectSpecular.assign(e.indirectSpecular.add(b.add(S).mul(g).mul(l.mix(l.vec3(1),l.vec3(0),M))))}};var i=c(require("three/webgpu"),1);var N={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"};var H=c(require("three/webgpu"),1);var fe=R(({parametricRimLift:r,parametricRimFresnelPower:e,parametricRimColor:t})=>{let o=H.modelViewPosition.normalize(),n=H.transformedNormalView.dot(o.negate());return H.float(1).sub(n).add(r).clamp().pow(e).mul(t)});var L=class extends i.NodeMaterial{customProgramCacheKey(){let e=super.customProgramCacheKey();return e+=`isOutline:${this.isOutline},`,e}get isMToonNodeMaterial(){return!0}constructor(e={}){super(),e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,delete e.giEqualizationFactor,delete e.v0CompatShade,delete e.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=N.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(e)}setupLightingModel(){return new f}setup(e){var t;this._animatedUVNode=new p((t=this.uvAnimationMaskTexture&&this.uvAnimationMaskTexture.isTexture===!0)!=null?t:!1),super.setup(e)}setupDiffuseColor(e){let t=null;if(this.colorNode==null){if(t=K,this.map&&this.map.isTexture===!0){let o=q.context({getUV:()=>this._animatedUVNode});t=t.mul(o)}this.colorNode=t}this.vertexColors===!0&&e.geometry.hasAttribute("color")&&(console.warn("MToonNodeMaterial: MToon ignores vertex colors. Consider using a model without vertex colors instead."),this.vertexColors=!1),super.setupDiffuseColor(e),parseInt(i.REVISION,10)<166&&this.transparent===!1&&this.blending===i.NormalBlending&&this.alphaToCoverage===!1&&i.diffuseColor.a.assign(1),this.colorNode===t&&(this.colorNode=null)}setupVariants(){y.assign(this._setupShadeColorNode()),C.assign(this._setupShadingShiftNode()),O.assign(this._setupShadingToonyNode()),M.assign(this._setupRimLightingMixNode()),g.assign(this._setupRimMultiplyNode()),S.assign(this._setupMatcapNode()),b.assign(this._setupParametricRimNode())}setupNormal(e){let t=this.normalNode;if(this.normalNode==null){if(this.normalNode=i.materialNormal,this.normalMap&&this.normalMap.isTexture===!0){let n=Z.context({getUV:()=>this._animatedUVNode});this.normalNode=i.normalMap(n,$)}this.isOutline&&(this.normalNode=this.normalNode.negate())}if(parseInt(i.REVISION,10)>=168){let n=this.normalNode;return this.normalNode=t,n}else{super.setupNormal(e),this.normalNode=t;return}}setupLighting(e){let t=null;if(this.emissiveNode==null){if(t=G.mul(J),this.emissiveMap&&this.emissiveMap.isTexture===!0){let n=Q.context({getUV:()=>this._animatedUVNode});t=t.mul(n)}this.emissiveNode=t}let o=super.setupLighting(e);return this.emissiveNode===t&&(this.emissiveNode=null),o}setupOutput(e,t){return this.isOutline&&this.outlineWidthMode!==N.None&&(t=i.vec4(i.mix(w,t.xyz.mul(w),Ee),t.w)),super.setupOutput(e,t)}setupPosition(e){var n,u;let t=this.positionNode;if(this.isOutline&&this.outlineWidthMode!==N.None){(n=this.positionNode)!=null||(this.positionNode=i.positionLocal);let m=i.normalLocal.normalize(),E=me;if(this.outlineWidthMultiplyTexture&&this.outlineWidthMultiplyTexture.isTexture===!0){let h=ce.context({getUV:()=>this._animatedUVNode});E=E.mul(h)}let F=i.length(i.modelNormalMatrix.mul(m)),x=E.mul(F).mul(m);if(this.outlineWidthMode===N.WorldCoordinates)this.positionNode=this.positionNode.add(x);else if(this.outlineWidthMode===N.ScreenCoordinates){let h=i.cameraProjectionMatrix.element(1).element(1);this.positionNode=this.positionNode.add(x.div(h).mul(i.positionView.z.negate()))}(u=this.positionNode)!=null||(this.positionNode=i.positionLocal)}let o=super.setupPosition(e);return o.z.add(o.w.mul(1e-6)),this.positionNode=t,o}copy(e){var t,o,n,u,m,E,F,x,h,A,V,W,j,I,U,_,z,k,D;return this.color.copy(e.color),this.map=(t=e.map)!=null?t:null,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.emissiveMap=(o=e.emissiveMap)!=null?o:null,this.normalMap=(n=e.normalMap)!=null?n:null,this.normalScale.copy(e.normalScale),this.shadeColorFactor.copy(e.shadeColorFactor),this.shadeMultiplyTexture=(u=e.shadeMultiplyTexture)!=null?u:null,this.shadingShiftFactor=e.shadingShiftFactor,this.shadingShiftTexture=(m=e.shadingShiftTexture)!=null?m:null,this.shadingShiftTextureScale=e.shadingShiftTextureScale,this.shadingToonyFactor=e.shadingToonyFactor,this.rimLightingMixFactor=e.rimLightingMixFactor,this.rimMultiplyTexture=(E=e.rimMultiplyTexture)!=null?E:null,this.matcapFactor.copy(e.matcapFactor),this.matcapTexture=(F=e.matcapTexture)!=null?F:null,this.parametricRimColorFactor.copy(e.parametricRimColorFactor),this.parametricRimLiftFactor=e.parametricRimLiftFactor,this.parametricRimFresnelPowerFactor=e.parametricRimFresnelPowerFactor,this.outlineWidthMode=e.outlineWidthMode,this.outlineWidthMultiplyTexture=(x=e.outlineWidthMultiplyTexture)!=null?x:null,this.outlineWidthFactor=e.outlineWidthFactor,this.outlineColorFactor.copy(e.outlineColorFactor),this.outlineLightingMixFactor=e.outlineLightingMixFactor,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.uvAnimationMaskTexture=(h=e.uvAnimationMaskTexture)!=null?h:null,this.shadeColorNode=(A=e.shadeColorNode)!=null?A:null,this.shadingShiftNode=(V=e.shadingShiftNode)!=null?V:null,this.shadingToonyNode=(W=e.shadingToonyNode)!=null?W:null,this.rimLightingMixNode=(j=e.rimLightingMixNode)!=null?j:null,this.rimMultiplyNode=(I=e.rimMultiplyNode)!=null?I:null,this.matcapNode=(U=e.matcapNode)!=null?U:null,this.parametricRimColorNode=(_=e.parametricRimColorNode)!=null?_:null,this.parametricRimLiftNode=(z=e.parametricRimLiftNode)!=null?z:null,this.parametricRimFresnelPowerNode=(k=e.parametricRimFresnelPowerNode)!=null?k:null,this.isOutline=(D=e.isOutline)!=null?D:null,super.copy(e)}update(e){this.uvAnimationScrollXOffset+=e*this.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYOffset+=e*this.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationPhase+=e*this.uvAnimationRotationSpeedFactor}_setupShadeColorNode(){if(this.shadeColorNode!=null)return i.vec3(this.shadeColorNode);let e=ee;if(this.shadeMultiplyTexture&&this.shadeMultiplyTexture.isTexture===!0){let t=P.context({getUV:()=>this._animatedUVNode});e=e.mul(t)}return e}_setupShadingShiftNode(){if(this.shadingShiftNode!=null)return i.float(this.shadingShiftNode);let e=te;if(this.shadingShiftTexture&&this.shadingShiftTexture.isTexture===!0){let t=P.context({getUV:()=>this._animatedUVNode});e=e.add(t.mul(ie))}return e}_setupShadingToonyNode(){return this.shadingToonyNode!=null?i.float(this.shadingToonyNode):oe}_setupRimLightingMixNode(){return this.rimLightingMixNode!=null?i.float(this.rimLightingMixNode):re}_setupRimMultiplyNode(){return this.rimMultiplyNode!=null?i.vec3(this.rimMultiplyNode):this.rimMultiplyTexture&&this.rimMultiplyTexture.isTexture===!0?ae.context({getUV:()=>this._animatedUVNode}):i.vec3(1)}_setupMatcapNode(){return this.matcapNode!=null?i.vec3(this.matcapNode):this.matcapTexture&&this.matcapTexture.isTexture===!0?le.context({getUV:()=>i.matcapUV.mul(1,-1).add(0,1)}).mul(ne):i.vec3(0)}_setupParametricRimNode(){let e=this.parametricRimColorNode!=null?i.vec3(this.parametricRimColorNode):se,t=this.parametricRimLiftNode!=null?i.float(this.parametricRimLiftNode):de,o=this.parametricRimFresnelPowerNode!=null?i.float(this.parametricRimFresnelPowerNode):ue;return fe({parametricRimLift:t,parametricRimFresnelPower:o,parametricRimColor:e})}}; +"use strict";var Ne=Object.create;var v=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var Se=(r,e)=>{for(var t in e)v(r,t,{get:e[t],enumerable:!0})},Y=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xe(e))!ge.call(r,n)&&n!==t&&v(r,n,{get:()=>e[n],enumerable:!(o=He(e,n))||o.enumerable});return r};var c=(r,e,t)=>(t=r!=null?Ne(Me(r)):{},Y(e||!r||!r.__esModule?v(t,"default",{value:r,enumerable:!0}):t,r)),be=r=>Y(v({},"__esModule",{value:!0}),r);var Ce={};Se(Ce,{MToonAnimatedUVNode:()=>p,MToonLightingModel:()=>f,MToonNodeMaterial:()=>L});module.exports=be(Ce);var B=c(require("three"),1),X=parseInt(B.REVISION,10);X<167&&console.warn(`MToonNodeMaterial requires Three.js r167 or higher (You are using r${X}). This would not work correctly.`);var s=c(require("three/webgpu"),1);var a=c(require("three/webgpu"),1),K=a.materialReference("color","color"),q=a.materialReference("map","texture"),Z=a.materialReference("normalMap","texture"),$=a.materialReference("normalScale","vec2"),G=a.materialReference("emissive","color"),J=a.materialReference("emissiveIntensity","float"),Q=a.materialReference("emissiveMap","texture"),ee=a.materialReference("shadeColorFactor","color"),te=a.materialReference("shadingShiftFactor","float"),V=a.materialReference("shadeMultiplyTexture","texture"),ie=a.materialReference("shadeMultiplyTextureScale","float"),oe=a.materialReference("shadingToonyFactor","float"),re=a.materialReference("rimLightingMixFactor","float"),ae=a.materialReference("rimMultiplyTexture","texture"),ne=a.materialReference("matcapFactor","color"),le=a.materialReference("matcapTexture","texture"),se=a.materialReference("parametricRimColorFactor","color"),de=a.materialReference("parametricRimLiftFactor","float"),ue=a.materialReference("parametricRimFresnelPowerFactor","float"),ce=a.materialReference("outlineWidthMultiplyTexture","texture"),Ee=a.materialReference("outlineWidthFactor","float"),P=a.materialReference("outlineColorFactor","color"),me=a.materialReference("outlineLightingMixFactor","float"),he=a.materialReference("uvAnimationMaskTexture","texture"),pe=a.materialReference("uvAnimationScrollXOffset","float"),Te=a.materialReference("uvAnimationScrollYOffset","float"),Re=a.materialReference("uvAnimationRotationPhase","float");var p=class extends s.TempNode{constructor(e){super("vec2"),this.hasMaskTexture=e}setup(){let e=1;this.hasMaskTexture&&(e=s.vec4(he).context({getUV:()=>s.uv()}).r);let t=s.uv(),o=Re.mul(e),n=s.cos(o),u=s.sin(o);t=t.sub(s.vec2(.5,.5)),t=t.mul(s.mat2(n,u,u.negate(),n)),t=t.add(s.vec2(.5,.5));let E=s.vec2(pe,Te).mul(e);return t=t.add(E),t.toVar("AnimatedUV")}};var l=c(require("three/webgpu"),1);var d=c(require("three/webgpu"),1),y=d.nodeImmutable(d.PropertyNode,"vec3").toVar("ShadeColor"),C=d.nodeImmutable(d.PropertyNode,"float").toVar("ShadingShift"),O=d.nodeImmutable(d.PropertyNode,"float").toVar("ShadingToony"),M=d.nodeImmutable(d.PropertyNode,"float").toVar("RimLightingMix"),g=d.nodeImmutable(d.PropertyNode,"vec3").toVar("RimMultiply"),S=d.nodeImmutable(d.PropertyNode,"vec3").toVar("matcap"),b=d.nodeImmutable(d.PropertyNode,"vec3").toVar("ParametricRim");var T=c(require("three/webgpu"),1),R=r=>parseInt(T.REVISION,10)>=168?T.Fn(r):T.tslFn(r);var Fe=R(({a:r,b:e,t})=>{let o=t.sub(r),n=e.sub(r);return o.div(n).clamp()}),ve=R(({dotNL:r})=>{let t=l.float(1).sub(O),o=r.add(C);return o=Fe({a:t.negate(),b:t,t:o}),o=o.mul(1),o}),ye=R(({shading:r,lightColor:e})=>{let t=l.mix(y,l.diffuseColor,r);return e.mul(l.BRDF_Lambert({diffuseColor:t}))}),f=class extends l.LightingModel{constructor(){super()}direct({lightDirection:e,lightColor:t,reflectedLight:o}){let n=l.transformedNormalView.dot(e).clamp(-1,1),u=ve({dotNL:n});o.directDiffuse.assign(o.directDiffuse.add(ye({shading:u,lightColor:t}))),o.directSpecular.assign(o.directSpecular.add(b.add(S).mul(g).mul(l.mix(l.vec3(0),l.BRDF_Lambert({diffuseColor:t}),M))))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e)}indirectDiffuse({irradiance:e,reflectedLight:t}){t.indirectDiffuse.assign(t.indirectDiffuse.add(e.mul(l.BRDF_Lambert({diffuseColor:l.diffuseColor}))))}indirectSpecular({reflectedLight:e}){e.indirectSpecular.assign(e.indirectSpecular.add(b.add(S).mul(g).mul(l.mix(l.vec3(1),l.vec3(0),M))))}};var i=c(require("three/webgpu"),1);var N={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"};var H=c(require("three/webgpu"),1);var fe=R(({parametricRimLift:r,parametricRimFresnelPower:e,parametricRimColor:t})=>{let o=H.modelViewPosition.normalize(),n=H.transformedNormalView.dot(o.negate());return H.float(1).sub(n).add(r).clamp().pow(e).mul(t)});var L=class extends i.NodeMaterial{customProgramCacheKey(){let e=super.customProgramCacheKey();return e+=`isOutline:${this.isOutline},`,e}get isMToonNodeMaterial(){return!0}constructor(e={}){super(),e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,delete e.giEqualizationFactor,delete e.v0CompatShade,delete e.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=N.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(e)}setupLightingModel(){return new f}setup(e){var t;this._animatedUVNode=new p((t=this.uvAnimationMaskTexture&&this.uvAnimationMaskTexture.isTexture===!0)!=null?t:!1),super.setup(e)}setupDiffuseColor(e){let t=null;if(this.colorNode==null){if(t=K,this.map&&this.map.isTexture===!0){let o=q.context({getUV:()=>this._animatedUVNode});t=t.mul(o)}this.colorNode=t}this.vertexColors===!0&&e.geometry.hasAttribute("color")&&(console.warn("MToonNodeMaterial: MToon ignores vertex colors. Consider using a model without vertex colors instead."),this.vertexColors=!1),super.setupDiffuseColor(e),parseInt(i.REVISION,10)<166&&this.transparent===!1&&this.blending===i.NormalBlending&&this.alphaToCoverage===!1&&i.diffuseColor.a.assign(1),this.colorNode===t&&(this.colorNode=null)}setupVariants(){y.assign(this._setupShadeColorNode()),C.assign(this._setupShadingShiftNode()),O.assign(this._setupShadingToonyNode()),M.assign(this._setupRimLightingMixNode()),g.assign(this._setupRimMultiplyNode()),S.assign(this._setupMatcapNode()),b.assign(this._setupParametricRimNode())}setupNormal(e){let t=this.normalNode;if(this.normalNode==null){if(this.normalNode=i.materialNormal,this.normalMap&&this.normalMap.isTexture===!0){let n=Z.context({getUV:()=>this._animatedUVNode});this.normalNode=i.normalMap(n,$)}this.isOutline&&(this.normalNode=this.normalNode.negate())}if(parseInt(i.REVISION,10)>=168){let n=this.normalNode;return this.normalNode=t,n}else{super.setupNormal(e),this.normalNode=t;return}}setupLighting(e){let t=null;if(this.emissiveNode==null){if(t=G.mul(J),this.emissiveMap&&this.emissiveMap.isTexture===!0){let n=Q.context({getUV:()=>this._animatedUVNode});t=t.mul(n)}this.emissiveNode=t}let o=super.setupLighting(e);return this.emissiveNode===t&&(this.emissiveNode=null),o}setupOutput(e,t){return this.isOutline&&this.outlineWidthMode!==N.None&&(t=i.vec4(i.mix(P,t.xyz.mul(P),me),t.w)),super.setupOutput(e,t)}setupPosition(e){var n,u;let t=this.positionNode;if(this.isOutline&&this.outlineWidthMode!==N.None){(n=this.positionNode)!=null||(this.positionNode=i.positionLocal);let E=i.normalLocal.normalize(),m=Ee;if(this.outlineWidthMultiplyTexture&&this.outlineWidthMultiplyTexture.isTexture===!0){let h=ce.context({getUV:()=>this._animatedUVNode});m=m.mul(h)}let F=i.length(i.modelNormalMatrix.mul(E)),x=m.mul(F).mul(E);if(this.outlineWidthMode===N.WorldCoordinates)this.positionNode=this.positionNode.add(x);else if(this.outlineWidthMode===N.ScreenCoordinates){let h=i.cameraProjectionMatrix.element(1).element(1);this.positionNode=this.positionNode.add(x.div(h).mul(i.positionView.z.negate()))}(u=this.positionNode)!=null||(this.positionNode=i.positionLocal)}let o=super.setupPosition(e);return o.z.add(o.w.mul(1e-6)),this.positionNode=t,o}copy(e){var t,o,n,u,E,m,F,x,h,w,A,W,j,I,U,_,z,k,D;return this.color.copy(e.color),this.map=(t=e.map)!=null?t:null,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.emissiveMap=(o=e.emissiveMap)!=null?o:null,this.normalMap=(n=e.normalMap)!=null?n:null,this.normalScale.copy(e.normalScale),this.shadeColorFactor.copy(e.shadeColorFactor),this.shadeMultiplyTexture=(u=e.shadeMultiplyTexture)!=null?u:null,this.shadingShiftFactor=e.shadingShiftFactor,this.shadingShiftTexture=(E=e.shadingShiftTexture)!=null?E:null,this.shadingShiftTextureScale=e.shadingShiftTextureScale,this.shadingToonyFactor=e.shadingToonyFactor,this.rimLightingMixFactor=e.rimLightingMixFactor,this.rimMultiplyTexture=(m=e.rimMultiplyTexture)!=null?m:null,this.matcapFactor.copy(e.matcapFactor),this.matcapTexture=(F=e.matcapTexture)!=null?F:null,this.parametricRimColorFactor.copy(e.parametricRimColorFactor),this.parametricRimLiftFactor=e.parametricRimLiftFactor,this.parametricRimFresnelPowerFactor=e.parametricRimFresnelPowerFactor,this.outlineWidthMode=e.outlineWidthMode,this.outlineWidthMultiplyTexture=(x=e.outlineWidthMultiplyTexture)!=null?x:null,this.outlineWidthFactor=e.outlineWidthFactor,this.outlineColorFactor.copy(e.outlineColorFactor),this.outlineLightingMixFactor=e.outlineLightingMixFactor,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.uvAnimationMaskTexture=(h=e.uvAnimationMaskTexture)!=null?h:null,this.shadeColorNode=(w=e.shadeColorNode)!=null?w:null,this.shadingShiftNode=(A=e.shadingShiftNode)!=null?A:null,this.shadingToonyNode=(W=e.shadingToonyNode)!=null?W:null,this.rimLightingMixNode=(j=e.rimLightingMixNode)!=null?j:null,this.rimMultiplyNode=(I=e.rimMultiplyNode)!=null?I:null,this.matcapNode=(U=e.matcapNode)!=null?U:null,this.parametricRimColorNode=(_=e.parametricRimColorNode)!=null?_:null,this.parametricRimLiftNode=(z=e.parametricRimLiftNode)!=null?z:null,this.parametricRimFresnelPowerNode=(k=e.parametricRimFresnelPowerNode)!=null?k:null,this.isOutline=(D=e.isOutline)!=null?D:null,super.copy(e)}update(e){this.uvAnimationScrollXOffset+=e*this.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYOffset+=e*this.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationPhase+=e*this.uvAnimationRotationSpeedFactor}_setupShadeColorNode(){if(this.shadeColorNode!=null)return i.vec3(this.shadeColorNode);let e=ee;if(this.shadeMultiplyTexture&&this.shadeMultiplyTexture.isTexture===!0){let t=V.context({getUV:()=>this._animatedUVNode});e=e.mul(t)}return e}_setupShadingShiftNode(){if(this.shadingShiftNode!=null)return i.float(this.shadingShiftNode);let e=te;if(this.shadingShiftTexture&&this.shadingShiftTexture.isTexture===!0){let t=V.context({getUV:()=>this._animatedUVNode});e=e.add(t.mul(ie))}return e}_setupShadingToonyNode(){return this.shadingToonyNode!=null?i.float(this.shadingToonyNode):oe}_setupRimLightingMixNode(){return this.rimLightingMixNode!=null?i.float(this.rimLightingMixNode):re}_setupRimMultiplyNode(){return this.rimMultiplyNode!=null?i.vec3(this.rimMultiplyNode):this.rimMultiplyTexture&&this.rimMultiplyTexture.isTexture===!0?ae.context({getUV:()=>this._animatedUVNode}):i.vec3(1)}_setupMatcapNode(){return this.matcapNode!=null?i.vec3(this.matcapNode):this.matcapTexture&&this.matcapTexture.isTexture===!0?le.context({getUV:()=>i.matcapUV.mul(1,-1).add(0,1)}).mul(ne):i.vec3(0)}_setupParametricRimNode(){let e=this.parametricRimColorNode!=null?i.vec3(this.parametricRimColorNode):se,t=this.parametricRimLiftNode!=null?i.float(this.parametricRimLiftNode):de,o=this.parametricRimFresnelPowerNode!=null?i.float(this.parametricRimFresnelPowerNode):ue;return fe({parametricRimLift:t,parametricRimFresnelPower:o,parametricRimColor:e})}}; 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 fe83545f7..9d213779e 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.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -69,7 +69,7 @@ var MToonAnimatedUVNode = class extends THREE3.TempNode { uv2 = uv2.add(THREE3.vec2(0.5, 0.5)); const scroll = THREE3.vec2(refUVAnimationScrollXOffset, refUVAnimationScrollYOffset).mul(uvAnimationMask); uv2 = uv2.add(scroll); - return uv2.temp("AnimatedUV"); + return uv2.toVar("AnimatedUV"); } }; @@ -78,13 +78,13 @@ import * as THREE6 from "three/webgpu"; // src/nodes/immutableNodes.ts import * as THREE4 from "three/webgpu"; -var shadeColor = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("ShadeColor"); -var shadingShift = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("ShadingShift"); -var shadingToony = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("ShadingToony"); -var rimLightingMix = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("RimLightingMix"); -var rimMultiply = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("RimMultiply"); -var matcap = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("matcap"); -var parametricRim = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("ParametricRim"); +var shadeColor = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("ShadeColor"); +var shadingShift = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("ShadingShift"); +var shadingToony = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("ShadingToony"); +var rimLightingMix = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("RimLightingMix"); +var rimMultiply = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("RimMultiply"); +var matcap = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("matcap"); +var parametricRim = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("ParametricRim"); // src/nodes/utils/FnCompat.ts import * as THREE5 from "three/webgpu"; @@ -511,4 +511,4 @@ export { MToonLightingModel, MToonNodeMaterial }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc3JjL25vZGVzL3dhcm5pbmdJZlByZTE2MS50cyIsICIuLi8uLi9zcmMvbm9kZXMvTVRvb25BbmltYXRlZFVWTm9kZS50cyIsICIuLi8uLi9zcmMvbm9kZXMvbWF0ZXJpYWxSZWZlcmVuY2VzLnRzIiwgIi4uLy4uL3NyYy9ub2Rlcy9NVG9vbkxpZ2h0aW5nTW9kZWwudHMiLCAiLi4vLi4vc3JjL25vZGVzL2ltbXV0YWJsZU5vZGVzLnRzIiwgIi4uLy4uL3NyYy9ub2Rlcy91dGlscy9GbkNvbXBhdC50cyIsICIuLi8uLi9zcmMvbm9kZXMvTVRvb25Ob2RlTWF0ZXJpYWwudHMiLCAiLi4vLi4vc3JjL01Ub29uTWF0ZXJpYWxPdXRsaW5lV2lkdGhNb2RlLnRzIiwgIi4uLy4uL3NyYy9ub2Rlcy9tdG9vblBhcmFtZXRyaWNSaW0udHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8vIFRoaXMgbW9kdWxlIHdpbGwgYm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wgInV2IiwgIlRIUkVFIiwgIlRIUkVFIiwgIlRIUkVFIiwgInRocmVlUmV2aXNpb24iLCAiZGlmZnVzZUNvbG9yIiwgIlRIUkVFIiwgIlRIUkVFIiwgInRocmVlUmV2aXNpb24iLCAibm9ybWFsTG9jYWwiXQp9Cg== diff --git a/packages/three-vrm-materials-mtoon/lib/nodes/index.module.min.js b/packages/three-vrm-materials-mtoon/lib/nodes/index.module.min.js index b1e788d36..13b4df474 100644 --- a/packages/three-vrm-materials-mtoon/lib/nodes/index.module.min.js +++ b/packages/three-vrm-materials-mtoon/lib/nodes/index.module.min.js @@ -1,2 +1,2 @@ /*! (c) 2019-2024 pixiv Inc. - https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -import*as D from"three";var k=parseInt(D.REVISION,10);k<167&&console.warn(`MToonNodeMaterial requires Three.js r167 or higher (You are using r${k}). This would not work correctly.`);import*as l from"three/webgpu";import*as r from"three/webgpu";var Y=r.materialReference("color","color"),X=r.materialReference("map","texture"),B=r.materialReference("normalMap","texture"),K=r.materialReference("normalScale","vec2"),q=r.materialReference("emissive","color"),Z=r.materialReference("emissiveIntensity","float"),$=r.materialReference("emissiveMap","texture"),G=r.materialReference("shadeColorFactor","color"),J=r.materialReference("shadingShiftFactor","float"),C=r.materialReference("shadeMultiplyTexture","texture"),Q=r.materialReference("shadeMultiplyTextureScale","float"),ee=r.materialReference("shadingToonyFactor","float"),te=r.materialReference("rimLightingMixFactor","float"),ie=r.materialReference("rimMultiplyTexture","texture"),oe=r.materialReference("matcapFactor","color"),re=r.materialReference("matcapTexture","texture"),ae=r.materialReference("parametricRimColorFactor","color"),ne=r.materialReference("parametricRimLiftFactor","float"),le=r.materialReference("parametricRimFresnelPowerFactor","float"),se=r.materialReference("outlineWidthMultiplyTexture","texture"),de=r.materialReference("outlineWidthFactor","float"),O=r.materialReference("outlineColorFactor","color"),ue=r.materialReference("outlineLightingMixFactor","float"),ce=r.materialReference("uvAnimationMaskTexture","texture"),me=r.materialReference("uvAnimationScrollXOffset","float"),Ee=r.materialReference("uvAnimationScrollYOffset","float"),he=r.materialReference("uvAnimationRotationPhase","float");var N=class extends l.TempNode{constructor(e){super("vec2"),this.hasMaskTexture=e}setup(){let e=1;this.hasMaskTexture&&(e=l.vec4(ce).context({getUV:()=>l.uv()}).r);let t=l.uv(),o=he.mul(e),n=l.cos(o),u=l.sin(o);t=t.sub(l.vec2(.5,.5)),t=t.mul(l.mat2(n,u,u.negate(),n)),t=t.add(l.vec2(.5,.5));let c=l.vec2(me,Ee).mul(e);return t=t.add(c),t.temp("AnimatedUV")}};import*as a from"three/webgpu";import*as s from"three/webgpu";var F=s.nodeImmutable(s.PropertyNode,"vec3").temp("ShadeColor"),v=s.nodeImmutable(s.PropertyNode,"float").temp("ShadingShift"),y=s.nodeImmutable(s.PropertyNode,"float").temp("ShadingToony"),H=s.nodeImmutable(s.PropertyNode,"float").temp("RimLightingMix"),x=s.nodeImmutable(s.PropertyNode,"vec3").temp("RimMultiply"),M=s.nodeImmutable(s.PropertyNode,"vec3").temp("matcap"),g=s.nodeImmutable(s.PropertyNode,"vec3").temp("ParametricRim");import*as h from"three/webgpu";var p=d=>parseInt(h.REVISION,10)>=168?h.Fn(d):h.tslFn(d);var Te=p(({a:d,b:e,t})=>{let o=t.sub(d),n=e.sub(d);return o.div(n).clamp()}),Re=p(({dotNL:d})=>{let t=a.float(1).sub(y),o=d.add(v);return o=Te({a:t.negate(),b:t,t:o}),o=o.mul(1),o}),fe=p(({shading:d,lightColor:e})=>{let t=a.mix(F,a.diffuseColor,d);return e.mul(a.BRDF_Lambert({diffuseColor:t}))}),S=class extends a.LightingModel{constructor(){super()}direct({lightDirection:e,lightColor:t,reflectedLight:o}){let n=a.transformedNormalView.dot(e).clamp(-1,1),u=Re({dotNL:n});o.directDiffuse.assign(o.directDiffuse.add(fe({shading:u,lightColor:t}))),o.directSpecular.assign(o.directSpecular.add(g.add(M).mul(x).mul(a.mix(a.vec3(0),a.BRDF_Lambert({diffuseColor:t}),H))))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e)}indirectDiffuse({irradiance:e,reflectedLight:t}){t.indirectDiffuse.assign(t.indirectDiffuse.add(e.mul(a.BRDF_Lambert({diffuseColor:a.diffuseColor}))))}indirectSpecular({reflectedLight:e}){e.indirectSpecular.assign(e.indirectSpecular.add(g.add(M).mul(x).mul(a.mix(a.vec3(1),a.vec3(0),H))))}};import*as i from"three/webgpu";var T={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"};import*as R from"three/webgpu";var pe=p(({parametricRimLift:d,parametricRimFresnelPower:e,parametricRimColor:t})=>{let o=R.modelViewPosition.normalize(),n=R.transformedNormalView.dot(o.negate());return R.float(1).sub(n).add(d).clamp().pow(e).mul(t)});var L=class extends i.NodeMaterial{customProgramCacheKey(){let e=super.customProgramCacheKey();return e+=`isOutline:${this.isOutline},`,e}get isMToonNodeMaterial(){return!0}constructor(e={}){super(),e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,delete e.giEqualizationFactor,delete e.v0CompatShade,delete e.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=T.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(e)}setupLightingModel(){return new S}setup(e){var t;this._animatedUVNode=new N((t=this.uvAnimationMaskTexture&&this.uvAnimationMaskTexture.isTexture===!0)!=null?t:!1),super.setup(e)}setupDiffuseColor(e){let t=null;if(this.colorNode==null){if(t=Y,this.map&&this.map.isTexture===!0){let o=X.context({getUV:()=>this._animatedUVNode});t=t.mul(o)}this.colorNode=t}this.vertexColors===!0&&e.geometry.hasAttribute("color")&&(console.warn("MToonNodeMaterial: MToon ignores vertex colors. Consider using a model without vertex colors instead."),this.vertexColors=!1),super.setupDiffuseColor(e),parseInt(i.REVISION,10)<166&&this.transparent===!1&&this.blending===i.NormalBlending&&this.alphaToCoverage===!1&&i.diffuseColor.a.assign(1),this.colorNode===t&&(this.colorNode=null)}setupVariants(){F.assign(this._setupShadeColorNode()),v.assign(this._setupShadingShiftNode()),y.assign(this._setupShadingToonyNode()),H.assign(this._setupRimLightingMixNode()),x.assign(this._setupRimMultiplyNode()),M.assign(this._setupMatcapNode()),g.assign(this._setupParametricRimNode())}setupNormal(e){let t=this.normalNode;if(this.normalNode==null){if(this.normalNode=i.materialNormal,this.normalMap&&this.normalMap.isTexture===!0){let n=B.context({getUV:()=>this._animatedUVNode});this.normalNode=i.normalMap(n,K)}this.isOutline&&(this.normalNode=this.normalNode.negate())}if(parseInt(i.REVISION,10)>=168){let n=this.normalNode;return this.normalNode=t,n}else{super.setupNormal(e),this.normalNode=t;return}}setupLighting(e){let t=null;if(this.emissiveNode==null){if(t=q.mul(Z),this.emissiveMap&&this.emissiveMap.isTexture===!0){let n=$.context({getUV:()=>this._animatedUVNode});t=t.mul(n)}this.emissiveNode=t}let o=super.setupLighting(e);return this.emissiveNode===t&&(this.emissiveNode=null),o}setupOutput(e,t){return this.isOutline&&this.outlineWidthMode!==T.None&&(t=i.vec4(i.mix(O,t.xyz.mul(O),ue),t.w)),super.setupOutput(e,t)}setupPosition(e){var n,u;let t=this.positionNode;if(this.isOutline&&this.outlineWidthMode!==T.None){(n=this.positionNode)!=null||(this.positionNode=i.positionLocal);let c=i.normalLocal.normalize(),m=de;if(this.outlineWidthMultiplyTexture&&this.outlineWidthMultiplyTexture.isTexture===!0){let E=se.context({getUV:()=>this._animatedUVNode});m=m.mul(E)}let b=i.length(i.modelNormalMatrix.mul(c)),f=m.mul(b).mul(c);if(this.outlineWidthMode===T.WorldCoordinates)this.positionNode=this.positionNode.add(f);else if(this.outlineWidthMode===T.ScreenCoordinates){let E=i.cameraProjectionMatrix.element(1).element(1);this.positionNode=this.positionNode.add(f.div(E).mul(i.positionView.z.negate()))}(u=this.positionNode)!=null||(this.positionNode=i.positionLocal)}let o=super.setupPosition(e);return o.z.add(o.w.mul(1e-6)),this.positionNode=t,o}copy(e){var t,o,n,u,c,m,b,f,E,P,w,A,V,W,j,I,U,_,z;return this.color.copy(e.color),this.map=(t=e.map)!=null?t:null,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.emissiveMap=(o=e.emissiveMap)!=null?o:null,this.normalMap=(n=e.normalMap)!=null?n:null,this.normalScale.copy(e.normalScale),this.shadeColorFactor.copy(e.shadeColorFactor),this.shadeMultiplyTexture=(u=e.shadeMultiplyTexture)!=null?u:null,this.shadingShiftFactor=e.shadingShiftFactor,this.shadingShiftTexture=(c=e.shadingShiftTexture)!=null?c:null,this.shadingShiftTextureScale=e.shadingShiftTextureScale,this.shadingToonyFactor=e.shadingToonyFactor,this.rimLightingMixFactor=e.rimLightingMixFactor,this.rimMultiplyTexture=(m=e.rimMultiplyTexture)!=null?m:null,this.matcapFactor.copy(e.matcapFactor),this.matcapTexture=(b=e.matcapTexture)!=null?b:null,this.parametricRimColorFactor.copy(e.parametricRimColorFactor),this.parametricRimLiftFactor=e.parametricRimLiftFactor,this.parametricRimFresnelPowerFactor=e.parametricRimFresnelPowerFactor,this.outlineWidthMode=e.outlineWidthMode,this.outlineWidthMultiplyTexture=(f=e.outlineWidthMultiplyTexture)!=null?f:null,this.outlineWidthFactor=e.outlineWidthFactor,this.outlineColorFactor.copy(e.outlineColorFactor),this.outlineLightingMixFactor=e.outlineLightingMixFactor,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.uvAnimationMaskTexture=(E=e.uvAnimationMaskTexture)!=null?E:null,this.shadeColorNode=(P=e.shadeColorNode)!=null?P:null,this.shadingShiftNode=(w=e.shadingShiftNode)!=null?w:null,this.shadingToonyNode=(A=e.shadingToonyNode)!=null?A:null,this.rimLightingMixNode=(V=e.rimLightingMixNode)!=null?V:null,this.rimMultiplyNode=(W=e.rimMultiplyNode)!=null?W:null,this.matcapNode=(j=e.matcapNode)!=null?j:null,this.parametricRimColorNode=(I=e.parametricRimColorNode)!=null?I:null,this.parametricRimLiftNode=(U=e.parametricRimLiftNode)!=null?U:null,this.parametricRimFresnelPowerNode=(_=e.parametricRimFresnelPowerNode)!=null?_:null,this.isOutline=(z=e.isOutline)!=null?z:null,super.copy(e)}update(e){this.uvAnimationScrollXOffset+=e*this.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYOffset+=e*this.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationPhase+=e*this.uvAnimationRotationSpeedFactor}_setupShadeColorNode(){if(this.shadeColorNode!=null)return i.vec3(this.shadeColorNode);let e=G;if(this.shadeMultiplyTexture&&this.shadeMultiplyTexture.isTexture===!0){let t=C.context({getUV:()=>this._animatedUVNode});e=e.mul(t)}return e}_setupShadingShiftNode(){if(this.shadingShiftNode!=null)return i.float(this.shadingShiftNode);let e=J;if(this.shadingShiftTexture&&this.shadingShiftTexture.isTexture===!0){let t=C.context({getUV:()=>this._animatedUVNode});e=e.add(t.mul(Q))}return e}_setupShadingToonyNode(){return this.shadingToonyNode!=null?i.float(this.shadingToonyNode):ee}_setupRimLightingMixNode(){return this.rimLightingMixNode!=null?i.float(this.rimLightingMixNode):te}_setupRimMultiplyNode(){return this.rimMultiplyNode!=null?i.vec3(this.rimMultiplyNode):this.rimMultiplyTexture&&this.rimMultiplyTexture.isTexture===!0?ie.context({getUV:()=>this._animatedUVNode}):i.vec3(1)}_setupMatcapNode(){return this.matcapNode!=null?i.vec3(this.matcapNode):this.matcapTexture&&this.matcapTexture.isTexture===!0?re.context({getUV:()=>i.matcapUV.mul(1,-1).add(0,1)}).mul(oe):i.vec3(0)}_setupParametricRimNode(){let e=this.parametricRimColorNode!=null?i.vec3(this.parametricRimColorNode):ae,t=this.parametricRimLiftNode!=null?i.float(this.parametricRimLiftNode):ne,o=this.parametricRimFresnelPowerNode!=null?i.float(this.parametricRimFresnelPowerNode):le;return pe({parametricRimLift:t,parametricRimFresnelPower:o,parametricRimColor:e})}};export{N as MToonAnimatedUVNode,S as MToonLightingModel,L as MToonNodeMaterial}; +import*as D from"three";var k=parseInt(D.REVISION,10);k<167&&console.warn(`MToonNodeMaterial requires Three.js r167 or higher (You are using r${k}). This would not work correctly.`);import*as l from"three/webgpu";import*as r from"three/webgpu";var Y=r.materialReference("color","color"),X=r.materialReference("map","texture"),B=r.materialReference("normalMap","texture"),K=r.materialReference("normalScale","vec2"),q=r.materialReference("emissive","color"),Z=r.materialReference("emissiveIntensity","float"),$=r.materialReference("emissiveMap","texture"),G=r.materialReference("shadeColorFactor","color"),J=r.materialReference("shadingShiftFactor","float"),C=r.materialReference("shadeMultiplyTexture","texture"),Q=r.materialReference("shadeMultiplyTextureScale","float"),ee=r.materialReference("shadingToonyFactor","float"),te=r.materialReference("rimLightingMixFactor","float"),ie=r.materialReference("rimMultiplyTexture","texture"),oe=r.materialReference("matcapFactor","color"),re=r.materialReference("matcapTexture","texture"),ae=r.materialReference("parametricRimColorFactor","color"),ne=r.materialReference("parametricRimLiftFactor","float"),le=r.materialReference("parametricRimFresnelPowerFactor","float"),se=r.materialReference("outlineWidthMultiplyTexture","texture"),de=r.materialReference("outlineWidthFactor","float"),O=r.materialReference("outlineColorFactor","color"),ue=r.materialReference("outlineLightingMixFactor","float"),ce=r.materialReference("uvAnimationMaskTexture","texture"),Ee=r.materialReference("uvAnimationScrollXOffset","float"),me=r.materialReference("uvAnimationScrollYOffset","float"),he=r.materialReference("uvAnimationRotationPhase","float");var N=class extends l.TempNode{constructor(e){super("vec2"),this.hasMaskTexture=e}setup(){let e=1;this.hasMaskTexture&&(e=l.vec4(ce).context({getUV:()=>l.uv()}).r);let t=l.uv(),o=he.mul(e),n=l.cos(o),u=l.sin(o);t=t.sub(l.vec2(.5,.5)),t=t.mul(l.mat2(n,u,u.negate(),n)),t=t.add(l.vec2(.5,.5));let c=l.vec2(Ee,me).mul(e);return t=t.add(c),t.toVar("AnimatedUV")}};import*as a from"three/webgpu";import*as s from"three/webgpu";var F=s.nodeImmutable(s.PropertyNode,"vec3").toVar("ShadeColor"),v=s.nodeImmutable(s.PropertyNode,"float").toVar("ShadingShift"),y=s.nodeImmutable(s.PropertyNode,"float").toVar("ShadingToony"),H=s.nodeImmutable(s.PropertyNode,"float").toVar("RimLightingMix"),x=s.nodeImmutable(s.PropertyNode,"vec3").toVar("RimMultiply"),M=s.nodeImmutable(s.PropertyNode,"vec3").toVar("matcap"),g=s.nodeImmutable(s.PropertyNode,"vec3").toVar("ParametricRim");import*as h from"three/webgpu";var p=d=>parseInt(h.REVISION,10)>=168?h.Fn(d):h.tslFn(d);var Te=p(({a:d,b:e,t})=>{let o=t.sub(d),n=e.sub(d);return o.div(n).clamp()}),Re=p(({dotNL:d})=>{let t=a.float(1).sub(y),o=d.add(v);return o=Te({a:t.negate(),b:t,t:o}),o=o.mul(1),o}),fe=p(({shading:d,lightColor:e})=>{let t=a.mix(F,a.diffuseColor,d);return e.mul(a.BRDF_Lambert({diffuseColor:t}))}),S=class extends a.LightingModel{constructor(){super()}direct({lightDirection:e,lightColor:t,reflectedLight:o}){let n=a.transformedNormalView.dot(e).clamp(-1,1),u=Re({dotNL:n});o.directDiffuse.assign(o.directDiffuse.add(fe({shading:u,lightColor:t}))),o.directSpecular.assign(o.directSpecular.add(g.add(M).mul(x).mul(a.mix(a.vec3(0),a.BRDF_Lambert({diffuseColor:t}),H))))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e)}indirectDiffuse({irradiance:e,reflectedLight:t}){t.indirectDiffuse.assign(t.indirectDiffuse.add(e.mul(a.BRDF_Lambert({diffuseColor:a.diffuseColor}))))}indirectSpecular({reflectedLight:e}){e.indirectSpecular.assign(e.indirectSpecular.add(g.add(M).mul(x).mul(a.mix(a.vec3(1),a.vec3(0),H))))}};import*as i from"three/webgpu";var T={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"};import*as R from"three/webgpu";var pe=p(({parametricRimLift:d,parametricRimFresnelPower:e,parametricRimColor:t})=>{let o=R.modelViewPosition.normalize(),n=R.transformedNormalView.dot(o.negate());return R.float(1).sub(n).add(d).clamp().pow(e).mul(t)});var L=class extends i.NodeMaterial{customProgramCacheKey(){let e=super.customProgramCacheKey();return e+=`isOutline:${this.isOutline},`,e}get isMToonNodeMaterial(){return!0}constructor(e={}){super(),e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,delete e.giEqualizationFactor,delete e.v0CompatShade,delete e.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=T.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(e)}setupLightingModel(){return new S}setup(e){var t;this._animatedUVNode=new N((t=this.uvAnimationMaskTexture&&this.uvAnimationMaskTexture.isTexture===!0)!=null?t:!1),super.setup(e)}setupDiffuseColor(e){let t=null;if(this.colorNode==null){if(t=Y,this.map&&this.map.isTexture===!0){let o=X.context({getUV:()=>this._animatedUVNode});t=t.mul(o)}this.colorNode=t}this.vertexColors===!0&&e.geometry.hasAttribute("color")&&(console.warn("MToonNodeMaterial: MToon ignores vertex colors. Consider using a model without vertex colors instead."),this.vertexColors=!1),super.setupDiffuseColor(e),parseInt(i.REVISION,10)<166&&this.transparent===!1&&this.blending===i.NormalBlending&&this.alphaToCoverage===!1&&i.diffuseColor.a.assign(1),this.colorNode===t&&(this.colorNode=null)}setupVariants(){F.assign(this._setupShadeColorNode()),v.assign(this._setupShadingShiftNode()),y.assign(this._setupShadingToonyNode()),H.assign(this._setupRimLightingMixNode()),x.assign(this._setupRimMultiplyNode()),M.assign(this._setupMatcapNode()),g.assign(this._setupParametricRimNode())}setupNormal(e){let t=this.normalNode;if(this.normalNode==null){if(this.normalNode=i.materialNormal,this.normalMap&&this.normalMap.isTexture===!0){let n=B.context({getUV:()=>this._animatedUVNode});this.normalNode=i.normalMap(n,K)}this.isOutline&&(this.normalNode=this.normalNode.negate())}if(parseInt(i.REVISION,10)>=168){let n=this.normalNode;return this.normalNode=t,n}else{super.setupNormal(e),this.normalNode=t;return}}setupLighting(e){let t=null;if(this.emissiveNode==null){if(t=q.mul(Z),this.emissiveMap&&this.emissiveMap.isTexture===!0){let n=$.context({getUV:()=>this._animatedUVNode});t=t.mul(n)}this.emissiveNode=t}let o=super.setupLighting(e);return this.emissiveNode===t&&(this.emissiveNode=null),o}setupOutput(e,t){return this.isOutline&&this.outlineWidthMode!==T.None&&(t=i.vec4(i.mix(O,t.xyz.mul(O),ue),t.w)),super.setupOutput(e,t)}setupPosition(e){var n,u;let t=this.positionNode;if(this.isOutline&&this.outlineWidthMode!==T.None){(n=this.positionNode)!=null||(this.positionNode=i.positionLocal);let c=i.normalLocal.normalize(),E=de;if(this.outlineWidthMultiplyTexture&&this.outlineWidthMultiplyTexture.isTexture===!0){let m=se.context({getUV:()=>this._animatedUVNode});E=E.mul(m)}let b=i.length(i.modelNormalMatrix.mul(c)),f=E.mul(b).mul(c);if(this.outlineWidthMode===T.WorldCoordinates)this.positionNode=this.positionNode.add(f);else if(this.outlineWidthMode===T.ScreenCoordinates){let m=i.cameraProjectionMatrix.element(1).element(1);this.positionNode=this.positionNode.add(f.div(m).mul(i.positionView.z.negate()))}(u=this.positionNode)!=null||(this.positionNode=i.positionLocal)}let o=super.setupPosition(e);return o.z.add(o.w.mul(1e-6)),this.positionNode=t,o}copy(e){var t,o,n,u,c,E,b,f,m,V,P,w,A,W,j,I,U,_,z;return this.color.copy(e.color),this.map=(t=e.map)!=null?t:null,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.emissiveMap=(o=e.emissiveMap)!=null?o:null,this.normalMap=(n=e.normalMap)!=null?n:null,this.normalScale.copy(e.normalScale),this.shadeColorFactor.copy(e.shadeColorFactor),this.shadeMultiplyTexture=(u=e.shadeMultiplyTexture)!=null?u:null,this.shadingShiftFactor=e.shadingShiftFactor,this.shadingShiftTexture=(c=e.shadingShiftTexture)!=null?c:null,this.shadingShiftTextureScale=e.shadingShiftTextureScale,this.shadingToonyFactor=e.shadingToonyFactor,this.rimLightingMixFactor=e.rimLightingMixFactor,this.rimMultiplyTexture=(E=e.rimMultiplyTexture)!=null?E:null,this.matcapFactor.copy(e.matcapFactor),this.matcapTexture=(b=e.matcapTexture)!=null?b:null,this.parametricRimColorFactor.copy(e.parametricRimColorFactor),this.parametricRimLiftFactor=e.parametricRimLiftFactor,this.parametricRimFresnelPowerFactor=e.parametricRimFresnelPowerFactor,this.outlineWidthMode=e.outlineWidthMode,this.outlineWidthMultiplyTexture=(f=e.outlineWidthMultiplyTexture)!=null?f:null,this.outlineWidthFactor=e.outlineWidthFactor,this.outlineColorFactor.copy(e.outlineColorFactor),this.outlineLightingMixFactor=e.outlineLightingMixFactor,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.uvAnimationMaskTexture=(m=e.uvAnimationMaskTexture)!=null?m:null,this.shadeColorNode=(V=e.shadeColorNode)!=null?V:null,this.shadingShiftNode=(P=e.shadingShiftNode)!=null?P:null,this.shadingToonyNode=(w=e.shadingToonyNode)!=null?w:null,this.rimLightingMixNode=(A=e.rimLightingMixNode)!=null?A:null,this.rimMultiplyNode=(W=e.rimMultiplyNode)!=null?W:null,this.matcapNode=(j=e.matcapNode)!=null?j:null,this.parametricRimColorNode=(I=e.parametricRimColorNode)!=null?I:null,this.parametricRimLiftNode=(U=e.parametricRimLiftNode)!=null?U:null,this.parametricRimFresnelPowerNode=(_=e.parametricRimFresnelPowerNode)!=null?_:null,this.isOutline=(z=e.isOutline)!=null?z:null,super.copy(e)}update(e){this.uvAnimationScrollXOffset+=e*this.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYOffset+=e*this.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationPhase+=e*this.uvAnimationRotationSpeedFactor}_setupShadeColorNode(){if(this.shadeColorNode!=null)return i.vec3(this.shadeColorNode);let e=G;if(this.shadeMultiplyTexture&&this.shadeMultiplyTexture.isTexture===!0){let t=C.context({getUV:()=>this._animatedUVNode});e=e.mul(t)}return e}_setupShadingShiftNode(){if(this.shadingShiftNode!=null)return i.float(this.shadingShiftNode);let e=J;if(this.shadingShiftTexture&&this.shadingShiftTexture.isTexture===!0){let t=C.context({getUV:()=>this._animatedUVNode});e=e.add(t.mul(Q))}return e}_setupShadingToonyNode(){return this.shadingToonyNode!=null?i.float(this.shadingToonyNode):ee}_setupRimLightingMixNode(){return this.rimLightingMixNode!=null?i.float(this.rimLightingMixNode):te}_setupRimMultiplyNode(){return this.rimMultiplyNode!=null?i.vec3(this.rimMultiplyNode):this.rimMultiplyTexture&&this.rimMultiplyTexture.isTexture===!0?ie.context({getUV:()=>this._animatedUVNode}):i.vec3(1)}_setupMatcapNode(){return this.matcapNode!=null?i.vec3(this.matcapNode):this.matcapTexture&&this.matcapTexture.isTexture===!0?re.context({getUV:()=>i.matcapUV.mul(1,-1).add(0,1)}).mul(oe):i.vec3(0)}_setupParametricRimNode(){let e=this.parametricRimColorNode!=null?i.vec3(this.parametricRimColorNode):ae,t=this.parametricRimLiftNode!=null?i.float(this.parametricRimLiftNode):ne,o=this.parametricRimFresnelPowerNode!=null?i.float(this.parametricRimFresnelPowerNode):le;return pe({parametricRimLift:t,parametricRimFresnelPower:o,parametricRimColor:e})}};export{N as MToonAnimatedUVNode,S as MToonLightingModel,L as MToonNodeMaterial}; 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 8fd0c897e..0e0b1ed25 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.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.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 2ab8cf2f9..a057e46dd 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.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.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 c2a0739b2..6e46e38e5 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 2339a2fa3..c353dc10e 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.1.6 + * @pixiv/three-vrm-materials-v0compat v3.2.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 a4e751a62..541578e1f 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.1.6 + * @pixiv/three-vrm-materials-v0compat v3.2.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 119594e75..c49b5df72 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 4de7e5dbd..4658e387b 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 43d84bc81..9d40aeffe 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 f745dd9d9..f786c5667 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 20f7db792..07c61930c 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 9da9a7661..7b0fecc2f 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 375d832c3..29f8128bc 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.1.6 + * @pixiv/three-vrm-node-constraint v3.2.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 05b7e0336..7d59cf8d7 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.1.6 + * @pixiv/three-vrm-node-constraint v3.2.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneCollider.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneCollider.html index 802019b09..3825db7ae 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneCollider.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneCollider.html @@ -1,5 +1,5 @@ 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

    @@ -146,7 +146,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

    diff --git a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderHelper.html b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneColliderHelper.html index 01caaae1f..ce91a093f 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 42ca5f6e1..82c622780 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 43cd27d97..063c7561d 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 ad65a2a40..e466e6db9 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 61e4636ef..b6628a782 100644 --- a/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJoint.html +++ b/packages/three-vrm-springbone/docs/classes/VRMSpringBoneJoint.html @@ -1,6 +1,6 @@ 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

    bone child colliderGroups @@ -15,16 +15,16 @@
  • 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 a4a29a2d4..d27bf7c94 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 e77e27fce..f4c3374de 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 21f31199e..9fa4f4788 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 3356ae78a..ce607c758 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 3fc796879..8de309392 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.1.6 + * @pixiv/three-vrm-springbone v3.2.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. 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 6277c9be7..d8dd0c962 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.1.6 + * @pixiv/three-vrm-springbone v3.2.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm/docs/assets/search.js b/packages/three-vrm/docs/assets/search.js index cbac853d5..0fcb0c6cb 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,H4sIAAAAAAAAA8W9WZPjRpK2+1+ybqvry9hJ3am1HGlMJemUlvn6yNpkVBKViRGT5IBgVtW09X8/hgiCGeF4A3AsqblpZRcRHi8Aj80fj8C/bqrDh9PNZ7/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wT4pLjLeZ6x39SZimXSRJJq1LqngeMdIKYnzQDnmSmZWVVHCZrl0na52nlBwrzkwIfaoecx92iPf1SeZqKzWXa0YiDttLZig1NZ2eJJEaj5kiM0LfZ7zjM3GvL68fLGLOwZ+qx2tucGo1+X4xW/bV2K4kS6Q4DCaZs97YYMeV420YssX9inmwUWw5hD7o6T7xgd+KeahRbDWNaMW0TTHPMWqtkeOUZRxxVu1KVjEjsJHRcOpqiuTjXBlm4C2ymGthMv5olWKmDWfsgsmEjA9rUdz5e/WY7RCSD5JMsYZOvEhyhvhG6VYuGU+d1PX0M34Tvezn8h8IJvsjkuPPR2psfB4ajSfL/HZEz2KDpuMJPTMseTUNvD8+7UHzJ9DBXtb344N1NZOeXq22+0JSnXGQlwkmrhab8aOzRotPT9DXiB4zUv5UPdIlkooPITDM/XwXO+Xj8VDVRYXaUMwsDJMUXczmj7qJw7jMsM9T9ZiempEu5+JzDfirm9Ri1z/1bbIaY999ajf7HGKOY/lrqMFzSVScpOWYGzCeqsfMyTtxd8L2q05WT/ytLcU8Yv9iB4YnZUyDFPNbsU/VY1X897msoiNCOk0znj+qdge64r+fJgKW+wxrHGBmRte8xTATzX1NO85z4oakqsdnzIy/9B6fgsaf/net+s++p6bjzEjmbkBoGjVZFTfZGbK7qRsxC3bMDKa86bvN8XTekRpi8cw0mXwNx92GpE7EWcCOuUktb/90fChIPCzeW+b4A/pzBd3PDcdrf8dv58Qk8pR4ey0zn7NrGGYextlvK2YGQmI6Gx6M98E5fjinN/9Fx2fbOH5Hd67L9NjM5DuzvAfaPSciPqpLtDvu5fXgjDZUblfXFNn2DybK9ewym+QbzySYZzl9Sr/KIeOkJ805SeKfr2+O5bHw3wr57Ld//vvf/z+GnjC3HxgDAA=="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA8W9WZPkNpK2+19Kt9X1JfYI3am71ac1ppJ0Sst8fWRtsqgMViZHsQ2DkVU1bf3fjxEIRgLOF6RzSc3NtKaScLwB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kW3/g4lyPbvMJfnGIWvLvMvpc/pVDhknPWnOTRL/fP3qVJ4K/62QL3/957///f8DZphUbDEZAwA="; \ 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 3e7ae3597..2f46fe6bd 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/VRMLoaderPlugin.html b/packages/three-vrm/docs/classes/VRMLoaderPlugin.html index 4c6642e6f..036d0bff0 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/VRMUtils.html b/packages/three-vrm/docs/classes/VRMUtils.html index cc03ea3db..a83d60ec7 100644 --- a/packages/three-vrm/docs/classes/VRMUtils.html +++ b/packages/three-vrm/docs/classes/VRMUtils.html @@ -1,8 +1,13 @@ -VRMUtils | @pixiv/three-vrm

    Properties

    deepDispose +VRMUtils | @pixiv/three-vrm

    Properties

    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.

        +

    Properties

    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.

        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.

        @@ -13,12 +18,13 @@ especially when the model loaded has many materials and the dependent bone count is different between them.

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

        false by default.

        -

    Returns void

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

    Type declaration

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

    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. 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 2e5a57453..8b62dd454 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 0812be300..52d5e7f10 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 688a598f0..fbe5655de 100644 --- a/packages/three-vrm/examples/animations.html +++ b/packages/three-vrm/examples/animations.html @@ -81,7 +81,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/basic.html b/packages/three-vrm/examples/basic.html index 1b85b03d5..ce42f37e2 100644 --- a/packages/three-vrm/examples/basic.html +++ b/packages/three-vrm/examples/basic.html @@ -82,7 +82,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/bones.html b/packages/three-vrm/examples/bones.html index d5150623e..9830e3b5e 100644 --- a/packages/three-vrm/examples/bones.html +++ b/packages/three-vrm/examples/bones.html @@ -80,7 +80,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/debug.html b/packages/three-vrm/examples/debug.html index 867422e68..2c4852697 100644 --- a/packages/three-vrm/examples/debug.html +++ b/packages/three-vrm/examples/debug.html @@ -88,7 +88,7 @@ // calling this function greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/dnd.html b/packages/three-vrm/examples/dnd.html index b8d7e0b52..b9579d8b1 100644 --- a/packages/three-vrm/examples/dnd.html +++ b/packages/three-vrm/examples/dnd.html @@ -82,7 +82,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); if ( currentVrm ) { diff --git a/packages/three-vrm/examples/expressions.html b/packages/three-vrm/examples/expressions.html index cda0e3cb5..11c30f93f 100644 --- a/packages/three-vrm/examples/expressions.html +++ b/packages/three-vrm/examples/expressions.html @@ -80,7 +80,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/firstperson.html b/packages/three-vrm/examples/firstperson.html index 347dbf75e..94abc4bc9 100644 --- a/packages/three-vrm/examples/firstperson.html +++ b/packages/three-vrm/examples/firstperson.html @@ -80,7 +80,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/lookat-advanced.html b/packages/three-vrm/examples/lookat-advanced.html index b81982336..de42627aa 100644 --- a/packages/three-vrm/examples/lookat-advanced.html +++ b/packages/three-vrm/examples/lookat-advanced.html @@ -151,7 +151,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/lookat.html b/packages/three-vrm/examples/lookat.html index 22f6162d3..d6dba3bce 100644 --- a/packages/three-vrm/examples/lookat.html +++ b/packages/three-vrm/examples/lookat.html @@ -84,7 +84,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // 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 9346d77af..9a7e36903 100644 --- a/packages/three-vrm/examples/materials-debug.html +++ b/packages/three-vrm/examples/materials-debug.html @@ -80,7 +80,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/meta.html b/packages/three-vrm/examples/meta.html index e06595968..bc249e714 100644 --- a/packages/three-vrm/examples/meta.html +++ b/packages/three-vrm/examples/meta.html @@ -97,7 +97,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // Disable frustum culling vrm.scene.traverse( ( obj ) => { diff --git a/packages/three-vrm/examples/mouse.html b/packages/three-vrm/examples/mouse.html index 78651b70a..a2c5a7dca 100644 --- a/packages/three-vrm/examples/mouse.html +++ b/packages/three-vrm/examples/mouse.html @@ -75,7 +75,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene ); + VRMUtils.combineSkeletons( gltf.scene ); // 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 5a32768e7..9a64a3e76 100644 --- a/packages/three-vrm/examples/webgpu-dnd.html +++ b/packages/three-vrm/examples/webgpu-dnd.html @@ -98,7 +98,7 @@ // calling these functions greatly improves the performance VRMUtils.removeUnnecessaryVertices( gltf.scene ); - VRMUtils.removeUnnecessaryJoints( gltf.scene, { experimentalSameBoneCounts: true } ); + VRMUtils.combineSkeletons( gltf.scene ); if ( currentVrm ) { diff --git a/packages/three-vrm/lib/nodes/index.cjs b/packages/three-vrm/lib/nodes/index.cjs index 2ea1056e8..1ff855533 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.1.6 + * @pixiv/three-vrm v3.2.0 * VRM file loader for three.js. * * Copyright (c) 2019-2024 pixiv Inc. @@ -105,16 +105,16 @@ var MToonAnimatedUVNode = class extends THREE3.TempNode { uv2 = uv2.add(THREE3.vec2(0.5, 0.5)); const scroll = THREE3.vec2(refUVAnimationScrollXOffset, refUVAnimationScrollYOffset).mul(uvAnimationMask); uv2 = uv2.add(scroll); - return uv2.temp("AnimatedUV"); + return uv2.toVar("AnimatedUV"); } }; -var shadeColor = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("ShadeColor"); -var shadingShift = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("ShadingShift"); -var shadingToony = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("ShadingToony"); -var rimLightingMix = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("RimLightingMix"); -var rimMultiply = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("RimMultiply"); -var matcap = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("matcap"); -var parametricRim = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("ParametricRim"); +var shadeColor = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("ShadeColor"); +var shadingShift = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("ShadingShift"); +var shadingToony = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("ShadingToony"); +var rimLightingMix = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("RimLightingMix"); +var rimMultiply = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("RimMultiply"); +var matcap = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("matcap"); +var parametricRim = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("ParametricRim"); var FnCompat = (jsFunc) => { const threeRevision2 = parseInt(THREE5.REVISION, 10); if (threeRevision2 >= 168) { @@ -522,11 +522,11 @@ var MToonNodeMaterial = class extends THREE8.NodeMaterial { } }; /*! - * @pixiv/three-vrm-materials-mtoon v3.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. * @pixiv/three-vrm-materials-mtoon is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc3JjL25vZGVzL2luZGV4LnRzIiwgIi4uLy4uLy4uL3RocmVlLXZybS1tYXRlcmlhbHMtbXRvb24vc3JjL25vZGVzL3dhcm5pbmdJZlByZTE2MS50cyIsICIuLi8uLi8uLi90aHJlZS12cm0tbWF0ZXJpYWxzLW10b29uL3NyYy9ub2Rlcy9NVG9vbkFuaW1hdGVkVVZOb2RlLnRzIiwgIi4uLy4uLy4uL3RocmVlLXZybS1tYXRlcmlhbHMtbXRvb24vc3Jj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644 --- 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 $=(e,t)=>{for(var o in t)v(e,o,{get:t[o],enumerable:!0})},O=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of K(t))!Z.call(e,l)&&l!==o&&v(e,l,{get:()=>t[l],enumerable:!(r=q(t,l))||r.enumerable});return e};var h=(e,t,o)=>(o=e!=null?B(j(e)):{},O(t||!e||!e.__esModule?v(o,"default",{value:e,enumerable:!0}):o,e)),G=e=>O(v({},"__esModule",{value:!0}),e);var Ce={};$(Ce,{MToonAnimatedUVNode:()=>D,MToonLightingModel:()=>z,MToonNodeMaterial:()=>ye});module.exports=G(Ce);var b=h(require("three"),1),s=h(require("three/webgpu"),1),a=h(require("three/webgpu"),1),n=h(require("three/webgpu"),1),m=h(require("three/webgpu"),1),p=h(require("three/webgpu"),1),i=h(require("three/webgpu"),1),E=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"),ee=a.materialReference("normalMap","texture"),te=a.materialReference("normalScale","vec2"),ie=a.materialReference("emissive","color"),oe=a.materialReference("emissiveIntensity","float"),re=a.materialReference("emissiveMap","texture"),ae=a.materialReference("shadeColorFactor","color"),le=a.materialReference("shadingShiftFactor","float"),U=a.materialReference("shadeMultiplyTexture","texture"),ne=a.materialReference("shadeMultiplyTextureScale","float"),se=a.materialReference("shadingToonyFactor","float"),me=a.materialReference("rimLightingMixFactor","float"),ue=a.materialReference("rimMultiplyTexture","texture"),he=a.materialReference("matcapFactor","color"),de=a.materialReference("matcapTexture","texture"),ce=a.materialReference("parametricRimColorFactor","color"),pe=a.materialReference("parametricRimLiftFactor","float"),Ee=a.materialReference("parametricRimFresnelPowerFactor","float"),Re=a.materialReference("outlineWidthMultiplyTexture","texture"),fe=a.materialReference("outlineWidthFactor","float"),I=a.materialReference("outlineColorFactor","color"),Te=a.materialReference("outlineLightingMixFactor","float"),ve=a.materialReference("uvAnimationMaskTexture","texture"),Ne=a.materialReference("uvAnimationScrollXOffset","float"),ge=a.materialReference("uvAnimationScrollYOffset","float"),He=a.materialReference("uvAnimationRotationPhase","float"),D=class extends s.TempNode{constructor(e){super("vec2"),this.hasMaskTexture=e}setup(){let e=1;this.hasMaskTexture&&(e=s.vec4(ve).context({getUV:()=>s.uv()}).r);let t=s.uv(),o=He.mul(e),r=s.cos(o),l=s.sin(o);t=t.sub(s.vec2(.5,.5)),t=t.mul(s.mat2(r,l,l.negate(),r)),t=t.add(s.vec2(.5,.5));let u=s.vec2(Ne,ge).mul(e);return t=t.add(u),t.temp("AnimatedUV")}},k=m.nodeImmutable(m.PropertyNode,"vec3").temp("ShadeColor"),Y=m.nodeImmutable(m.PropertyNode,"float").temp("ShadingShift"),X=m.nodeImmutable(m.PropertyNode,"float").temp("ShadingToony"),g=m.nodeImmutable(m.PropertyNode,"float").temp("RimLightingMix"),H=m.nodeImmutable(m.PropertyNode,"vec3").temp("RimMultiply"),M=m.nodeImmutable(m.PropertyNode,"vec3").temp("matcap"),x=m.nodeImmutable(m.PropertyNode,"vec3").temp("ParametricRim"),N=e=>parseInt(p.REVISION,10)>=168?p.Fn(e):p.tslFn(e),Me=N(({a:e,b:t,t:o})=>{let r=o.sub(e),l=t.sub(e);return r.div(l).clamp()}),xe=N(({dotNL:e})=>{let o=n.float(1).sub(X),r=e.add(Y);return r=Me({a:o.negate(),b:o,t:r}),r=r.mul(1),r}),Se=N(({shading:e,lightColor:t})=>{let o=n.mix(k,n.diffuseColor,e);return t.mul(n.BRDF_Lambert({diffuseColor:o}))}),z=class extends n.LightingModel{constructor(){super()}direct({lightDirection:e,lightColor:t,reflectedLight:o}){let r=n.transformedNormalView.dot(e).clamp(-1,1),l=xe({dotNL:r});o.directDiffuse.assign(o.directDiffuse.add(Se({shading:l,lightColor:t}))),o.directSpecular.assign(o.directSpecular.add(x.add(M).mul(H).mul(n.mix(n.vec3(0),n.BRDF_Lambert({diffuseColor:t}),g))))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e)}indirectDiffuse({irradiance:e,reflectedLight:t}){t.indirectDiffuse.assign(t.indirectDiffuse.add(e.mul(n.BRDF_Lambert({diffuseColor:n.diffuseColor}))))}indirectSpecular({reflectedLight:e}){e.indirectSpecular.assign(e.indirectSpecular.add(x.add(M).mul(H).mul(n.mix(n.vec3(1),n.vec3(0),g))))}},f={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},Fe=N(({parametricRimLift:e,parametricRimFresnelPower:t,parametricRimColor:o})=>{let r=E.modelViewPosition.normalize(),l=E.transformedNormalView.dot(r.negate());return E.float(1).sub(l).add(e).clamp().pow(t).mul(o)}),ye=class extends i.NodeMaterial{customProgramCacheKey(){let e=super.customProgramCacheKey();return e+=`isOutline:${this.isOutline},`,e}get isMToonNodeMaterial(){return!0}constructor(e={}){super(),e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,delete e.giEqualizationFactor,delete e.v0CompatShade,delete e.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(e)}setupLightingModel(){return new z}setup(e){var t;this._animatedUVNode=new D((t=this.uvAnimationMaskTexture&&this.uvAnimationMaskTexture.isTexture===!0)!=null?t:!1),super.setup(e)}setupDiffuseColor(e){let t=null;if(this.colorNode==null){if(t=J,this.map&&this.map.isTexture===!0){let o=Q.context({getUV:()=>this._animatedUVNode});t=t.mul(o)}this.colorNode=t}this.vertexColors===!0&&e.geometry.hasAttribute("color")&&(console.warn("MToonNodeMaterial: MToon ignores vertex colors. Consider using a model without vertex colors instead."),this.vertexColors=!1),super.setupDiffuseColor(e),parseInt(i.REVISION,10)<166&&this.transparent===!1&&this.blending===i.NormalBlending&&this.alphaToCoverage===!1&&i.diffuseColor.a.assign(1),this.colorNode===t&&(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(e){let t=this.normalNode;if(this.normalNode==null){if(this.normalNode=i.materialNormal,this.normalMap&&this.normalMap.isTexture===!0){let r=ee.context({getUV:()=>this._animatedUVNode});this.normalNode=i.normalMap(r,te)}this.isOutline&&(this.normalNode=this.normalNode.negate())}if(parseInt(i.REVISION,10)>=168){let r=this.normalNode;return this.normalNode=t,r}else{super.setupNormal(e),this.normalNode=t;return}}setupLighting(e){let t=null;if(this.emissiveNode==null){if(t=ie.mul(oe),this.emissiveMap&&this.emissiveMap.isTexture===!0){let r=re.context({getUV:()=>this._animatedUVNode});t=t.mul(r)}this.emissiveNode=t}let o=super.setupLighting(e);return this.emissiveNode===t&&(this.emissiveNode=null),o}setupOutput(e,t){return this.isOutline&&this.outlineWidthMode!==f.None&&(t=i.vec4(i.mix(I,t.xyz.mul(I),Te),t.w)),super.setupOutput(e,t)}setupPosition(e){var t,o;let r=this.positionNode;if(this.isOutline&&this.outlineWidthMode!==f.None){(t=this.positionNode)!=null||(this.positionNode=i.positionLocal);let u=i.normalLocal.normalize(),d=fe;if(this.outlineWidthMultiplyTexture&&this.outlineWidthMultiplyTexture.isTexture===!0){let c=Re.context({getUV:()=>this._animatedUVNode});d=d.mul(c)}let T=i.length(i.modelNormalMatrix.mul(u)),R=d.mul(T).mul(u);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(e);return l.z.add(l.w.mul(1e-6)),this.positionNode=r,l}copy(e){var t,o,r,l,u,d,T,R,c,S,F,y,C,_,L,w,V,P,A;return this.color.copy(e.color),this.map=(t=e.map)!=null?t:null,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.emissiveMap=(o=e.emissiveMap)!=null?o:null,this.normalMap=(r=e.normalMap)!=null?r:null,this.normalScale.copy(e.normalScale),this.shadeColorFactor.copy(e.shadeColorFactor),this.shadeMultiplyTexture=(l=e.shadeMultiplyTexture)!=null?l:null,this.shadingShiftFactor=e.shadingShiftFactor,this.shadingShiftTexture=(u=e.shadingShiftTexture)!=null?u:null,this.shadingShiftTextureScale=e.shadingShiftTextureScale,this.shadingToonyFactor=e.shadingToonyFactor,this.rimLightingMixFactor=e.rimLightingMixFactor,this.rimMultiplyTexture=(d=e.rimMultiplyTexture)!=null?d:null,this.matcapFactor.copy(e.matcapFactor),this.matcapTexture=(T=e.matcapTexture)!=null?T:null,this.parametricRimColorFactor.copy(e.parametricRimColorFactor),this.parametricRimLiftFactor=e.parametricRimLiftFactor,this.parametricRimFresnelPowerFactor=e.parametricRimFresnelPowerFactor,this.outlineWidthMode=e.outlineWidthMode,this.outlineWidthMultiplyTexture=(R=e.outlineWidthMultiplyTexture)!=null?R:null,this.outlineWidthFactor=e.outlineWidthFactor,this.outlineColorFactor.copy(e.outlineColorFactor),this.outlineLightingMixFactor=e.outlineLightingMixFactor,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.uvAnimationMaskTexture=(c=e.uvAnimationMaskTexture)!=null?c:null,this.shadeColorNode=(S=e.shadeColorNode)!=null?S:null,this.shadingShiftNode=(F=e.shadingShiftNode)!=null?F:null,this.shadingToonyNode=(y=e.shadingToonyNode)!=null?y:null,this.rimLightingMixNode=(C=e.rimLightingMixNode)!=null?C:null,this.rimMultiplyNode=(_=e.rimMultiplyNode)!=null?_:null,this.matcapNode=(L=e.matcapNode)!=null?L:null,this.parametricRimColorNode=(w=e.parametricRimColorNode)!=null?w:null,this.parametricRimLiftNode=(V=e.parametricRimLiftNode)!=null?V:null,this.parametricRimFresnelPowerNode=(P=e.parametricRimFresnelPowerNode)!=null?P:null,this.isOutline=(A=e.isOutline)!=null?A:null,super.copy(e)}update(e){this.uvAnimationScrollXOffset+=e*this.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYOffset+=e*this.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationPhase+=e*this.uvAnimationRotationSpeedFactor}_setupShadeColorNode(){if(this.shadeColorNode!=null)return i.vec3(this.shadeColorNode);let e=ae;if(this.shadeMultiplyTexture&&this.shadeMultiplyTexture.isTexture===!0){let t=U.context({getUV:()=>this._animatedUVNode});e=e.mul(t)}return e}_setupShadingShiftNode(){if(this.shadingShiftNode!=null)return i.float(this.shadingShiftNode);let e=le;if(this.shadingShiftTexture&&this.shadingShiftTexture.isTexture===!0){let t=U.context({getUV:()=>this._animatedUVNode});e=e.add(t.mul(ne))}return e}_setupShadingToonyNode(){return this.shadingToonyNode!=null?i.float(this.shadingToonyNode):se}_setupRimLightingMixNode(){return this.rimLightingMixNode!=null?i.float(this.rimLightingMixNode):me}_setupRimMultiplyNode(){return this.rimMultiplyNode!=null?i.vec3(this.rimMultiplyNode):this.rimMultiplyTexture&&this.rimMultiplyTexture.isTexture===!0?ue.context({getUV:()=>this._animatedUVNode}):i.vec3(1)}_setupMatcapNode(){return this.matcapNode!=null?i.vec3(this.matcapNode):this.matcapTexture&&this.matcapTexture.isTexture===!0?de.context({getUV:()=>i.matcapUV.mul(1,-1).add(0,1)}).mul(he):i.vec3(0)}_setupParametricRimNode(){let e=this.parametricRimColorNode!=null?i.vec3(this.parametricRimColorNode):ce,t=this.parametricRimLiftNode!=null?i.float(this.parametricRimLiftNode):pe,o=this.parametricRimFresnelPowerNode!=null?i.float(this.parametricRimFresnelPowerNode):Ee;return Fe({parametricRimLift:t,parametricRimFresnelPower:o,parametricRimColor:e})}}; +"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.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.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 7c9503cbb..54211c280 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.1.6 + * @pixiv/three-vrm v3.2.0 * VRM file loader for three.js. * * Copyright (c) 2019-2024 pixiv Inc. @@ -68,16 +68,16 @@ var MToonAnimatedUVNode = class extends THREE3.TempNode { uv2 = uv2.add(THREE3.vec2(0.5, 0.5)); const scroll = THREE3.vec2(refUVAnimationScrollXOffset, refUVAnimationScrollYOffset).mul(uvAnimationMask); uv2 = uv2.add(scroll); - return uv2.temp("AnimatedUV"); + return uv2.toVar("AnimatedUV"); } }; -var shadeColor = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("ShadeColor"); -var shadingShift = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("ShadingShift"); -var shadingToony = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("ShadingToony"); -var rimLightingMix = THREE4.nodeImmutable(THREE4.PropertyNode, "float").temp("RimLightingMix"); -var rimMultiply = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("RimMultiply"); -var matcap = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("matcap"); -var parametricRim = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").temp("ParametricRim"); +var shadeColor = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("ShadeColor"); +var shadingShift = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("ShadingShift"); +var shadingToony = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("ShadingToony"); +var rimLightingMix = THREE4.nodeImmutable(THREE4.PropertyNode, "float").toVar("RimLightingMix"); +var rimMultiply = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("RimMultiply"); +var matcap = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("matcap"); +var parametricRim = THREE4.nodeImmutable(THREE4.PropertyNode, "vec3").toVar("ParametricRim"); var FnCompat = (jsFunc) => { const threeRevision2 = parseInt(THREE5.REVISION, 10); if (threeRevision2 >= 168) { @@ -490,11 +490,11 @@ export { MToonNodeMaterial }; /*! - * @pixiv/three-vrm-materials-mtoon v3.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. * @pixiv/three-vrm-materials-mtoon is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vdGh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CQUFzQixLQUFLLG1CQUFtQixjQUFjLE1BQU07QUFDekUsWUFBTSxNQUFNLHNCQUFzQixRQUFRLEVBQUUsT0FBTyxNQUFNLEtBQUssZ0JBQWdCLENBQUM7QUFDL0UsYUFBTztJQUNUO0FBRUEsV0FBYSxZQUFLLENBQUc7RUFDdkI7RUFFUSxtQkFBb0M7QUFDMUMsUUFBSSxLQUFLLGNBQWMsTUFBTTtBQUMzQixhQUFhLFlBQUssS0FBSyxVQUFVO0lBQ25DO0FBRUEsUUFBSSxLQUFLLGlCQUFpQixLQUFLLGNBQWMsY0FBYyxNQUFNO0FBQy9ELFlBQU0sTUFBTSxpQkFBaUIsUUFBUSxFQUFFLE9BQU8sTUFBWSxnQkFBUyxJQUFJLEdBQUssRUFBSSxFQUFFLElBQUksR0FBSyxDQUFHLEVBQUUsQ0FBQztBQUNqRyxhQUFPLElBQUksSUFBSSxlQUFlO0lBQ2hDO0FBRUEsV0FBYSxZQUFLLENBQUc7RUFDdkI7RUFFUSwwQkFBMkM7QUFDakQsVUFBTSxxQkFDSixLQUFLLDBCQUEwQixPQUFhLFlBQUssS0FBSyxzQkFBc0IsSUFBSTtBQUVsRixVQUFNLG9CQUNKLEtBQUsseUJBQXlCLE9BQWEsYUFBTSxLQUFLLHFCQUFxQixJQUFJO0FBRWpGLFVBQU0sNEJBQ0osS0FBSyxpQ0FBaUMsT0FDNUIsYUFBTSxLQUFLLDZCQUE2QixJQUM5QztBQUVOLFdBQU8sbUJBQW1CO01BQ3hCO01BQ0E7TUFDQTtJQUNGLENBQUM7RUFDSDtBQUNGOyIsCiAgIm5hbWVzIjogWyJUSFJFRSIsICJ1diIsICJ0aHJlZVJldmlzaW9uIiwgImRpZmZ1c2VDb2xvciIsICJub3JtYWxMb2NhbCJdCn0K diff --git a/packages/three-vrm/lib/nodes/index.module.min.js b/packages/three-vrm/lib/nodes/index.module.min.js index d730a1474..348c179eb 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 p 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"),ee=r.materialReference("matcapTexture","texture"),te=r.materialReference("parametricRimColorFactor","color"),ie=r.materialReference("parametricRimLiftFactor","float"),oe=r.materialReference("parametricRimFresnelPowerFactor","float"),re=r.materialReference("outlineWidthMultiplyTexture","texture"),ae=r.materialReference("outlineWidthFactor","float"),O=r.materialReference("outlineColorFactor","color"),le=r.materialReference("outlineLightingMixFactor","float"),ne=r.materialReference("uvAnimationMaskTexture","texture"),se=r.materialReference("uvAnimationScrollXOffset","float"),me=r.materialReference("uvAnimationScrollYOffset","float"),ue=r.materialReference("uvAnimationRotationPhase","float"),he=class extends n.TempNode{constructor(e){super("vec2"),this.hasMaskTexture=e}setup(){let e=1;this.hasMaskTexture&&(e=n.vec4(ne).context({getUV:()=>n.uv()}).r);let t=n.uv(),o=ue.mul(e),a=n.cos(o),m=n.sin(o);t=t.sub(n.vec2(.5,.5)),t=t.mul(n.mat2(a,m,m.negate(),a)),t=t.add(n.vec2(.5,.5));let u=n.vec2(se,me).mul(e);return t=t.add(u),t.temp("AnimatedUV")}},U=s.nodeImmutable(s.PropertyNode,"vec3").temp("ShadeColor"),I=s.nodeImmutable(s.PropertyNode,"float").temp("ShadingShift"),b=s.nodeImmutable(s.PropertyNode,"float").temp("ShadingToony"),v=s.nodeImmutable(s.PropertyNode,"float").temp("RimLightingMix"),N=s.nodeImmutable(s.PropertyNode,"vec3").temp("RimMultiply"),g=s.nodeImmutable(s.PropertyNode,"vec3").temp("matcap"),H=s.nodeImmutable(s.PropertyNode,"vec3").temp("ParametricRim"),T=e=>parseInt(c.REVISION,10)>=168?c.Fn(e):c.tslFn(e),de=T(({a:e,b:t,t:o})=>{let a=o.sub(e),m=t.sub(e);return a.div(m).clamp()}),ce=T(({dotNL:e})=>{let o=l.float(1).sub(b),a=e.add(I);return a=de({a:o.negate(),b:o,t:a}),a=a.mul(1),a}),pe=T(({shading:e,lightColor:t})=>{let o=l.mix(U,l.diffuseColor,e);return t.mul(l.BRDF_Lambert({diffuseColor:o}))}),Ee=class extends l.LightingModel{constructor(){super()}direct({lightDirection:e,lightColor:t,reflectedLight:o}){let a=l.transformedNormalView.dot(e).clamp(-1,1),m=ce({dotNL:a});o.directDiffuse.assign(o.directDiffuse.add(pe({shading:m,lightColor:t}))),o.directSpecular.assign(o.directSpecular.add(H.add(g).mul(N).mul(l.mix(l.vec3(0),l.BRDF_Lambert({diffuseColor:t}),v))))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e)}indirectDiffuse({irradiance:e,reflectedLight:t}){t.indirectDiffuse.assign(t.indirectDiffuse.add(e.mul(l.BRDF_Lambert({diffuseColor:l.diffuseColor}))))}indirectSpecular({reflectedLight:e}){e.indirectSpecular.assign(e.indirectSpecular.add(H.add(g).mul(N).mul(l.mix(l.vec3(1),l.vec3(0),v))))}},R={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},Re=T(({parametricRimLift:e,parametricRimFresnelPower:t,parametricRimColor:o})=>{let a=p.modelViewPosition.normalize(),m=p.transformedNormalView.dot(a.negate());return p.float(1).sub(m).add(e).clamp().pow(t).mul(o)}),fe=class extends i.NodeMaterial{customProgramCacheKey(){let e=super.customProgramCacheKey();return e+=`isOutline:${this.isOutline},`,e}get isMToonNodeMaterial(){return!0}constructor(e={}){super(),e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,delete e.giEqualizationFactor,delete e.v0CompatShade,delete e.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(e)}setupLightingModel(){return new Ee}setup(e){var t;this._animatedUVNode=new he((t=this.uvAnimationMaskTexture&&this.uvAnimationMaskTexture.isTexture===!0)!=null?t:!1),super.setup(e)}setupDiffuseColor(e){let t=null;if(this.colorNode==null){if(t=D,this.map&&this.map.isTexture===!0){let o=k.context({getUV:()=>this._animatedUVNode});t=t.mul(o)}this.colorNode=t}this.vertexColors===!0&&e.geometry.hasAttribute("color")&&(console.warn("MToonNodeMaterial: MToon ignores vertex colors. Consider using a model without vertex colors instead."),this.vertexColors=!1),super.setupDiffuseColor(e),parseInt(i.REVISION,10)<166&&this.transparent===!1&&this.blending===i.NormalBlending&&this.alphaToCoverage===!1&&i.diffuseColor.a.assign(1),this.colorNode===t&&(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(e){let t=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=t,a}else{super.setupNormal(e),this.normalNode=t;return}}setupLighting(e){let t=null;if(this.emissiveNode==null){if(t=z.mul(B),this.emissiveMap&&this.emissiveMap.isTexture===!0){let a=q.context({getUV:()=>this._animatedUVNode});t=t.mul(a)}this.emissiveNode=t}let o=super.setupLighting(e);return this.emissiveNode===t&&(this.emissiveNode=null),o}setupOutput(e,t){return this.isOutline&&this.outlineWidthMode!==R.None&&(t=i.vec4(i.mix(O,t.xyz.mul(O),le),t.w)),super.setupOutput(e,t)}setupPosition(e){var t,o;let a=this.positionNode;if(this.isOutline&&this.outlineWidthMode!==R.None){(t=this.positionNode)!=null||(this.positionNode=i.positionLocal);let u=i.normalLocal.normalize(),h=ae;if(this.outlineWidthMultiplyTexture&&this.outlineWidthMultiplyTexture.isTexture===!0){let d=re.context({getUV:()=>this._animatedUVNode});h=h.mul(d)}let f=i.length(i.modelNormalMatrix.mul(u)),E=h.mul(f).mul(u);if(this.outlineWidthMode===R.WorldCoordinates)this.positionNode=this.positionNode.add(E);else if(this.outlineWidthMode===R.ScreenCoordinates){let d=i.cameraProjectionMatrix.element(1).element(1);this.positionNode=this.positionNode.add(E.div(d).mul(i.positionView.z.negate()))}(o=this.positionNode)!=null||(this.positionNode=i.positionLocal)}let m=super.setupPosition(e);return m.z.add(m.w.mul(1e-6)),this.positionNode=a,m}copy(e){var t,o,a,m,u,h,f,E,d,M,x,S,F,y,C,_,L,w,V;return this.color.copy(e.color),this.map=(t=e.map)!=null?t:null,this.emissive.copy(e.emissive),this.emissiveIntensity=e.emissiveIntensity,this.emissiveMap=(o=e.emissiveMap)!=null?o:null,this.normalMap=(a=e.normalMap)!=null?a:null,this.normalScale.copy(e.normalScale),this.shadeColorFactor.copy(e.shadeColorFactor),this.shadeMultiplyTexture=(m=e.shadeMultiplyTexture)!=null?m:null,this.shadingShiftFactor=e.shadingShiftFactor,this.shadingShiftTexture=(u=e.shadingShiftTexture)!=null?u:null,this.shadingShiftTextureScale=e.shadingShiftTextureScale,this.shadingToonyFactor=e.shadingToonyFactor,this.rimLightingMixFactor=e.rimLightingMixFactor,this.rimMultiplyTexture=(h=e.rimMultiplyTexture)!=null?h:null,this.matcapFactor.copy(e.matcapFactor),this.matcapTexture=(f=e.matcapTexture)!=null?f:null,this.parametricRimColorFactor.copy(e.parametricRimColorFactor),this.parametricRimLiftFactor=e.parametricRimLiftFactor,this.parametricRimFresnelPowerFactor=e.parametricRimFresnelPowerFactor,this.outlineWidthMode=e.outlineWidthMode,this.outlineWidthMultiplyTexture=(E=e.outlineWidthMultiplyTexture)!=null?E:null,this.outlineWidthFactor=e.outlineWidthFactor,this.outlineColorFactor.copy(e.outlineColorFactor),this.outlineLightingMixFactor=e.outlineLightingMixFactor,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.uvAnimationMaskTexture=(d=e.uvAnimationMaskTexture)!=null?d:null,this.shadeColorNode=(M=e.shadeColorNode)!=null?M:null,this.shadingShiftNode=(x=e.shadingShiftNode)!=null?x:null,this.shadingToonyNode=(S=e.shadingToonyNode)!=null?S:null,this.rimLightingMixNode=(F=e.rimLightingMixNode)!=null?F:null,this.rimMultiplyNode=(y=e.rimMultiplyNode)!=null?y:null,this.matcapNode=(C=e.matcapNode)!=null?C:null,this.parametricRimColorNode=(_=e.parametricRimColorNode)!=null?_:null,this.parametricRimLiftNode=(L=e.parametricRimLiftNode)!=null?L:null,this.parametricRimFresnelPowerNode=(w=e.parametricRimFresnelPowerNode)!=null?w:null,this.isOutline=(V=e.isOutline)!=null?V:null,super.copy(e)}update(e){this.uvAnimationScrollXOffset+=e*this.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYOffset+=e*this.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationPhase+=e*this.uvAnimationRotationSpeedFactor}_setupShadeColorNode(){if(this.shadeColorNode!=null)return i.vec3(this.shadeColorNode);let e=K;if(this.shadeMultiplyTexture&&this.shadeMultiplyTexture.isTexture===!0){let t=A.context({getUV:()=>this._animatedUVNode});e=e.mul(t)}return e}_setupShadingShiftNode(){if(this.shadingShiftNode!=null)return i.float(this.shadingShiftNode);let e=j;if(this.shadingShiftTexture&&this.shadingShiftTexture.isTexture===!0){let t=A.context({getUV:()=>this._animatedUVNode});e=e.add(t.mul(Z))}return e}_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?ee.context({getUV:()=>i.matcapUV.mul(1,-1).add(0,1)}).mul(Q):i.vec3(0)}_setupParametricRimNode(){let e=this.parametricRimColorNode!=null?i.vec3(this.parametricRimColorNode):te,t=this.parametricRimLiftNode!=null?i.float(this.parametricRimLiftNode):ie,o=this.parametricRimFresnelPowerNode!=null?i.float(this.parametricRimFresnelPowerNode):oe;return Re({parametricRimLift:t,parametricRimFresnelPower:o,parametricRimColor:e})}};export{he as MToonAnimatedUVNode,Ee as MToonLightingModel,fe as MToonNodeMaterial}; +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.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.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 e21170230..f28cf152c 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.1.6 + * @pixiv/three-vrm v3.2.0 * VRM file loader for three.js. * * Copyright (c) 2019-2024 pixiv Inc. @@ -6064,6 +6064,82 @@ var VRMLoaderPlugin = class { } }; +// src/VRMUtils/combineSkeletons.ts +var THREE21 = __toESM(require("three"), 1); +function combineSkeletons(root) { + const skinnedMeshes = /* @__PURE__ */ new Set(); + const geometryToSkinnedMesh = /* @__PURE__ */ new Map(); + root.traverse((obj) => { + if (obj.type !== "SkinnedMesh") { + return; + } + const skinnedMesh = obj; + const previousSkinnedMesh = geometryToSkinnedMesh.get(skinnedMesh.geometry); + if (previousSkinnedMesh) { + skinnedMeshes.delete(previousSkinnedMesh); + } else { + geometryToSkinnedMesh.set(skinnedMesh.geometry, skinnedMesh); + skinnedMeshes.add(skinnedMesh); + } + }); + const newSkeletons = []; + skinnedMeshes.forEach((skinnedMesh) => { + const skeleton = skinnedMesh.skeleton; + let newSkeleton = newSkeletons.find((candidate) => skeletonMatches(skeleton, candidate)); + if (!newSkeleton) { + newSkeleton = { bones: [], boneInverses: [], meshes: [] }; + newSkeletons.push(newSkeleton); + } + newSkeleton.meshes.push(skinnedMesh); + const boneIndexMap = skeleton.bones.map((bone) => newSkeleton.bones.indexOf(bone)); + const geometry = skinnedMesh.geometry; + const attribute = geometry.getAttribute("skinIndex"); + const weightAttribute = geometry.getAttribute("skinWeight"); + for (let i = 0; i < attribute.count; i++) { + for (let j = 0; j < attribute.itemSize; j++) { + const weight = weightAttribute.getComponent(i, j); + if (weight === 0) { + continue; + } + const index = attribute.getComponent(i, j); + if (boneIndexMap[index] === -1) { + boneIndexMap[index] = newSkeleton.bones.length; + newSkeleton.bones.push(skeleton.bones[index]); + newSkeleton.boneInverses.push(skeleton.boneInverses[index]); + } + attribute.setComponent(i, j, boneIndexMap[index]); + } + } + 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())); + } +} +function skeletonMatches(skeleton, candidate) { + return skeleton.bones.every((bone, index) => { + const candidateIndex = candidate.bones.indexOf(bone); + if (candidateIndex !== -1) { + return matrixEquals(skeleton.boneInverses[index], candidate.boneInverses[candidateIndex]); + } + return true; + }); +} +function matrixEquals(a, b, tolerance) { + tolerance = tolerance || 1e-4; + if (a.elements.length != b.elements.length) { + return false; + } + for (let i = 0, il = a.elements.length; i < il; i++) { + const delta = Math.abs(a.elements[i] - b.elements[i]); + if (delta > tolerance) { + return false; + } + } + return true; +} + // src/VRMUtils/deepDispose.ts function disposeMaterial(material) { Object.values(material).forEach((value) => { @@ -6109,9 +6185,12 @@ function deepDispose(object3D) { } // src/VRMUtils/removeUnnecessaryJoints.ts -var THREE21 = __toESM(require("three"), 1); +var THREE25 = __toESM(require("three"), 1); function removeUnnecessaryJoints(root, options) { 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." + ); const experimentalSameBoneCounts = (_a = options == null ? void 0 : options.experimentalSameBoneCounts) != null ? _a : false; const skinnedMeshes = []; root.traverse((obj) => { @@ -6128,17 +6207,17 @@ function removeUnnecessaryJoints(root, options) { const bones = []; const boneInverses = []; const boneIndexMap = {}; - const array = attribute.array; - for (let i = 0; i < array.length; i++) { - const index = array[i]; - if (boneIndexMap[index] == null) { - boneIndexMap[index] = bones.length; - bones.push(mesh.skeleton.bones[index]); - boneInverses.push(mesh.skeleton.boneInverses[index]); + for (let i = 0; i < attribute.count; i++) { + for (let j = 0; j < attribute.itemSize; j++) { + const index = attribute.getComponent(i, j); + if (boneIndexMap[index] == null) { + boneIndexMap[index] = bones.length; + bones.push(mesh.skeleton.bones[index]); + boneInverses.push(mesh.skeleton.boneInverses[index]); + } + attribute.setComponent(i, j, boneIndexMap[index]); } - array[i] = boneIndexMap[index]; } - attribute.copyArray(array); attribute.needsUpdate = true; bonesList.set(mesh, { bones, boneInverses }); maxBones = Math.max(maxBones, bones.length); @@ -6151,13 +6230,13 @@ function removeUnnecessaryJoints(root, options) { boneInverses[i] = boneInverses[0]; } } - const skeleton = new THREE21.Skeleton(bones, boneInverses); - mesh.bind(skeleton, new THREE21.Matrix4()); + const skeleton = new THREE25.Skeleton(bones, boneInverses); + mesh.bind(skeleton, new THREE25.Matrix4()); } } // src/VRMUtils/removeUnnecessaryVertices.ts -var THREE25 = __toESM(require("three"), 1); +var THREE26 = __toESM(require("three"), 1); var import_three = require("three"); function removeUnnecessaryVertices(root) { const geometryMap = /* @__PURE__ */ new Map(); @@ -6168,8 +6247,8 @@ function removeUnnecessaryVertices(root) { } const mesh = obj; const geometry = mesh.geometry; - const origianlIndex = geometry.index; - if (origianlIndex == null) { + const originalIndex = geometry.index; + if (originalIndex == null) { return; } const newGeometryAlreadyExisted = geometryMap.get(geometry); @@ -6177,7 +6256,31 @@ function removeUnnecessaryVertices(root) { mesh.geometry = newGeometryAlreadyExisted; return; } - const newGeometry = new THREE25.BufferGeometry(); + const vertexCount = Object.values(geometry.attributes)[0].count; + const vertexInUse = new Array(vertexCount); + let verticesUsed = 0; + const originalIndexArray = originalIndex.array; + for (let i = 0; i < originalIndexArray.length; i++) { + const index = originalIndexArray[i]; + if (!vertexInUse[index]) { + vertexInUse[index] = true; + verticesUsed++; + } + } + if (verticesUsed === vertexCount) { + return; + } + const originalIndexNewIndexMap = []; + const newIndexOriginalIndexMap = []; + let indexHead = 0; + for (let i = 0; i < vertexInUse.length; i++) { + if (vertexInUse[i]) { + const newIndex = indexHead++; + originalIndexNewIndexMap[i] = newIndex; + newIndexOriginalIndexMap[newIndex] = i; + } + } + const newGeometry = new THREE26.BufferGeometry(); newGeometry.name = geometry.name; newGeometry.morphTargetsRelative = geometry.morphTargetsRelative; geometry.groups.forEach((group) => { @@ -6188,21 +6291,12 @@ function removeUnnecessaryVertices(root) { newGeometry.setDrawRange(geometry.drawRange.start, geometry.drawRange.count); newGeometry.userData = geometry.userData; geometryMap.set(geometry, newGeometry); - const originalIndexNewIndexMap = []; - const newIndexOriginalIndexMap = []; { - const originalIndexArray = origianlIndex.array; - const newIndexArray = new originalIndexArray.constructor(originalIndexArray.length); - let indexHead = 0; - for (let i = 0; i < originalIndexArray.length; i++) { - const originalIndex = originalIndexArray[i]; - let newIndex = originalIndexNewIndexMap[originalIndex]; - if (newIndex == null) { - originalIndexNewIndexMap[originalIndex] = indexHead; - newIndexOriginalIndexMap[indexHead] = originalIndex; - newIndex = indexHead; - indexHead++; - } + const originalIndexArray2 = originalIndex.array; + const newIndexArray = new originalIndexArray2.constructor(originalIndexArray2.length); + for (let i = 0; i < originalIndexArray2.length; i++) { + const originalIndex2 = originalIndexArray2[i]; + const newIndex = originalIndexNewIndexMap[originalIndex2]; newIndexArray[i] = newIndex; } newGeometry.setIndex(new import_three.BufferAttribute(newIndexArray, 1, false)); @@ -6217,9 +6311,9 @@ function removeUnnecessaryVertices(root) { const newAttributeArray = new originalAttributeArray.constructor( newIndexOriginalIndexMap.length * itemSize ); - newIndexOriginalIndexMap.forEach((originalIndex, i) => { + newIndexOriginalIndexMap.forEach((originalIndex2, i) => { for (let j = 0; j < itemSize; j++) { - newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex * itemSize + j]; + newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex2 * itemSize + j]; } }); newGeometry.setAttribute(attributeName, new import_three.BufferAttribute(newAttributeArray, itemSize, normalized)); @@ -6238,9 +6332,9 @@ function removeUnnecessaryVertices(root) { const newAttributeArray = new originalAttributeArray.constructor( newIndexOriginalIndexMap.length * itemSize ); - newIndexOriginalIndexMap.forEach((originalIndex, i) => { + newIndexOriginalIndexMap.forEach((originalIndex2, i) => { for (let j = 0; j < itemSize; j++) { - newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex * itemSize + j]; + newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex2 * itemSize + j]; } }); isNullMorph = isNullMorph && newAttributeArray.every((v) => v === 0); @@ -6274,12 +6368,13 @@ var VRMUtils = class { constructor() { } }; +VRMUtils.combineSkeletons = combineSkeletons; VRMUtils.deepDispose = deepDispose; VRMUtils.removeUnnecessaryJoints = removeUnnecessaryJoints; VRMUtils.removeUnnecessaryVertices = removeUnnecessaryVertices; VRMUtils.rotateVRM0 = rotateVRM0; /*! - * @pixiv/three-vrm-core v3.1.6 + * @pixiv/three-vrm-core v3.2.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6287,7 +6382,7 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-mtoon v3.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6295,7 +6390,7 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.1.6 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.0 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6303,7 +6398,7 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-v0compat v3.1.6 + * @pixiv/three-vrm-materials-v0compat v3.2.0 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6311,7 +6406,7 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-node-constraint v3.1.6 + * @pixiv/three-vrm-node-constraint v3.2.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6319,11 +6414,11 @@ VRMUtils.rotateVRM0 = rotateVRM0; * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-springbone v3.1.6 + * @pixiv/three-vrm-springbone v3.2.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,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy91dGlscy9nbHRmRXh0cmFjdFByaW1pdGl2ZXNGcm9tTm9kZS50cyIsICIuLi8uLi90aHJlZS12cm0tY29yZS9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvblByZXNldE5hbWUudHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL3V0aWxzL3NhdHVyYXRlLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTWFuYWdlci50cyIsICIuLi8uLi90aHJlZS12cm0tY29yZS9zcmMvZXhwcmVzc2lvbnMvVlJNRXhwcmVzc2lvbk1hdGVyaWFsQ29sb3JUeXBlLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uTWF0ZXJpYWxDb2xvckJpbmQudHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25Nb3JwaFRhcmdldEJpbmQudHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJl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AgICAgICB0eXBlOiBiaW5kLnR5cGUsXG4gICAgICAgICAgICAgICAgICB0YXJnZXRWYWx1ZTogbmV3IFRIUkVFLkNvbG9yKCkuZnJvbUFycmF5KGJpbmQudGFyZ2V0VmFsdWUpLFxuICAgICAgICAgICAgICAgICAgdGFyZ2V0QWxwaGE6IGJpbmQudGFyZ2V0VmFsdWVbM10sXG4gICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNjaGVtYUV4cHJlc3Npb24udGV4dHVyZVRyYW5zZm9ybUJpbmRzPy5mb3JFYWNoKGFzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbHMgPSBnbHRmTWF0ZXJpYWxzLmZpbHRlcigobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxJbmRleCA9IHRoaXMucGFyc2VyLmFzc29jaWF0aW9ucy5nZXQobWF0ZXJpYWwpPy5tYXRlcmlhbHM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIG9mZnNldDogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5vZmZzZXQgPz8gWzAuMCwgMC4wXSksXG4gICAgICAgICAgICAgICAgICBzY2FsZTogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC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WVTZXQuYWRkKG5hbWUpO1xuXG4gICAgICAgIGNvbnN0IGV4cHJlc3Npb24gPSBuZXcgVlJNRXhwcmVzc2lvbihuYW1lKTtcbiAgICAgICAgZ2x0Zi5zY2VuZS5hZGQoZXhwcmVzc2lvbik7XG5cbiAgICAgICAgZXhwcmVzc2lvbi5pc0JpbmFyeSA9IHNjaGVtYUdyb3VwLmlzQmluYXJ5ID8/IGZhbHNlO1xuICAgICAgICAvLyB2MCBkb2Vzbid0IGhhdmUgaWdub3JlIHByb3BlcnRpZXNcblxuICAgICAgICAvLyBCaW5kIG1vcnBoVGFyZ2V0XG4gICAgICAgIGlmIChzY2hlbWFHcm91cC5iaW5kcykge1xuICAgICAgICAgIHNjaGVtYUdyb3VwLmJpbmRzLmZvckVhY2goYXN5bmMgKGJpbmQpID0+IHtcbiAgICAgICAgICAgIGlmIChiaW5kLm1lc2ggPT09IHVuZGVmaW5lZCB8fCBiaW5kLmluZGV4ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBub2Rlc1VzaW5nTWVzaDogbnVtYmVyW10gPSBbXTtcbiAgICAgICAgICAgIGpzb24ubm9kZXM/LmZvckVhY2goKG5vZGUsIGkpID0+IHtcbiAgICAgICAgICAgICAgaWYgKG5vZGUubWVzaCA9PT0gYmluZC5tZXNoKSB7XG4gICAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gucHVzaChpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gubWFwKGFzeW5jIChub2RlSW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwcmltaXRpdmVzID0gKGF3YWl0IGdsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlKGdsdGYsIG5vZGVJbmRleCkpITtcblxuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUdyb3VwLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4ICR7bW9ycGhUYXJnZXRJbmRleH10aCBtb3JwaCBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIHdlaWdodDogMC4wMSAqIChiaW5k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sLmZpbHRlcihcbiAgICAgICAgICAgICAgICAgICAgICAobXRsKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgKG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISArICcgKE91dGxpbmUpJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5pbmRleE9mKG10bCkgPT09IC0xLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGVyaWFsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lICYmIG1hdGVyaWFscy5pbmRleE9mKG1hdGVyaWFsKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5wdXNoKG1hdGVyaWFsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbFByb3BlcnR5TmFtZSA9IG1hdGVyaWFsVmFsdWUucHJvcGVydHlOYW1lO1xuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIC8vIFRleHR1cmVUcmFuc2Zvcm1CaW5kXG4gICAgICAgICAgICAgIGlmIChtYXRlcmlhbFByb3BlcnR5TmFtZSA9PT0gJ19NYWluVGV4X1NUJykge1xuICAgICAgICAgICAgICAgIGNvbnN0IHNjYWxlID0gbmV3IFRIUkVFLlZlY3RvcjIobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMF0sIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzFdKTtcbiAgICAgICAgICAgICAgICBjb25zdCBvZmZzZXQgPSBuZXcgVEhSRUUuVmVjdG9yMihtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVsyXSwgbWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbM10pO1xuXG4gICAgICAgICAgICAgICAgb2Zmc2V0LnkgPSAxLjAgLSBvZmZzZXQueSAtIHNjYWxlLnk7XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHNjYWxlLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gTWF0ZXJpYWxDb2xvckJpbmRcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxDb2xvclR5cGUgPSB2MEV4cHJlc3Npb25NYXRlcmlhbENvbG9yTWFwW21hdGVyaWFsUHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsQ29sb3JUeXBlKSB7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBtYXRlcmlhbENvbG9yVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIS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ICAgIHV2QW5pbWF0aW9uTWFza1RleHR1cmU6IHsgdmFsdWU6IG51bGwgfSxcbiAgICAgICAgdXZBbmltYXRpb25NYXNrVGV4dHVyZVV2VHJhbnNmb3JtOiB7IHZhbHVlOiBuZXcgVEhSRUUuTWF0cml4MygpIH0sXG4gICAgICAgIHV2QW5pbWF0aW9uU2Nyb2xsWE9mZnNldDogeyB2YWx1ZTogMC4wIH0sXG4gICAgICAgIHV2QW5pbWF0aW9uU2Nyb2xsWU9mZnNldDogeyB2YWx1ZTogMC4wIH0sXG4gICAgICAgIHV2QW5pbWF0aW9uUm90YXRpb25QaGFzZTogeyB2YWx1ZTogMC4wIH0sXG4gICAgICB9LFxuICAgICAgcGFyYW1ldGVycy51bmlmb3JtcyA/PyB7fSxcbiAgICBdKSBhcyB0eXBlb2YgTVRvb25NYXRlcmlhbC5wcm90b3R5cGUudW5pZm9ybXM7XG5cbiAgICAvLyA9PSBmaW5hbGx5IGNvbXBpbGUgdGhlIHNoYWRlciBwcm9ncmFtID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgICB0aGlzLnNldFZhbHVlcyhwYXJhbWV0ZXJzKTtcblxuICAgIC8vID09IHVwbG9hZCB1bmlmb3JtcyB0aGF0IG5lZWQgdG8gdXBsb2FkID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICAgIHRoaXMuX3VwbG9hZFVuaWZvcm1zV29ya2Fyb3VuZCgpO1xuXG4gICAgLy8gPT0gdXBkYXRlIHNoYWRlciBzdHVmZiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gICAgdGhpcy5jdXN0b21Qcm9ncmFtQ2FjaGVLZXkgPSAoKSA9PlxuICAgICAgW1xuICAgICAgICAuLi5PYmplY3QuZW50cmllcyh0aGlzLl9nZW5lcmF0ZURlZmluZXM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mFpbnRzLmRlbGV0ZShjb25zdHJhaW50KTtcblxuICAgIGNvbnN0IG9iamVjdFNldCA9IHRoaXMuX29iamVjdENvbnN0cmFpbnRzTWFwLmdldChjb25zdHJhaW50LmRlc3RpbmF0aW9uKSE7XG4gICAgb2JqZWN0U2V0LmRlbGV0ZShjb25zdHJhaW50KTtcbiAgfVxuXG4gIHB1YmxpYyBzZXRJbml0U3RhdGUoKTogdm9pZCB7XG4gICAgY29uc3QgY29uc3RyYWludHNUcmllZCA9IG5ldyBTZXQ8VlJNTm9kZUNvbnN0cmFpbnQ+KCk7XG4gICAgY29uc3QgY29uc3RyYWludHNEb25lID0gbmV3IFNldDxWUk1Ob2RlQ29uc3RyYWludD4oKTtcblxuICAgIGZvciAoY29uc3QgY29uc3RyYWludCBvZiB0aGlzLl9jb25zdHJhaW50cykge1xuICAgICAgdGhpcy5fcHJvY2Vzc0NvbnN0cmFpbnQoY29uc3RyYWludCwgY29uc3RyYWludHNUcmllZCwgY29uc3RyYWludHNEb25lLCAoY29uc3RyYWludCkgPT4gY29uc3RyYWludC5zZXRJbml0U3RhdGUoKSk7XG4gICAgfVxuICB9XG5cbiAgcHVibGljIHVwZGF0ZSgpOiB2b2lkIHtcbiAgICBjb25zdCBjb25zdHJhaW50c1RyaWVkID0gbmV3IFNldDxWUk1Ob2RlQ29uc3RyYWludD4oKTtcbiAgICBjb25zdCBjb25zdHJhaW50c0RvbmUgPSBuZXcgU2V0PFZSTU5vZGVDb25zdHJhaW50PigpO1xuXG4gICAgZm9yIChjb25zdCBjb25zdHJhaW50IG9mIHRoaXMuX2NvbnN0cmFpbnRzKSB7XG4gICAgICB0aGlzLl9wcm9jZXNzQ29uc3RyYWludChjb25zdHJhaW50LCBjb25zdHJhaW50c1RyaWVkLCBjb25zdHJhaW50c0RvbmUsIChjb25zdHJhaW50KSA9PiBjb25zdHJhaW50LnVwZGF0ZSgpKTtcbiAgICB9XG4gIH1cblxuICAvKipcbiAgICogVXBkYXRlIGEgY29uc3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VhURU5TSU9OX05BTUVdIGFzXG4gICAgICAgIHwgQ29uc3RyYWludFNjaGVtYS5WUk1DTm9kZUNvbnN0cmFpbnRcbiAgICAgICAgfCB1bmRlZmluZWQ7XG5cbiAgICAgIGlmIChleHRlbnNpb24gPT0gbnVsbCkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IHNwZWNWZXJzaW9uID0gZXh0ZW5zaW9uLnNwZWNWZXJzaW9uO1xuICAgICAgaWYgKCFQT1NTSUJMRV9TUEVDX1ZFUlNJT05TLmhhcyhzcGVjVmVyc2lvbikpIHtcbiAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgIGBWUk1Ob2RlQ29uc3RyYWludExvYWRlclBsdWdpbjogVW5rbm93biAke1ZSTU5vZGVDb25zdHJhaW50TG9hZGVyUGx1Z2luLkVYVEVOU0lPTl9OQU1FfSBzcGVjVmVyc2lvbiBcIiR7c3BlY1ZlcnNpb259XCJgLFxuICAgICAgICApO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IGNvbnN0cmFpbnREZWYgPSBleHRlbnNpb24uY29uc3RyYWludDtcblxuICAgICAgLy8gaW1wb3J0IGNvbnN0cmFpbnRzXG4gICAgICBpZiAoY29uc3RyYWludERlZi5yb2xsICE9IG51bGwpIHtcbiAgICAgICAgY29uc3QgY29uc3RyYWludCA9IHRoaXMuX2ltcG9ydFJvbGxDb25zdHJhaW50KG5vZGUsIHRocmVlTm9kZXMsIGNvbnN0cmFpbnREZWYucm9sbCk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5haW0gIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb25zdHJhaW50ID0gdGhpcy5faW1wb3J0QWltQ29uc3RyYWludChub2RlLCB0aHJlZU5vZGVzLCBjb25zdHJhaW50RGVmLmFpbSk7XG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leCA9IHNjaGVtYUpvaW50Lm5vZGU7XG4gICAgICAgICAgY29uc3QgY2hpbGQgPSB0aHJlZU5vZGVzW2NoaWxkSW5kZXhdO1xuXG4gICAgICAgICAgLy8gcHJlcGFyZSBzZXR0aW5nXG4gICAgICAgICAgY29uc3Qgc2V0dGluZzogUGFydGlhbDxWUk1TcHJpbmdCb25lSm9pbnRTZXR0aW5ncz4gPSB7XG4gICAgICAgICAgICBoaXRSYWRpdXM6IHByZXZTY2hlbWFKb2ludC5oaXRSYWRpdXMsXG4gICAgICAgICAgICBkcmFnRm9yY2U6IHByZXZTY2hlbWFKb2ludC5kcmFnRm9yY2UsXG4gICAgICAgICAgICBncmF2aXR5UG93ZXI6IHByZXZTY2hlbWFKb2ludC5ncmF2aXR5UG93ZXIsXG4gICAgICAgICAgICBzdGlmZm5lc3M6IHByZXZTY2hlbWFKb2ludC5zdGlmZm5lc3MsXG4gICAgICAgICAgICBncmF2aXR5RGlyOlxuICAgICAgICAgICAgICBwcmV2U2NoZW1hSm9pbnQuZ3Jhdml0eURpciAhPSBudWxsXG4gICAgICAgICAgICAgICAgPyBuZXcgVEhSRUUuVmVjdG9yMygpLmZyb21BcnJheShwcmV2U2NoZW1hSm9pbnQuZ3Jhdml0eURpcilcbiAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZCxcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgLy8gY3JlYXRlIHNwcmluZyBib25lc1xuICAgICAgICAgIGNvbnN0IGpvaW50ID0gdGhpcy5faW1wb3J0Sm9pbnQobm9kZSwgY2hpbGQsIHNldHRpbmcsIGNvbGxpZGVyR3JvdXBzRm9yU3ByaW5nKTtcbiAgICAgICAgICBpZiAoY2VudGVyKSB7XG4gICAgICAgICAgICBqb2ludC5jZW50ZXIgPSBjZW50ZXI7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbWFuYWdlci5hZGRKb2ludChqb2ludCk7XG4gICAgICAgIH1cblxuICAgICAgICBwcmV2U2NoZW1hSm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XG4gICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICByYWRpdXM6IHNjaGVtYUNvbGxpZGVyLnJhZGl1cyA/PyAwLjAsXG4gICAgICAgICAgICBpbnNpZGU6IGZhbHNlLFxuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4geyBjb2xsaWRlcnMgfTtcbiAgICAgIH0sXG4gICAgKTtcblxuICAgIC8vIGltcG9ydCBzcHJpbmcgYm9uZXMgZm9yIGVhY2ggc3ByaW5nIGJvbmUgZ3JvdXBzXG4gICAgc2NoZW1hQm9uZUdyb3Vwcz8uZm9yRWFjaCgoc2NoZW1hQm9uZUdyb3VwLCBpQm9uZUdyb3VwKSA9PiB7XG4gICAgICBjb25zdCByb290SW5kaWNlcyA9IHNjaGVtYUJvbmVHcm91cC5ib25lcztcbiAgICAgIGlmICghcm9vdEluZGljZXMpIHtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgICByb290SW5kaWNlcy5mb3JFYWNoKChyb290SW5kZXgpID0+IHtcbiAgICAgICAgY29uc3Qgcm9vdCA9IHRocmVlTm9kZXNbcm9vdEluZGV4XTtcblxuICAgICAgICAvLyBwcmVwYXJlIHNldHRpbmdcbiAgICAgICAgY29uc3QgZ3Jhdml0eURpciA9IG5ldyBUSFJFRS5WZWN0b3IzKCk7XG4gICAgICAgIGlmIChzY2hlbWFCb25lR3JvdXAuZ3Jhdml0eURpcikge1xuICAgICAgICAgIGdyYXZpdHlEaXIuc2V0KFxuICAgICAgICAgICAgc2NoZW1hQm9uZUdyb3VwLmdyYXZpdHlEaXIueCA/PyAwLjAsXG4gICAgICAgICAgICBzY2hlbWFCb25lR3JvdXAuZ3Jhdml0eURpci55ID8/IDAuMCxcbiAgICAgICAgICAgIHNjaGVtYUJvbmVHcm91cC5ncmF2aXR5RGlyLnogPz8gMC4wLFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZ3Jhdml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0ZXJpYWxJbmRleCA9IHRoaXMucGFyc2VyLmFzc29jaWF0aW9ucy5nZXQobWF0ZXJpYWwpPy5tYXRlcmlhbHM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIG9mZnNldDogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5vZmZzZXQgPz8gWzAuMCwgMC4wXSksXG4gICAgICAgICAgICAgICAgICBzY2FsZTogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5zY2FsZSA/PyBbMS4wLCAxLjBdKSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1hbmFnZXI7XG4gIH1cblxuICBwcml2YXRlIGFzeW5jIF92MEltcG9ydChnbHRmOiBHTFRGKTogUHJvbWlzZTxWUk1FeHByZXNzaW9uTWFuYWdlciB8IG51bGw+IHtcbiAgICBjb25zdCBqc29uID0gdGhpcy5wYXJzZXIuanNvbiBhcyBHTFRGU2NoZW1hLklHTFRGO1xuXG4gICAgLy8gZWFybHkgYWJvcnQgaWYgaXQgZG9lc24ndCB1c2UgdnJtXG4gICAgY29uc3Qgdn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iaW5kLmluZGV4ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBub2Rlc1VzaW5nTWVzaDogbnVtYmVyW10gPSBbXTtcbiAgICAgICAgICAgIGpzb24ubm9kZXM/LmZvckVhY2goKG5vZGUsIGkpID0+IHtcbiAgICAgICAgICAgICAgaWYgKG5vZGUubWVzaCA9PT0gYmluZC5tZXNoKSB7XG4gICAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gucHVzaChpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gubWFwKGFzeW5jIChub2RlSW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwcmltaXRpdmVzID0gKGF3YWl0IGdsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlKGdsdGYsIG5vZGVJbmRleCkpITtcblxuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUdyb3VwLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4ICR7bW9ycGhUYXJnZXRJbmRleH10aCBtb3JwaCBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIHdlaWdodDogMC4wMSAqIChiaW5kLndlaWdodCA/PyAxMDApLCAvLyBuYXJyb3dpbmcgdGhlIHJhbmdlIGZyb20gWyAwLjAgLSAxMDAuMCBdIHRvIFsgMC4wIC0gMS4wIF1cbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEJpbmQgTWF0ZXJpYWxDb2xvciBhbmQgVGV4dHVyZVRyYW5zZm9ybVxuICAgICAgICBjb25zdCBtYXRlcmlhbFZhbHVlcyA9IHNjaGVtYUdyb3VwLm1hdGVyaWFsVmFsdWVzO1xuICAgICAgICBpZiAobWF0ZXJpYWxWYWx1ZXMgJiYgbWF0ZXJpYWxWYWx1ZXMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgbWF0ZXJpYWxWYWx1ZXMuZm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UzMEM2XHUzMEVBXHUzMEEyXHUzMEVCXHUzMDgyXHU1NDBDXHU2NjQyXHUzMDZCXHU5NkM2XHUzMDgxXHUzMDhCXHUzMDAyXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGNvbnN0IG1hdGVyaWFsczogVEhSRUUuTWF0ZXJpYWxbXSA9IFtdO1xuICAgICAgICAgICAgZ2x0Zi5zY2VuZS50cmF2ZXJzZSgob2JqZWN0KSA9PiB7XG4gICAgICAgICAgICAgIGlmICgob2JqZWN0IGFzIGFueSkubWF0ZXJpYWwpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbDogVEhSRUUuTWF0ZXJpYWxbXSB8IFRIUkVFLk1hdGVyaWFsID0gKG9iamVjdCBhcyBhbnkpLm1hdGVyaWFsO1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG1hdGVyaWFsKSkge1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hdGVyaWFsLmZpbHRlcihcbiAgICAgICAgICAgICAgICAgICAgICAobXRsKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgKG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISArICcgKE91dGxpbmUpJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5pbmRleE9mKG10bCkgPT09IC0xLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGVyaWFsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lICYmIG1hdGVyaWFscy5pbmRleE9mKG1hdGVyaWFsKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5wdXNoKG1hdGVyaWFsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbFByb3BlcnR5TmFtZSA9IG1hdGVyaWFsVmFsdWUucHJvcGVydHlOYW1lO1xuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIC8vIFRleHR1cmVUcmFuc2Zvcm1CaW5kXG4gICAgICAgICAgICAgIGlmIChtYXRlcmlhbFByb3BlcnR5TmFtZSA9PT0gJ19NYWluVGV4X1NUJykge1xuICAgICAgICAgICAgICAgIGNvbnN0IHNjYWxlID0gbmV3IFRIUkVFLlZlY3RvcjIobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMF0sIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzFdKTtcbiAgICAgICAgICAgICAgICBjb25zdCBvZmZzZXQgPSBuZXcgVEhSRUUuVmVjdG9yMihtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVsyXSwgbWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbM10pO1xuXG4gICAgICAgICAgICAgICAgb2Zmc2V0LnkgPSAxLjAgLSBvZmZzZXQueSAtIHNjYWxlLnk7XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHNjYWxlLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gTWF0ZXJpYWxDb2xvckJpbmRcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxDb2xvclR5cGUgPSB2MEV4cHJlc3Npb25NYXRlcmlhbENvbG9yTWFwW21hdGVyaWFsUHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsQ29sb3JUeXBlKSB7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBtYXRlcmlhbENvbG9yVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlISksXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjb25zb2xlLndhcm4obWF0ZXJpYWxQcm9wZXJ0eU5hbWUgKyAnIGlzIG5vdCBzdXBwb3J0ZWQnKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1hbmFnZXI7XG4gIH1cbn1cbiIsICJpbXBvcnQgdHlwZSAqIGFzIFRIUkVFIGZy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BmaW5hbGx5IGNvbXBpbGUgdGhlIHNoYWRlciBwcm9ncmFtID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgICB0aGlzLnNldFZhbHVlcyhwYXJhbWV0ZXJzKTtcblxuICAgIC8vID09IHVwbG9hZCB1bmlmb3JtcyB0aGF0IG5lZWQgdG8gdXBsb2FkID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICAgIHRoaXMuX3VwbG9hZFVuaWZvcm1zV29ya2Fyb3VuZCgpO1xuXG4gICAgLy8gPT0gdXBkYXRlIHNoYWRlciBzdHVmZiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gICAgdGhpcy5jdXN0b21Qcm9ncmFtQ2FjaGVLZXkgPSAoKSA9PlxuICAgICAgW1xuICAgICAgICAuLi5PYmplY3QuZW50cmllcyh0aGlzLl9nZW5lcmF0ZURlZmluZXMoKSkubWFwKChbdG9rZW4sIG1hY3JvXSkgPT4gYCR7dG9rZW59OiR7bWFjcm99YCksXG4gICAgICAgIHRoaXMubWF0Y2FwVGV4dHVyZSA/IGBtYXRjYXBUZXh0dXJlQ29sb3JTcGFjZToke2dldFRleHR1cmVDb2xvclNwYWNlKHRoaXMubWF0Y2FwVGV4dHVyZSl9YCA6ICcnLFxuICAgICAgICB0aGlzLnNoYWRlTXVsdGlwbHlUZXh0dXJlXG4gICAgICAgICAgPyBgc2hhZGVNdWx0aXBseVRleHR1cmVDb2xvclNwYWNlOiR7Z2V0VGV4dHVyZUNvbG9yU3BhY2UodGhpcy5zaGFkZU11bHRpcGx5VGV4dHVyZSl9YFxuICAgICAgICAgIDogJycsXG4gICAgICAgIHRoaXMucmltTXVsdGlwbHlUZXh0dXJlID8gYHJpbU11bHRpcGx5VGV4dHVyZUNvbG9yU3BhY2U6JHtnZXRUZXh0dXJlQ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cIiR7c3BlY1ZlcnNpb259XCJgLFxuICAgICAgICApO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IGNvbnN0cmFpbnREZWYgPSBleHRlbnNpb24uY29uc3RyYWludDtcblxuICAgICAgLy8gaW1wb3J0IGNvbnN0cmFpbnRzXG4gICAgICBpZiAoY29uc3RyYWludERlZi5yb2xsICE9IG51bGwpIHtcbiAgICAgICAgY29uc3QgY29uc3RyYWludCA9IHRoaXMuX2ltcG9ydFJvbGxDb25zdHJhaW50KG5vZGUsIHRocmVlTm9kZXMsIGNvbnN0cmFpbnREZWYucm9sbCk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5haW0gIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb25zdHJhaW50ID0gdGhpcy5faW1wb3J0QWltQ29uc3RyYWludChub2RlLCB0aHJlZU5vZGVzLCBjb25zdHJhaW50RGVmLmFpbSk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5yb3RhdGlvbiAhPSBudWxsKSB7XG4gICAgICAgIGNvbnN0IGNvbnN0cmFpbnQgPSB0aGlzLl9pbXBvcnRSb3RhdGlvbkNvbnN0cmFpbnQobm9kZSwgdGhyZWVOb2RlcywgY29uc3RyYWludERlZi5yb3RhdGlvbik7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIC8vIGluaXQgY29uc3RyYWludHNcbiAgICBnbHRmLnNjZW5lLnVwZGF0ZU1hdHJpeFdvcmxkKCk7XG4gICAgbWFuYWdlci5zZXRJbml0U3RhdGUoKTtcblxuICAgIHJldHVybiBtYW5hZ2VyO1xuICB9XG5cbiAgcHJvdGVj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YiIsICJfYyIsICJfZCIsICJfZSIsICJUSFJFRSIsICJtYXRlcmlhbCIsICJUSFJFRSIsICJUSFJFRSIsICJvcmlnaW5hbEluZGV4QXJyYXkiLCAib3JpZ2luYWxJbmRleCJdCn0K diff --git a/packages/three-vrm/lib/three-vrm.min.cjs b/packages/three-vrm/lib/three-vrm.min.cjs index c6d01c703..850fa1ad3 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 Rr=Object.create;var Be=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var xr=Object.getOwnPropertyNames;var yr=Object.getPrototypeOf,wr=Object.prototype.hasOwnProperty;var Pr=(t,e)=>{for(var n in e)Be(t,n,{get:e[n],enumerable:!0})},Rn=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of xr(e))!wr.call(t,r)&&r!==n&&Be(t,r,{get:()=>e[r],enumerable:!(i=Tr(e,r))||i.enumerable});return t};var E=(t,e,n)=>(n=t!=null?Rr(yr(t)):{},Rn(e||!t||!t.__esModule?Be(n,"default",{value:t,enumerable:!0}):n,t)),Sr=t=>Rn(Be({},"__esModule",{value:!0}),t);var Pe=(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 Zo={};Pr(Zo,{MToonMaterial:()=>di,MToonMaterialDebugMode:()=>li,MToonMaterialLoaderPlugin:()=>Vt,MToonMaterialOutlineWidthMode:()=>bt,VRM:()=>ge,VRMAimConstraint:()=>Ri,VRMCore:()=>$e,VRMCoreLoaderPlugin:()=>eo,VRMExpression:()=>ft,VRMExpressionLoaderPlugin:()=>je,VRMExpressionManager:()=>_t,VRMExpressionMaterialColorBind:()=>gt,VRMExpressionMaterialColorType:()=>fe,VRMExpressionMorphTargetBind:()=>vt,VRMExpressionOverrideType:()=>br,VRMExpressionPresetName:()=>ze,VRMExpressionTextureTransformBind:()=>Et,VRMFirstPerson:()=>Mt,VRMFirstPersonLoaderPlugin:()=>Qe,VRMFirstPersonMeshAnnotationType:()=>Ir,VRMHumanBoneList:()=>We,VRMHumanBoneName:()=>Ur,VRMHumanBoneParentMap:()=>Xn,VRMHumanoid:()=>xt,VRMHumanoidHelper:()=>Rt,VRMHumanoidLoaderPlugin:()=>Ye,VRMLoaderPlugin:()=>at,VRMLookAt:()=>ti,VRMLookAtBoneApplier:()=>Ae,VRMLookAtExpressionApplier:()=>Ge,VRMLookAtHelper:()=>Jn,VRMLookAtLoaderPlugin:()=>qe,VRMLookAtRangeMap:()=>Pt,VRMLookAtTypeName:()=>$r,VRMMetaLoaderPlugin:()=>Ze,VRMNodeConstraint:()=>nt,VRMNodeConstraintHelper:()=>et,VRMNodeConstraintLoaderPlugin:()=>Ut,VRMNodeConstraintManager:()=>Ti,VRMRequiredHumanBoneName:()=>$n,VRMRollConstraint:()=>yi,VRMRotationConstraint:()=>xi,VRMSpringBoneCollider:()=>ot,VRMSpringBoneColliderHelper:()=>rt,VRMSpringBoneColliderShape:()=>st,VRMSpringBoneColliderShapeCapsule:()=>Dt,VRMSpringBoneColliderShapePlane:()=>Ft,VRMSpringBoneColliderShapeSphere:()=>Wt,VRMSpringBoneJoint:()=>Oi,VRMSpringBoneJointHelper:()=>bi,VRMSpringBoneLoaderPlugin:()=>kt,VRMSpringBoneManager:()=>Bt,VRMUtils:()=>ce});module.exports=Sr(Zo);var On=E(require("three"),1),K=E(require("three"),1),St=E(require("three"),1),kn=E(require("three"),1),F=E(require("three"),1),X=E(require("three"),1),Xe=E(require("three"),1),W=E(require("three"),1),S=E(require("three"),1),Le=E(require("three"),1),ee=E(require("three"),1),I=E(require("three"),1),Lt=E(require("three"),1),V=E(require("three"),1),wt=E(require("three"),1),ni=E(require("three"),1);var w=(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())}),ft=class extends On.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 Nn(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(c=>{d.length{let o=Nn(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 Bn(t){return Math.max(Math.min(t,1),0)}var _t=class Dn{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 Dn().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}}},fe={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",MatcapColor:"matcapColor",RimColor:"rimColor",OutlineColor:"outlineColor"},Ar={_Color:fe.Color,_EmissionColor:fe.EmissionColor,_ShadeColor:fe.ShadeColor,_RimColor:fe.RimColor,_OutlineColor:fe.OutlineColor},Lr=new St.Color,Fn=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(Lr.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(),c=new St.Color(a.r-d.r,a.g-d.g,a.b-d.b);return{propertyName:s,initialValue:d,deltaValue:c}}_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}};Fn._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 gt=Fn,vt=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)})}},yn=new kn.Vector2,zn=class Gn{constructor({material:e,scale:n,offset:i}){var r,o;this.material=e,this.scale=n,this.offset=i;let a=(r=Object.entries(Gn._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(),c=u.repeat.clone(),f=i.clone().sub(d),p=n.clone().sub(c);this._properties.push({name:l,initialOffset:d,deltaOffset:f,initialScale:c,deltaScale:p})}))}applyWeight(e){this._properties.forEach(n=>{let i=this.material[n.name];i!==void 0&&(i.offset.add(yn.copy(n.deltaOffset).multiplyScalar(e)),i.repeat.add(yn.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))})}};zn._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var Et=zn,Hr=new Set(["1.0","1.0-beta"]),jn=class Qn{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return w(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return w(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 w(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(`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(([f,p])=>{if(p!=null){if(!u.has(f)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${f}" detected. Ignoring the expression`);return}d.set(f,p)}}),s.custom!=null&&Object.entries(s.custom).forEach(([f,p])=>{if(u.has(f)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${f}". Ignoring the expression`);return}d.set(f,p)});let c=new _t;return yield Promise.all(Array.from(d.entries()).map(f=>w(this,[f],function*([p,m]){var h,_,g,x,T,v,R;let M=new ft(p);if(e.scene.add(M),M.isBinary=(h=m.isBinary)!=null?h:!1,M.overrideBlink=(_=m.overrideBlink)!=null?_:"none",M.overrideLookAt=(g=m.overrideLookAt)!=null?g:"none",M.overrideMouth=(x=m.overrideMouth)!=null?x:"none",(T=m.morphTargetBinds)==null||T.forEach(y=>w(this,null,function*(){var A;if(y.node===void 0||y.index===void 0)return;let b=yield Tn(e,y.node),L=y.index;if(!b.every(H=>Array.isArray(H.morphTargetInfluences)&&L{let b=A.material;b&&(Array.isArray(b)?y.push(...b):y.push(b))}),(v=m.materialColorBinds)==null||v.forEach(A=>w(this,null,function*(){y.filter(L=>{var H;let U=(H=this.parser.associations.get(L))==null?void 0:H.materials;return A.material===U}).forEach(L=>{M.addBind(new gt({material:L,type:A.type,targetValue:new K.Color().fromArray(A.targetValue),targetAlpha:A.targetValue[3]}))})})),(R=m.textureTransformBinds)==null||R.forEach(A=>w(this,null,function*(){y.filter(L=>{var H;let U=(H=this.parser.associations.get(L))==null?void 0:H.materials;return A.material===U}).forEach(L=>{var H,U;M.addBind(new Et({material:L,offset:new K.Vector2().fromArray((H=A.offset)!=null?H:[0,0]),scale:new K.Vector2().fromArray((U=A.scale)!=null?U:[1,1])}))})}))}c.registerExpression(M)}))),c})}_v0Import(e){return w(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 _t,l=o.blendShapeGroups;if(!l)return a;let s=new Set;return yield Promise.all(l.map(u=>w(this,null,function*(){var d;let c=u.presetName,f=c!=null&&Qn.v0v1PresetNameMap[c]||null,p=f!=null?f:u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${c} has duplicated entries. Ignoring the expression`);return}s.add(p);let m=new ft(p);e.scene.add(m),m.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(_=>w(this,null,function*(){var g;if(_.mesh===void 0||_.index===void 0)return;let x=[];(g=i.nodes)==null||g.forEach((v,R)=>{v.mesh===_.mesh&&x.push(R)});let T=_.index;yield Promise.all(x.map(v=>w(this,null,function*(){var R;let M=yield Tn(e,v);if(!M.every(y=>Array.isArray(y.morphTargetInfluences)&&T{if(_.materialName===void 0||_.propertyName===void 0||_.targetValue===void 0)return;let g=[];e.scene.traverse(T=>{if(T.material){let v=T.material;Array.isArray(v)?g.push(...v.filter(R=>(R.name===_.materialName||R.name===_.materialName+" (Outline)")&&g.indexOf(R)===-1)):v.name===_.materialName&&g.indexOf(v)===-1&&g.push(v)}});let x=_.propertyName;g.forEach(T=>{if(x==="_MainTex_ST"){let R=new K.Vector2(_.targetValue[0],_.targetValue[1]),M=new K.Vector2(_.targetValue[2],_.targetValue[3]);M.y=1-M.y-R.y,m.addBind(new Et({material:T,scale:R,offset:M}));return}let v=Ar[x];if(v){m.addBind(new gt({material:T,type:v,targetValue:new K.Color().fromArray(_.targetValue),targetAlpha:_.targetValue[3]}));return}console.warn(x+" is not supported")})}),a.registerExpression(m)}))),a})}};jn.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=jn,br={None:"none",Block:"block",Blend:"blend"},At=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(c[0])||d[1]>0&&r.includes(c[1])||d[2]>0&&r.includes(c[2])||d[3]>0&&r.includes(c[3]))continue;let f=n[s],p=i[s];if(f[0]>0&&r.includes(p[0])||f[1]>0&&r.includes(p[1])||f[2]>0&&r.includes(p[2])||f[3]>0&&r.includes(p[3]))continue;let m=n[u],h=i[u];m[0]>0&&r.includes(h[0])||m[1]>0&&r.includes(h[1])||m[2]>0&&r.includes(h[2])||m[3]>0&&r.includes(h[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 h=0;h{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}};At.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;At.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var Mt=At,Vr=new Set(["1.0","1.0-beta"]),Qe=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return w(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 w(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 w(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(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.firstPerson,u=[],d=yield xn(t);return Array.from(d.entries()).forEach(([c,f])=>{var p,m;let h=(p=s==null?void 0:s.meshAnnotations)==null?void 0:p.find(_=>_.node===c);u.push({meshes:f,type:(m=h==null?void 0:h.type)!=null?m:"auto"})}),new Mt(e,u)})}_v0Import(t,e){return w(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 xn(t);return Array.from(l.entries()).forEach(([s,u])=>{let d=i.nodes[s],c=o.meshAnnotations?o.meshAnnotations.find(f=>f.mesh===d.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(c==null?void 0:c.firstPersonFlag)})}),new Mt(e,a)})}_convertV0FlagToV1Type(t){return t==="FirstPersonOnly"?"firstPersonOnly":t==="ThirdPersonOnly"?"thirdPersonOnly":t==="Both"?"both":"auto"}},Ir={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"},wn=new X.Vector3,Pn=new X.Vector3,Cr=new X.Quaternion,Rt=class extends X.Group{constructor(t){super(),this.vrmHumanoid=t,this._boneAxesMap=new Map,Object.values(t.humanBones).forEach(e=>{let n=new X.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(wn,Cr,Pn);let i=wn.set(.1,.1,.1).divide(Pn);n.matrix.copy(e.node.matrixWorld).scale(i)}),super.updateMatrixWorld(t)}},We=["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"],Ur={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"},Xn={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 Yn(t){return t.invert?t.invert():t.inverse(),t}var se=new Xe.Vector3,ae=new Xe.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&&Yn(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}},ct=new W.Vector3,Or=new W.Quaternion,Nr=new W.Vector3,Sn=class qn extends Tt{static _setupTransforms(e){let n=new W.Object3D;n.name="VRMHumanoidRig";let i={},r={},o={},a={};We.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let c=new W.Vector3,f=new W.Quaternion;d.updateWorldMatrix(!0,!1),d.matrixWorld.decompose(c,f,ct),i[s]=c,r[s]=f,o[s]=d.quaternion.clone();let p=new W.Quaternion;(u=d.parent)==null||u.matrixWorld.decompose(ct,p,ct),a[s]=p}});let l={};return We.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let c=i[s],f=s,p;for(;p==null&&(f=Xn[f],f!=null);)p=i[f];let m=new W.Object3D;m.name="Normalized_"+d.name,(f?(u=l[f])==null?void 0:u.node:n).add(m),m.position.copy(c),p&&m.position.sub(p),l[s]={node:m}}}),{rigBones:l,root:n,parentWorldRotations:a,boneRotations:o}}constructor(e){let{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=qn._setupTransforms(e);super(n),this.original=e,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){We.forEach(e=>{let n=this.original.getBoneNode(e);if(n!=null){let i=this.getBoneNode(e),r=this._parentWorldRotations[e],o=Or.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(Nr);n.parent.updateWorldMatrix(!0,!1);let s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},xt=class Zn{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 Sn(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new Tt(e.humanBones),this._normalizedHumanBones=new Sn(this._rawHumanBones),this}clone(){return new Zn(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()}},$n={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"},Br=new Set(["1.0","1.0-beta"]),An={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 w(this,null,function*(){t.userData.vrmHumanoid=yield this._import(t)})}_import(t){return w(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 w(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(!Br.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(c=>w(this,[c],function*([f,p]){let m=f,h=p.node;if(s){let g=An[m];g!=null&&(m=g)}let _=yield this.parser.getDependency("node",h);if(_==null){console.warn(`A glTF node bound to the humanoid bone ${m} (index = ${h}) does not exist`);return}u[m]={node:_}}))));let d=new xt(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(d.normalizedHumanBonesRoot),this.helperRoot){let c=new Rt(d);this.helperRoot.add(c),c.renderOrder=this.helperRoot.renderOrder}return d})}_v0Import(t){return w(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=>w(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 c=An[s],f=c!=null?c:s;if(o[f]!=null){console.warn(`Multiple bone entries for ${f} detected (index = ${u}), ignoring duplicated entries.`);return}o[f]={node:d}}))));let a=new xt(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){let l=new Rt(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(t){let e=Object.values($n).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}},Ln=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}},Dr=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}},De=new S.Quaternion,Hn=new S.Quaternion,Se=new S.Vector3,bn=new S.Vector3,Vn=Math.sqrt(2)/2,Fr=new S.Quaternion(0,0,-Vn,Vn),Wr=new S.Vector3(0,1,0),Jn=class extends S.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=t;{let e=new Ln;e.radius=.5;let n=new S.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:S.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new S.Mesh(e,n),this.add(this._meshPitch)}{let e=new Ln;e.radius=.5;let n=new S.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:S.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new S.Mesh(e,n),this.add(this._meshYaw)}{let e=new Dr;e.radius=.1;let n=new S.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new S.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=S.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=e,this._meshYaw.geometry.update();let n=S.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(Hn)),this._meshYaw.position.copy(Se),this._meshYaw.quaternion.copy(De),this._meshPitch.position.copy(Se),this._meshPitch.quaternion.copy(De),this._meshPitch.quaternion.multiply(Hn.setFromAxisAngle(Wr,e)),this._meshPitch.quaternion.multiply(Fr);let{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(bn).sub(Se),this._lineTarget.geometry.tail.copy(bn),this._lineTarget.geometry.update(),this._lineTarget.position.copy(Se)),super.updateMatrixWorld(t)}},kr=new Lt.Vector3,zr=new Lt.Vector3;function yt(t,e){return t.matrixWorld.decompose(kr,e,zr),e}function ke(t){return[Math.atan2(-t.z,t.x),Math.atan2(t.y,Math.sqrt(t.x*t.x+t.z*t.z))]}function In(t){let e=Math.round(t/2/Math.PI);return t-2*Math.PI*e}var Cn=new I.Vector3(0,0,1),Gr=new I.Vector3,jr=new I.Vector3,Qr=new I.Vector3,Xr=new I.Quaternion,pt=new I.Quaternion,Un=new I.Quaternion,Yr=new I.Quaternion,mt=new I.Euler,Kn=class ei{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 ei(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 yt(n,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Cn)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[n,i]=ke(this.faceFront);return mt.set(0,.5*Math.PI+n,i,"YZX"),e.setFromEuler(mt).premultiply(Yr.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(pt),this.getFaceFrontQuaternion(Un),e.copy(Cn).applyQuaternion(pt).applyQuaternion(Un).applyEuler(this.getEuler(mt))}lookAt(e){let n=Xr.copy(this._restHeadWorldQuaternion).multiply(Yn(this.getLookAtWorldQuaternion(pt))),i=this.getLookAtWorldPosition(jr),r=Qr.copy(e).sub(i).applyQuaternion(n).normalize(),[o,a]=ke(this.faceFront),[l,s]=ke(r),u=In(l-o),d=In(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(Gr)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Kn.EULER_ORDER="YXZ";var ti=Kn,qr=new V.Vector3(0,0,1),z=new V.Quaternion,me=new V.Quaternion,B=new V.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 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),yt(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),yt(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=-V.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):B.x=V.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?B.y=-V.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-t):B.y=V.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(t),z.setFromEuler(B),this._getWorldFaceFrontQuat(me),r.quaternion.copy(me).multiply(z).multiply(me.invert()),z.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(z).premultiply(z.invert()).multiply(this._restQuatLeftEye)),i&&(e<0?B.x=-V.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):B.x=V.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?B.y=-V.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-t):B.y=V.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(t),z.setFromEuler(B),this._getWorldFaceFrontQuat(me),o.quaternion.copy(me).multiply(z).multiply(me.invert()),z.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(z).premultiply(z.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(qr)<.01)return t.identity();let[e,n]=ke(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=wt.MathUtils.RAD2DEG*t.y,n=wt.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*Bn(t/this.inputMaxValue)}},Zr=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 w(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 w(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 w(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(!Zr.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;let d=s.lookAt;if(!d)return null;let c=d.type==="expression"?1:10,f=this._v1ImportRangeMap(d.rangeMapHorizontalInner,c),p=this._v1ImportRangeMap(d.rangeMapHorizontalOuter,c),m=this._v1ImportRangeMap(d.rangeMapVerticalDown,c),h=this._v1ImportRangeMap(d.rangeMapVerticalUp,c),_;d.type==="expression"?_=new Ge(n,f,p,m,h):_=new Ae(e,f,p,m,h);let g=this._importLookAt(e,_);return g.offsetFromHeadBone.fromArray((o=d.offsetFromHeadBone)!=null?o:[0,.06,0]),g})}_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()}},eo=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 w(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 ge=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=E(require("three"),1),si=E(require("three"),1),ai=E(require("three"),1),P=E(require("three"),1),ui=E(require("three"),1);var to=Object.defineProperty,ii=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,ri=(t,e,n)=>e in t?to(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oi=(t,e)=>{for(var n in e||(e={}))no.call(e,n)&&ri(t,n,e[n]);if(ii)for(var n of ii(e))io.call(e,n)&&ri(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())}),ro={"":3e3,srgb:3001};function oo(t,e){parseInt(ai.REVISION,10)>=152?t.colorSpace=e:t.encoding=ro[e]}var so=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 si.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&&oo(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)})}},ao=`// #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})},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 varying vec3 vViewPosition; @@ -117,7 +117,7 @@ void main() { #include #include -}`,lo=`// #define PHONG +}`,ho=`// #define PHONG uniform vec3 litFactor; @@ -919,11 +919,11 @@ void main() { gl_FragColor = vec4( col, diffuseColor.a ); postCorrection(); } -`,li={None:"none",Normal:"normal",LitShadeRate:"litShadeRate",UV:"uv"},bt={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},uo={3e3:"",3001:"srgb"};function Ht(t){return parseInt(ui.REVISION,10)>=152?t.colorSpace:uo[t.encoding]}var di=class extends P.ShaderMaterial{constructor(t={}){var e;super({vertexShader:ao,fragmentShader:lo}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=P.TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=li.None,this._outlineWidthMode=bt.None,this._isOutline=!1,t.transparentWithZWrite&&(t.depthWrite=!0),delete t.transparentWithZWrite,t.fog=!0,t.lights=!0,t.clipping=!0,this.uniforms=P.UniformsUtils.merge([P.UniformsLib.common,P.UniformsLib.normalmap,P.UniformsLib.emissivemap,P.UniformsLib.fog,P.UniformsLib.lights,{litFactor:{value:new P.Color(1,1,1)},mapUvTransform:{value:new P.Matrix3},colorAlpha:{value:1},normalMapUvTransform:{value:new P.Matrix3},shadeColorFactor:{value:new P.Color(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new P.Matrix3},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new P.Matrix3},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new P.Color(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new P.Matrix3},parametricRimColorFactor:{value:new P.Color(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new P.Matrix3},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new P.Color(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new P.Matrix3},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new P.Matrix3},outlineWidthFactor:{value:0},outlineColorFactor:{value:new P.Color(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new P.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:${Ht(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${Ht(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${Ht(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{let i=parseInt(P.REVISION,10),r=Object.entries(oi(oi({},this._generateDefines()),this.defines)).filter(([o,a])=>!!a).map(([o,a])=>`#define ${o} ${a}`).join(` +`,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(` `)+` -`;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(P.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===bt.ScreenCoordinates}}_updateTextureMatrix(t,e){t.value&&(t.value.matrixAutoUpdate&&t.value.updateMatrix(),e.value.copy(t.value.matrix))}},ho=new Set(["1.0","1.0-beta"]),hi=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:di,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[Je.EXTENSION_NAME];if(l==null)return;let s=l.specVersion;if(!ho.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${Je.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 so(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)}};hi.EXTENSION_NAME="VRMC_materials_mtoon";var Vt=hi;var co=(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())}),ci=class It{get name(){return It.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,n){return co(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[It.EXTENSION_NAME];if(l!=null)return l}};ci.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var pi=ci;var gi=E(require("three"),1);var po=Object.defineProperty,mo=Object.defineProperties,fo=Object.getOwnPropertyDescriptors,mi=Object.getOwnPropertySymbols,_o=Object.prototype.hasOwnProperty,go=Object.prototype.propertyIsEnumerable,fi=(t,e,n)=>e in t?po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,G=(t,e)=>{for(var n in e||(e={}))_o.call(e,n)&&fi(t,n,e[n]);if(mi)for(var n of mi(e))go.call(e,n)&&fi(t,n,e[n]);return t},_i=(t,e)=>mo(t,fo(e)),vo=(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 ve(t){return Math.pow(t,2.2)}var vi=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 vo(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,c,f,p,m,h,_,g,x,T,v,R,M,y,A,b,L,H,U,$,xe,ye,J,k,pe,we,O,zt,Gt,jt,Qt,Xt,Yt,qt,Zt,$t,Jt,Kt,en,tn,nn,rn,on,sn,an,ln,un;let dn=(i=(n=t.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,ji=((r=t.floatProperties)==null?void 0:r._ZWrite)===1&&dn,Qi=this._v0ParseRenderQueue(t),hn=(a=(o=t.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,Xi=dn?"BLEND":hn?"MASK":"OPAQUE",Yi=hn?(s=(l=t.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,qi=((d=(u=t.floatProperties)==null?void 0:u._CullMode)!=null?d:2)===0,oe=this._portTextureTransform(t),Zi=((f=(c=t.vectorProperties)==null?void 0:c._Color)!=null?f:[1,1,1,1]).map((Mn,Mr)=>Mr===3?Mn:ve(Mn)),cn=(p=t.textureProperties)==null?void 0:p._MainTex,$i=cn!=null?{index:cn,extensions:G({},oe)}:void 0,Ji=(h=(m=t.floatProperties)==null?void 0:m._BumpScale)!=null?h:1,pn=(_=t.textureProperties)==null?void 0:_._BumpMap,Ki=pn!=null?{index:pn,scale:Ji,extensions:G({},oe)}:void 0,er=((x=(g=t.vectorProperties)==null?void 0:g._EmissionColor)!=null?x:[0,0,0,1]).map(ve),mn=(T=t.textureProperties)==null?void 0:T._EmissionMap,tr=mn!=null?{index:mn,extensions:G({},oe)}:void 0,nr=((R=(v=t.vectorProperties)==null?void 0:v._ShadeColor)!=null?R:[.97,.81,.86,1]).map(ve),fn=(M=t.textureProperties)==null?void 0:M._ShadeTexture,ir=fn!=null?{index:fn,extensions:G({},oe)}:void 0,Ue=(A=(y=t.floatProperties)==null?void 0:y._ShadeShift)!=null?A:0,Oe=(L=(b=t.floatProperties)==null?void 0:b._ShadeToony)!=null?L:.9;Oe=gi.MathUtils.lerp(Oe,1,.5+.5*Ue),Ue=-Ue-(1-Oe);let _n=(U=(H=t.floatProperties)==null?void 0:H._IndirectLightIntensity)!=null?U:.1,rr=_n?1-_n:void 0,dt=($=t.textureProperties)==null?void 0:$._SphereAdd,or=dt!=null?[1,1,1]:void 0,sr=dt!=null?{index:dt}:void 0,ar=(ye=(xe=t.floatProperties)==null?void 0:xe._RimLightingMix)!=null?ye:0,gn=(J=t.textureProperties)==null?void 0:J._RimTexture,lr=gn!=null?{index:gn,extensions:G({},oe)}:void 0,ur=((pe=(k=t.vectorProperties)==null?void 0:k._RimColor)!=null?pe:[0,0,0,1]).map(ve),dr=(O=(we=t.floatProperties)==null?void 0:we._RimFresnelPower)!=null?O:1,hr=(Gt=(zt=t.floatProperties)==null?void 0:zt._RimLift)!=null?Gt:0,cr=["none","worldCoordinates","screenCoordinates"][(Qt=(jt=t.floatProperties)==null?void 0:jt._OutlineWidthMode)!=null?Qt:0],ht=(Yt=(Xt=t.floatProperties)==null?void 0:Xt._OutlineWidth)!=null?Yt:0;ht=.01*ht;let vn=(qt=t.textureProperties)==null?void 0:qt._OutlineWidthTexture,pr=vn!=null?{index:vn,extensions:G({},oe)}:void 0,mr=(($t=(Zt=t.vectorProperties)==null?void 0:Zt._OutlineColor)!=null?$t:[0,0,0]).map(ve),fr=((Kt=(Jt=t.floatProperties)==null?void 0:Jt._OutlineColorMode)!=null?Kt:0)===1?(tn=(en=t.floatProperties)==null?void 0:en._OutlineLightingMix)!=null?tn:1:0,En=(nn=t.textureProperties)==null?void 0:nn._UvAnimMaskTexture,_r=En!=null?{index:En,extensions:G({},oe)}:void 0,gr=(on=(rn=t.floatProperties)==null?void 0:rn._UvAnimScrollX)!=null?on:0,Ne=(an=(sn=t.floatProperties)==null?void 0:sn._UvAnimScrollY)!=null?an:0;Ne!=null&&(Ne=-Ne);let vr=(un=(ln=t.floatProperties)==null?void 0:ln._UvAnimRotation)!=null?un:0,Er={specVersion:"1.0",transparentWithZWrite:ji,renderQueueOffsetNumber:Qi,shadeColorFactor:nr,shadeMultiplyTexture:ir,shadingShiftFactor:Ue,shadingToonyFactor:Oe,giEqualizationFactor:rr,matcapFactor:or,matcapTexture:sr,rimLightingMixFactor:ar,rimMultiplyTexture:lr,parametricRimColorFactor:ur,parametricRimFresnelPowerFactor:dr,parametricRimLiftFactor:hr,outlineWidthMode:cr,outlineWidthFactor:ht,outlineWidthMultiplyTexture:pr,outlineColorFactor:mr,outlineLightingMixFactor:fr,uvAnimationMaskTexture:_r,uvAnimationScrollXSpeedFactor:gr,uvAnimationScrollYSpeedFactor:Ne,uvAnimationRotationSpeedFactor:vr};return _i(G({},e),{pbrMetallicRoughness:{baseColorFactor:Zi,baseColorTexture:$i},normalTexture:Ki,emissiveTexture:tr,emissiveFactor:er,alphaMode:Xi,alphaCutoff:Yi,doubleSided:qi,extensions:{VRMC_materials_mtoon:Er}})}_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",c=s?"BLEND":d?"MASK":"OPAQUE",f=d?(i=(n=t.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,p=this._portTextureTransform(t),m=((o=(r=t.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(ve),h=(a=t.textureProperties)==null?void 0:a._MainTex,_=h!=null?{index:h,extensions:G({},p)}:void 0,g={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:m,shadeMultiplyTexture:_};return _i(G({},e),{pbrMetallicRoughness:{baseColorFactor:m,baseColorTexture:_},alphaMode:c,alphaCutoff:f,extensions:{VRMC_materials_mtoon:g}})}_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=E(require("three"),1),j=E(require("three"),1),Ct=E(require("three"),1),be=E(require("three"),1),Y=E(require("three"),1);var Ei=(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 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){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 Mi(t,e){return e.set(t.elements[12],t.elements[13],t.elements[14])}var Eo=new Ct.Vector3,Mo=new Ct.Vector3;function Ro(t,e){return t.decompose(Eo,e,Mo),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}},To=new j.Vector3,xo=new j.Vector3,yo=new j.Vector3,wo=new j.Quaternion,Po=new j.Quaternion,So=new j.Quaternion,Ri=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 j.Vector3(1,0,0),this._dstRestQuat=new j.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let t=wo.identity(),e=Po.identity();this.destination.parent&&(Ro(this.destination.parent.matrixWorld,t),tt(e.copy(t)));let n=To.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(t),i=Mi(this.source.matrixWorld,xo).sub(Mi(this.destination.matrixWorld,yo)).normalize(),r=So.setFromUnitVectors(n,i).premultiply(e).multiply(t).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function Ao(t,e){let n=[t],i=t.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}var Ti=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)Ao(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)}},Lo=new be.Quaternion,Ho=new be.Quaternion,xi=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=Lo.copy(this._invSrcRestQuat).multiply(this.source.quaternion),e=Ho.copy(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(e,this.weight)}},bo=new Y.Vector3,Vo=new Y.Quaternion,Io=new Y.Quaternion,yi=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 Y.Vector3(1,0,0),this._dstRestQuat=new Y.Quaternion,this._invDstRestQuat=new Y.Quaternion,this._invSrcRestQuatMulDstRestQuat=new Y.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=Vo.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),e=bo.copy(this._v3RollAxis).applyQuaternion(t),i=Io.setFromUnitVectors(e,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},Co=new Set(["1.0","1.0-beta"]),wi=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 Ei(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(e){return Ei(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 Ti,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;let d=i.nodes[s],c=(u=d==null?void 0:d.extensions)==null?void 0:u[He.EXTENSION_NAME];if(c==null)return;let f=c.specVersion;if(!Co.has(f)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${He.EXTENSION_NAME} specVersion "${f}"`);return}let p=c.constraint;if(p.roll!=null){let m=this._importRollConstraint(l,a,p.roll);o.addConstraint(m)}else if(p.aim!=null){let m=this._importAimConstraint(l,a,p.aim);o.addConstraint(m)}else if(p.rotation!=null){let m=this._importRotationConstraint(l,a,p.rotation);o.addConstraint(m)}}),e.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(e,n,i){let{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new yi(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 Ri(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 xi(e,a);if(o!=null&&(l.weight=o),this.helperRoot){let s=new et(l);this.helperRoot.add(s)}return l}};wi.EXTENSION_NAME="VRMC_node_constraint";var Ut=wi;var ie=E(require("three"),1),Ce=E(require("three"),1),Te=E(require("three"),1),Hi=E(require("three"),1),Z=E(require("three"),1),ne=E(require("three"),1),de=E(require("three"),1),re=E(require("three"),1),he=E(require("three"),1),Vi=E(require("three"),1),C=E(require("three"),1),Ii=E(require("three"),1),Ui=E(require("three"),1),D=E(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{},Ot=new Ce.Vector3,ue=new Ce.Vector3,Dt=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){Ot.copy(this.offset).applyMatrix4(t),ue.copy(this.tail).applyMatrix4(t),ue.sub(Ot);let r=ue.lengthSq();i.copy(e).sub(Ot);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}},Nt=new Te.Vector3,Pi=new Te.Matrix3,Ft=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.copy(this.offset).applyMatrix4(t),i.negate().add(e),Pi.getNormalMatrix(t),Nt.copy(this.normal).applyNormalMatrix(Pi).normalize();let r=i.dot(Nt)-n;return i.copy(Nt),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 Hi.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}},Q=new Z.Vector3,Uo=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}},Oo=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}},No=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}},Bo=new ie.Vector3,rt=class extends ie.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof Wt)this._geometry=new No(this.collider.shape);else if(this.collider.shape instanceof Dt)this._geometry=new Uo(this.collider.shape);else if(this.collider.shape instanceof Ft)this._geometry=new Oo(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=Bo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},Do=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}},Fo=new re.Vector3,bi=class extends re.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new Do(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=Fo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},ot=class extends Vi.Object3D{constructor(t){super(),this.shape=t}},Wo=new Ii.Matrix4;function Ci(t){return t.invert?t.invert():t.getInverse(Wo.copy(t)),t}var ko=class{constructor(t){this._inverseCache=new Ui.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&&(Ci(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},zo=new C.Matrix4,q=new C.Vector3,Ve=new C.Vector3,Go=new C.Vector3,Ee=new C.Vector3,Si=new C.Vector3,Ie=new C.Vector3,Ai=new C.Quaternion,Me=new C.Matrix4,jo=new C.Matrix4,Oi=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 ko(this._center.matrixWorld)))}get initialLocalChildPosition(){return this._initialLocalChildPosition}get _parentMatrixWorld(){return this.bone.parent?this.bone.parent.matrixWorld:zo}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(Me);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(Me);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail)}update(t){if(t<=0)return;this._calcWorldSpaceBoneLength(),Ee.setFromMatrixPosition(this.bone.matrixWorld);let e=this._getMatrixWorldToCenter(Me);Si.copy(Ee).applyMatrix4(e);let n=Ai.setFromRotationMatrix(e),i=jo.copy(e).multiply(this._parentMatrixWorld),r=Ve.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(i).sub(Si).normalize(),o=Go.copy(this.settings.gravityDir).applyQuaternion(n).normalize(),a=this._getMatrixCenterToWorld(Me);Ie.copy(this._currentTail).add(q.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1-this.settings.dragForce)).add(q.copy(r).multiplyScalar(this.settings.stiffness*t)).add(q.copy(o).multiplyScalar(this.settings.gravityPower*t)).applyMatrix4(a),Ie.sub(Ee).normalize().multiplyScalar(this._worldSpaceBoneLength).add(Ee),this._collision(Ie),e=this._getMatrixWorldToCenter(Me),this._prevTail.copy(this._currentTail),this._currentTail.copy(q.copy(Ie).applyMatrix4(e));let l=Ci(Me.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix)),s=Ai.setFromUnitVectors(this._boneAxis,q.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,q);i<0&&(t.add(q.multiplyScalar(-i)),t.sub(Ee).normalize().multiplyScalar(this._worldSpaceBoneLength).add(Ee))})})}_calcWorldSpaceBoneLength(){q.setFromMatrixPosition(this.bone.matrixWorld),this.child?Ve.setFromMatrixPosition(this.child.matrixWorld):(Ve.copy(this._initialLocalChildPosition),Ve.applyMatrix4(this.bone.matrixWorld)),this._worldSpaceBoneLength=q.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 Qo(t,e){let n=[],i=t;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}function Ni(t,e){t.children.forEach(n=>{e(n)||Ni(n,e)})}var Bt=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)),Ni(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)Qo(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}},Li="VRMC_springBone_extended_collider",Xo=new Set(["1.0","1.0-beta"]),Yo=new Set(["1.0"]),Bi=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 Bt,d=yield e.parser.getDependencies("node"),c=(i=l.extensions)==null?void 0:i[Re.EXTENSION_NAME];if(!c)return null;let f=c.specVersion;if(!Xo.has(f))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Re.EXTENSION_NAME} specVersion "${f}"`),null;let p=(r=c.colliders)==null?void 0:r.map((h,_)=>{var g,x,T,v,R,M,y,A,b,L,H,U,$,xe,ye;let J=d[h.node],k=h.shape,pe=(g=h.extensions)==null?void 0:g[Li];if(this.useExtendedColliders&&pe!=null){let we=pe.specVersion;if(!Yo.has(we))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Li} specVersion "${we}". Fallbacking to the ${Re.EXTENSION_NAME} definition`);else{let O=pe.shape;if(O.sphere)return this._importSphereCollider(J,{offset:new D.Vector3().fromArray((x=O.sphere.offset)!=null?x:[0,0,0]),radius:(T=O.sphere.radius)!=null?T:0,inside:(v=O.sphere.inside)!=null?v:!1});if(O.capsule)return this._importCapsuleCollider(J,{offset:new D.Vector3().fromArray((R=O.capsule.offset)!=null?R:[0,0,0]),radius:(M=O.capsule.radius)!=null?M:0,tail:new D.Vector3().fromArray((y=O.capsule.tail)!=null?y:[0,0,0]),inside:(A=O.capsule.inside)!=null?A:!1});if(O.plane)return this._importPlaneCollider(J,{offset:new D.Vector3().fromArray((b=O.plane.offset)!=null?b:[0,0,0]),normal:new D.Vector3().fromArray((L=O.plane.normal)!=null?L:[0,0,1])})}}if(k.sphere)return this._importSphereCollider(J,{offset:new D.Vector3().fromArray((H=k.sphere.offset)!=null?H:[0,0,0]),radius:(U=k.sphere.radius)!=null?U:0,inside:!1});if(k.capsule)return this._importCapsuleCollider(J,{offset:new D.Vector3().fromArray(($=k.capsule.offset)!=null?$:[0,0,0]),radius:(xe=k.capsule.radius)!=null?xe:0,tail:new D.Vector3().fromArray((ye=k.capsule.tail)!=null?ye:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${_} has no valid shape`)}),m=(o=c.colliderGroups)==null?void 0:o.map((h,_)=>{var g;return{colliders:((g=h.colliders)!=null?g:[]).map(T=>{let v=p==null?void 0:p[T];if(v==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${_} attempted to use a collider #${T} but not found`);return v}),name:h.name}});return(a=c.springs)==null||a.forEach((h,_)=>{var g;let x=h.joints,T=(g=h.colliderGroups)==null?void 0:g.map(M=>{let y=m==null?void 0:m[M];if(y==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${_} attempted to use a colliderGroup ${M} but not found`);return y}),v=h.center!=null?d[h.center]:void 0,R;x.forEach(M=>{if(R){let y=R.node,A=d[y],b=M.node,L=d[b],H={hitRadius:R.hitRadius,dragForce:R.dragForce,gravityPower:R.gravityPower,stiffness:R.stiffness,gravityDir:R.gravityDir!=null?new D.Vector3().fromArray(R.gravityDir):void 0},U=this._importJoint(A,L,H,T);v&&(U.center=v),u.addJoint(U)}R=M})}),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 Bt,c=yield e.parser.getDependencies("node"),f=(r=s.colliderGroups)==null?void 0:r.map(p=>{var m;let h=c[p.node];return{colliders:((m=p.colliders)!=null?m:[]).map((g,x)=>{var T,v,R;let M=new D.Vector3(0,0,0);return g.offset&&M.set((T=g.offset.x)!=null?T:0,(v=g.offset.y)!=null?v:0,g.offset.z?-g.offset.z:0),this._importSphereCollider(h,{offset:M,radius:(R=g.radius)!=null?R:0,inside:!1})})}});return u==null||u.forEach((p,m)=>{let h=p.bones;h&&h.forEach(_=>{var g,x,T,v;let R=c[_],M=new D.Vector3;p.gravityDir?M.set((g=p.gravityDir.x)!=null?g:0,(x=p.gravityDir.y)!=null?x:0,(T=p.gravityDir.z)!=null?T:0):M.set(0,-1,0);let y=p.center!=null?c[p.center]:void 0,A={hitRadius:p.hitRadius,dragForce:p.dragForce,gravityPower:p.gravityPower,stiffness:p.stiffiness,gravityDir:M},b=(v=p.colliderGroups)==null?void 0:v.map(L=>{let H=f==null?void 0:f[L];if(H==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${m} attempted to use a colliderGroup ${L} but not found`);return H});R.traverse(L=>{var H;let U=(H=L.children[0])!=null?H:null,$=this._importJoint(L,U,A,b);y&&($.center=y),d.addJoint($)})})}),e.scene.updateMatrixWorld(),d.setInitState(),d})}_importJoint(e,n,i,r){let o=new Oi(e,n,i,r);if(this.jointHelperRoot){let a=new bi(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 Dt(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 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}};Bi.EXTENSION_NAME="VRMC_springBone";var kt=Bi;var at=class{get name(){return"VRMLoaderPlugin"}constructor(e,n){var o,a,l,s,u,d,c,f,p,m;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 Vt(e),this.materialsHDREmissiveMultiplierPlugin=(c=n==null?void 0:n.materialsHDREmissiveMultiplierPlugin)!=null?c:new pi(e),this.materialsV0CompatPlugin=(f=n==null?void 0:n.materialsV0CompatPlugin)!=null?f:new vi(e),this.springBonePlugin=(p=n==null?void 0:n.springBonePlugin)!=null?p:new kt(e,{colliderHelperRoot:i,jointHelperRoot:i}),this.nodeConstraintPlugin=(m=n==null?void 0:n.nodeConstraintPlugin)!=null?m:new Ut(e,{helperRoot:i})}beforeRoot(){return Pe(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return Pe(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 Pe(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,n),yield this.mtoonMaterialPlugin.extendMaterialParams(e,n)})}afterRoot(e){return Pe(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 ge({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}})}};function Di(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 qo(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=>Di(r)):i&&Di(i))}function Fi(t){t.traverse(qo)}var lt=E(require("three"),1);function Wi(t,e){var a;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=[],c=[],f={},p=u.array;for(let m=0;m{var c,f,p,m;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=new ki.BufferGeometry;l.name=r.name,l.morphTargetsRelative=r.morphTargetsRelative,r.groups.forEach(h=>{l.addGroup(h.start,h.count,h.materialIndex)}),l.boundingBox=(f=(c=r.boundingBox)==null?void 0:c.clone())!=null?f:null,l.boundingSphere=(m=(p=r.boundingSphere)==null?void 0:p.clone())!=null?m:null,l.setDrawRange(r.drawRange.start,r.drawRange.count),l.userData=r.userData,e.set(r,l);let s=[],u=[];{let h=o.array,_=new h.constructor(h.length),g=0;for(let x=0;x{let _=r.attributes[h];if(_.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");let g=_.array,{itemSize:x,normalized:T}=_,v=new g.constructor(u.length*x);u.forEach((R,M)=>{for(let y=0;y{l.morphAttributes[h]=[];let _=r.morphAttributes[h];for(let g=0;g<_.length;g++){let x=_[g];if(x.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");let T=x.array,{itemSize:v,normalized:R}=x,M=new T.constructor(u.length*v);u.forEach((y,A)=>{for(let b=0;by===0),l.morphAttributes[h][g]=new ut.BufferAttribute(M,v,R)}}),d&&(l.morphAttributes={}),i.geometry=l}),Array.from(e.keys()).forEach(n=>{n.dispose()})}function Gi(t){var e;((e=t.meta)==null?void 0:e.metaVersion)==="0"&&(t.scene.rotation.y=Math.PI)}var ce=class{constructor(){}};ce.deepDispose=Fi,ce.removeUnnecessaryJoints=Wi,ce.removeUnnecessaryVertices=zi,ce.rotateVRM0=Gi; +`;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; /*! - * @pixiv/three-vrm-core v3.1.6 + * @pixiv/three-vrm-core v3.2.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.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.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.1.6 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.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.1.6 + * @pixiv/three-vrm-materials-v0compat v3.2.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.1.6 + * @pixiv/three-vrm-node-constraint v3.2.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.1.6 + * @pixiv/three-vrm-springbone v3.2.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 d8abe5ba7..cb5a5c432 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.1.6 + * @pixiv/three-vrm v3.2.0 * VRM file loader for three.js. * * Copyright (c) 2019-2024 pixiv Inc. @@ -5977,6 +5977,82 @@ var VRMLoaderPlugin = class { } }; +// src/VRMUtils/combineSkeletons.ts +import * as THREE21 from "three"; +function combineSkeletons(root) { + const skinnedMeshes = /* @__PURE__ */ new Set(); + const geometryToSkinnedMesh = /* @__PURE__ */ new Map(); + root.traverse((obj) => { + if (obj.type !== "SkinnedMesh") { + return; + } + const skinnedMesh = obj; + const previousSkinnedMesh = geometryToSkinnedMesh.get(skinnedMesh.geometry); + if (previousSkinnedMesh) { + skinnedMeshes.delete(previousSkinnedMesh); + } else { + geometryToSkinnedMesh.set(skinnedMesh.geometry, skinnedMesh); + skinnedMeshes.add(skinnedMesh); + } + }); + const newSkeletons = []; + skinnedMeshes.forEach((skinnedMesh) => { + const skeleton = skinnedMesh.skeleton; + let newSkeleton = newSkeletons.find((candidate) => skeletonMatches(skeleton, candidate)); + if (!newSkeleton) { + newSkeleton = { bones: [], boneInverses: [], meshes: [] }; + newSkeletons.push(newSkeleton); + } + newSkeleton.meshes.push(skinnedMesh); + const boneIndexMap = skeleton.bones.map((bone) => newSkeleton.bones.indexOf(bone)); + const geometry = skinnedMesh.geometry; + const attribute = geometry.getAttribute("skinIndex"); + const weightAttribute = geometry.getAttribute("skinWeight"); + for (let i = 0; i < attribute.count; i++) { + for (let j = 0; j < attribute.itemSize; j++) { + const weight = weightAttribute.getComponent(i, j); + if (weight === 0) { + continue; + } + const index = attribute.getComponent(i, j); + if (boneIndexMap[index] === -1) { + boneIndexMap[index] = newSkeleton.bones.length; + newSkeleton.bones.push(skeleton.bones[index]); + newSkeleton.boneInverses.push(skeleton.boneInverses[index]); + } + attribute.setComponent(i, j, boneIndexMap[index]); + } + } + 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())); + } +} +function skeletonMatches(skeleton, candidate) { + return skeleton.bones.every((bone, index) => { + const candidateIndex = candidate.bones.indexOf(bone); + if (candidateIndex !== -1) { + return matrixEquals(skeleton.boneInverses[index], candidate.boneInverses[candidateIndex]); + } + return true; + }); +} +function matrixEquals(a, b, tolerance) { + tolerance = tolerance || 1e-4; + if (a.elements.length != b.elements.length) { + return false; + } + for (let i = 0, il = a.elements.length; i < il; i++) { + const delta = Math.abs(a.elements[i] - b.elements[i]); + if (delta > tolerance) { + return false; + } + } + return true; +} + // src/VRMUtils/deepDispose.ts function disposeMaterial(material) { Object.values(material).forEach((value) => { @@ -6022,9 +6098,12 @@ function deepDispose(object3D) { } // src/VRMUtils/removeUnnecessaryJoints.ts -import * as THREE21 from "three"; +import * as THREE25 from "three"; function removeUnnecessaryJoints(root, options) { 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." + ); const experimentalSameBoneCounts = (_a = options == null ? void 0 : options.experimentalSameBoneCounts) != null ? _a : false; const skinnedMeshes = []; root.traverse((obj) => { @@ -6041,17 +6120,17 @@ function removeUnnecessaryJoints(root, options) { const bones = []; const boneInverses = []; const boneIndexMap = {}; - const array = attribute.array; - for (let i = 0; i < array.length; i++) { - const index = array[i]; - if (boneIndexMap[index] == null) { - boneIndexMap[index] = bones.length; - bones.push(mesh.skeleton.bones[index]); - boneInverses.push(mesh.skeleton.boneInverses[index]); + for (let i = 0; i < attribute.count; i++) { + for (let j = 0; j < attribute.itemSize; j++) { + const index = attribute.getComponent(i, j); + if (boneIndexMap[index] == null) { + boneIndexMap[index] = bones.length; + bones.push(mesh.skeleton.bones[index]); + boneInverses.push(mesh.skeleton.boneInverses[index]); + } + attribute.setComponent(i, j, boneIndexMap[index]); } - array[i] = boneIndexMap[index]; } - attribute.copyArray(array); attribute.needsUpdate = true; bonesList.set(mesh, { bones, boneInverses }); maxBones = Math.max(maxBones, bones.length); @@ -6064,13 +6143,13 @@ function removeUnnecessaryJoints(root, options) { boneInverses[i] = boneInverses[0]; } } - const skeleton = new THREE21.Skeleton(bones, boneInverses); - mesh.bind(skeleton, new THREE21.Matrix4()); + const skeleton = new THREE25.Skeleton(bones, boneInverses); + mesh.bind(skeleton, new THREE25.Matrix4()); } } // src/VRMUtils/removeUnnecessaryVertices.ts -import * as THREE25 from "three"; +import * as THREE26 from "three"; import { BufferAttribute as BufferAttribute8 } from "three"; function removeUnnecessaryVertices(root) { const geometryMap = /* @__PURE__ */ new Map(); @@ -6081,8 +6160,8 @@ function removeUnnecessaryVertices(root) { } const mesh = obj; const geometry = mesh.geometry; - const origianlIndex = geometry.index; - if (origianlIndex == null) { + const originalIndex = geometry.index; + if (originalIndex == null) { return; } const newGeometryAlreadyExisted = geometryMap.get(geometry); @@ -6090,7 +6169,31 @@ function removeUnnecessaryVertices(root) { mesh.geometry = newGeometryAlreadyExisted; return; } - const newGeometry = new THREE25.BufferGeometry(); + const vertexCount = Object.values(geometry.attributes)[0].count; + const vertexInUse = new Array(vertexCount); + let verticesUsed = 0; + const originalIndexArray = originalIndex.array; + for (let i = 0; i < originalIndexArray.length; i++) { + const index = originalIndexArray[i]; + if (!vertexInUse[index]) { + vertexInUse[index] = true; + verticesUsed++; + } + } + if (verticesUsed === vertexCount) { + return; + } + const originalIndexNewIndexMap = []; + const newIndexOriginalIndexMap = []; + let indexHead = 0; + for (let i = 0; i < vertexInUse.length; i++) { + if (vertexInUse[i]) { + const newIndex = indexHead++; + originalIndexNewIndexMap[i] = newIndex; + newIndexOriginalIndexMap[newIndex] = i; + } + } + const newGeometry = new THREE26.BufferGeometry(); newGeometry.name = geometry.name; newGeometry.morphTargetsRelative = geometry.morphTargetsRelative; geometry.groups.forEach((group) => { @@ -6101,21 +6204,12 @@ function removeUnnecessaryVertices(root) { newGeometry.setDrawRange(geometry.drawRange.start, geometry.drawRange.count); newGeometry.userData = geometry.userData; geometryMap.set(geometry, newGeometry); - const originalIndexNewIndexMap = []; - const newIndexOriginalIndexMap = []; { - const originalIndexArray = origianlIndex.array; - const newIndexArray = new originalIndexArray.constructor(originalIndexArray.length); - let indexHead = 0; - for (let i = 0; i < originalIndexArray.length; i++) { - const originalIndex = originalIndexArray[i]; - let newIndex = originalIndexNewIndexMap[originalIndex]; - if (newIndex == null) { - originalIndexNewIndexMap[originalIndex] = indexHead; - newIndexOriginalIndexMap[indexHead] = originalIndex; - newIndex = indexHead; - indexHead++; - } + const originalIndexArray2 = originalIndex.array; + const newIndexArray = new originalIndexArray2.constructor(originalIndexArray2.length); + for (let i = 0; i < originalIndexArray2.length; i++) { + const originalIndex2 = originalIndexArray2[i]; + const newIndex = originalIndexNewIndexMap[originalIndex2]; newIndexArray[i] = newIndex; } newGeometry.setIndex(new BufferAttribute8(newIndexArray, 1, false)); @@ -6130,9 +6224,9 @@ function removeUnnecessaryVertices(root) { const newAttributeArray = new originalAttributeArray.constructor( newIndexOriginalIndexMap.length * itemSize ); - newIndexOriginalIndexMap.forEach((originalIndex, i) => { + newIndexOriginalIndexMap.forEach((originalIndex2, i) => { for (let j = 0; j < itemSize; j++) { - newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex * itemSize + j]; + newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex2 * itemSize + j]; } }); newGeometry.setAttribute(attributeName, new BufferAttribute8(newAttributeArray, itemSize, normalized)); @@ -6151,9 +6245,9 @@ function removeUnnecessaryVertices(root) { const newAttributeArray = new originalAttributeArray.constructor( newIndexOriginalIndexMap.length * itemSize ); - newIndexOriginalIndexMap.forEach((originalIndex, i) => { + newIndexOriginalIndexMap.forEach((originalIndex2, i) => { for (let j = 0; j < itemSize; j++) { - newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex * itemSize + j]; + newAttributeArray[i * itemSize + j] = originalAttributeArray[originalIndex2 * itemSize + j]; } }); isNullMorph = isNullMorph && newAttributeArray.every((v) => v === 0); @@ -6187,6 +6281,7 @@ var VRMUtils = class { constructor() { } }; +VRMUtils.combineSkeletons = combineSkeletons; VRMUtils.deepDispose = deepDispose; VRMUtils.removeUnnecessaryJoints = removeUnnecessaryJoints; VRMUtils.removeUnnecessaryVertices = removeUnnecessaryVertices; @@ -6247,7 +6342,7 @@ export { VRMUtils }; /*! - * @pixiv/three-vrm-core v3.1.6 + * @pixiv/three-vrm-core v3.2.0 * The implementation of core features of VRM, for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6255,7 +6350,7 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-mtoon v3.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.0 * MToon (toon material) module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6263,7 +6358,7 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.1.6 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.0 * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6271,7 +6366,7 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-materials-v0compat v3.1.6 + * @pixiv/three-vrm-materials-v0compat v3.2.0 * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6279,7 +6374,7 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-node-constraint v3.1.6 + * @pixiv/three-vrm-node-constraint v3.2.0 * Node constraint module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. @@ -6287,11 +6382,11 @@ export { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ /*! - * @pixiv/three-vrm-springbone v3.1.6 + * @pixiv/three-vrm-springbone v3.2.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,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb24udHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL2V4cHJlc3Npb25zL1ZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW4udHMiLCAiLi4vLi4vdGhyZWUtdnJtLWNvcmUvc3JjL3V0aWxzL2dsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlLnRzIiwgIi4uLy4uL3RocmVlLXZybS1jb3JlL3NyYy9leHByZXNzaW9ucy9WUk1FeHByZXNzaW9uUHJlc2V0TmFtZS50cyIsICIuLi8uLi90aHJlZS12cm0tY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AmJlxuICAgICAgICAgICAgICAgIG1vcnBoVGFyZ2V0SW5kZXggPCBwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzLmxlbmd0aCxcbiAgICAgICAgICAgIClcbiAgICAgICAgICApIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46ICR7c2NoZW1hRXhwcmVzc2lvbi5uYW1lfSBhdHRlbXB0cyB0byBpbmRleCBtb3JwaCAjJHttb3JwaFRhcmdldEluZGV4fSBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgIHdlaWdodDogYmluZC53ZWlnaHQgPz8gMS4wLFxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKHNjaGVtYUV4cHJlc3Npb24ubWF0ZXJpYWxDb2xvckJpbmRzIHx8IHNjaGVtYUV4cHJlc3Npb24udGV4dHVyZVRyYW5zZm9ybUJpbmRzKSB7XG4gICAgICAgICAgLy8gbGlzdCB1cCBldmVyeSBtYXRlcmlhbCBpbiBgZ2x0Zi5zY2VuZWBcbiAgICAgICAgICBjb25zdCBnbHRmTWF0ZXJpYWxzOiBUSFJFRS5NYXRlcmlhbFtdID0gW107XG4gICAgICAgICAgZ2x0Zi5zY2VuZS50cmF2ZXJzZSgob2JqZWN0KSA9PiB7XG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbCA9IChvYmplY3QgYXMgYW55K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YWx1ZTogbmV3IFRIUkVFLkNvbG9yKCkuZnJvbUFycmF5KGJpbmQudGFyZ2V0VmFsdWUpLFxuICAgICAgICAgICAgICAgICAgdGFyZ2V0QWxwaGE6IGJpbmQudGFyZ2V0VmFsdWVbM10sXG4gICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNjaGVtYUV4cHJlc3Npb24udGV4dHVyZVRyYW5zZm9ybUJpbmRzPy5mb3JFYWNoKGFzeW5jIChiaW5kKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbHMgPSBnbHRmTWF0ZXJpYWxzLmZpbHRlcigobWF0ZXJpYWwpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxJbmRleCA9IHRoaXMucGFyc2VyLmFzc29jaWF0aW9ucy5nZXQobWF0ZXJpYWwpPy5tYXRlcmlhbHM7XG4gICAgICAgICAgICAgIHJldHVybiBiaW5kLm1hdGVyaWFsID09PSBtYXRlcmlhbEluZGV4O1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIG9mZnNldDogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5vZmZzZXQgPz8gWzAuMCwgMC4wXSksXG4gICAgICAgICAgICAgICAgICBzY2FsZTogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5zY2FsZSA/PyBbMS4wLCAxLjBdKSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgIC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IG5vZGVJbmRleCkpITtcblxuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUdyb3VwLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4ICR7bW9ycGhUYXJnZXRJbmRleH10aCBtb3JwaCBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIHdlaWdodDogMC4wMSAqIChiaW5kLndlaWdodCA/PyAxMDApLCAvLyBuYXJyb3dpbmcgdGhlIHJhbmdlIGZyb20gWy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AgICAgICAgICAgICAgKG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISArICcgKE91dGxpbmUpJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5pbmRleE9mKG10bCkgPT09IC0xLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGVyaWFsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lICYmIG1hdGVyaWFscy5pbmRleE9mKG1hdGVyaWFsKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5wdXNoKG1hdGVyaWFsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbFByb3BlcnR5TmFtZSA9IG1hdGVyaWFsVmFsdWUucHJvcGVydHlOYW1lO1xuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIC8vIFRleHR1cmVUcmFuc2Zvcm1CaW5kXG4gICAgICAgICAgICAgIGlmIChtYXRlcmlhbFByb3BlcnR5TmFtZSA9PT0gJ19NYWluVGV4X1NUJykge1xuICAgICAgICAgICAgICAgIGNvbnN0IHNjYWxlID0gbmV3IFRIUkVFLlZlY3RvcjIobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMF0sIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzFdKTtcbiAgICAgICAgICAgICAgICBjb25zdCBvZmZzZXQgPSBuZXcgVEhSRUUuVmVjdG9yMihtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVsyXSwgbWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbM10pO1xuXG4gICAgICAgICAgICAgICAgb2Zmc2V0LnkgPSAxLjAgLSBvZmZzZXQueSAtIHNjYWxlLnk7XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHNjYWxlLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gTWF0ZXJpYWxDb2xvckJpbmRcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxDb2xvclR5cGUgPSB2MEV4cHJlc3Npb25NYXRlcmlhbENvbG9yTWFwW21hdGVyaWFsUHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsQ29sb3JUeXBlKSB7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBtYXRlcmlhbENvbG9yVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlISksXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBtYXRlcmlhbFZhbHVlL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09IG51bGwgfHwgaW5kZXggPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnN0IG5vZGUgPSBhd2FpdCB0aGlzLnBhcnNlci5nZXREZXBlbmRlbmN5KCdub2RlJywgaW5kZXgpO1xuXG4gICAgICAgICAgLy8gaWYgdGhlIHNwZWNpZmllZCBub2RlIGRvZXMgbm90IGV4aXN0LCBlbWl0IGEgd2FybmluZ1xuICAgICAgICAgIGlmIChub2RlID09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihgQSBnbFRGIG5vZGUgYm91bmQgdG8gdGhlIGh1bWFub2lkIGJvbmUgJHtib25lTmFtZX0gKGluZGV4ID0gJHtpbmRleH0pIGRvZXMgbm90IGV4aXN0YCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gbWFwIHRvIG5ldyBib25lIG5hbWVcbiAgICAgICAgICBjb25zdCB0aHVtYkJvbmVOYW1lID0gdGh1bWJCb25lTmFtZU1hcFtib25lTmFtZV07XG4gICAgICAgICAgY29uc3QgbmV3Qm9uZU5hbWUgPSAodGh1bWJCb25lTmFtZSA/PyBib25lTmFtZSkgYXMgVjFWUk1TY2hlbWEuSHVtYW5vaWRIdW1hbkJvbmVOYW1lO1xuXG4gICAgICAgICAgLy8gdjAgVlJNcyBtaWdodCBoYXZlIGEgbXVsdGlwbGUgbm9kZXMgYXR0YWNoZWQgdG8gYSBzaW5nbGUgYm9uZS4uLlxuICAgICAgICAgIC8vIHNvIGlmIHRoZXJlIGFscmVhZHkgaXMgYW4gZW50cnkgaW4gdGhlIGBodW1hbkJvbmVzYCwgc2hvdyBhIHdhcm5pbmcgYW5kIGlnbm9yZSBpdFxuICAgICAgICAgIGlmIChodW1hbkJvbmVzW25ld0JvbmVOYW1lXSAhPSBudWxsKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgIC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AgICAgICAgdXZBbmltYXRpb25NYXNrVGV4dHVyZVV2VHJhbnNmb3JtOiB7IHZhbHVlOiBuZXcgVEhSRUUuTWF0cml4MygpIH0sXG4gICAgICAgIHV2QW5pbWF0aW9uU2Nyb2xsWE9mZnNldDogeyB2YWx1ZTogMC4wIH0sXG4gICAgICAgIHV2QW5pbWF0aW9uU2Nyb2xsWU9mZnNldDogeyB2YWx1ZTogMC4wIH0sXG4gICAgICAgIHV2QW5pbWF0aW9uUm90YXRpb25QaGFzZTogeyB2YWx1ZTogMC4wIH0sXG4gICAgICB9LFxuICAgICAgcGFyYW1ldGVycy51bmlmb3JtcyA/PyB7fSxcbiAgICBdKSBhcyB0eXBlb2YgTVRvb25NYXRlcmlhbC5wcm90b3R5cGUudW5pZm9ybXM7XG5cbiAgICAvLyA9PSBmaW5hbGx5IGNvbXBpbGUgdGhlIHNoYWRlciBwcm9ncmFtID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgICB0aGlzLnNldFZhbHVlcyhwYXJhbWV0ZXJzKTtcblxuICAgIC8vID09IHVwbG9hZCB1bmlmb3JtcyB0aGF0IG5lZWQgdG8gdXBsb2FkID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICAgIHRoaXMuX3VwbG9hZFVuaWZvcm1zV29ya2Fyb3VuZCgpO1xuXG4gICAgLy8gPT0gdXBkYXRlIHNoYWRlciBzdHVmZiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gICAgdGhpcy5jdXN0b21Qcm9ncmFtQ2FjaGVLZXkgPSAoKSA9PlxuICAgICAgW1xuICAgICAgICAuLi5PYmplY3QuZW50cmllcyh0aGlzLl9nZW5lcmF0ZURlZmluZXMoKSkubWFwKChbdG9rZW4sIG1hY3JvXSkgPT4gYCR7dG9rZW59OiR7bWFjcm99Y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jaGFubmVsIGlzIHN0b3JlZCBpbiBsaW5lYXJcbiAgICApO1xuICAgIGNvbnN0IGJhc2VDb2xvclRleHR1cmVJbmRleCA9IG1hdGVyaWFsUHJvcGVydGllcy50ZXh0dXJlUHJvcGVydGllcz8uWydfTWFpblRleCddO1xuICAgIGNvbnN0IGJhc2VDb2xvclRleHR1cmUgPVxuICAgICAgYmFzZUNvbG9yVGV4dHVyZUluZGV4ICE9IG51bGxcbiAgICAgICAgPyB7XG4gICAgICAgICAgICBpbmRleDogYmFzZUNvbG9yVGV4dHVyZUluZGV4LFxuICAgICAgICAgICAgZXh0ZW5zaW9uczoge1xuICAgICAgICAgICAgICAuLi50ZXh0dXJlVHJhbnNmb3JtRXh0LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9XG4gICAgICAgIDogdW5kZWZpbmVkO1xuXG4gICAgY29uc3Qgbm9ybWFsVGV4dHVyZVNjYWxlID0gbWF0ZXJpYWxQcm9wZXJ0aWVzLmZsb2F0UHJvcGVydGllcz8uWydfQnVtcFNjYWxlJ10gPz8gMS4wO1xuICAgIGNvbnN0IG5vcm1hbFRleHR1cmVJbmRleCA9IG1hdGVyaWFsUHJvcGVydGllcy50ZXh0dXJlUHJvcGVydGllcz8uWydfQnVtcE1hcCddO1xuICAgIGNvbnN0IG5vcm1hbFRleHR1cmUgPVxuICAgICAgbm9ybWFsVGV4dHVyZUluZGV4ICE9IG51bGxcbiAgICAgICAgPyB7XG4gICAgICAgICAgICBpbmRleDogbm9ybWFsVGV4dHVyZUluZGV4LFxuICAgICAgICAgICAgc2NhbGU6IG5vcm1hbFRleHR1cmVTY2FsZSxcbiAgICAgICAgICAgIGV4dGVuc2lvbnM6IHtcbiAgICAgICAgICAgICAgLi4udGV4dHVyZVRyYW5zZm9ybUV4dCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgfVxuICAgICAgICA6IHVuZGVmaW5lZDtcblxuICAgIGNvbnN0IGVtaXNzaXZlRmFjdG9yID0gKG1hdG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CA9IHRoaXMuX29iamVjdENvbnN0cmFpbnRzTWFwLmdldChjb25zdHJhaW50LmRlc3RpbmF0aW9uKSE7XG4gICAgb2JqZWN0U2V0LmRlbGV0ZShjb25zdHJhaW50KTtcbiAgfVxuXG4gIHB1YmxpYyBzZXRJbml0U3RhdGUoKTogdm9pZCB7XG4gICAgY29uc3QgY29uc3RyYWludHNUcmllZCA9IG5ldyBTZXQ8VlJNTm9kZUNvbnN0cmFpbnQ+KCk7XG4gICAgY29uc3QgY29uc3RyYWludHNEb25lID0gbmV3IFNldDxWUk1Ob2RlQ29uc3RyYWludD4oKTtcblxuICAgIGZvciAoY29uc3QgY29uc3RyYWludCBvZiB0aGlzLl9jb25zdHJhaW50cykge1xuICAgICAgdGhpcy5fcHJvY2Vzc0NvbnN0cmFpbnQoY29uc3RyYWludCwgY29uc3RyYWludHNUcmllZCwgY29uc3RyYWludHNEb25lLCAoY29uc3RyYWludCkgPT4gY29uc3RyYWludC5zZXRJbml0U3RhdGUoKSk7XG4gICAgfVxuICB9XG5cbiAgcHVibGljIHVwZGF0ZSgpOiB2b2lkIHtcbiAgICBjb25zdCBjb25zdHJhaW50c1RyaWVkID0gbmV3IFNldDxWUk1Ob2RlQ29uc3RyYWludD4oKTtcbiAgICBjb25zdCBjb25zdHJhaW50c0RvbmUgPSBuZXcgU2V0PFZSTU5vZGVDb25zdHJhaW50PigpO1xuXG4gICAgZm9yIChjb25zdCBjb25zdHJhaW50IG9mIHRoaXMuX2NvbnN0cmFpbnRzKSB7XG4gICAgICB0aGlzLl9wcm9jZXNzQ29uc3RyYWludChjb25zdHJhaW50LCBjb25zdHJhaW50c1RyaWVkLCBjb25zdHJhaW50c0RvbmUsIChjb25zdHJhaW50KSA9PiBjb25zdHJhaW50LnVwZGF0ZSgpKTtcbiAgICB9XG4gIH1cblxuICAvKipcbiAgICogVXBkYXRlIGEgY29uc3RyYWludC5cbiAgICogSWYgdGhlcmUgYXJlIG90aGVyIGNvbnN0cmFpbnRzIHRoY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k1DTm9kZUNvbnN0cmFpbnRcbiAgICAgICAgfCB1bmRlZmluZWQ7XG5cbiAgICAgIGlmIChleHRlbnNpb24gPT0gbnVsbCkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IHNwZWNWZXJzaW9uID0gZXh0ZW5zaW9uLnNwZWNWZXJzaW9uO1xuICAgICAgaWYgKCFQT1NTSUJMRV9TUEVDX1ZFUlNJT05TLmhhcyhzcGVjVmVyc2lvbikpIHtcbiAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgIGBWUk1Ob2RlQ29uc3RyYWludExvYWRlclBsdWdpbjogVW5rbm93biAke1ZSTU5vZGVDb25zdHJhaW50TG9hZGVyUGx1Z2luLkVYVEVOU0lPTl9OQU1FfSBzcGVjVmVyc2lvbiBcIiR7c3BlY1ZlcnNpb259XCJgLFxuICAgICAgICApO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IGNvbnN0cmFpbnREZWYgPSBleHRlbnNpb24uY29uc3RyYWludDtcblxuICAgICAgLy8gaW1wb3J0IGNvbnN0cmFpbnRzXG4gICAgICBpZiAoY29uc3RyYWludERlZi5yb2xsICE9IG51bGwpIHtcbiAgICAgICAgY29uc3QgY29uc3RyYWludCA9IHRoaXMuX2ltcG9ydFJvbGxDb25zdHJhaW50KG5vZGUsIHRocmVlTm9kZXMsIGNvbnN0cmFpbnREZWYucm9sbCk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5haW0gIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb25zdHJhaW50ID0gdGhpcy5faW1wb3J0QWltQ29uc3RyYWludChub2RlLCB0aHJlZU5vZGVzLCBjb25zdHJhaW50RGVmLmFpbSk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAg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B0aHJlZU5vZGVzW2NoaWxkSW5kZXhdO1xuXG4gICAgICAgICAgLy8gcHJlcGFyZSBzZXR0aW5nXG4gICAgICAgICAgY29uc3Qgc2V0dGluZzogUGFydGlhbDxWUk1TcHJpbmdCb25lSm9pbnRTZXR0aW5ncz4gPSB7XG4gICAgICAgICAgICBoaXRSYWRpdXM6IHByZXZTY2hlbWFKb2ludC5oaXRSYWRpdXMsXG4gICAgICAgICAgICBkcmFnRm9yY2U6IHByZXZTY2hlbWFKb2ludC5kcmFnRm9yY2UsXG4gICAgICAgICAgICBncmF2aXR5UG93ZXI6IHByZXZTY2hlbWFKb2ludC5ncmF2aXR5UG93ZXIsXG4gICAgICAgICAgICBzdGlmZm5lc3M6IHByZXZTY2hlbWFKb2ludC5zdGlmZm5lc3MsXG4gICAgICAgICAgICBncmF2aXR5RGlyOlxuICAgICAgICAgICAgICBwcmV2U2NoZW1hSm9pbnQuZ3Jhdml0eURpciAhPSBudWxsXG4gICAgICAgICAgICAgICAgPyBuZXcgVEhSRUUuVmVjdG9yMygpLmZyb21BcnJheShwcmV2U2NoZW1hSm9pbnQuZ3Jhdml0eURpcilcbiAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZCxcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgLy8gY3JlYXRlIHNwcmluZyBib25lc1xuICAgICAgICAgIGNvbnN0IGpvaW50ID0gdGhpcy5faW1wb3J0Sm9pbnQobm9kZSwgY2hpbGQsIHNldHRpbmcsIGNvbGxpZGVyR3JvdXBzRm9yU3ByaW5nKTtcbiAgICAgICAgICBpZiAoY2VudGVyKSB7XG4gICAgICAgICAgICBqb2ludC5jZW50ZXIgPSBjZW50ZXI7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbWFuYWdlci5hZGRKb2ludChqb2ludCk7XG4gICAgICAgIH1cblxuICAgICAgICBwcmV2U2NoZW1hSm9pbnQgPSBzY2hlbWFKb2ludDtcbiAgICAgIH0pO1xuICAgIH0pO1xuXG4gICAg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O1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnN0IHByaW1pdGl2ZXMgPSAoYXdhaXQgZ2x0ZkV4dHJhY3RQcmltaXRpdmVzRnJvbU5vZGUoZ2x0ZiwgYmluZC5ub2RlKSkhO1xuICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIG1lc2ggaGFzIHRoZSB0YXJnZXQgbW9ycGggdGFyZ2V0XG4gICAgICAgICAgaWYgKFxuICAgICAgICAgICAgIXByaW1pdGl2ZXMuZXZlcnkoXG4gICAgICAgICAgICAgIChwcmltaXRpdmUpID0+XG4gICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzKSAmJlxuICAgICAgICAgICAgICAgIG1vcnBoVGFyZ2V0SW5kZXggPCBwcmltaXRpdmUubW9ycGhUYXJnZXRJbmZsdWVuY2VzLmxlbmd0aCxcbiAgICAgICAgICAgIClcbiAgICAgICAgICApIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgYFZSTUV4cHJlc3Npb25Mb2FkZXJQbHVnaW46ICR7c2NoZW1hRXhwcmVzc2lvbi5uYW1lfSBhdHRlbXB0cyB0byBpbmRleCBtb3JwaCAjJHttb3JwaFRhcmdldEluZGV4fSBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgIHdlaWdodDogYmluZ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7XG5cbiAgICAgICAgICAgIG1hdGVyaWFscy5mb3JFYWNoKChtYXRlcmlhbCkgPT4ge1xuICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25UZXh0dXJlVHJhbnNmb3JtQmluZCh7XG4gICAgICAgICAgICAgICAgICBtYXRlcmlhbCxcbiAgICAgICAgICAgICAgICAgIG9mZnNldDogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5vZmZzZXQgPz8gWzAuMCwgMC4wXSksXG4gICAgICAgICAgICAgICAgICBzY2FsZTogbmV3IFRIUkVFLlZlY3RvcjIoKS5mcm9tQXJyYXkoYmluZC5zY2FsZSA/PyBbMS4wLCAxLjBdKSxcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1hbmFnZXI7XG4gIH1cblxuICBwcml2YXRlIGFzeW5jIF92MEltcG9ydChnbHRmOiBHTFRGKTogUHJvbWlzZTxWUk1FeHByZXNzaW9uTWFuYWdlciB8IG51bGw+IHtcbiAgICBjb25zdCBqc29uID0gdGhpcy5wYXJzZXIuanNvbiBhcyBHTFRGU2NoZW1hLklHTFRGO1xuXG4gICAgLy8gZWFybHkgYWJvcnQgaWYgaXQgZG9lc24ndCB1c2UgdnJtXG4gICAgY29uc3QgdnJtRXh0ID0ganNvbi5leHRlbnNpb25zPy5WUk0gYXMgVjBWUk0uVlJNIHwgdW5kZWZpbmVkO1xuICAgIGlmICghdnJtRXh0KSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBjb25zdCBzY2hlbWFCbGVuZFNoYXBlID0g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M/LmZvckVhY2goKG5vZGUsIGkpID0+IHtcbiAgICAgICAgICAgICAgaWYgKG5vZGUubWVzaCA9PT0gYmluZC5tZXNoKSB7XG4gICAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gucHVzaChpKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG1vcnBoVGFyZ2V0SW5kZXggPSBiaW5kLmluZGV4O1xuXG4gICAgICAgICAgICBhd2FpdCBQcm9taXNlLmFsbChcbiAgICAgICAgICAgICAgbm9kZXNVc2luZ01lc2gubWFwKGFzeW5jIChub2RlSW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwcmltaXRpdmVzID0gKGF3YWl0IGdsdGZFeHRyYWN0UHJpbWl0aXZlc0Zyb21Ob2RlKGdsdGYsIG5vZGVJbmRleCkpITtcblxuICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSBtZXNoIGhhcyB0aGUgdGFyZ2V0IG1vcnBoIHRhcmdldFxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICFwcmltaXRpdmVzLmV2ZXJ5KFxuICAgICAgICAgICAgICAgICAgICAocHJpbWl0aXZlKSA9PlxuICAgICAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcykgJiZcbiAgICAgICAgICAgICAgICAgICAgICBtb3JwaFRhcmdldEluZGV4IDwgcHJpbWl0aXZlLm1vcnBoVGFyZ2V0SW5mbHVlbmNlcy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgIGBWUk1FeHByZXNzaW9uTG9hZGVyUGx1Z2luOiAke3NjaGVtYUdyb3VwLm5hbWV9IGF0dGVtcHRzIHRvIGluZGV4ICR7bW9ycGhUYXJnZXRJbmRleH10aCBtb3JwaCBidXQgbm90IGZvdW5kLmAsXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24uYWRkQmluZChcbiAgICAgICAgICAgICAgICAgIG5ldyBWUk1FeHByZXNzaW9uTW9ycGhUYXJnZXRCaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgcHJpbWl0aXZlcyxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IG1vcnBoVGFyZ2V0SW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIHdlaWdodDogMC4wMSAqIChiaW5kLndlaWdodCA/PyAxMDApLCAvLyBuYXJyb3dpbmcgdGhlIHJhbmdlIGZyb20gWyAwLjAgLSAxMDAuMCBdIHRvIFsgMC4wIC0gMS4wIF1cbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEJpbmQgTWF0ZXJpYWxDb2xvciBhbmQgVGV4dHVyZVRyYW5zZm9ybVxuICAgICAgICBjb25zdCBtYXRlcmlhbFZhbHVlcyA9IHNjaGVtYUdyb3VwLm1hdGVyaWFsVmFsdWVzO1xuICAgICAgICBpZiAobWF0ZXJpYWxWYWx1ZXMgJiYgbWF0ZXJpYWxWYWx1ZXMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgbWF0ZXJpYWxWYWx1ZXMuZm9yRWFjaCgobWF0ZXJpYWxWYWx1ZSkgPT4ge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSA9PT0gdW5kZWZpbmVkIHx8XG4gICAgICAgICAgICAgIG1hdGVyaWFsVmFsdWU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pYWxbXSA9IFtdO1xuICAgICAgICAgICAgZ2x0Zi5zY2VuZS50cmF2ZXJzZSgob2JqZWN0KSA9PiB7XG4gICAgICAgICAgICAgIGlmICgob2JqZWN0IGFzIGFueSkubWF0ZXJpYWwpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRlcmlhbDogVEhSRUUuTWF0ZXJpYWxbXSB8IFRIUkVFLk1hdGVyaWFsID0gKG9iamVjdCBhcyBhbnkpLm1hdGVyaWFsO1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG1hdGVyaWFsKSkge1xuICAgICAgICAgICAgICAgICAgbWF0ZXJpYWxzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIC4uLm1hdGVyaWFsLmZpbHRlcihcbiAgICAgICAgICAgICAgICAgICAgICAobXRsKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgKG10bC5uYW1lID09PSBtYXRlcmlhbFZhbHVlLm1hdGVyaWFsTmFtZSEgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbXRsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lISArICcgKE91dGxpbmUpJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5pbmRleE9mKG10bCkgPT09IC0xLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGVyaWFsLm5hbWUgPT09IG1hdGVyaWFsVmFsdWUubWF0ZXJpYWxOYW1lICYmIG1hdGVyaWFscy5pbmRleE9mKG1hdGVyaWFsKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgIG1hdGVyaWFscy5wdXNoKG1hdGVyaWFsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjb25zdCBtYXRlcmlhbFByb3BlcnR5TmFtZSA9IG1hdGVyaWFsVmFsdWUucHJvcGVydHlOYW1lO1xuICAgICAgICAgICAgbWF0ZXJpYWxzLmZvckVhY2goKG1hdGVyaWFsKSA9PiB7XG4gICAgICAgICAgICAgIC8vIFRleHR1cmVUcmFuc2Zvcm1CaW5kXG4gICAgICAgICAgICAgIGlmIChtYXRlcmlhbFByb3BlcnR5TmFtZSA9PT0gJ19NYWluVGV4X1NUJykge1xuICAgICAgICAgICAgICAgIGNvbnN0IHNjYWxlID0gbmV3IFRIUkVFLlZlY3RvcjIobWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbMF0sIG1hdGVyaWFsVmFsdWUudGFyZ2V0VmFsdWUhWzFdKTtcbiAgICAgICAgICAgICAgICBjb25zdCBvZmZzZXQgPSBuZXcgVEhSRUUuVmVjdG9yMihtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVsyXSwgbWF0ZXJpYWxWYWx1ZS50YXJnZXRWYWx1ZSFbM10pO1xuXG4gICAgICAgICAgICAgICAgb2Zmc2V0LnkgPSAxLjAgLSBvZmZzZXQueSAtIHNjYWxlLnk7XG5cbiAgICAgICAgICAgICAgICBleHByZXNzaW9uLmFkZEJpbmQoXG4gICAgICAgICAgICAgICAgICBuZXcgVlJNRXhwcmVzc2lvblRleHR1cmVUcmFuc2Zvcm1CaW5kKHtcbiAgICAgICAgICAgICAgICAgICAgbWF0ZXJpYWwsXG4gICAgICAgICAgICAgICAgICAgIHNjYWxlLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gTWF0ZXJpYWxDb2xvckJpbmRcbiAgICAgICAgICAgICAgY29uc3QgbWF0ZXJpYWxDb2xvclR5cGUgPSB2MEV4cHJlc3Npb25NYXRlcmlhbENvbG9yTWFwW21hdGVyaWFsUHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgaWYgKG1hdGVyaWFsQ29sb3JUeXBlKSB7XG4gICAgICAgICAgICAgICAgZXhwcmVzc2lvbi5hZGRCaW5kKFxuICAgICAgICAgICAgICAgICAgbmV3IFZSTUV4cHJlc3Npb25NYXRlcmlhbENvbG9yQmluZCh7XG4gICAgICAgICAgICAgICAgICAgIG1hdGVyaWFsLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBtYXRlcmlhbENvbG9yVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0VmFsdWU6IG5ldyBUSFJFRS5Db2xvcigpLmZyb21BcnJheShtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlISksXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldEFscGhhOiBtYXRlcmlhbFZhbHVlLnRhcmdldFZhbHVlIVszXSxcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjb25zb2xlLndhcm4obWF0ZXJpYWxQcm9wZXJ0eU5hbWUgKyAnIGlzIG5vdCBzdXBwb3J0ZWQnKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgbWFuYWdlci5yZWdpc3RlckV4cHJlc3Npb24oZXhwcmVzc2lvbik7XG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgcmV0dXJuIG1hbmFnZXI7XG4gIH1cbn1cbiIsICJpbXBvcnQgdHlwZSAqIGFzIFRIUkVFIGZyb20gJ3RocmVlJztcbmltcG9ydCB0eXBlIHsgR0xURiB9IGZyb20gJ3RocmVlL2V4YW1wbGVzL2pzbS9sb2FkZXJzL0dMVEZMb2FkZXIuanMnO1xuaW1wb3J0IHsgR0xURiBhcyBHTFRGU2NoZW1hIH0gZnJvbSAnQGdsdGYtdHJh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OYW1lU3RyaW5nIGFzIFZSTUh1bWFuQm9uZU5hbWU7XG4gICAgICBjb25zdCBub2RlID0gdGhpcy5nZXRCb25lTm9kZShib25lTmFtZSk7XG5cbiAgICAgIC8vIElnbm9yZSB3aGVuIHRoZXJlIGFyZSBubyBib25lIG9uIHRoZSBWUk1IdW1hbm9pZFxuICAgICAgaWYgKCFub2RlKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgLy8gVGFrZSBhIGRpZmYgZnJvbSByZXN0UG9zZVxuICAgICAgX3YzQS5zZXQoMCwgMCwgMCk7XG4gICAgICBfcXVhdEEuaWRlbnRpdHkoKTtcblxuICAgICAgY29uc3QgcmVzdFN0YXRlID0gdGhpcy5yZXN0UG9zZVtib25lTmFtZV07XG4gICAgICBpZiAocmVzdFN0YXRlPy5wb3NpdGlvbikge1xuICAgICAgICBfdjNBLmZyb21BcnJheShyZXN0U3RhdGUucG9zaXRpb24pLm5lZ2F0ZSgpO1xuICAgICAgfVxuICAgICAgaWYgKHJlc3RTdGF0ZT8ucm90YXRpb24pIHtcbiAgICAgICAgcXVhdEludmVydENvbXBhdChfcXVhdEEuZnJvbUFycmF5KHJlc3RTdGF0ZS5yb3RhdGlvbikpO1xuICAgICAgfVxuXG4gICAgICAvLyBHZXQgdGhlIHBvc2l0aW9uIC8gcm90YXRpb24gZnJvbSB0aGUgbm9kZVxuICAgICAgX3YzQS5hZGQobm9kZS5wb3NpdGlvbik7XG4gICAgICBfcXVhdEEucHJlbXVsdGlwbHkobm9kZS5xdWF0ZXJuaW9uKTtcblxuICAgICAgLy8gQ29udmVydCB0byByYXcgYXJyYXlzXG4gICAgICBwb3NlW2JvbmVOYW1lXSA9IHtcbiAgICAgICAgcG9zaXRpb246IF92M0EudG9BcnJheSgpIGFzIFtudW1iZXIsIG51bWJlciwgbnVtYmVyXSxcbiAgICAgICAgcm90YXRpb246IF9xdWF0QS50b0FycmF5KCkgYXMgW251bWJlciwgbnVtYmVyLCBudW1i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B2cm1FeHQuaHVtYW5vaWQ7XG4gICAgaWYgKCFzY2hlbWFIdW1hbm9pZCkge1xuICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgY29uc3QgaHVtYW5Cb25lczogUGFydGlhbDxWUk1IdW1hbkJvbmVzPiA9IHt9O1xuICAgIGlmIChzY2hlbWFIdW1hbm9pZC5odW1hbkJvbmVzICE9IG51bGwpIHtcbiAgICAgIGF3YWl0IFByb21pc2UuYWxsKFxuICAgICAgICBzY2hlbWFIdW1hbm9pZC5odW1hbkJvbmVzLm1hcChhc3luYyAoYm9uZSkgPT4ge1xuICAgICAgICAgIGNvbnN0IGJvbmVOYW1lID0gYm9uZS5ib25lO1xuICAgICAgICAgIGNvbnN0IGluZGV4ID0gYm9uZS5ub2RlO1xuXG4gICAgICAgICAgaWYgKGJvbmVOYW1lID09IG51bGwgfHwgaW5kZXggPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbnN0IG5vZGUgPSBhd2FpdCB0aGlzLnBhcnNlci5nZXREZXBlbmRlbmN5KCdub2RlJywgaW5kZXgpO1xuXG4gICAgICAgICAgLy8gaWYgdGhlIHNwZWNpZmllZCBub2RlIGRvZXMgbm90IGV4aXN0LCBlbWl0IGEgd2FybmluZ1xuICAgICAgICAgIGlmIChub2RlID09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihgQSBnbFRGIG5vZGUgYm91bmQgdG8gdGhlIGh1bWFub2lkIGJvbmUgJHtib25lTmFtZX0gKGluZGV4ID0gJHtpbmRleH0pIGRvZXMgbm90IGV4aXN0YCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gbWFwIHRvIG5ldyBib25lIG5hbWVcbiAgICAgICAgICBjb25zdCB0aHVtYkJvbmVOYW1lID0gdGh1bWJCb25lTmFtZU1hcFtib25lTmFtZV07XG4gICAgICAgICAg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c01hcC5nZXQoY29uc3RyYWludC5kZXN0aW5hdGlvbik7XG4gICAgaWYgKG9iamVjdFNldCA9PSBudWxsKSB7XG4gICAgICBvYmplY3RTZXQgPSBuZXcgU2V0PFZSTU5vZGVDb25zdHJhaW50PigpO1xuICAgICAgdGhpcy5fb2JqZWN0Q29uc3RyYWludHNNYXAuc2V0KGNvbnN0cmFpbnQuZGVzdGluYXRpb24sIG9iamVjdFNldCk7XG4gICAgfVxuICAgIG9iamVjdFNldC5hZGQoY29uc3RyYWludCk7XG4gIH1cblxuICBwdWJsaWMgZGVsZXRlQ29uc3RyYWludChjb25zdHJhaW50OiBWUk1Ob2RlQ29uc3RyYWludCk6IHZvaWQge1xuICAgIHRoaXMuX2NvbnN0cmFpbnRzLmRlbGV0ZShjb25zdHJhaW50KTtcblxuICAgIGNvbnN0IG9iamVjdFNldCA9IHRoaXMuX29iamVjdENvbnN0cmFpbnRzTWFwLmdldChjb25zdHJhaW50LmRlc3RpbmF0aW9uKSE7XG4gICAgb2JqZWN0U2V0LmRlbGV0ZShjb25zdHJhaW50KTtcbiAgfVxuXG4gIHB1YmxpYyBzZXRJbml0U3RhdGUoKTogdm9pZCB7XG4gICAgY29uc3QgY29uc3RyYWludHNUcmllZCA9IG5ldyBTZXQ8VlJNTm9kZUNvbnN0cmFpbnQ+KCk7XG4gICAgY29uc3QgY29uc3RyYWludHNEb25lID0gbmV3IFNldDxWUk1Ob2RlQ29uc3RyYWludD4oKTtcblxuICAgIGZvciAoY29uc3QgY29uc3RyYWludCBvZiB0aGlzLl9jb25zdHJhaW50cykge1xuICAgICAgdGhpcy5fcHJvY2Vzc0NvbnN0cmFpbnQoY29uc3RyYWludCwgY29uc3RyYWludHNUcmllZCwgY29uc3RyYWludHNEb25lLCAoY29uc3RyYWludCkgPT4gY29uc3RyYWludC5zZXRJbml0U3RhdGUoKSk7XG4gICAgfVxuICB9XG5cbiAgcHVibGljIHVwZGF0ZSgpOiB2b2lkIHtcbiAgICBjb25zdCBjb25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RzXG4gICAgICBpZiAoY29uc3RyYWludERlZi5yb2xsICE9IG51bGwpIHtcbiAgICAgICAgY29uc3QgY29uc3RyYWludCA9IHRoaXMuX2ltcG9ydFJvbGxDb25zdHJhaW50KG5vZGUsIHRocmVlTm9kZXMsIGNvbnN0cmFpbnREZWYucm9sbCk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5haW0gIT0gbnVsbCkge1xuICAgICAgICBjb25zdCBjb25zdHJhaW50ID0gdGhpcy5faW1wb3J0QWltQ29uc3RyYWludChub2RlLCB0aHJlZU5vZGVzLCBjb25zdHJhaW50RGVmLmFpbSk7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH0gZWxzZSBpZiAoY29uc3RyYWludERlZi5yb3RhdGlvbiAhPSBudWxsKSB7XG4gICAgICAgIGNvbnN0IGNvbnN0cmFpbnQgPSB0aGlzLl9pbXBvcnRSb3RhdGlvbkNvbnN0cmFpbnQobm9kZSwgdGhyZWVOb2RlcywgY29uc3RyYWludERlZi5yb3RhdGlvbik7XG4gICAgICAgIG1hbmFnZXIuYWRkQ29uc3RyYWludChjb25zdHJhaW50KTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIC8vIGluaXQgY29uc3RyYWludHNcbiAgICBnbHRmLnNjZW5lLnVwZGF0ZU1hdHJpeFdvcmxkKCk7XG4gICAgbWFuYWdlci5zZXRJbml0U3RhdGUoKTtcblxuICAgIHJldHVybiBtYW5hZ2VyO1xuICB9XG5cbiAgcHJvdGVjdGVkIF9pbXBvcnRSb2xsQ29uc3RyYWludChcbiAgICBkZXN0aW5hdGlvbjogVEhSRUUuT2JqZWN0M0QsXG4gICAgbm9kZXM6IFRIUkVFLk9iamVjdDNEW10sXG4gICAgcm9sbENvbnN0cmFpbnREZWY6IENvbnN0cmFpbnRTY2hlbWEuU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ZXIub2Zmc2V0KSB7XG4gICAgICAgICAgICBvZmZzZXQuc2V0KFxuICAgICAgICAgICAgICBzY2hlbWFDb2xsaWRlci5vZmZzZXQueCA/PyAwLjAsXG4gICAgICAgICAgICAgIHNjaGVtYUNvbGxpZGVyLm9mZnNldC55ID8/IDAuMCxcbiAgICAgICAgICAgICAgc2NoZW1hQ29sbGlkZXIub2Zmc2V0LnogPyAtc2NoZW1hQ29sbGlkZXIub2Zmc2V0LnogOiAwLjAsIC8vIHogaXMgb3Bwb3NpdGUgaW4gVlJNMC4wXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiB0aGlzLl9pbXBvcnRTcGhlcmVDb2xsaWRlcihub2RlLCB7XG4gICAgICAgICAgICBvZmZzZXQsXG4gICAgICAgICAgICByYWRpdXM6IHNjaGVtYUNvbGxpZGVyLnJhZGl1cyA/PyAwLjAsXG4gICAgICAgICAgICBpbnNpZGU6IGZhbHNlLFxuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4geyBjb2xsaWRlcnMgfTtcbiAgICAgIH0sXG4gICAgKTtcblxuICAgIC8vIGltcG9ydCBzcHJpbmcgYm9uZXMgZm9yIGVhY2ggc3ByaW5nIGJvbmUgZ3JvdXBzXG4gICAgc2NoZW1hQm9uZUdyb3Vwcz8uZm9yRWFjaCgoc2NoZW1hQm9uZUdyb3VwLCBpQm9uZUdyb3VwKSA9PiB7XG4gICAgICBjb25zdCByb290SW5kaWNlcyA9IHNjaGVtYUJvbmVHcm91cC5ib25lcztcbiAgICAgIGlmICghcm9vdEluZGljZXMpIHtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuXG4gICAgICByb290SW5kaWNlcy5mb3JFYWNoKChyb290SW5kZXgpID0+IHtcbiAgICAgICAgY29uc3Qgcm9vdCA9IHRocmVlTm9kZXNbcm9vdEluZGV4XTtcblxuICAgICAgICAvLyBwcmVwYXJlIHNldHRpbmdcbiAg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cgPSBzY2hlbWFCb25lR3JvdXAuY29sbGlkZXJHcm91cHM/Lm1hcCgoaUNvbGxpZGVyR3JvdXApID0+IHtcbiAgICAgICAgICBjb25zdCBncm91cCA9IGNvbGxpZGVyR3JvdXBzPy5baUNvbGxpZGVyR3JvdXBdO1xuXG4gICAgICAgICAgaWYgKGdyb3VwID09IG51bGwpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgYFZSTVNwcmluZ0JvbmVMb2FkZXJQbHVnaW46IFRoZSBzcHJpbmcgIyR7aUJvbmVHcm91cH0gYXR0ZW1wdGVkIHRvIHVzZSBhIGNvbGxpZGVyR3JvdXAgJHtpQ29sbGlkZXJHcm91cH0gYnV0IG5vdCBmb3VuZGAsXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBncm91cDtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gY3JlYXRlIHNwcmluZyBib25lc1xuICAgICAgICByb290LnRyYXZlcnNlKChub2RlKSA9PiB7XG4gICAgICAgICAgY29uc3QgY2hpbGQ6IFRIUkVFLk9iamVjdDNEIHwgbnVsbCA9IG5vZGUuY2hpbGRyZW5bMF0gPz8gbnVsbDtcblxuICAgICAgICAgIGNvbnN0IGpvaW50ID0gdGhpcy5faW1wb3J0Sm9pbnQobm9kZSwgY2hpbGQsIHNldHRpbmcsIGNvbGxpZGVyR3JvdXBzRm9yU3ByaW5nKTtcbiAgICAgICAgICBpZiAoY2VudGVyKSB7XG4gICAgICAgICAgICBqb2ludC5jZW50ZXIgPSBjZW50ZXI7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbWFuYWdlci5hZGRKb2ludChqb2ludCk7XG4gICAgICAgIH0pO1xuICAgICAgfSk7XG4gICAgfSk7XG5cbiAgICAvLyBpbml0IHNwcmluZyBib25lc1xuICAgIGdsdGYuc2NlbmUudXBkYXRlTWF0cml4V29ybGQoKTtcbiAgICBtYW5hZ2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BPU1NJQkxFX1NQRUNfVkVSU0lPTlMiLCAiX1ZSTU5vZGVDb25zdHJhaW50TG9hZGVyUGx1Z2luIiwgIl9fYXN5bmMiLCAiX2EiLCAiVEhSRUUiLCAiX3YzQSIsICJfdjNCIiwgIl92M0MiLCAiX3F1YXRBIiwgIl9tYXRBIiwgInRyYXZlcnNlQW5jZXN0b3JzRnJvbVJvb3QiLCAic3ByaW5nQm9uZSIsICJQT1NTSUJMRV9TUEVDX1ZFUlNJT05TIiwgIl9WUk1TcHJpbmdCb25lTG9hZGVyUGx1Z2luIiwgIl9fYXN5bmMiLCAiX2EiLCAiX2IiLCAiX2MiLCAiX2QiLCAiX2UiLCAiVEhSRUUiLCAibWF0ZXJpYWwiLCAiVEhSRUUiLCAiVEhSRUUiLCAiQnVmZmVyQXR0cmlidXRlIiwgIm9yaWdpbmFsSW5kZXhBcnJheSIsICJvcmlnaW5hbEluZGV4Il0KfQo= diff --git a/packages/three-vrm/lib/three-vrm.module.min.js b/packages/three-vrm/lib/three-vrm.module.min.js index 641b48ce7..df6bfdd40 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 wn from"three";import*as J from"three";import*as it from"three";import*as bn from"three";import*as D from"three";import*as Q from"three";import*as Fe from"three";import*as F from"three";import*as P from"three";import*as Pe from"three";import*as K from"three";import*as V from"three";import*as lt from"three";import*as b from"three";import*as tt from"three";import*as Wn from"three";var y=(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())}),tn=class extends wn.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(c=>{d.length{let o=Pn(t,r,i);o!=null&&n.set(r,o)}),n})}var Je={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 Sn(t){return Math.max(Math.min(t,1),0)}var on=class An{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(Je));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)&&(e[i]=r)}),e}get customExpressionMap(){let e={},n=new Set(Object.values(Je));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 An().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=Sn(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"},sr={_Color:ye.Color,_EmissionColor:ye.EmissionColor,_ShadeColor:ye.ShadeColor,_RimColor:ye.RimColor,_OutlineColor:ye.OutlineColor},ar=new it.Color,Ln=class Hn{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(ar.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(),c=new it.Color(a.r-d.r,a.g-d.g,a.b-d.b);return{propertyName:s,initialValue:d,deltaValue:c}}_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(Hn._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:e[1])!=null?n:null}};Ln._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 sn=Ln,an=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)})}},ln=new bn.Vector2,Vn=class In{constructor({material:e,scale:n,offset:i}){var r,o;this.material=e,this.scale=n,this.offset=i;let a=(r=Object.entries(In._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(),c=u.repeat.clone(),f=i.clone().sub(d),p=n.clone().sub(c);this._properties.push({name:l,initialOffset:d,deltaOffset:f,initialScale:c,deltaScale:p})}))}applyWeight(e){this._properties.forEach(n=>{let i=this.material[n.name];i!==void 0&&(i.offset.add(ln.copy(n.deltaOffset).multiplyScalar(e)),i.repeat.add(ln.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))})}};Vn._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var un=Vn,lr=new Set(["1.0","1.0-beta"]),Cn=class Un{get name(){return"VRMExpressionLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return y(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return y(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 y(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(!lr.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(Je)),d=new Map;s.preset!=null&&Object.entries(s.preset).forEach(([f,p])=>{if(p!=null){if(!u.has(f)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${f}" detected. Ignoring the expression`);return}d.set(f,p)}}),s.custom!=null&&Object.entries(s.custom).forEach(([f,p])=>{if(u.has(f)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${f}". Ignoring the expression`);return}d.set(f,p)});let c=new on;return yield Promise.all(Array.from(d.entries()).map(f=>y(this,[f],function*([p,m]){var h,_,g,T,R,v,M;let E=new tn(p);if(e.scene.add(E),E.isBinary=(h=m.isBinary)!=null?h:!1,E.overrideBlink=(_=m.overrideBlink)!=null?_:"none",E.overrideLookAt=(g=m.overrideLookAt)!=null?g:"none",E.overrideMouth=(T=m.overrideMouth)!=null?T:"none",(R=m.morphTargetBinds)==null||R.forEach(x=>y(this,null,function*(){var S;if(x.node===void 0||x.index===void 0)return;let H=yield nn(e,x.node),A=x.index;if(!H.every(L=>Array.isArray(L.morphTargetInfluences)&&A{let H=S.material;H&&(Array.isArray(H)?x.push(...H):x.push(H))}),(v=m.materialColorBinds)==null||v.forEach(S=>y(this,null,function*(){x.filter(A=>{var L;let C=(L=this.parser.associations.get(A))==null?void 0:L.materials;return S.material===C}).forEach(A=>{E.addBind(new sn({material:A,type:S.type,targetValue:new J.Color().fromArray(S.targetValue),targetAlpha:S.targetValue[3]}))})})),(M=m.textureTransformBinds)==null||M.forEach(S=>y(this,null,function*(){x.filter(A=>{var L;let C=(L=this.parser.associations.get(A))==null?void 0:L.materials;return S.material===C}).forEach(A=>{var L,C;E.addBind(new un({material:A,offset:new J.Vector2().fromArray((L=S.offset)!=null?L:[0,0]),scale:new J.Vector2().fromArray((C=S.scale)!=null?C:[1,1])}))})}))}c.registerExpression(E)}))),c})}_v0Import(e){return y(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 on,l=o.blendShapeGroups;if(!l)return a;let s=new Set;return yield Promise.all(l.map(u=>y(this,null,function*(){var d;let c=u.presetName,f=c!=null&&Un.v0v1PresetNameMap[c]||null,p=f!=null?f:u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${c} has duplicated entries. Ignoring the expression`);return}s.add(p);let m=new tn(p);e.scene.add(m),m.isBinary=(d=u.isBinary)!=null?d:!1,u.binds&&u.binds.forEach(_=>y(this,null,function*(){var g;if(_.mesh===void 0||_.index===void 0)return;let T=[];(g=i.nodes)==null||g.forEach((v,M)=>{v.mesh===_.mesh&&T.push(M)});let R=_.index;yield Promise.all(T.map(v=>y(this,null,function*(){var M;let E=yield nn(e,v);if(!E.every(x=>Array.isArray(x.morphTargetInfluences)&&R{if(_.materialName===void 0||_.propertyName===void 0||_.targetValue===void 0)return;let g=[];e.scene.traverse(R=>{if(R.material){let v=R.material;Array.isArray(v)?g.push(...v.filter(M=>(M.name===_.materialName||M.name===_.materialName+" (Outline)")&&g.indexOf(M)===-1)):v.name===_.materialName&&g.indexOf(v)===-1&&g.push(v)}});let T=_.propertyName;g.forEach(R=>{if(T==="_MainTex_ST"){let M=new J.Vector2(_.targetValue[0],_.targetValue[1]),E=new J.Vector2(_.targetValue[2],_.targetValue[3]);E.y=1-E.y-M.y,m.addBind(new un({material:R,scale:M,offset:E}));return}let v=sr[T];if(v){m.addBind(new sn({material:R,type:v,targetValue:new J.Color().fromArray(_.targetValue),targetAlpha:_.targetValue[3]}));return}console.warn(T+" is not supported")})}),a.registerExpression(m)}))),a})}};Cn.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 rt=Cn,Do={None:"none",Block:"block",Blend:"blend"},ot=class pe{constructor(e,n){this._firstPersonOnlyLayer=pe.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=pe.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 pe(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:e=pe.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=pe.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(c[0])||d[1]>0&&r.includes(c[1])||d[2]>0&&r.includes(c[2])||d[3]>0&&r.includes(c[3]))continue;let f=n[s],p=i[s];if(f[0]>0&&r.includes(p[0])||f[1]>0&&r.includes(p[1])||f[2]>0&&r.includes(p[2])||f[3]>0&&r.includes(p[3]))continue;let m=n[u],h=i[u];m[0]>0&&r.includes(h[0])||m[1]>0&&r.includes(h[1])||m[2]>0&&r.includes(h[2])||m[3]>0&&r.includes(h[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 h=0;h{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}};ot.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;ot.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var dn=ot,ur=new Set(["1.0","1.0-beta"]),st=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return y(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 y(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 y(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(!ur.has(l))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;let s=a.firstPerson,u=[],d=yield rn(t);return Array.from(d.entries()).forEach(([c,f])=>{var p,m;let h=(p=s==null?void 0:s.meshAnnotations)==null?void 0:p.find(_=>_.node===c);u.push({meshes:f,type:(m=h==null?void 0:h.type)!=null?m:"auto"})}),new dn(e,u)})}_v0Import(t,e){return y(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 rn(t);return Array.from(l.entries()).forEach(([s,u])=>{let d=i.nodes[s],c=o.meshAnnotations?o.meshAnnotations.find(f=>f.mesh===d.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(c==null?void 0:c.firstPersonFlag)})}),new dn(e,a)})}_convertV0FlagToV1Type(t){return t==="FirstPersonOnly"?"firstPersonOnly":t==="ThirdPersonOnly"?"thirdPersonOnly":t==="Both"?"both":"auto"}},Fo={Auto:"auto",Both:"both",ThirdPersonOnly:"thirdPersonOnly",FirstPersonOnly:"firstPersonOnly"},hn=new Q.Vector3,cn=new Q.Vector3,dr=new Q.Quaternion,pn=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(hn,dr,cn);let i=hn.set(.1,.1,.1).divide(cn);n.matrix.copy(e.node.matrixWorld).scale(i)}),super.updateMatrixWorld(t)}},Ye=["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"],Wo={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"},hr={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 On(t){return t.invert?t.invert():t.inverse(),t}var oe=new Fe.Vector3,se=new Fe.Quaternion,Ke=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&&(oe.copy(i.position),se.copy(i.quaternion),t[n]={position:oe.toArray(),rotation:se.toArray()})}),t}getPose(){let t={};return Object.keys(this.humanBones).forEach(e=>{let n=e,i=this.getBoneNode(n);if(!i)return;oe.set(0,0,0),se.identity();let r=this.restPose[n];r!=null&&r.position&&oe.fromArray(r.position).negate(),r!=null&&r.rotation&&On(se.fromArray(r.rotation)),oe.add(i.position),se.premultiply(i.quaternion),t[n]={position:oe.toArray(),rotation:se.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(oe.fromArray(o.position))),n!=null&&n.rotation&&(r.quaternion.fromArray(n.rotation),o.rotation&&r.quaternion.multiply(se.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}},qe=new F.Vector3,cr=new F.Quaternion,pr=new F.Vector3,mn=class Nn extends Ke{static _setupTransforms(e){let n=new F.Object3D;n.name="VRMHumanoidRig";let i={},r={},o={},a={};Ye.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let c=new F.Vector3,f=new F.Quaternion;d.updateWorldMatrix(!0,!1),d.matrixWorld.decompose(c,f,qe),i[s]=c,r[s]=f,o[s]=d.quaternion.clone();let p=new F.Quaternion;(u=d.parent)==null||u.matrixWorld.decompose(qe,p,qe),a[s]=p}});let l={};return Ye.forEach(s=>{var u;let d=e.getBoneNode(s);if(d){let c=i[s],f=s,p;for(;p==null&&(f=hr[f],f!=null);)p=i[f];let m=new F.Object3D;m.name="Normalized_"+d.name,(f?(u=l[f])==null?void 0:u.node:n).add(m),m.position.copy(c),p&&m.position.sub(p),l[s]={node:m}}}),{rigBones:l,root:n,parentWorldRotations:a,boneRotations:o}}constructor(e){let{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=Nn._setupTransforms(e);super(n),this.original=e,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){Ye.forEach(e=>{let n=this.original.getBoneNode(e);if(n!=null){let i=this.getBoneNode(e),r=this._parentWorldRotations[e],o=cr.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(pr);n.parent.updateWorldMatrix(!0,!1);let s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},fn=class Bn{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 Ke(e),this._normalizedHumanBones=new mn(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new Ke(e.humanBones),this._normalizedHumanBones=new mn(this._rawHumanBones),this}clone(){return new Bn(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()}},mr={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"]),_n={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},at=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 y(this,null,function*(){t.userData.vrmHumanoid=yield this._import(t)})}_import(t){return y(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 y(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(c=>y(this,[c],function*([f,p]){let m=f,h=p.node;if(s){let g=_n[m];g!=null&&(m=g)}let _=yield this.parser.getDependency("node",h);if(_==null){console.warn(`A glTF node bound to the humanoid bone ${m} (index = ${h}) does not exist`);return}u[m]={node:_}}))));let d=new fn(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(d.normalizedHumanBonesRoot),this.helperRoot){let c=new pn(d);this.helperRoot.add(c),c.renderOrder=this.helperRoot.renderOrder}return d})}_v0Import(t){return y(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=>y(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 c=_n[s],f=c!=null?c:s;if(o[f]!=null){console.warn(`Multiple bone entries for ${f} detected (index = ${u}), ignoring duplicated entries.`);return}o[f]={node:d}}))));let a=new fn(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(t.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){let l=new pn(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(t){let e=Object.values(mr).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}},gn=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 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}},_r=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 P.Quaternion,vn=new P.Quaternion,we=new P.Vector3,En=new P.Vector3,Mn=Math.sqrt(2)/2,gr=new P.Quaternion(0,0,-Mn,Mn),vr=new P.Vector3(0,1,0),Er=class extends P.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=t;{let e=new gn;e.radius=.5;let n=new P.MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:P.DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new P.Mesh(e,n),this.add(this._meshPitch)}{let e=new gn;e.radius=.5;let n=new P.MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:P.DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new P.Mesh(e,n),this.add(this._meshYaw)}{let e=new _r;e.radius=.1;let n=new P.LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new P.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=P.MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=e,this._meshYaw.geometry.update();let n=P.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(vn)),this._meshYaw.position.copy(we),this._meshYaw.quaternion.copy(Oe),this._meshPitch.position.copy(we),this._meshPitch.quaternion.copy(Oe),this._meshPitch.quaternion.multiply(vn.setFromAxisAngle(vr,e)),this._meshPitch.quaternion.multiply(gr);let{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(En).sub(we),this._lineTarget.geometry.tail.copy(En),this._lineTarget.geometry.update(),this._lineTarget.position.copy(we)),super.updateMatrixWorld(t)}},Mr=new lt.Vector3,Rr=new lt.Vector3;function et(t,e){return t.matrixWorld.decompose(Mr,e,Rr),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 Rn(t){let e=Math.round(t/2/Math.PI);return t-2*Math.PI*e}var Tn=new V.Vector3(0,0,1),Tr=new V.Vector3,xr=new V.Vector3,yr=new V.Vector3,wr=new V.Quaternion,Ze=new V.Quaternion,xn=new V.Quaternion,Pr=new V.Quaternion,$e=new V.Euler,Dn=class Fn{constructor(e,n){this.offsetFromHeadBone=new V.Vector3,this.autoUpdate=!0,this.faceFront=new V.Vector3(0,0,1),this.humanoid=e,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new V.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 V.Euler)}getEuler(e){return e.set(V.MathUtils.DEG2RAD*this._pitch,V.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 Fn(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 et(n,e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Tn)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[n,i]=Be(this.faceFront);return $e.set(0,.5*Math.PI+n,i,"YZX"),e.setFromEuler($e).premultiply(Pr.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(Ze),this.getFaceFrontQuaternion(xn),e.copy(Tn).applyQuaternion(Ze).applyQuaternion(xn).applyEuler(this.getEuler($e))}lookAt(e){let n=wr.copy(this._restHeadWorldQuaternion).multiply(On(this.getLookAtWorldQuaternion(Ze))),i=this.getLookAtWorldPosition(xr),r=yr.copy(e).sub(i).applyQuaternion(n).normalize(),[o,a]=Be(this.faceFront),[l,s]=Be(r),u=Rn(l-o),d=Rn(a-s);this._yaw=V.MathUtils.RAD2DEG*u,this._pitch=V.MathUtils.RAD2DEG*d,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Tr)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Dn.EULER_ORDER="YXZ";var Sr=Dn,Ar=new b.Vector3(0,0,1),k=new b.Quaternion,ce=new b.Quaternion,N=new b.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 b.Vector3(0,0,1),this._restQuatLeftEye=new b.Quaternion,this._restQuatRightEye=new b.Quaternion,this._restLeftEyeParentWorldQuat=new b.Quaternion,this._restRightEyeParentWorldQuat=new b.Quaternion;let o=this.humanoid.getRawBoneNode("leftEye"),a=this.humanoid.getRawBoneNode("rightEye");o&&(this._restQuatLeftEye.copy(o.quaternion),et(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),et(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=-b.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):N.x=b.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?N.y=-b.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-t):N.y=b.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(t),k.setFromEuler(N),this._getWorldFaceFrontQuat(ce),r.quaternion.copy(ce).multiply(k).multiply(ce.invert()),k.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(k).premultiply(k.invert()).multiply(this._restQuatLeftEye)),i&&(e<0?N.x=-b.MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-e):N.x=b.MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(e),t<0?N.y=-b.MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-t):N.y=b.MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(t),k.setFromEuler(N),this._getWorldFaceFrontQuat(ce),o.quaternion.copy(ce).multiply(k).multiply(ce.invert()),k.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(k).premultiply(k.invert()).multiply(this._restQuatRightEye))}lookAt(t){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");let e=b.MathUtils.RAD2DEG*t.y,n=b.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}_getWorldFaceFrontQuat(t){if(this.faceFront.distanceToSquared(Ar)<.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 nt=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=tt.MathUtils.RAD2DEG*t.y,n=tt.MathUtils.RAD2DEG*t.x;this.applyYawPitch(e,n)}};nt.type="expression";var yn=class{constructor(t,e){this.inputMaxValue=t,this.outputScale=e}map(t){return this.outputScale*Sn(t/this.inputMaxValue)}},Lr=new Set(["1.0","1.0-beta"]),Ne=.01,ut=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(t,e){this.parser=t,this.helperRoot=e==null?void 0:e.helperRoot}afterRoot(t){return y(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 y(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 y(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(!Lr.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;let d=s.lookAt;if(!d)return null;let c=d.type==="expression"?1:10,f=this._v1ImportRangeMap(d.rangeMapHorizontalInner,c),p=this._v1ImportRangeMap(d.rangeMapHorizontalOuter,c),m=this._v1ImportRangeMap(d.rangeMapVerticalDown,c),h=this._v1ImportRangeMap(d.rangeMapVerticalUp,c),_;d.type==="expression"?_=new nt(n,f,p,m,h):_=new De(e,f,p,m,h);let g=this._importLookAt(e,_);return g.offsetFromHeadBone.fromArray((o=d.offsetFromHeadBone)!=null?o:[0,.06,0]),g})}_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))})}},ht=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 rt(t),this.firstPersonPlugin=(i=e==null?void 0:e.firstPersonPlugin)!=null?i:new st(t),this.humanoidPlugin=(r=e==null?void 0:e.humanoidPlugin)!=null?r:new at(t,{helperRoot:l,autoUpdateHumanBones:s}),this.lookAtPlugin=(o=e==null?void 0:e.lookAtPlugin)!=null?o:new ut(t,{helperRoot:l}),this.metaPlugin=(a=e==null?void 0:e.metaPlugin)!=null?a:new dt(t)}afterRoot(t){return y(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 ht({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 ht{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 ke from"three";import*as Qn from"three";import*as Xn from"three";import*as w from"three";import*as Yn from"three";var Vr=Object.defineProperty,kn=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable,zn=(t,e,n)=>e in t?Vr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Gn=(t,e)=>{for(var n in e||(e={}))Ir.call(e,n)&&zn(t,n,e[n]);if(kn)for(var n of kn(e))Cr.call(e,n)&&zn(t,n,e[n]);return t},ae=(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())}),Ur={"":3e3,srgb:3001};function Or(t,e){parseInt(Xn.REVISION,10)>=152?t.colorSpace=e:t.encoding=Ur[e]}var Nr=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 Qn.Color().fromArray(e),n&&this._materialParams[t].convertSRGBToLinear())}assignTexture(t,e,n){return ae(this,null,function*(){let i=ae(this,null,function*(){e!=null&&(yield this._parser.assignTexture(this._materialParams,t,e),n&&Or(this._materialParams[t],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(t,e,n){return ae(this,null,function*(){return this.assignTexture(t,e!=null?{index:e}:void 0,n)})}},Br=`// #define PHONG +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 varying vec3 vViewPosition; @@ -117,7 +117,7 @@ void main() { #include #include -}`,Dr=`// #define PHONG +}`,kr=`// #define PHONG uniform vec3 litFactor; @@ -919,11 +919,11 @@ void main() { gl_FragColor = vec4( col, diffuseColor.a ); postCorrection(); } -`,Fr={None:"none",Normal:"normal",LitShadeRate:"litShadeRate",UV:"uv"},jn={None:"none",WorldCoordinates:"worldCoordinates",ScreenCoordinates:"screenCoordinates"},Wr={3e3:"",3001:"srgb"};function ct(t){return parseInt(Yn.REVISION,10)>=152?t.colorSpace:Wr[t.encoding]}var kr=class extends w.ShaderMaterial{constructor(t={}){var e;super({vertexShader:Br,fragmentShader:Dr}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=w.TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=Fr.None,this._outlineWidthMode=jn.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:${ct(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${ct(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${ct(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{let i=parseInt(w.REVISION,10),r=Object.entries(Gn(Gn({},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 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(` `)+` -`;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===jn.ScreenCoordinates}}_updateTextureMatrix(t,e){t.value&&(t.value.matrixAutoUpdate&&t.value.updateMatrix(),e.value.copy(t.value.matrix))}},zr=new Set(["1.0","1.0-beta"]),qn=class We{get name(){return We.EXTENSION_NAME}constructor(e,n={}){var i,r,o,a;this.parser=e,this.materialType=(i=n.materialType)!=null?i:kr,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 ae(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return ae(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 ae(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[We.EXTENSION_NAME];if(l==null)return;let s=l.specVersion;if(!zr.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${We.EXTENSION_NAME} specVersion "${s}"`);return}return l}_extendMaterialParams(e,n){return ae(this,null,function*(){var i;delete n.metalness,delete n.roughness;let r=new Nr(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)}};qn.EXTENSION_NAME="VRMC_materials_mtoon";var Zn=qn;var Gr=(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())}),$n=class pt{get name(){return pt.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,n){return Gr(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[pt.EXTENSION_NAME];if(l!=null)return l}};$n.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var Jn=$n;import*as ni from"three";var jr=Object.defineProperty,Qr=Object.defineProperties,Xr=Object.getOwnPropertyDescriptors,Kn=Object.getOwnPropertySymbols,Yr=Object.prototype.hasOwnProperty,qr=Object.prototype.propertyIsEnumerable,ei=(t,e,n)=>e in t?jr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z=(t,e)=>{for(var n in e||(e={}))Yr.call(e,n)&&ei(t,n,e[n]);if(Kn)for(var n of Kn(e))qr.call(e,n)&&ei(t,n,e[n]);return t},ti=(t,e)=>Qr(t,Xr(e)),Zr=(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 me(t){return Math.pow(t,2.2)}var ii=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 Zr(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,c,f,p,m,h,_,g,T,R,v,M,E,x,S,H,A,L,C,Z,Me,Re,$,W,he,Te,U,yt,wt,Pt,St,At,Lt,Ht,bt,Vt,It,Ct,Ut,Ot,Nt,Bt,Dt,Ft,Wt,kt,zt;let Gt=(i=(n=t.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,Hi=((r=t.floatProperties)==null?void 0:r._ZWrite)===1&&Gt,bi=this._v0ParseRenderQueue(t),jt=(a=(o=t.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,Vi=Gt?"BLEND":jt?"MASK":"OPAQUE",Ii=jt?(s=(l=t.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,Ci=((d=(u=t.floatProperties)==null?void 0:u._CullMode)!=null?d:2)===0,re=this._portTextureTransform(t),Ui=((f=(c=t.vectorProperties)==null?void 0:c._Color)!=null?f:[1,1,1,1]).map((en,or)=>or===3?en:me(en)),Qt=(p=t.textureProperties)==null?void 0:p._MainTex,Oi=Qt!=null?{index:Qt,extensions:z({},re)}:void 0,Ni=(h=(m=t.floatProperties)==null?void 0:m._BumpScale)!=null?h:1,Xt=(_=t.textureProperties)==null?void 0:_._BumpMap,Bi=Xt!=null?{index:Xt,scale:Ni,extensions:z({},re)}:void 0,Di=((T=(g=t.vectorProperties)==null?void 0:g._EmissionColor)!=null?T:[0,0,0,1]).map(me),Yt=(R=t.textureProperties)==null?void 0:R._EmissionMap,Fi=Yt!=null?{index:Yt,extensions:z({},re)}:void 0,Wi=((M=(v=t.vectorProperties)==null?void 0:v._ShadeColor)!=null?M:[.97,.81,.86,1]).map(me),qt=(E=t.textureProperties)==null?void 0:E._ShadeTexture,ki=qt!=null?{index:qt,extensions:z({},re)}:void 0,Ie=(S=(x=t.floatProperties)==null?void 0:x._ShadeShift)!=null?S:0,Ce=(A=(H=t.floatProperties)==null?void 0:H._ShadeToony)!=null?A:.9;Ce=ni.MathUtils.lerp(Ce,1,.5+.5*Ie),Ie=-Ie-(1-Ce);let Zt=(C=(L=t.floatProperties)==null?void 0:L._IndirectLightIntensity)!=null?C:.1,zi=Zt?1-Zt:void 0,Qe=(Z=t.textureProperties)==null?void 0:Z._SphereAdd,Gi=Qe!=null?[1,1,1]:void 0,ji=Qe!=null?{index:Qe}:void 0,Qi=(Re=(Me=t.floatProperties)==null?void 0:Me._RimLightingMix)!=null?Re:0,$t=($=t.textureProperties)==null?void 0:$._RimTexture,Xi=$t!=null?{index:$t,extensions:z({},re)}:void 0,Yi=((he=(W=t.vectorProperties)==null?void 0:W._RimColor)!=null?he:[0,0,0,1]).map(me),qi=(U=(Te=t.floatProperties)==null?void 0:Te._RimFresnelPower)!=null?U:1,Zi=(wt=(yt=t.floatProperties)==null?void 0:yt._RimLift)!=null?wt:0,$i=["none","worldCoordinates","screenCoordinates"][(St=(Pt=t.floatProperties)==null?void 0:Pt._OutlineWidthMode)!=null?St:0],Xe=(Lt=(At=t.floatProperties)==null?void 0:At._OutlineWidth)!=null?Lt:0;Xe=.01*Xe;let Jt=(Ht=t.textureProperties)==null?void 0:Ht._OutlineWidthTexture,Ji=Jt!=null?{index:Jt,extensions:z({},re)}:void 0,Ki=((Vt=(bt=t.vectorProperties)==null?void 0:bt._OutlineColor)!=null?Vt:[0,0,0]).map(me),er=((Ct=(It=t.floatProperties)==null?void 0:It._OutlineColorMode)!=null?Ct:0)===1?(Ot=(Ut=t.floatProperties)==null?void 0:Ut._OutlineLightingMix)!=null?Ot:1:0,Kt=(Nt=t.textureProperties)==null?void 0:Nt._UvAnimMaskTexture,tr=Kt!=null?{index:Kt,extensions:z({},re)}:void 0,nr=(Dt=(Bt=t.floatProperties)==null?void 0:Bt._UvAnimScrollX)!=null?Dt:0,Ue=(Wt=(Ft=t.floatProperties)==null?void 0:Ft._UvAnimScrollY)!=null?Wt:0;Ue!=null&&(Ue=-Ue);let ir=(zt=(kt=t.floatProperties)==null?void 0:kt._UvAnimRotation)!=null?zt:0,rr={specVersion:"1.0",transparentWithZWrite:Hi,renderQueueOffsetNumber:bi,shadeColorFactor:Wi,shadeMultiplyTexture:ki,shadingShiftFactor:Ie,shadingToonyFactor:Ce,giEqualizationFactor:zi,matcapFactor:Gi,matcapTexture:ji,rimLightingMixFactor:Qi,rimMultiplyTexture:Xi,parametricRimColorFactor:Yi,parametricRimFresnelPowerFactor:qi,parametricRimLiftFactor:Zi,outlineWidthMode:$i,outlineWidthFactor:Xe,outlineWidthMultiplyTexture:Ji,outlineColorFactor:Ki,outlineLightingMixFactor:er,uvAnimationMaskTexture:tr,uvAnimationScrollXSpeedFactor:nr,uvAnimationScrollYSpeedFactor:Ue,uvAnimationRotationSpeedFactor:ir};return ti(z({},e),{pbrMetallicRoughness:{baseColorFactor:Ui,baseColorTexture:Oi},normalTexture:Bi,emissiveTexture:Fi,emissiveFactor:Di,alphaMode:Vi,alphaCutoff:Ii,doubleSided:Ci,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",c=s?"BLEND":d?"MASK":"OPAQUE",f=d?(i=(n=t.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,p=this._portTextureTransform(t),m=((o=(r=t.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(me),h=(a=t.textureProperties)==null?void 0:a._MainTex,_=h!=null?{index:h,extensions:z({},p)}:void 0,g={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:m,shadeMultiplyTexture:_};return ti(z({},e),{pbrMetallicRoughness:{baseColorFactor:m,baseColorTexture:_},alphaMode:c,alphaCutoff:f,extensions:{VRMC_materials_mtoon:g}})}_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 G from"three";import*as ft from"three";import*as Le from"three";import*as X from"three";var ri=(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,mt=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 oi(t,e){return e.set(t.elements[12],t.elements[13],t.elements[14])}var $r=new ft.Vector3,Jr=new ft.Vector3;function Kr(t,e){return t.decompose($r,e,Jr),e}function ze(t){return t.invert?t.invert():t.inverse(),t}var _t=class{constructor(t,e){this.destination=t,this.source=e,this.weight=1}},eo=new G.Vector3,to=new G.Vector3,no=new G.Vector3,io=new G.Quaternion,ro=new G.Quaternion,oo=new G.Quaternion,so=class extends _t{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 G.Vector3(1,0,0),this._dstRestQuat=new G.Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let t=io.identity(),e=ro.identity();this.destination.parent&&(Kr(this.destination.parent.matrixWorld,t),ze(e.copy(t)));let n=eo.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(t),i=oi(this.source.matrixWorld,to).sub(oi(this.destination.matrixWorld,no)).normalize(),r=oo.setFromUnitVectors(n,i).premultiply(e).multiply(t).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function ao(t,e){let n=[t],i=t.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}var lo=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)ao(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)}},uo=new Le.Quaternion,ho=new Le.Quaternion,co=class extends _t{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=uo.copy(this._invSrcRestQuat).multiply(this.source.quaternion),e=ho.copy(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(e,this.weight)}},po=new X.Vector3,mo=new X.Quaternion,fo=new X.Quaternion,_o=class extends _t{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 X.Vector3(1,0,0),this._dstRestQuat=new X.Quaternion,this._invDstRestQuat=new X.Quaternion,this._invSrcRestQuatMulDstRestQuat=new X.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=mo.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),e=po.copy(this._v3RollAxis).applyQuaternion(t),i=fo.setFromUnitVectors(e,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(t);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},go=new Set(["1.0","1.0-beta"]),si=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 ri(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(e){return ri(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 lo,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;let d=i.nodes[s],c=(u=d==null?void 0:d.extensions)==null?void 0:u[Ae.EXTENSION_NAME];if(c==null)return;let f=c.specVersion;if(!go.has(f)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Ae.EXTENSION_NAME} specVersion "${f}"`);return}let p=c.constraint;if(p.roll!=null){let m=this._importRollConstraint(l,a,p.roll);o.addConstraint(m)}else if(p.aim!=null){let m=this._importAimConstraint(l,a,p.aim);o.addConstraint(m)}else if(p.rotation!=null){let m=this._importRotationConstraint(l,a,p.rotation);o.addConstraint(m)}}),e.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(e,n,i){let{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new _o(e,l);if(o!=null&&(s.rollAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new mt(s);this.helperRoot.add(u)}return s}_importAimConstraint(e,n,i){let{source:r,aimAxis:o,weight:a}=i,l=n[r],s=new so(e,l);if(o!=null&&(s.aimAxis=o),a!=null&&(s.weight=a),this.helperRoot){let u=new mt(s);this.helperRoot.add(u)}return s}_importRotationConstraint(e,n,i){let{source:r,weight:o}=i,a=n[r],l=new co(e,a);if(o!=null&&(l.weight=o),this.helperRoot){let s=new mt(l);this.helperRoot.add(s)}return l}};si.EXTENSION_NAME="VRMC_node_constraint";var ai=si;import*as ne from"three";import*as Ve from"three";import*as ve from"three";import*as fi from"three";import*as q from"three";import*as te from"three";import*as ue from"three";import*as ie from"three";import*as de from"three";import*as gi from"three";import*as I from"three";import*as vi from"three";import*as Mi 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())}),Rt=class{},gt=new Ve.Vector3,le=new Ve.Vector3,pi=class extends Rt{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){gt.copy(this.offset).applyMatrix4(t),le.copy(this.tail).applyMatrix4(t),le.sub(gt);let r=le.lengthSq();i.copy(e).sub(gt);let o=le.dot(i);o<=0||(r<=o||le.multiplyScalar(o/r),i.sub(le));let a=this.inside?this.radius-n-i.length():i.length()-n-this.radius;return i.normalize(),this.inside&&i.negate(),a}},vt=new ve.Vector3,li=new ve.Matrix3,mi=class extends Rt{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.copy(this.offset).applyMatrix4(t),i.negate().add(e),li.getNormalMatrix(t),vt.copy(this.normal).applyNormalMatrix(li).normalize();let r=i.dot(vt)-n;return i.copy(vt),r}},_i=class extends Rt{get type(){return"sphere"}constructor(t){var e,n,i;super(),this.offset=(e=t==null?void 0:t.offset)!=null?e:new fi.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}},j=new q.Vector3,vo=class extends q.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new q.Vector3,this._currentTail=new q.Vector3,this._shape=t,this._attrPos=new q.BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new q.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=j.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),t=!0),t&&this._buildPosition()}_buildPosition(){j.copy(this._currentTail).sub(this._currentOffset);let t=j.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(j.y,Math.sqrt(j.x*j.x+j.z*j.z)),n=-Math.atan2(j.z,j.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}},Eo=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}},Mo=class extends ue.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new ue.Vector3,this._shape=t,this._attrPos=new ue.BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new ue.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}},Ro=new ne.Vector3,Et=class extends ne.Group{constructor(t){if(super(),this.matrixAutoUpdate=!1,this.collider=t,this.collider.shape instanceof _i)this._geometry=new Mo(this.collider.shape);else if(this.collider.shape instanceof pi)this._geometry=new vo(this.collider.shape);else if(this.collider.shape instanceof mi)this._geometry=new Eo(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=Ro.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},To=class extends de.BufferGeometry{constructor(t){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new de.Vector3,this._springBone=t,this._attrPos=new de.BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new de.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}},xo=new ie.Vector3,yo=class extends ie.Group{constructor(t){super(),this.matrixAutoUpdate=!1,this.springBone=t,this._geometry=new To(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=xo.set(e[0],e[1],e[2]).length(),this._geometry.update(),super.updateMatrixWorld(t)}},Mt=class extends gi.Object3D{constructor(t){super(),this.shape=t}},wo=new vi.Matrix4;function Ei(t){return t.invert?t.invert():t.getInverse(wo.copy(t)),t}var Po=class{constructor(t){this._inverseCache=new Mi.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&&(Ei(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},So=new I.Matrix4,Y=new I.Vector3,He=new I.Vector3,Ao=new I.Vector3,fe=new I.Vector3,ui=new I.Vector3,be=new I.Vector3,di=new I.Quaternion,_e=new I.Matrix4,Lo=new I.Matrix4,Ho=class{constructor(t,e,n={},i=[]){this._currentTail=new I.Vector3,this._prevTail=new I.Vector3,this._boneAxis=new I.Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new I.Matrix4,this._initialLocalRotation=new I.Quaternion,this._initialLocalChildPosition=new I.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 I.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 Po(this._center.matrixWorld)))}get initialLocalChildPosition(){return this._initialLocalChildPosition}get _parentMatrixWorld(){return this.bone.parent?this.bone.parent.matrixWorld:So}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(_e);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(_e);this.bone.localToWorld(this._currentTail.copy(this._initialLocalChildPosition)).applyMatrix4(t),this._prevTail.copy(this._currentTail)}update(t){if(t<=0)return;this._calcWorldSpaceBoneLength(),fe.setFromMatrixPosition(this.bone.matrixWorld);let e=this._getMatrixWorldToCenter(_e);ui.copy(fe).applyMatrix4(e);let n=di.setFromRotationMatrix(e),i=Lo.copy(e).multiply(this._parentMatrixWorld),r=He.copy(this._boneAxis).applyMatrix4(this._initialLocalMatrix).applyMatrix4(i).sub(ui).normalize(),o=Ao.copy(this.settings.gravityDir).applyQuaternion(n).normalize(),a=this._getMatrixCenterToWorld(_e);be.copy(this._currentTail).add(Y.copy(this._currentTail).sub(this._prevTail).multiplyScalar(1-this.settings.dragForce)).add(Y.copy(r).multiplyScalar(this.settings.stiffness*t)).add(Y.copy(o).multiplyScalar(this.settings.gravityPower*t)).applyMatrix4(a),be.sub(fe).normalize().multiplyScalar(this._worldSpaceBoneLength).add(fe),this._collision(be),e=this._getMatrixWorldToCenter(_e),this._prevTail.copy(this._currentTail),this._currentTail.copy(Y.copy(be).applyMatrix4(e));let l=Ei(_e.copy(this._parentMatrixWorld).multiply(this._initialLocalMatrix)),s=di.setFromUnitVectors(this._boneAxis,Y.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,Y);i<0&&(t.add(Y.multiplyScalar(-i)),t.sub(fe).normalize().multiplyScalar(this._worldSpaceBoneLength).add(fe))})})}_calcWorldSpaceBoneLength(){Y.setFromMatrixPosition(this.bone.matrixWorld),this.child?He.setFromMatrixPosition(this.child.matrixWorld):(He.copy(this._initialLocalChildPosition),He.applyMatrix4(this.bone.matrixWorld)),this._worldSpaceBoneLength=Y.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 bo(t,e){let n=[],i=t;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{e(r)})}function Ri(t,e){t.children.forEach(n=>{e(n)||Ri(n,e)})}var hi=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)),Ri(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)bo(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}},ci="VRMC_springBone_extended_collider",Vo=new Set(["1.0","1.0-beta"]),Io=new Set(["1.0"]),Ti=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 hi,d=yield e.parser.getDependencies("node"),c=(i=l.extensions)==null?void 0:i[ge.EXTENSION_NAME];if(!c)return null;let f=c.specVersion;if(!Vo.has(f))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${ge.EXTENSION_NAME} specVersion "${f}"`),null;let p=(r=c.colliders)==null?void 0:r.map((h,_)=>{var g,T,R,v,M,E,x,S,H,A,L,C,Z,Me,Re;let $=d[h.node],W=h.shape,he=(g=h.extensions)==null?void 0:g[ci];if(this.useExtendedColliders&&he!=null){let Te=he.specVersion;if(!Io.has(Te))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${ci} specVersion "${Te}". Fallbacking to the ${ge.EXTENSION_NAME} definition`);else{let U=he.shape;if(U.sphere)return this._importSphereCollider($,{offset:new B.Vector3().fromArray((T=U.sphere.offset)!=null?T:[0,0,0]),radius:(R=U.sphere.radius)!=null?R:0,inside:(v=U.sphere.inside)!=null?v:!1});if(U.capsule)return this._importCapsuleCollider($,{offset:new B.Vector3().fromArray((M=U.capsule.offset)!=null?M:[0,0,0]),radius:(E=U.capsule.radius)!=null?E:0,tail:new B.Vector3().fromArray((x=U.capsule.tail)!=null?x:[0,0,0]),inside:(S=U.capsule.inside)!=null?S:!1});if(U.plane)return this._importPlaneCollider($,{offset:new B.Vector3().fromArray((H=U.plane.offset)!=null?H:[0,0,0]),normal:new B.Vector3().fromArray((A=U.plane.normal)!=null?A:[0,0,1])})}}if(W.sphere)return this._importSphereCollider($,{offset:new B.Vector3().fromArray((L=W.sphere.offset)!=null?L:[0,0,0]),radius:(C=W.sphere.radius)!=null?C:0,inside:!1});if(W.capsule)return this._importCapsuleCollider($,{offset:new B.Vector3().fromArray((Z=W.capsule.offset)!=null?Z:[0,0,0]),radius:(Me=W.capsule.radius)!=null?Me:0,tail:new B.Vector3().fromArray((Re=W.capsule.tail)!=null?Re:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${_} has no valid shape`)}),m=(o=c.colliderGroups)==null?void 0:o.map((h,_)=>{var g;return{colliders:((g=h.colliders)!=null?g:[]).map(R=>{let v=p==null?void 0:p[R];if(v==null)throw new Error(`VRMSpringBoneLoaderPlugin: The colliderGroup #${_} attempted to use a collider #${R} but not found`);return v}),name:h.name}});return(a=c.springs)==null||a.forEach((h,_)=>{var g;let T=h.joints,R=(g=h.colliderGroups)==null?void 0:g.map(E=>{let x=m==null?void 0:m[E];if(x==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${_} attempted to use a colliderGroup ${E} but not found`);return x}),v=h.center!=null?d[h.center]:void 0,M;T.forEach(E=>{if(M){let x=M.node,S=d[x],H=E.node,A=d[H],L={hitRadius:M.hitRadius,dragForce:M.dragForce,gravityPower:M.gravityPower,stiffness:M.stiffness,gravityDir:M.gravityDir!=null?new B.Vector3().fromArray(M.gravityDir):void 0},C=this._importJoint(S,A,L,R);v&&(C.center=v),u.addJoint(C)}M=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 hi,c=yield e.parser.getDependencies("node"),f=(r=s.colliderGroups)==null?void 0:r.map(p=>{var m;let h=c[p.node];return{colliders:((m=p.colliders)!=null?m:[]).map((g,T)=>{var R,v,M;let E=new B.Vector3(0,0,0);return g.offset&&E.set((R=g.offset.x)!=null?R:0,(v=g.offset.y)!=null?v:0,g.offset.z?-g.offset.z:0),this._importSphereCollider(h,{offset:E,radius:(M=g.radius)!=null?M:0,inside:!1})})}});return u==null||u.forEach((p,m)=>{let h=p.bones;h&&h.forEach(_=>{var g,T,R,v;let M=c[_],E=new B.Vector3;p.gravityDir?E.set((g=p.gravityDir.x)!=null?g:0,(T=p.gravityDir.y)!=null?T:0,(R=p.gravityDir.z)!=null?R:0):E.set(0,-1,0);let x=p.center!=null?c[p.center]:void 0,S={hitRadius:p.hitRadius,dragForce:p.dragForce,gravityPower:p.gravityPower,stiffness:p.stiffiness,gravityDir:E},H=(v=p.colliderGroups)==null?void 0:v.map(A=>{let L=f==null?void 0:f[A];if(L==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${m} attempted to use a colliderGroup ${A} but not found`);return L});M.traverse(A=>{var L;let C=(L=A.children[0])!=null?L:null,Z=this._importJoint(A,C,S,H);x&&(Z.center=x),d.addJoint(Z)})})}),e.scene.updateMatrixWorld(),d.setInitState(),d})}_importJoint(e,n,i,r){let o=new Ho(e,n,i,r);if(this.jointHelperRoot){let a=new yo(o);this.jointHelperRoot.add(a),a.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(e,n){let i=new _i(n),r=new Mt(i);if(e.add(r),this.colliderHelperRoot){let o=new Et(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importCapsuleCollider(e,n){let i=new pi(n),r=new Mt(i);if(e.add(r),this.colliderHelperRoot){let o=new Et(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importPlaneCollider(e,n){let i=new mi(n),r=new Mt(i);if(e.add(r),this.colliderHelperRoot){let o=new Et(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}};Ti.EXTENSION_NAME="VRMC_springBone";var xi=Ti;var Tt=class{get name(){return"VRMLoaderPlugin"}constructor(e,n){var o,a,l,s,u,d,c,f,p,m;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 rt(e),this.firstPersonPlugin=(a=n==null?void 0:n.firstPersonPlugin)!=null?a:new st(e),this.humanoidPlugin=(l=n==null?void 0:n.humanoidPlugin)!=null?l:new at(e,{helperRoot:i,autoUpdateHumanBones:r}),this.lookAtPlugin=(s=n==null?void 0:n.lookAtPlugin)!=null?s:new ut(e,{helperRoot:i}),this.metaPlugin=(u=n==null?void 0:n.metaPlugin)!=null?u:new dt(e),this.mtoonMaterialPlugin=(d=n==null?void 0:n.mtoonMaterialPlugin)!=null?d:new Zn(e),this.materialsHDREmissiveMultiplierPlugin=(c=n==null?void 0:n.materialsHDREmissiveMultiplierPlugin)!=null?c:new Jn(e),this.materialsV0CompatPlugin=(f=n==null?void 0:n.materialsV0CompatPlugin)!=null?f:new ii(e),this.springBonePlugin=(p=n==null?void 0:n.springBonePlugin)!=null?p:new xi(e,{colliderHelperRoot:i,jointHelperRoot:i}),this.nodeConstraintPlugin=(m=n==null?void 0:n.nodeConstraintPlugin)!=null?m:new ai(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 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}})}};function yi(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 Co(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=>yi(r)):i&&yi(i))}function wi(t){t.traverse(Co)}import*as je from"three";function Pi(t,e){var a;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=[],c=[],f={},p=u.array;for(let m=0;m{var c,f,p,m;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=new Si.BufferGeometry;l.name=r.name,l.morphTargetsRelative=r.morphTargetsRelative,r.groups.forEach(h=>{l.addGroup(h.start,h.count,h.materialIndex)}),l.boundingBox=(f=(c=r.boundingBox)==null?void 0:c.clone())!=null?f:null,l.boundingSphere=(m=(p=r.boundingSphere)==null?void 0:p.clone())!=null?m:null,l.setDrawRange(r.drawRange.start,r.drawRange.count),l.userData=r.userData,e.set(r,l);let s=[],u=[];{let h=o.array,_=new h.constructor(h.length),g=0;for(let T=0;T{let _=r.attributes[h];if(_.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");let g=_.array,{itemSize:T,normalized:R}=_,v=new g.constructor(u.length*T);u.forEach((M,E)=>{for(let x=0;x{l.morphAttributes[h]=[];let _=r.morphAttributes[h];for(let g=0;g<_.length;g++){let T=_[g];if(T.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");let R=T.array,{itemSize:v,normalized:M}=T,E=new R.constructor(u.length*v);u.forEach((x,S)=>{for(let H=0;Hx===0),l.morphAttributes[h][g]=new xt(E,v,M)}}),d&&(l.morphAttributes={}),i.geometry=l}),Array.from(e.keys()).forEach(n=>{n.dispose()})}function Li(t){var e;((e=t.meta)==null?void 0:e.metaVersion)==="0"&&(t.scene.rotation.y=Math.PI)}var Ee=class{constructor(){}};Ee.deepDispose=wi,Ee.removeUnnecessaryJoints=Pi,Ee.removeUnnecessaryVertices=Ai,Ee.rotateVRM0=Li;export{kr as MToonMaterial,Fr as MToonMaterialDebugMode,Zn as MToonMaterialLoaderPlugin,jn as MToonMaterialOutlineWidthMode,Se as VRM,so as VRMAimConstraint,ht as VRMCore,zo as VRMCoreLoaderPlugin,tn as VRMExpression,rt as VRMExpressionLoaderPlugin,on as VRMExpressionManager,sn as VRMExpressionMaterialColorBind,ye as VRMExpressionMaterialColorType,an as VRMExpressionMorphTargetBind,Do as VRMExpressionOverrideType,Je as VRMExpressionPresetName,un as VRMExpressionTextureTransformBind,dn as VRMFirstPerson,st as VRMFirstPersonLoaderPlugin,Fo as VRMFirstPersonMeshAnnotationType,Ye as VRMHumanBoneList,Wo as VRMHumanBoneName,hr as VRMHumanBoneParentMap,fn as VRMHumanoid,pn as VRMHumanoidHelper,at as VRMHumanoidLoaderPlugin,Tt as VRMLoaderPlugin,Sr as VRMLookAt,De as VRMLookAtBoneApplier,nt as VRMLookAtExpressionApplier,Er as VRMLookAtHelper,ut as VRMLookAtLoaderPlugin,yn as VRMLookAtRangeMap,ko as VRMLookAtTypeName,dt as VRMMetaLoaderPlugin,_t as VRMNodeConstraint,mt as VRMNodeConstraintHelper,ai as VRMNodeConstraintLoaderPlugin,lo as VRMNodeConstraintManager,mr as VRMRequiredHumanBoneName,_o as VRMRollConstraint,co as VRMRotationConstraint,Mt as VRMSpringBoneCollider,Et as VRMSpringBoneColliderHelper,Rt as VRMSpringBoneColliderShape,pi as VRMSpringBoneColliderShapeCapsule,mi as VRMSpringBoneColliderShapePlane,_i as VRMSpringBoneColliderShapeSphere,Ho as VRMSpringBoneJoint,yo as VRMSpringBoneJointHelper,xi as VRMSpringBoneLoaderPlugin,hi as VRMSpringBoneManager,Ee 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"]),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}; /*! - * @pixiv/three-vrm-core v3.1.6 + * @pixiv/three-vrm-core v3.2.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.1.6 + * @pixiv/three-vrm-materials-mtoon v3.2.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.1.6 + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.2.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.1.6 + * @pixiv/three-vrm-materials-v0compat v3.2.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.1.6 + * @pixiv/three-vrm-node-constraint v3.2.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.1.6 + * @pixiv/three-vrm-springbone v3.2.0 * Spring bone module for @pixiv/three-vrm * * Copyright (c) 2019-2024 pixiv Inc. diff --git a/packages/three-vrm/types/VRMUtils/combineSkeletons.d.ts b/packages/three-vrm/types/VRMUtils/combineSkeletons.d.ts new file mode 100644 index 000000000..925902400 --- /dev/null +++ b/packages/three-vrm/types/VRMUtils/combineSkeletons.d.ts @@ -0,0 +1,10 @@ +import * as THREE from 'three'; +/** + * 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. + * + * @param root Root object that will be traversed + */ +export declare function combineSkeletons(root: THREE.Object3D): void; diff --git a/packages/three-vrm/types/VRMUtils/index.d.ts b/packages/three-vrm/types/VRMUtils/index.d.ts index 79f593b09..64189935c 100644 --- a/packages/three-vrm/types/VRMUtils/index.d.ts +++ b/packages/three-vrm/types/VRMUtils/index.d.ts @@ -1,9 +1,11 @@ +import { combineSkeletons } from './combineSkeletons'; import { deepDispose } from './deepDispose'; import { removeUnnecessaryJoints } from './removeUnnecessaryJoints'; import { removeUnnecessaryVertices } from './removeUnnecessaryVertices'; import { rotateVRM0 } from './rotateVRM0'; export declare class VRMUtils { private constructor(); + static combineSkeletons: typeof combineSkeletons; static deepDispose: typeof deepDispose; static removeUnnecessaryJoints: typeof removeUnnecessaryJoints; static removeUnnecessaryVertices: typeof removeUnnecessaryVertices; diff --git a/packages/three-vrm/types/VRMUtils/removeUnnecessaryJoints.d.ts b/packages/three-vrm/types/VRMUtils/removeUnnecessaryJoints.d.ts index 657bbf8d7..1251924e5 100644 --- a/packages/three-vrm/types/VRMUtils/removeUnnecessaryJoints.d.ts +++ b/packages/three-vrm/types/VRMUtils/removeUnnecessaryJoints.d.ts @@ -9,6 +9,8 @@ import * as THREE from 'three'; * Also, this function might significantly improve the performance of mesh skinning. * * @param root Root object that will be traversed + * + * @deprecated `removeUnnecessaryJoints` is deprecated. Use `combineSkeletons` instead. `combineSkeletons` contributes more to the performance improvement. This function will be removed in the next major version. */ export declare function removeUnnecessaryJoints(root: THREE.Object3D, options?: { /** diff --git a/packages/types-vrm-0.0/docs/interfaces/BlendShape.html b/packages/types-vrm-0.0/docs/interfaces/BlendShape.html index 3bc7ac495..51e7a5d8f 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 2b1a11665..0ce9053fa 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 76d4ddd35..81ff06752 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 141e94b34..f16965c5b 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 00dea8d0d..68b4b8954 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 2f8a2ea93..e87c26a96 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 d558b818b..89e256c63 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 accff1918..554626789 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 db4b45b8c..45f445540 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 8e217b26a..c6b8412c6 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 b40141ba6..e1406eb39 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 1bcd2017e..a0d91b63a 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 ac58ecbac..8f2ed782e 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 f8def0c1c..4a4140895 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 4479a229d..755a378d3 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 08558e5d5..499f13bd2 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 3d3d18b0d..13b83b132 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 642bcfd57..6ee308cb6 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 31632ad47..944448520 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 56ec706f0..eebcf9ee1 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 e4559148e..dfe6cb619 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 11bb84c16..210c90e27 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 8bfe03ef4..60fb7397a 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 4093bf6b9..016f18dd2 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 1e186b4fc..3d0b22515 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 4ad2e50c5..b0a35cf4e 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 46fa7684b..e41518a65 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 1ed81c080..b59400ea4 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 3ca635aff..e766fdea3 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 31180ba08..4f447ed35 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 7bcb6754e..7ffba1f8d 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 4ae66530d..9b53df3de 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 5fcd22df4..184e7a603 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 377d98bea..d4682bb30 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 f61916e52..0b08b6a3c 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 ec7fa3ea8..88a46af0d 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 7850143b7..95336f89b 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 645707ae8..bff427f84 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 e98200c58..2b626ae84 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 3cbef1074..a920be697 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 8096096ec..559f48d19 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 e87aeef43..f9e24f0d1 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 9496185c3..e78c4285a 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 b62237477..779f2ccfd 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 ec7955cc1..3e503a169 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 e01ad1924..5aaf32287 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 02599d680..48009b95c 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 353bc80a4..6f91682e9 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 431c6ff54..f75ecdeb6 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 718bda406..e61771ff6 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 9c03ab67f..91a9b0d8b 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 f65020855..d7b214d8a 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 fcd4f892a..0cbececa7 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 a6a9aa1af..d297dbc30 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 95d6371b2..96e496c36 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 448d57ef5..6df97ce79 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 38bc110d4..2a2812af8 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 347aba766..27d1c2665 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 6175d56cc..624a9f4b2 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 64420f7c3..a33003337 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 5d22232ae..9dcec9ca0 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 f3e943c8e..9f6b34f1d 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 809641e02..fc4feb341 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 475bc71ff..70aaf14bd 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 bb5f7715d..b2259568d 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 4366113c6..e155dfe29 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 13d597299..d176a1e62 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.

    -
    +