8 lines
53 KiB
JavaScript
8 lines
53 KiB
JavaScript
/**
|
|
* Minified by jsDelivr using Terser v5.19.2.
|
|
* Original file: /npm/three-mmd-loader@0.0.11/dist/mmd-loader.js
|
|
*
|
|
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
*/
|
|
module.exports=function(e){var t={};function r(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=22)}([function(e,t,r){"use strict";let a;Object.defineProperty(t,"__esModule",{value:!0}),a="undefined"!=typeof window&&window.THREE?window.THREE:r(16),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);class i extends a.default.Interpolant{constructor(e,t,r,a,i){super(e,t,r,a),this.params=i}interpolate_(e,t,r,i){var o=this.resultBuffer,s=this.sampleValues,n=this.valueSize,l=e*n,u=l-n,h=(r-t)/(i-t);if(4===n){var d=this.params[4*e+0],f=this.params[4*e+1],c=this.params[4*e+2],p=this.params[4*e+3],m=this._calculate(d,f,c,p,h);a.default.Quaternion.slerpFlat(o,0,s,u,s,l,m)}else if(3===n)for(var g=0;g!==n;++g){d=this.params[12*e+4*g+0],f=this.params[12*e+4*g+1],c=this.params[12*e+4*g+2],p=this.params[12*e+4*g+3],m=this._calculate(d,f,c,p,h);o[g]=s[u+g]*(1-m)+s[l+g]*m}else{d=this.params[4*e+0],f=this.params[4*e+1],c=this.params[4*e+2],p=this.params[4*e+3],m=this._calculate(d,f,c,p,h);o[0]=s[u]*(1-m)+s[l]*m}return o}_calculate(e,t,r,a,i){for(var o,s,n,l=.5,u=l,h=1-u,d=Math,f=0;f<15;f++){var c=(o=3*h*h*u)*e+(s=3*h*u*u)*t+(n=u*u*u)-i;if(d.abs(c)<1e-5)break;l/=2,h=1-(u+=c<0?l:-l)}return o*r+s*a+n}}t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);t.default=class{constructor(e){var t;this.update=(t=new a.default.Quaternion,function(){for(var e=0;e<this.mesh.geometry.grants.length;e++){var r=this.mesh.geometry.grants[e],a=this.mesh.skeleton.bones[r.index],i=this.mesh.skeleton.bones[r.parentIndex];r.isLocal?(r.affectPosition,r.affectRotation):(r.affectPosition,r.affectRotation&&(t.set(0,0,0,1),t.slerp(i.quaternion,r.ratio),a.quaternion.multiply(t)))}}),this.mesh=e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(13);t.Constraint=a.default;var i=r(20);t.PhysicsHelper=i.default;var o=r(14);t.ResourceHelper=o.default;var s=r(15);t.RigidBody=s.default;var n=r(19);t.default=n.default},function(e,t){e.exports=require("ammo.js")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t,r){var a=null==r?{}:r;this.audio=e,this.listener=t,this.elapsedTime=0,this.currentTime=0,this.delayTime=void 0!==a.delayTime?a.delayTime:0,this.audioDuration=this.audio.buffer.duration,this.duration=this.audioDuration+this.delayTime}control(e){this.elapsed+=e,this.currentTime+=e,this.checkIfStopAudio()&&this.audio.stop(),this.checkIfStartAudio()&&this.audio.play()}checkIfStartAudio(){if(this.audio.isPlaying)return!1;for(;this.currentTime>=this.duration;)this.currentTime-=this.duration;return!(this.currentTime<this.delayTime)&&(this.audio.startTime=this.currentTime-this.delayTime,!0)}checkIfStopAudio(){return!!this.audio.isPlaying&&this.currentTime>=this.duration}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),i=r(3),o=r(8),s=r(2);t.default=class{constructor(){this.meshes=[],this.doAnimation=!0,this.doIk=!0,this.doGrant=!0,this.doPhysics=!0,this.doCameraAnimation=!0,this.sharedPhysics=!1,this.masterPhysics=null,this.audioManager=null,this.camera=null}add(e){if(!(e instanceof a.default.SkinnedMesh))throw new Error("THREE.MMDHelper.add() accepts only THREE.SkinnedMesh instance.");void 0===e.mixer&&(e.mixer=null),void 0===e.ikSolver&&(e.ikSolver=null),void 0===e.grantSolver&&(e.grantSolver=null),void 0===e.physics&&(e.physics=null),void 0===e.looped&&(e.looped=!1),this.meshes.push(e),this.initBackupBones(e)}setAudio(e,t,r){this.audioManager=new MMDAudioManager(e,t,r)}setCamera(e){e.mixer=null,this.camera=e}setPhysicses(e){for(var t=0;t<this.meshes.length;t++)this.setPhysics(this.meshes[t],e)}setPhysics(e,t={}){if(void 0===t.world&&this.sharedPhysics){var r=this.getMasterPhysics();null!==r&&(t.world=r.world)}var a=void 0!==t.warmup?t.warmup:60,o=new i.default(e,t);null!==e.mixer&&void 0!==e.mixer&&!0!==t.preventAnimationWarmup&&(this.animateOneMesh(0,e),o.reset()),o.warmup(a),this.updateIKParametersDependingOnPhysicsEnabled(e,!0),e.physics=o}getMasterPhysics(){if(null!==this.masterPhysics)return this.masterPhysics;for(var e=0,t=this.meshes.length;e<t;e++){var r=this.meshes[e].physics;if(null!=r)return this.masterPhysics=r,this.masterPhysics}return null}enablePhysics(e){this.doPhysics=!0===e;for(var t=0,r=this.meshes.length;t<r;t++)this.updateIKParametersDependingOnPhysicsEnabled(this.meshes[t],e)}updateIKParametersDependingOnPhysicsEnabled(e,t){for(var r=e.geometry.iks,a=e.geometry.bones,i=0,o=r.length;i<o;i++)for(var s=r[i].links,n=0,l=s.length;n<l;n++){var u=s[n];u.enabled=!0!==t||!(a[u.index].rigidBodyType>0)}}setAnimations(){for(var e=0;e<this.meshes.length;e++)this.setAnimation(this.meshes[e])}setAnimation(e){if(void 0!==e.geometry.animations){e.mixer=new a.default.AnimationMixer(e),e.mixer.addEventListener("loop",(function(e){0===e.action._clip.tracks[0].name.indexOf(".bones")&&(e.target._root.looped=!0)}));for(var t=!1,r=!1,i=0;i<e.geometry.animations.length;i++){var n=e.geometry.animations[i],l=e.mixer.clipAction(n);0===n.tracks[0].name.indexOf(".morphTargetInfluences")?r||(l.play(),r=!0):t||(l.play(),t=!0)}t&&(e.ikSolver=new o.default(e),void 0!==e.geometry.grants&&(e.grantSolver=new s.default(e)))}}setCameraAnimation(e){void 0!==e.animations&&(e.mixer=new a.default.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())}unifyAnimationDuration(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,i=0;i<this.meshes.length;i++){if(null!==(n=this.meshes[i].mixer))for(var o=0;o<n._actions.length;o++){var s=n._actions[o];t=Math.max(t,s._clip.duration)}}if(null!==r&&null!==r.mixer){var n=r.mixer;for(i=0;i<n._actions.length;i++){s=n._actions[i];t=Math.max(t,s._clip.duration)}}null!==a&&(t=Math.max(t,a.duration)),void 0!==e.afterglow&&(t+=e.afterglow);for(i=0;i<this.meshes.length;i++){if(null!==(n=this.meshes[i].mixer))for(o=0;o<n._actions.length;o++){(s=n._actions[o])._clip.duration=t}}if(null!==r&&null!==r.mixer)for(n=r.mixer,i=0;i<n._actions.length;i++){(s=n._actions[i])._clip.duration=t}null!==a&&(a.duration=t)}controlAudio(e){null!==this.audioManager&&this.audioManager.control(e)}animate(e){this.controlAudio(e);for(var t=0;t<this.meshes.length;t++)this.animateOneMesh(e,this.meshes[t]);this.sharedPhysics&&this.updateSharedPhysics(e),this.animateCamera(e)}animateOneMesh(e,t){var r=t.mixer,a=t.ikSolver,i=t.grantSolver,o=t.physics;null!==r&&!0===this.doAnimation&&(this.restoreBones(t),r.update(e),this.backupBones(t)),null!==a&&!0===this.doIk&&a.update(),null!==i&&!0===this.doGrant&&i.update(),!0===t.looped&&(null!==o&&o.reset(),t.looped=!1),null!==o&&this.doPhysics&&!this.sharedPhysics&&o.update(e)}updateSharedPhysics(e){if(0!==this.meshes.length&&this.doPhysics&&this.sharedPhysics){var t=this.getMasterPhysics();if(null!==t){for(var r=0,a=this.meshes.length;r<a;r++){null!=(i=this.meshes[r].physics)&&i.updateRigidBodies()}t.stepSimulation(e);for(r=0,a=this.meshes.length;r<a;r++){var i;null!=(i=this.meshes[r].physics)&&i.updateBones()}}}}animateCamera(e){if(null!==this.camera){var t=this.camera.mixer;null!==t&&void 0!==this.camera.center&&!0===this.doCameraAnimation&&(t.update(e),this.camera.updateProjectionMatrix(),this.camera.up.set(0,1,0),this.camera.up.applyQuaternion(this.camera.quaternion),this.camera.lookAt(this.camera.center))}}poseAsVpd(e,t,r){void 0===r&&(r={}),!0!==r.preventResetPose&&e.pose();for(var i=e.skeleton.bones,n=t.bones,l={},u=0;u<i.length;u++)l[i[u].name]=u;var h=new a.default.Vector3,d=new a.default.Quaternion;for(u=0;u<n.length;u++){var f=n[u],c=l[f.name];if(void 0!==c){var p=i[c],m=f.translation,g=f.quaternion;h.set(m[0],m[1],m[2]),d.set(g[0],g[1],g[2],g[3]),p.position.add(h),p.quaternion.multiply(d)}}(e.updateMatrixWorld(!0),!0!==r.preventIk)&&new o.default(e).update(r.saveOriginalBonesBeforeIK);!0!==r.preventGrant&&void 0!==e.geometry.grants&&new s.default(e).update()}initBackupBones(e){e.skeleton.backupBones=[];for(var t=0;t<e.skeleton.bones.length;t++)e.skeleton.backupBones.push(e.skeleton.bones[t].clone())}backupBones(e){e.skeleton.backupBoneIsSaved=!0;for(var t=0;t<e.skeleton.bones.length;t++){var r=e.skeleton.backupBones[t],a=e.skeleton.bones[t];r.position.copy(a.position),r.quaternion.copy(a.quaternion)}}restoreBones(e){if(!0===e.skeleton.backupBoneIsSaved){e.skeleton.backupBoneIsSaved=!1;for(var t=0;t<e.skeleton.bones.length;t++){var r=e.skeleton.bones[t],a=e.skeleton.backupBones[t];r.position.copy(a.position),r.quaternion.copy(a.quaternion)}}}}},function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){return new(r||(r=Promise))((function(i,o){function s(e){try{l(a.next(e))}catch(e){o(e)}}function n(e){try{l(a.throw(e))}catch(e){o(e)}}function l(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,n)}l((a=a.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),o=r(23),s=r(21),n=r(9),l=r(12),u=r(11),h=r(10),d={VectorKeyframeTrackEx:l.default,QuaternionKeyframeTrackEx:u.default,NumberKeyframeTrackEx:h.default};class f extends i.default.Loader{constructor(e){super(),this.defaultToonTextures=["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAN0lEQVRYR+3WQREAMBACsZ5/bWiiMvgEBTt5cW37hjsBBAgQIECAwFwgyfYPCCBAgAABAgTWAh8aBHZBl14e8wAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAOUlEQVRYR+3WMREAMAwDsYY/yoDI7MLwIiP40+RJklfcCCBAgAABAgTqArfb/QMCCBAgQIAAgbbAB3z/e0F3js2cAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAN0lEQVRYR+3WQREAMBACsZ5/B5ilMvgEBTt5cW37hjsBBAgQIECAwFwgyfYPCCBAgAABAgTWAh81dWyx0gFwKAAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAOklEQVRYR+3WoREAMAwDsWb/UQtCy9wxTOQJ/oQ8SXKKGwEECBAgQIBAXeDt7f4BAQQIECBAgEBb4AOz8Hzx7WLY4wAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABPUlEQVRYR+1XwW7CMAy1+f9fZOMysSEOEweEOPRNdm3HbdOyIhAcklPrOs/PLy9RygBALxzcCDQFmgJNgaZAU6Ap0BR4PwX8gsRMVLssMRH5HcpzJEaWL7EVg9F1IHRlyqQohgVr4FGUlUcMJSjcUlDw0zvjeun70cLWmneoyf7NgBTQSniBTQQSuJAZsOnnaczjIMb5hCiuHKxokCrJfVnrctyZL0PkJAJe1HMil4nxeyi3Ypfn1kX51jpPvo/JeCNC4PhVdHdJw2XjBR8brF8PEIhNVn12AgP7uHsTBguBn53MUZCqv7Lp07Pn5k1Ro+uWmUNn7D+M57rtk7aG0Vo73xyF/fbFf0bPJjDXngnGocDTdFhygZjwUQrMNrDcmZlQT50VJ/g/UwNyHpu778+yW+/ksOz/BFo54P4AsUXMfRq7XWsAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACMElEQVRYR+2Xv4pTQRTGf2dubhLdICiii2KnYKHVolhauKWPoGAnNr6BD6CvIVaihYuI2i1ia0BY0MZGRHQXjZj/mSPnnskfNWiWZUlzJ5k7M2cm833nO5Mziej2DWWJRUoCpQKlAntSQCqgw39/iUWAGmh37jrRnVsKlgpiqmkoGVABA7E57fvY+pJDdgKqF6HzFCSADkDq+F6AHABtQ+UMVE5D7zXod7fFNhTEckTbj5XQgHzNN+5tQvc5NG7C6BNkp6D3EmpXHDR+dQAjFLchW3VS9rlw3JBh+B7ys5Cf9z0GW1C/7P32AyBAOAz1q4jGliIH3YPuBnSfQX4OGreTIgEYQb/pBDtPnEQ4CivXYPAWBk13oHrB54yA9QuSn2H4AcKRpEILDt0BUzj+RLR1V5EqjD66NPRBVpLcQwjHoHYJOhsQv6U4mnzmrIXJCFr4LDwm/xBUoboG9XX4cc9VKdYoSA2yk5NQLJaKDUjTBoveG3Z2TElTxwjNK4M3LEZgUdDdruvcXzKBpStgp2NPiWi3ks9ZXxIoFVi+AvHLdc9TqtjL3/aYjpPlrzOcEnK62Szhimdd7xX232zFDTgtxezOu3WNMRLjiKgjtOhHVMd1loynVHvOgjuIIJMaELEqhJAV/RCSLbWTcfPFakFgFlALTRRvx+ok6Hlp/Q+v3fmx90bMyUzaEAhmM3KvHlXTL5DxnbGf/1M8RNNACLL5MNtPxP/mypJAqcDSFfgFhpYqWUzhTEAAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII="],this.manager=void 0!==e?e:i.default.DefaultLoadingManager,this.parser=new o.Parser,this.textureCrossOrigin=null}setTextureCrossOrigin(e){this.textureCrossOrigin=e}load(e,t,r){return a(this,void 0,void 0,(function*(){const a=yield this.loadModel(e,r),i=yield this.loadVmds(t,r);this.pourVmdIntoModel(a,i)}))}loadModel(e,t){return a(this,void 0,void 0,(function*(){var r=this.extractUrlBase(e),a=this.extractExtension(e);const i=yield this.loadFileAsBuffer(e,t);return this.createModel(i,a,r,t)}))}createModel(e,t,r,a){return this.createMesh(this.parseModel(e,t),r,a)}loadVmd(e,t){return a(this,void 0,void 0,(function*(){return this.parseVmd(yield this.loadFileAsBuffer(e,t))}))}loadVmds(e,t){return a(this,void 0,void 0,(function*(){const t=e.map((e=>this.loadVmd(e)));return this.mergeVmds(yield Promise.all(t))}))}loadAudio(e,t){return a(this,void 0,void 0,(function*(){var r=new i.default.AudioListener,a=new i.default.Audio(r),o=new i.default.AudioLoader(this.manager);return new Promise(((i,s)=>{o.load(e,(e=>{a.setBuffer(e),i([a,r])}),t,(e=>s(e.error)))}))}))}loadVpd(e,t,r){return a(this,void 0,void 0,(function*(){const a=(t&&"unicode"===t.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this);return new Promise(((t,i)=>{a(e,(e=>t(this.parseVpd(e))),r,(e=>i(e.error)))}))}))}parseModel(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}}parsePmd(e){return this.parser.parsePmd(e,!0)}parsePmx(e){return this.parser.parsePmx(e,!0)}parseVmd(e){return this.parser.parseVmd(e,!0)}parseVpd(e){return this.parser.parseVpd(e,!0)}mergeVmds(e){return this.parser.mergeVmds(e)}pourVmdIntoModel(e,t,r){this.createAnimation(e,t,r)}pourVmdIntoCamera(e,t,r){var a=new n.default;!function(){for(var o,s,n=a.createOrderedMotionArray(t.cameras),l=[],u=[],h=[],f=[],c=[],p=[],m=[],g=[],A=[],v=new i.default.Quaternion,y=new i.default.Euler,x=new i.default.Vector3,M=new i.default.Vector3,b=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},w=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},B=function(e,t,r,a,i){if(r.length>2){r=r.slice(),a=a.slice(),i=i.slice();let e=a.length/r.length,t=3===e?12:4,s=1;for(let n=2,l=r.length;n<l;n++){for(let t=0;t<e;t++)if(a[s*e+t]!==a[(s-1)*e+t]||a[s*e+t]!==a[n*e+t]){s++;break}if(n>s){r[s]=r[n];for(var o=0;o<e;o++)a[s*e+o]=a[n*e+o];for(o=0;o<t;o++)i[s*t+o]=i[n*t+o]}}r.length=s+1,a.length=(s+1)*e,i.length=(s+1)*t}return new d[t](e,r,a,i)},T=0;T<n.length;T++){var C=n[T],k=C.frameNum/30,I=C.position,V=C.rotation,O=C.distance,P=C.fov,S=C.interpolation;x.set(0,0,-O),M.set(I[0],I[1],I[2]),y.set(-V[0],-V[1],-V[2]),v.setFromEuler(y),x.add(M),x.applyQuaternion(v),l.length>0&&k<l[l.length-1]+.05&&(l[l.length-1]=k-1e-13),l.push(k),b(u,M),(o=h).push((s=v).x),o.push(s.y),o.push(s.z),o.push(s.w),b(f,x),c.push(P);for(var E=0;E<3;E++)w(p,S,E);w(m,S,3);for(E=0;E<3;E++)w(g,S,4);w(A,S,5)}if(0!==l.length){var Q=[];Q.push(B(".center","VectorKeyframeTrackEx",l,u,p)),Q.push(B(".quaternion","QuaternionKeyframeTrackEx",l,h,m)),Q.push(B(".position","VectorKeyframeTrackEx",l,f,g)),Q.push(B(".fov","NumberKeyframeTrackEx",l,c,A));var R=new i.default.AnimationClip(void 0===r?i.default.Math.generateUUID():r,-1,Q);null!==R&&(void 0===e.center&&(e.center=new i.default.Vector3(0,0,0)),void 0===e.animations&&(e.animations=[]),e.animations.push(R))}}()}extractExtension(e){var t=e.lastIndexOf(".");return t<0?null:e.slice(t+1)}loadFile(e,t,r,a){return new Promise(((o,s)=>{const n=new i.default.FileLoader(this.manager);null!=r&&n.setMimeType(r),n.setResponseType(t),n.load(e,(e=>o(e)),a,(e=>s(e.error)))}))}loadFileAsBuffer(e,t){return a(this,void 0,void 0,(function*(){return this.loadFile(e,"arraybuffer",null,t)}))}loadFileAsText(e,t){return a(this,void 0,void 0,(function*(){return this.loadFile(e,"text",null,t)}))}loadFileAsShiftJISText(e,t){return a(this,void 0,void 0,(function*(){return this.loadFile(e,"text","text/plain; charset=shift_jis",t)}))}createMesh(e,t,r){var a=this,o=new i.default.BufferGeometry,l=new i.default.MultiMaterial,u=(new n.default,{vertices:[],uvs:[],normals:[],skinIndices:[],skinWeights:[],indices:[]});return function(){for(var t=0;t<e.metadata.vertexCount;t++){for(var r=e.vertices[t],a=0,i=r.position.length;a<i;a++)u.vertices.push(r.position[a]);for(a=0,i=r.normal.length;a<i;a++)u.normals.push(r.normal[a]);for(a=0,i=r.uv.length;a<i;a++)u.uvs.push(r.uv[a]);for(a=0;a<4;a++)u.skinIndices.push(r.skinIndices.length-1>=a?r.skinIndices[a]:0);for(a=0;a<4;a++)u.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t<e.metadata.faceCount;t++)for(var r=e.faces[t],a=0,i=r.indices.length;a<i;a++)u.indices.push(r.indices[a])}(),function(){for(var t=[],r=e.rigidBodies,a={},i=0,s=r.length;i<s;i++){var n=r[i],l=a[n.boneIndex];l=void 0===l?n.type:Math.max(n.type,l),a[n.boneIndex]=l}for(i=0;i<e.metadata.boneCount;i++){var u={},h=e.bones[i];u.parent=h.parentIndex,u.name=h.name,u.pos=[h.position[0],h.position[1],h.position[2]],u.rotq=[0,0,0,1],u.scl=[1,1,1],-1!==u.parent&&(u.pos[0]-=e.bones[u.parent].position[0],u.pos[1]-=e.bones[u.parent].position[1],u.pos[2]-=e.bones[u.parent].position[2]),u.rigidBodyType=void 0!==a[i]?a[i]:-1,t.push(u)}o.bones=t}(),function(){var t=[];if("pmd"===e.metadata.format)for(var r=0;r<e.metadata.ikCount;r++){var a=e.iks[r];(n={}).target=a.target,n.effector=a.effector,n.iteration=a.iteration,n.maxAngle=4*a.maxAngle,n.links=[];for(var s=0;s<a.links.length;s++){(l={}).index=a.links[s].index,e.bones[l.index].name.indexOf("ひざ")>=0&&(l.limitation=new i.default.Vector3(1,0,0)),n.links.push(l)}t.push(n)}else for(r=0;r<e.metadata.boneCount;r++){if(void 0!==(a=e.bones[r].ik)){var n;(n={}).target=r,n.effector=a.effector,n.iteration=a.iteration,n.maxAngle=a.maxAngle,n.links=[];for(s=0;s<a.links.length;s++){var l;(l={}).index=a.links[s].index,l.enabled=!0,1===a.links[s].angleLimitation&&(l.limitation=new i.default.Vector3(1,0,0)),n.links.push(l)}t.push(n)}}o.iks=t}(),function(){if("pmd"!==e.metadata.format){for(var t=[],r=0;r<e.metadata.boneCount;r++){var a=e.bones[r],i=a.grant;if(void 0!==i){var s={};s.index=r,s.parentIndex=i.parentIndex,s.ratio=i.ratio,s.isLocal=i.isLocal,s.affectRotation=i.affectRotation,s.affectPosition=i.affectPosition,s.transformationClass=a.transformationClass,t.push(s)}}t.sort((function(e,t){return e.transformationClass-t.transformationClass})),o.grants=t}}(),function(){function t(e,t,r,a){e.array[3*t+0]+=r.position[0]*a,e.array[3*t+1]+=r.position[1]*a,e.array[3*t+2]+=r.position[2]*a}function r(r,a,i){for(var o=0;o<a.elementCount;o++){var s=a.elements[o];t(r,"pmd"===e.metadata.format?e.morphs[0].elements[s.index].index:s.index,s,i)}}for(var a=[],s=[],n=0;n<e.metadata.morphCount;n++){for(var l=e.morphs[n],h={name:l.name},d=new i.default.Float32BufferAttribute(3*e.metadata.vertexCount,3),f=0;f<3*e.metadata.vertexCount;f++)d.array[f]=u.vertices[f];if("pmd"===e.metadata.format)0!==n&&r(d,l,1);else if(0===l.type)for(f=0;f<l.elementCount;f++){var c=e.morphs[l.elements[f].index],p=l.elements[f].ratio;1===c.type&&r(d,c,p)}else 1===l.type?r(d,l,1):2===l.type||3===l.type||4===l.type||5===l.type||6===l.type||7===l.type||l.type;a.push(h),s.push(d)}o.morphTargets=a,o.morphAttributes.position=s}(),function(){var n={},u=new i.default.TextureLoader(a.manager),h=new s.default(a.manager),d=document.createElement("canvas"),f=d.getContext("2d"),c=0,p=[];function m(e,o){var s;if(void 0===o&&(o={}),!0===o.defaultTexturePath)try{s=a.defaultToonTextures[parseInt(e.match("toon([0-9]{2}).bmp$")[1])]}catch(t){console.warn("THREE.MMDLoader: "+e+" seems like not right default texture path. Using toon00.bmp instead."),s=a.defaultToonTextures[0]}else s=t+e;if(void 0!==n[s])return s;var l=i.default.Loader.Handlers.get(s);null===l&&(l=e.indexOf(".tga")>=0?h:u);var c=l.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,a=t.height;d.width=r,d.height=a,f.clearRect(0,0,r,a),f.translate(r/2,a/2),f.rotate(.5*Math.PI),f.translate(-r/2,-a/2),f.drawImage(t,0,0),e.image=f.getImageData(0,0,r,a)}e.flipY=!1,e.wrapS=i.default.RepeatWrapping,e.wrapT=i.default.RepeatWrapping,!0===o.sphericalReflectionMapping&&(e.mapping=i.default.SphericalReflectionMapping);for(var s=0;s<c.readyCallbacks.length;s++)c.readyCallbacks[s](c);delete c.readyCallbacks}),r,(e=>{throw e.error}));return c.readyCallbacks=[],n[s]=c,s}function g(e,t){return void 0===t[e]&&console.warn("THREE.MMDLoader: Undefined texture",e),t[e]}null!==a.textureCrossOrigin&&u.setCrossOrigin(a.textureCrossOrigin);for(var A=0;A<e.metadata.materialCount;A++){var v=e.materials[A],y={};if(y.faceOffset=c,y.faceNum=v.faceCount,c+=v.faceCount,y.name=v.name,y.color=new i.default.Color(v.diffuse[0],v.diffuse[1],v.diffuse[2]),y.opacity=v.diffuse[3],y.specular=new i.default.Color(v.specular[0],v.specular[1],v.specular[2]),y.shininess=v.shininess,1===y.opacity?(y.side=i.default.FrontSide,y.transparent=!1):(y.side=i.default.DoubleSide,y.transparent=!0),"pmd"===e.metadata.format){if(v.fileName){var x=v.fileName,M=[],b=x.lastIndexOf("*");b>=0?(M.push(x.slice(0,b)),M.push(x.slice(b+1))):M.push(x);for(var w=0;w<M.length;w++){(B=M[w]).indexOf(".sph")>=0||B.indexOf(".spa")>=0?(y.envMap=m(B,{sphericalReflectionMapping:!0}),B.indexOf(".sph")>=0?y.envMapType=i.default.MultiplyOperation:y.envMapType=i.default.AddOperation):y.map=m(B)}}}else{if(-1!==v.textureIndex){var B=e.textures[v.textureIndex];y.map=m(B)}if(-1!==v.envTextureIndex&&(1===v.envFlag||2==v.envFlag)){B=e.textures[v.envTextureIndex];y.envMap=m(B,{sphericalReflectionMapping:!0}),1===v.envFlag?y.envMapType=i.default.MultiplyOperation:y.envMapType=i.default.AddOperation}}var T=void 0===y.map?1:.2;y.emissive=new i.default.Color(v.ambient[0]*T,v.ambient[1]*T,v.ambient[2]*T),p.push(y)}for(A=0;A<p.length;A++){var C=p[A],k=e.materials[A];v=new i.default.MeshToonMaterial;if(o.addGroup(3*C.faceOffset,3*C.faceNum,A),void 0!==C.name&&(v.name=C.name),v.skinning=o.bones.length>0,v.morphTargets=o.morphTargets.length>0,v.lights=!0,v.side="pmx"===e.metadata.format&&1==(1&k.flag)?i.default.DoubleSide:C.side,v.transparent=C.transparent,v.fog=!0,v.blending=i.default.CustomBlending,v.blendSrc=i.default.SrcAlphaFactor,v.blendDst=i.default.OneMinusSrcAlphaFactor,v.blendSrcAlpha=i.default.SrcAlphaFactor,v.blendDstAlpha=i.default.DstAlphaFactor,void 0!==C.map){function R(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,i=Math.round(t.x*r)%r,o=Math.round(t.y*a)%a;i<0&&(i+=r),o<0&&(o+=a);var s=o*r+i;return e.data[4*s+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),i=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var i=e.width,o=e.height;if(e.data.length/(i*o)!=4)return!1;for(var s=0;s<a.length;s+=3){for(var n={x:0,y:0},l=0;l<3;l++){var u=a[3*s+l],h={x:t[2*u+0],y:t[2*u+1]};if(r(e,h)<253)return!0;n.x+=h.x,n.y+=h.y}if(n.x/=3,n.y/=3,r(e,n)<253)return!0}return!1})(a,o.attributes.uv.array,i)&&(e.transparent=!0),delete e.faceOffset,delete e.faceNum}))}v.faceOffset=C.faceOffset,v.faceNum=C.faceNum,v.map=g(C.map,n),R(v)}if(void 0!==C.envMap&&(v.envMap=g(C.envMap,n),v.combine=C.envMapType,v.envMap.readyCallbacks.push((function(e){v.needsUpdate=!0}))),v.opacity=C.opacity,v.color=C.color,void 0!==C.emissive&&(v.emissive=C.emissive),v.specular=C.specular,v.shininess=Math.max(C.shininess,1e-4),"pmd"===e.metadata.format){function F(e){return 10===e.length&&null!==e.match(/toon(10|0[0-9]).bmp/)}v.outlineParameters={thickness:1===k.edgeFlag?.003:0,color:new i.default.Color(0,0,0),alpha:1},0===v.outlineParameters.thickness&&(v.outlineParameters.visible=!1);var I=m(V=-1===k.toonIndex?"toon00.bmp":e.toonTextures[k.toonIndex].fileName,{isToonTexture:!0,defaultTexturePath:F(V)});v.gradientMap=g(I,n)}else{var V,O;if(v.outlineParameters={thickness:k.edgeSize/300,color:new i.default.Color(k.edgeColor[0],k.edgeColor[1],k.edgeColor[2]),alpha:k.edgeColor[3]},0!=(16&k.flag)&&0!==v.outlineParameters.thickness||(v.outlineParameters.visible=!1),-1===k.toonIndex||0!==k.toonFlag){var P=k.toonIndex+1;V="toon"+(P<10?"0"+P:P)+".bmp",O=!0}else V=e.textures[k.toonIndex],O=!1;I=m(V,{isToonTexture:!0,defaultTexturePath:O});v.gradientMap=g(I,n)}l.materials.push(v)}if("pmx"===e.metadata.format){function _(e,t){if(8===e.type)for(var r=0;r<t.length;r++){var a=t[r];if(-1!==a.index){var i=l.materials[a.index];i.opacity!==a.diffuse[3]&&(i.transparent=!0)}}}for(A=0;A<e.morphs.length;A++){var S=e.morphs[A],E=S.elements;if(0===S.type)for(w=0;w<E.length;w++){var Q=e.morphs[E[w].index];_(Q,Q.elements)}else _(S,E)}}}(),function(){for(var t=[],r=[],a=0;a<e.metadata.rigidBodyCount;a++){for(var i=e.rigidBodies[a],s=Object.keys(i),n={},l=0;l<s.length;l++){n[d=s[l]]=i[d]}if("pmx"===e.metadata.format&&-1!==n.boneIndex){var u=e.bones[n.boneIndex];n.position[0]-=u.position[0],n.position[1]-=u.position[1],n.position[2]-=u.position[2]}t.push(n)}for(a=0;a<e.metadata.constraintCount;a++){var h=e.constraints[a];for(s=Object.keys(h),n={},l=0;l<s.length;l++){var d;n[d=s[l]]=h[d]}var f=t[n.rigidBodyIndex1],c=t[n.rigidBodyIndex2];0!==f.type&&2===c.type&&-1!==f.boneIndex&&-1!==c.boneIndex&&e.bones[c.boneIndex].parentIndex===f.boneIndex&&(c.type=1),r.push(n)}o.rigidBodies=t,o.constraints=r}(),o.setIndex(new(u.indices.length>65535?i.default.Uint32BufferAttribute:i.default.Uint16BufferAttribute)(u.indices,1)),o.addAttribute("position",new i.default.Float32BufferAttribute(u.vertices,3)),o.addAttribute("normal",new i.default.Float32BufferAttribute(u.normals,3)),o.addAttribute("uv",new i.default.Float32BufferAttribute(u.uvs,2)),o.addAttribute("skinIndex",new i.default.Float32BufferAttribute(u.skinIndices,4)),o.addAttribute("skinWeight",new i.default.Float32BufferAttribute(u.skinWeights,4)),o.computeBoundingSphere(),o.mmdFormat=e.metadata.format,new i.default.SkinnedMesh(o,l)}createAnimation(e,t,r){var a=new n.default;!function(){if(0!==t.metadata.motionCount){for(var o=e.geometry.bones,s=a.createOrderedMotionArrays(o,t.motions,"boneName"),n=[],h=function(e,t,r){e.push(t[r+0]/127),e.push(t[r+8]/127),e.push(t[r+4]/127),e.push(t[r+12]/127)},d=0;d<s.length;d++){for(var f=[],c=[],p=[],m=[],g=[],A=o[d],v=s[d],y=0;y<v.length;y++){var x=v[y].frameNum/30,M=v[y].position,b=v[y].rotation,w=v[y].interpolation;f.push(x);for(var B=0;B<3;B++)c.push(A.pos[B]+M[B]);for(B=0;B<4;B++)p.push(b[B]);for(B=0;B<3;B++)h(m,w,B);h(g,w,3)}if(0!==f.length){var T=".bones["+A.name+"]";n.push(new l.default(T+".position",f,c,m)),n.push(new u.default(T+".quaternion",f,p,g))}}var C=new i.default.AnimationClip(void 0===r?i.default.Math.generateUUID():r,-1,n);null!==C&&(void 0===e.geometry.animations&&(e.geometry.animations=[]),e.geometry.animations.push(C))}}(),function(){if(0!==t.metadata.morphCount){for(var o=a.createOrderedMotionArrays(e.geometry.morphTargets,t.morphs,"morphName"),s=[],n=0;n<o.length;n++){for(var l=[],u=[],h=o[n],d=0;d<h.length;d++)l.push(h[d].frameNum/30),u.push(h[d].weight);0!==l.length&&s.push(new i.default.NumberKeyframeTrack(".morphTargetInfluences["+n+"]",l,u,null))}var f=new i.default.AnimationClip(void 0===r?i.default.Math.generateUUID():r+"Morph",-1,s);null!==f&&(void 0===e.geometry.animations&&(e.geometry.animations=[]),e.geometry.animations.push(f))}}()}}t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(17);t.CCDIKHelper=a.default;var i=r(18);t.default=i.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{toCharcodeStrings(e){for(var t="",r=0;r<e.length;r++)t+="0x"+("0000"+e[r].charCodeAt().toString(16)).substr(-4);return t}createDictionary(e){for(var t={},r=0;r<e.length;r++)t[e[r].name]=r;return t}initializeMotionArrays(e){for(var t=[],r=0;r<e.length;r++)t[r]=[];return t}sortMotionArray(e){e.sort((function(e,t){return e.frameNum-t.frameNum}))}sortMotionArrays(e){for(var t=0;t<e.length;t++)this.sortMotionArray(e[t])}createMotionArray(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t}createMotionArrays(e,t,r,a){for(var i=0;i<e.length;i++){var o=e[i],s=r[o[a]];void 0!==s&&t[s].push(o)}}createOrderedMotionArray(e){var t=this.createMotionArray(e);return this.sortMotionArray(t),t}createOrderedMotionArrays(e,t,r){var a=this.createDictionary(e),i=this.initializeMotionArrays(e);return this.createMotionArrays(t,i,a,r),this.sortMotionArrays(i),i}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),i=r(1);class o extends a.default.NumberKeyframeTrack{constructor(e,t,r,a){super(e,t,r),this.TimeBufferType=Float64Array,this.interpolationParameters=new Float32Array(a)}InterpolantFactoryMethodCubicBezier(e){return new i.default(this.times,this.values,this.getValueSize(),e,this.interpolationParameters)}setInterpolation(e){this.createInterpolant=this.InterpolantFactoryMethodCubicBezier}}t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),i=r(1);class o extends a.default.QuaternionKeyframeTrack{constructor(e,t,r,a){super(e,t,r),this.TimeBufferType=Float64Array,this.interpolationParameters=new Float32Array(a)}InterpolantFactoryMethodCubicBezier(e){return new i.default(this.times,this.values,this.getValueSize(),e,this.interpolationParameters)}setInterpolation(e){this.createInterpolant=this.InterpolantFactoryMethodCubicBezier}}t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),i=r(1);class o extends a.default.VectorKeyframeTrack{constructor(e,t,r,a){super(e,t,r),this.TimeBufferType=Float64Array,this.interpolationParameters=new Float32Array(a)}InterpolantFactoryMethodCubicBezier(e){return new i.default(this.times,this.values,this.getValueSize(),e,this.interpolationParameters)}setInterpolation(e){this.createInterpolant=this.InterpolantFactoryMethodCubicBezier}}t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(4);t.default=class{constructor(e,t,r,a,i,o){this.mesh=e,this.world=t,this.bodyA=r,this.bodyB=a,this.params=i,this.helper=o,this.constraint=null,this.init()}init(){var e=this.helper,t=this.params,r=this.bodyA,i=this.bodyB,o=e.allocTransform();e.setIdentity(o),e.setOriginFromArray3(o,t.position),e.setBasisFromArray3(o,t.rotation);var s=e.allocTransform(),n=e.allocTransform();r.body.getMotionState().getWorldTransform(s),i.body.getMotionState().getWorldTransform(n);var l=e.inverseTransform(s),u=e.inverseTransform(n),h=e.multiplyTransforms(l,o),d=e.multiplyTransforms(u,o),f=new a.btGeneric6DofSpringConstraint(r.body,i.body,h,d,!0),c=e.allocVector3(),p=e.allocVector3(),m=e.allocVector3(),g=e.allocVector3();c.setValue(t.translationLimitation1[0],t.translationLimitation1[1],t.translationLimitation1[2]),p.setValue(t.translationLimitation2[0],t.translationLimitation2[1],t.translationLimitation2[2]),m.setValue(t.rotationLimitation1[0],t.rotationLimitation1[1],t.rotationLimitation1[2]),g.setValue(t.rotationLimitation2[0],t.rotationLimitation2[1],t.rotationLimitation2[2]),f.setLinearLowerLimit(c),f.setLinearUpperLimit(p),f.setAngularLowerLimit(m),f.setAngularUpperLimit(g);for(var A=0;A<3;A++)0!==t.springPosition[A]&&(f.enableSpring(A,!0),f.setStiffness(A,t.springPosition[A]));for(A=0;A<3;A++)0!==t.springRotation[A]&&(f.enableSpring(A+3,!0),f.setStiffness(A+3,t.springRotation[A]));if(void 0!==f.setParam)for(A=0;A<6;A++)f.setParam(2,.475,A);this.world.addConstraint(f,!0),this.constraint=f,e.freeTransform(o),e.freeTransform(s),e.freeTransform(n),e.freeTransform(l),e.freeTransform(u),e.freeTransform(h),e.freeTransform(d),e.freeVector3(c),e.freeVector3(p),e.freeVector3(m),e.freeVector3(g)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),i=r(4);t.default=class{constructor(){this.threeVector3s=[],this.threeMatrix4s=[],this.threeQuaternions=[],this.threeEulers=[],this.transforms=[],this.quaternions=[],this.vector3s=[]}allocThreeVector3(){return this.threeVector3s.length>0?this.threeVector3s.pop():new a.default.Vector3}freeThreeVector3(e){this.threeVector3s.push(e)}allocThreeMatrix4(){return this.threeMatrix4s.length>0?this.threeMatrix4s.pop():new a.default.Matrix4}freeThreeMatrix4(e){this.threeMatrix4s.push(e)}allocThreeQuaternion(){return this.threeQuaternions.length>0?this.threeQuaternions.pop():new a.default.Quaternion}freeThreeQuaternion(e){this.threeQuaternions.push(e)}allocThreeEuler(){return this.threeEulers.length>0?this.threeEulers.pop():new a.default.Euler}freeThreeEuler(e){this.threeEulers.push(e)}allocTransform(){return this.transforms.length>0?this.transforms.pop():new i.btTransform}freeTransform(e){this.transforms.push(e)}allocQuaternion(){return this.quaternions.length>0?this.quaternions.pop():new i.btQuaternion}freeQuaternion(e){this.quaternions.push(e)}allocVector3(){return this.vector3s.length>0?this.vector3s.pop():new i.btVector3}freeVector3(e){this.vector3s.push(e)}setIdentity(e){e.setIdentity()}getBasis(e){var t=this.allocQuaternion();return e.getBasis().getRotation(t),t}getBasisAsMatrix3(e){var t=this.getBasis(e),r=this.quaternionToMatrix3(t);return this.freeQuaternion(t),r}getOrigin(e){return e.getOrigin()}setOrigin(e,t){e.getOrigin().setValue(t.x(),t.y(),t.z())}copyOrigin(e,t){var r=t.getOrigin();this.setOrigin(e,r)}setBasis(e,t){e.setRotation(t)}setBasisFromMatrix3(e,t){var r=this.matrix3ToQuaternion(t);this.setBasis(e,r),this.freeQuaternion(r)}setOriginFromArray3(e,t){e.getOrigin().setValue(t[0],t[1],t[2])}setBasisFromArray3(e,t){var r=this.allocThreeQuaternion(),a=this.allocThreeEuler();a.set(t[0],t[1],t[2]),this.setBasisFromArray4(e,r.setFromEuler(a).toArray()),this.freeThreeEuler(a),this.freeThreeQuaternion(r)}setBasisFromArray4(e,t){var r=this.array4ToQuaternion(t);this.setBasis(e,r),this.freeQuaternion(r)}array4ToQuaternion(e){var t=this.allocQuaternion();return t.setX(e[0]),t.setY(e[1]),t.setZ(e[2]),t.setW(e[3]),t}multiplyTransforms(e,t){var r=this.allocTransform();this.setIdentity(r);var a=this.getBasisAsMatrix3(e),i=this.getBasisAsMatrix3(t),o=this.getOrigin(e),s=this.getOrigin(t),n=this.multiplyMatrix3ByVector3(a,s),l=this.addVector3(n,o);this.setOrigin(r,l);var u=this.multiplyMatrices3(a,i);return this.setBasisFromMatrix3(r,u),this.freeVector3(n),this.freeVector3(l),r}inverseTransform(e){var t=this.allocTransform(),r=this.getBasisAsMatrix3(e),a=this.getOrigin(e),i=this.transposeMatrix3(r),o=this.negativeVector3(a),s=this.multiplyMatrix3ByVector3(i,o);return this.setOrigin(t,s),this.setBasisFromMatrix3(t,i),this.freeVector3(o),this.freeVector3(s),t}multiplyMatrices3(e,t){var r=[],a=this.rowOfMatrix3(e,0),i=this.rowOfMatrix3(e,1),o=this.rowOfMatrix3(e,2),s=this.columnOfMatrix3(t,0),n=this.columnOfMatrix3(t,1),l=this.columnOfMatrix3(t,2);return r[0]=this.dotVectors3(a,s),r[1]=this.dotVectors3(a,n),r[2]=this.dotVectors3(a,l),r[3]=this.dotVectors3(i,s),r[4]=this.dotVectors3(i,n),r[5]=this.dotVectors3(i,l),r[6]=this.dotVectors3(o,s),r[7]=this.dotVectors3(o,n),r[8]=this.dotVectors3(o,l),this.freeVector3(a),this.freeVector3(i),this.freeVector3(o),this.freeVector3(s),this.freeVector3(n),this.freeVector3(l),r}addVector3(e,t){var r=this.allocVector3();return r.setValue(e.x()+t.x(),e.y()+t.y(),e.z()+t.z()),r}dotVectors3(e,t){return e.x()*t.x()+e.y()*t.y()+e.z()*t.z()}rowOfMatrix3(e,t){var r=this.allocVector3();return r.setValue(e[3*t+0],e[3*t+1],e[3*t+2]),r}columnOfMatrix3(e,t){var r=this.allocVector3();return r.setValue(e[t+0],e[t+3],e[t+6]),r}negativeVector3(e){var t=this.allocVector3();return t.setValue(-e.x(),-e.y(),-e.z()),t}multiplyMatrix3ByVector3(e,t){var r=this.allocVector3(),a=this.rowOfMatrix3(e,0),i=this.rowOfMatrix3(e,1),o=this.rowOfMatrix3(e,2),s=this.dotVectors3(a,t),n=this.dotVectors3(i,t),l=this.dotVectors3(o,t);return r.setValue(s,n,l),this.freeVector3(a),this.freeVector3(i),this.freeVector3(o),r}transposeMatrix3(e){var t=[];return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t}quaternionToMatrix3(e){var t=[],r=e.x(),a=e.y(),i=e.z(),o=e.w(),s=r*r,n=a*a,l=i*i,u=r*a,h=a*i,d=i*r,f=r*o,c=a*o,p=i*o;return t[0]=1-2*(n+l),t[1]=2*(u-p),t[2]=2*(d+c),t[3]=2*(u+p),t[4]=1-2*(l+s),t[5]=2*(h-f),t[6]=2*(d-c),t[7]=2*(h+f),t[8]=1-2*(s+n),t}matrix3ToQuaternion(e){var t,r,a,i,o,s=e[0]+e[4]+e[8];s>0?(o=.25*(t=2*Math.sqrt(s+1)),r=(e[7]-e[5])/t,a=(e[2]-e[6])/t,i=(e[3]-e[1])/t):e[0]>e[4]&&e[0]>e[8]?(t=2*Math.sqrt(1+e[0]-e[4]-e[8]),o=(e[7]-e[5])/t,r=.25*t,a=(e[1]+e[3])/t,i=(e[2]+e[6])/t):e[4]>e[8]?(t=2*Math.sqrt(1+e[4]-e[0]-e[8]),o=(e[2]-e[6])/t,r=(e[1]+e[3])/t,a=.25*t,i=(e[5]+e[7])/t):(t=2*Math.sqrt(1+e[8]-e[0]-e[4]),o=(e[3]-e[1])/t,r=(e[2]+e[6])/t,a=(e[5]+e[7])/t,i=.25*t);var n=this.allocQuaternion();return n.setX(r),n.setY(a),n.setZ(i),n.setW(o),n}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(4);t.default=class{constructor(e,t,r,a){this.mesh=e,this.world=t,this.params=r,this.helper=a,this.body=null,this.bone=null,this.boneOffsetForm=null,this.boneOffsetFormInverse=null,this.init()}init(){var e=this.helper,t=this.params,r=this.mesh.skeleton.bones,i=-1===t.boneIndex?new THREE.Bone:r[t.boneIndex],o=function(e){switch(e.shapeType){case 0:return new a.btSphereShape(e.width);case 1:return new a.btBoxShape(new a.btVector3(e.width,e.height,e.depth));case 2:return new a.btCapsuleShape(e.width,e.height);default:throw"unknown shape type "+e.shapeType}}(t),s=0===t.type?0:t.weight,n=e.allocVector3();n.setValue(0,0,0),0!==s&&o.calculateLocalInertia(s,n);var l=e.allocTransform();e.setIdentity(l),e.setOriginFromArray3(l,t.position),e.setBasisFromArray3(l,t.rotation);var u=e.allocTransform();e.setIdentity(u),e.setOriginFromArray3(u,i.getWorldPosition().toArray());var h=e.multiplyTransforms(u,l),d=new a.btDefaultMotionState(h),f=new a.btRigidBodyConstructionInfo(s,d,o,n);f.set_m_friction(t.friction),f.set_m_restitution(t.restitution);var c=new a.btRigidBody(f);0===t.type&&(c.setCollisionFlags(2|c.getCollisionFlags()),c.setActivationState(4)),c.setDamping(t.positionDamping,t.rotationDamping),c.setSleepingThresholds(0,0),this.world.addRigidBody(c,1<<t.groupIndex,t.groupTarget),this.body=c,this.bone=i,this.boneOffsetForm=l,this.boneOffsetFormInverse=e.inverseTransform(l),e.freeVector3(n),e.freeTransform(h),e.freeTransform(u)}reset(){this.setTransformFromBone()}updateFromBone(){-1!==this.params.boneIndex&&0===this.params.type&&this.setTransformFromBone()}updateBone(){0!==this.params.type&&-1!==this.params.boneIndex&&(this.updateBoneRotation(),1===this.params.type&&this.updateBonePosition(),this.bone.updateMatrixWorld(!0),2===this.params.type&&this.setPositionFromBone())}getBoneTransform(){var e=this.helper,t=this.bone.getWorldPosition(),r=this.bone.getWorldQuaternion(),a=e.allocTransform();e.setOriginFromArray3(a,t.toArray()),e.setBasisFromArray4(a,r.toArray());var i=e.multiplyTransforms(a,this.boneOffsetForm);return e.freeTransform(a),i}getWorldTransformForBone(){var e=this.helper,t=e.allocTransform();this.body.getMotionState().getWorldTransform(t);var r=e.multiplyTransforms(t,this.boneOffsetFormInverse);return e.freeTransform(t),r}setTransformFromBone(){var e=this.helper,t=this.getBoneTransform();this.body.setCenterOfMassTransform(t),this.body.getMotionState().setWorldTransform(t),e.freeTransform(t)}setPositionFromBone(){var e=this.helper,t=this.getBoneTransform(),r=e.allocTransform();this.body.getMotionState().getWorldTransform(r),e.copyOrigin(r,t),this.body.setCenterOfMassTransform(r),this.body.getMotionState().setWorldTransform(r),e.freeTransform(r),e.freeTransform(t)}updateBoneRotation(){this.bone.updateMatrixWorld(!0);var e=this.helper,t=this.getWorldTransformForBone(),r=e.getBasis(t),a=e.allocThreeQuaternion(),i=e.allocThreeQuaternion(),o=e.allocThreeQuaternion();a.set(r.x(),r.y(),r.z(),r.w()),i.setFromRotationMatrix(this.bone.matrixWorld),i.conjugate(),i.multiply(a),o.setFromRotationMatrix(this.bone.matrix),this.bone.quaternion.copy(i.multiply(o)),e.freeThreeQuaternion(a),e.freeThreeQuaternion(i),e.freeThreeQuaternion(o),e.freeQuaternion(r),e.freeTransform(t)}updateBonePosition(){var e=this.helper,t=this.getWorldTransformForBone(),r=e.allocThreeVector3(),a=e.getOrigin(t);r.set(a.x(),a.y(),a.z());var i=this.bone.worldToLocal(r);this.bone.position.add(i),e.freeThreeVector3(r),e.freeTransform(t)}}},function(e,t){e.exports=require("three")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);class i extends a.default.Object3D{constructor(e){if(super(),void 0===e.geometry.iks||void 0===e.skeleton)throw"THREE.CCDIKHelper requires iks in mesh.geometry and skeleton in mesh.";a.default.Object3D.call(this),this.root=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.sphereGeometry=new a.default.SphereBufferGeometry(.25,16,8),this.targetSphereMaterial=new a.default.MeshBasicMaterial({color:new a.default.Color(16746632),depthTest:!1,depthWrite:!1,transparent:!0}),this.effectorSphereMaterial=new a.default.MeshBasicMaterial({color:new a.default.Color(8978312),depthTest:!1,depthWrite:!1,transparent:!0}),this.linkSphereMaterial=new a.default.MeshBasicMaterial({color:new a.default.Color(8947967),depthTest:!1,depthWrite:!1,transparent:!0}),this.lineMaterial=new a.default.LineBasicMaterial({color:new a.default.Color(16711680),depthTest:!1,depthWrite:!1,transparent:!0}),this._init(),this.update()}_init(){var e=this,t=this.root.geometry.iks;function r(t){return new a.default.Line(function(e){var t=new a.default.BufferGeometry,r=new Float32Array(3*(2+e.links.length));return t.addAttribute("position",new a.default.BufferAttribute(r,3)),t}(t),e.lineMaterial)}for(var i=0,o=t.length;i<o;i++){var s=t[i];this.add(new a.default.Mesh(e.sphereGeometry,e.targetSphereMaterial)),this.add(new a.default.Mesh(e.sphereGeometry,e.effectorSphereMaterial));for(var n=0,l=s.links.length;n<l;n++)this.add(new a.default.Mesh(e.sphereGeometry,e.linkSphereMaterial));this.add(r(s))}}update(){var e=0,t=this.root,r=t.geometry.iks,i=t.skeleton.bones,o=(new a.default.Matrix4).getInverse(t.matrixWorld),s=new a.default.Vector3;function n(e){return s.setFromMatrixPosition(e.matrixWorld),s.applyMatrix4(o),s}function l(e,t,r){var a=n(r);e[3*t+0]=a.x,e[3*t+1]=a.y,e[3*t+2]=a.z}for(var u=0,h=r.length;u<h;u++){var d=r[u],f=i[d.target],c=i[d.effector],p=this.children[e++],m=this.children[e++];p.position.copy(n(f)),m.position.copy(n(c));for(var g=0,A=d.links.length;g<A;g++){var v=i[d.links[g].index];this.children[e++].position.copy(n(v))}var y=this.children[e++],x=y.geometry.attributes.position.array;l(x,0,f),l(x,1,c);for(g=0,A=d.links.length;g<A;g++){l(x,g+2,v=i[d.links[g].index])}y.geometry.attributes.position.needsUpdate=!0}}}t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);t.default=class{constructor(e){this.mesh=e,this._valid()}_valid(){for(var e=this.mesh.geometry.iks,t=this.mesh.skeleton.bones,r=0,a=e.length;r<a;r++){var i,o,s=e[r],n=t[s.effector],l=s.links;i=n;for(var u=0,h=l.length;u<h;u++)o=t[l[u].index],i.parent!==o&&console.warn("THREE.CCDIKSolver: bone "+i.name+" is not the child of bone "+o.name),i=o}}_saveOriginalBonesInfo(){for(var e=this.mesh.skeleton.bones,t=0,r=e.length;t<r;t++){var a=e[t];void 0===a.userData.ik&&(a.userData.ik={}),a.userData.ik.originalMatrix=a.matrix.toArray()}}update(e){var t=new a.default.Quaternion,r=new a.default.Vector3,i=new a.default.Vector3,o=new a.default.Vector3,s=new a.default.Vector3,n=new a.default.Vector3,l=new a.default.Quaternion,u=new a.default.Vector3,h=new a.default.Vector3,d=this.mesh.skeleton.bones,f=this.mesh.geometry.iks,c=(this.mesh.geometry.bones,Math);this.mesh.updateMatrixWorld(!0),!0===e&&this._saveOriginalBonesInfo();for(var p=0,m=f.length;p<m;p++){var g=f[p],A=d[g.effector],v=d[g.target];r.setFromMatrixPosition(v.matrixWorld);for(var y=g.links,x=void 0!==g.iteration?g.iteration:1,M=0;M<x;M++){for(var b=!1,w=0,B=y.length;w<B;w++){var T=d[y[w].index];if(!1===y[w].enabled)break;var C=y[w].limitation;T.matrixWorld.decompose(n,l,u),l.inverse(),o.setFromMatrixPosition(A.matrixWorld),s.subVectors(o,n),s.applyQuaternion(l),s.normalize(),i.subVectors(r,n),i.applyQuaternion(l),i.normalize();var k=i.dot(s);if(k>1?k=1:k<-1&&(k=-1),!((k=c.acos(k))<1e-5)){if(void 0!==g.minAngle&&k<g.minAngle&&(k=g.minAngle),void 0!==g.maxAngle&&k>g.maxAngle&&(k=g.maxAngle),h.crossVectors(s,i),h.normalize(),t.setFromAxisAngle(h,k),T.quaternion.multiply(t),void 0!==C){var I=T.quaternion.w;I>1&&(I=1);var V=c.sqrt(1-I*I);T.quaternion.set(C.x*V,C.y*V,C.z*V,I)}T.updateMatrixWorld(!0),b=!0}}if(!b)break}}this.mesh.updateMatrixWorld(!0)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(4),i=r(15);t.RigidBody=i.default;const o=r(13);t.Constraint=o.default;const s=r(14);t.ResourceHelper=s.default;t.default=class{constructor(e,t={}){this.mesh=e,this.helper=new s.default,this.unitStep=void 0!==t.unitStep?t.unitStep:1/65,this.maxStepNum=void 0!==t.maxStepNum?t.maxStepNum:3,this.world=void 0!==t.world?t.world:null,this.bodies=[],this.constraints=[],this.init(e)}init(e){const t=e.parent;null!==t&&t.remove(e);const r=e.position.clone(),a=e.rotation.clone(),i=e.scale.clone();e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1),e.updateMatrixWorld(!0),null===this.world&&this.initWorld(),this.initRigidBodies(),this.initConstraints(),null!==t&&t.add(e),e.position.copy(r),e.rotation.copy(a),e.scale.copy(i),e.updateMatrixWorld(!0),this.reset()}initWorld(){var e=new a.btDefaultCollisionConfiguration,t=new a.btCollisionDispatcher(e),r=new a.btDbvtBroadphase,i=new a.btSequentialImpulseConstraintSolver,o=new a.btDiscreteDynamicsWorld(t,r,i,e);o.setGravity(new a.btVector3(0,-98,0)),this.world=o}initRigidBodies(){for(var e=this.mesh.geometry.rigidBodies,t=0;t<e.length;t++){var r=new i.default(this.mesh,this.world,e[t],this.helper);this.bodies.push(r)}}initConstraints(){for(var e=this.mesh.geometry.constraints,t=0;t<e.length;t++){var r=e[t],a=this.bodies[r.rigidBodyIndex1],i=this.bodies[r.rigidBodyIndex2],s=new o.default(this.mesh,this.world,a,i,r,this.helper);this.constraints.push(s)}}update(e){this.updateRigidBodies(),this.stepSimulation(e),this.updateBones()}stepSimulation(e){var t=this.unitStep,r=e,a=1+(e/t|0);r<t&&(r=t,a=1),a>this.maxStepNum&&(a=this.maxStepNum),this.world.stepSimulation(r,a,t)}updateRigidBodies(){for(var e=0;e<this.bodies.length;e++)this.bodies[e].updateFromBone()}updateBones(){for(var e=0;e<this.bodies.length;e++)this.bodies[e].updateBone()}reset(){for(var e=0;e<this.bodies.length;e++)this.bodies[e].reset()}warmup(e){for(var t=0;t<e;t++)this.update(1/60)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);class i extends a.default.Object3D{constructor(e){if(super(),void 0===e.physics||void 0===e.geometry.rigidBodies)throw"THREE.MMDPhysicsHelper requires physics in mesh and rigidBodies in mesh.geometry.";this.root=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.materials=[],this.materials.push(new a.default.MeshBasicMaterial({color:new a.default.Color(16746632),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this.materials.push(new a.default.MeshBasicMaterial({color:new a.default.Color(8978312),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this.materials.push(new a.default.MeshBasicMaterial({color:new a.default.Color(8947967),wireframe:!0,depthTest:!1,depthWrite:!1,opacity:.25,transparent:!0})),this._init(),this.update()}_init(){for(var e=this.root.geometry.rigidBodies,t=0,r=e.length;t<r;t++){var i=e[t];this.add(new a.default.Mesh(this._createGeometry(i),this.materials[i.type]))}}_createGeometry(e){switch(e.shapeType){case 0:return new a.default.SphereBufferGeometry(e.width,16,8);case 1:return new a.default.BoxBufferGeometry(2*e.width,2*e.height,2*e.depth,8,8,8);case 2:return this._createCapsuleGeometry(e.width,e.height,16,8);default:return null}}_createCapsuleGeometry(e,t,r,i){var o=new a.default.CylinderBufferGeometry(e,e,t,r,i,!0),s=new a.default.Mesh(new a.default.SphereBufferGeometry(e,r,i,0,2*Math.PI,0,Math.PI/2)),n=new a.default.Mesh(new a.default.SphereBufferGeometry(e,r,i,0,2*Math.PI,Math.PI/2,Math.PI/2));return s.position.set(0,t/2,0),n.position.set(0,-t/2,0),s.updateMatrix(),n.updateMatrix(),o.merge(s.geometry,s.matrix),o.merge(n.geometry,n.matrix),o}update(){var e,t,r=(f=this.root).geometry.rigidBodies,i=f.physics.bodies,o=(new a.default.Matrix4).getInverse(f.matrixWorld),s=new a.default.Vector3,n=new a.default.Quaternion,l=new a.default.Quaternion;for(var u=0,h=r.length;u<h;u++){var d=i[u].body,f=this.children[u],c=d.getCenterOfMassTransform();f.position.copy((t=c.getOrigin(),s.set(t.x(),t.y(),t.z()),s.applyMatrix4(o),s)),f.quaternion.copy((e=c.getRotation(),n.set(e.x(),e.y(),e.z(),e.w()),l.setFromRotationMatrix(o),l.multiply(n),l))}}}t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(16);t.default=class{constructor(e){this.manager=void 0!==e?e:a.DefaultLoadingManager}load(e,t,r,i){var o=new a.Texture,s=new a.FileLoader(this.manager);return s.setResponseType("arraybuffer"),s.load(e,(e=>{o.image=this.parse(e),o.needsUpdate=!0,void 0!==t&&t(o)}),r,i),o}parse(e){var t=0,r=1,a=2,i=3,o=9,s=10,n=11,l=48,u=4,h=0,d=1,f=2,c=3;e.length<19&&console.error("TGALoader: Not enough data to contain header.");var p=new Uint8Array(e),m=0,g={id_length:p[m++],colormap_type:p[m++],image_type:p[m++],colormap_index:p[m++]|p[m++]<<8,colormap_length:p[m++]|p[m++]<<8,colormap_size:p[m++],origin:[p[m++]|p[m++]<<8,p[m++]|p[m++]<<8],width:p[m++]|p[m++]<<8,height:p[m++]|p[m++]<<8,pixel_size:p[m++],flags:p[m++]};!function(e){switch(e.image_type){case r:case o:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("TGALoader: Invalid type colormap data for indexed type.");break;case a:case i:case s:case n:e.colormap_type&&console.error("TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("TGALoader: No data.");default:console.error('TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('TGALoader: Invalid pixel size "%s".',e.pixel_size)}(g),g.id_length+m>e.length&&console.error("TGALoader: No data."),m+=g.id_length;var A=!1,v=!1,y=!1;switch(g.image_type){case o:A=!0,v=!0;break;case r:v=!0;break;case s:A=!0;break;case a:break;case n:A=!0,y=!0;break;case i:y=!0}var x=document.createElement("canvas");x.width=g.width,x.height=g.height;var M=x.getContext("2d"),b=M.createImageData(g.width,g.height),w=function(e,t,r,a,i){var o,s,n,l;if(s=r.pixel_size>>3,n=r.width*r.height*s,t&&(l=i.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,h,d;o=new Uint8Array(n);for(var f=0,c=new Uint8Array(s);f<n;)if(h=1+(127&(u=i[a++])),128&u){for(d=0;d<s;++d)c[d]=i[a++];for(d=0;d<h;++d)o.set(c,f+d*s);f+=s*h}else{for(h*=s,d=0;d<h;++d)o[f+d]=i[a++];f+=h}}else o=i.subarray(a,a+=t?r.width*r.height:n);return{pixel_data:o,palettes:l}}(A,v,g,m,p);!function(e,t,r,a,i){var o,s,n,p,m,A;switch((g.flags&l)>>u){default:case f:o=0,n=1,m=t,s=0,p=1,A=r;break;case h:o=0,n=1,m=t,s=r-1,p=-1,A=-1;break;case c:o=t-1,n=-1,m=-1,s=0,p=1,A=r;break;case d:o=t-1,n=-1,m=-1,s=r-1,p=-1,A=-1}if(y)switch(g.pixel_size){case 8:!function(e,t,r,a,i,o,s,n){var l,u,h,d=0,f=g.width;for(h=t;h!==a;h+=r)for(u=i;u!==s;u+=o,d++)l=n[d],e[4*(u+f*h)+0]=l,e[4*(u+f*h)+1]=l,e[4*(u+f*h)+2]=l,e[4*(u+f*h)+3]=255}(e,s,p,A,o,n,m,a);break;case 16:!function(e,t,r,a,i,o,s,n){var l,u,h=0,d=g.width;for(u=t;u!==a;u+=r)for(l=i;l!==s;l+=o,h+=2)e[4*(l+d*u)+0]=n[h+0],e[4*(l+d*u)+1]=n[h+0],e[4*(l+d*u)+2]=n[h+0],e[4*(l+d*u)+3]=n[h+1]}(e,s,p,A,o,n,m,a);break;default:console.error("TGALoader: Format not supported.")}else switch(g.pixel_size){case 8:!function(e,t,r,a,i,o,s,n,l){var u,h,d,f=l,c=0,p=g.width;for(d=t;d!==a;d+=r)for(h=i;h!==s;h+=o,c++)u=n[c],e[4*(h+p*d)+3]=255,e[4*(h+p*d)+2]=f[3*u+0],e[4*(h+p*d)+1]=f[3*u+1],e[4*(h+p*d)+0]=f[3*u+2]}(e,s,p,A,o,n,m,a,i);break;case 16:!function(e,t,r,a,i,o,s,n){var l,u,h,d=0,f=g.width;for(h=t;h!==a;h+=r)for(u=i;u!==s;u+=o,d+=2)l=n[d+0]+(n[d+1]<<8),e[4*(u+f*h)+0]=(31744&l)>>7,e[4*(u+f*h)+1]=(992&l)>>2,e[4*(u+f*h)+2]=(31&l)>>3,e[4*(u+f*h)+3]=32768&l?0:255}(e,s,p,A,o,n,m,a);break;case 24:!function(e,t,r,a,i,o,s,n){var l,u,h=0,d=g.width;for(u=t;u!==a;u+=r)for(l=i;l!==s;l+=o,h+=3)e[4*(l+d*u)+3]=255,e[4*(l+d*u)+2]=n[h+0],e[4*(l+d*u)+1]=n[h+1],e[4*(l+d*u)+0]=n[h+2]}(e,s,p,A,o,n,m,a);break;case 32:!function(e,t,r,a,i,o,s,n){var l,u,h=0,d=g.width;for(u=t;u!==a;u+=r)for(l=i;l!==s;l+=o,h+=4)e[4*(l+d*u)+2]=n[h+0],e[4*(l+d*u)+1]=n[h+1],e[4*(l+d*u)+0]=n[h+2],e[4*(l+d*u)+3]=n[h+3]}(e,s,p,A,o,n,m,a);break;default:console.error("TGALoader: Format not supported.")}}(b.data,g.width,g.height,w.pixel_data,w.palettes);return M.putImageData(b,0,0),x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(7),i=r(5),o=r(2),s=r(6),n=r(3);var l=r(7);t.MMDLoader=l.default;var u=r(5);t.MMDAudioManager=u.default;var h=r(2);t.MMDGrantSolver=h.default;var d=r(6);t.MMDHelper=d.default;var f=r(9);t.DataCreationHelper=f.default;var c=r(12);t.VectorKeyframeTrackEx=c.default;var p=r(11);t.QuaternionKeyframeTrackEx=p.default;var m=r(10);t.NumberKeyframeTrackEx=m.default;var g=r(1);t.CubicBezierInterpolation=g.default;var A=r(3);t.MMDPhysics=A.default;var v=r(8);t.CCDIKSolver=v.default,t.mixin=e=>{e.MMDLoader=a.default,e.MMDAudioManager=i.default,e.MMDGrantSolver=o.default,e.MMDHelper=s.default,e.MMDPhysics=n.default,e.CCDIKSolver=CCDIKSolver}},function(e,t){e.exports=require("mmd-parser")}]);
|
|
//# sourceMappingURL=/sm/0dfc3f9662b95de68fc05aa4d0c277f2d3b083f59718cf8aae38fbe50195f52c.map
|