minecraft-renderer 0.1.32 → 0.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/threeWorker.js
CHANGED
|
@@ -7767,7 +7767,7 @@ void main() {
|
|
|
7767
7767
|
}`;function vFe(i){let e=document.createElement("style");e.innerHTML=i;let t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}var L5e=!1,BM=class i{constructor({parent:e,autoPlace:t=e===void 0,container:n,width:r,title:s="Controls",closeFolders:a=!1,injectStyles:o=!0,touchStyles:l=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",c=>{(c.code==="Enter"||c.code==="Space")&&(c.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),l&&this.domElement.classList.add("allow-touch-styles"),!L5e&&o&&(vFe(mFe),L5e=!0),n?n.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this._closeFolders=a}add(e,t,n,r,s){if(Object(n)===n)return new IM(this,e,t,n);let a=e[t];switch(typeof a){case"number":return new PM(this,e,t,n,r,s);case"boolean":return new RM(this,e,t);case"string":return new LM(this,e,t);case"function":return new bp(this,e,t)}console.error(`gui.add failed
|
|
7768
7768
|
property:`,t,`
|
|
7769
7769
|
object:`,e,`
|
|
7770
|
-
value:`,a)}addColor(e,t,n=1){return new CM(this,e,t,n)}addFolder(e){let t=new i({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(n=>{n instanceof bp||n._name in e.controllers&&n.load(e.controllers[n._name])}),t&&e.folders&&this.folders.forEach(n=>{n._title in e.folders&&n.load(e.folders[n._title])}),this}save(e=!0){let t={controllers:{},folders:{}};return this.controllers.forEach(n=>{if(!(n instanceof bp)){if(n._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${n._name}"`);t.controllers[n._name]=n.save()}}),e&&this.folders.forEach(n=>{if(n._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${n._title}"`);t.folders[n._title]=n.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");let n=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",n))};this.$children.addEventListener("transitionend",n);let r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=r+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(n=>n.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}},NM=BM;var $o=class{gui=null;storageKey="";target;params=[];paramsMeta={};_visible=!1;initialValues={};initialized=!1;constructor(e,t,n,r){if(!Gn){this.gui=new NM,this.storageKey=`debug_params_${e}`,this.target=t,this.paramsMeta=r??{},this.params=n??Object.keys(t);for(let s of this.params)this.initialValues[s]=t[s];this.gui.domElement.style.display="none"}}activate(){return Gn?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return Gn?!1:this._visible}set visible(e){Gn||!this.gui||(this._visible=e,this.gui.domElement.style.display=e?"block":"none",this.saveVisibility())}loadSavedValues(){if(!Gn)try{let e=localStorage.getItem(this.storageKey);if(e){let t=JSON.parse(e);for(let n of this.params)if(n in t){let r=t[n];r!==null&&(this.target[n]=r)}}}catch(e){console.warn("Failed to load debug values:",e)}}saveValues(e=!1){if(!Gn)try{let t={};for(let n of this.params)t[n]=this.target[n];e?localStorage.removeItem(this.storageKey):localStorage.setItem(this.storageKey,JSON.stringify(t))}catch(t){console.warn("Failed to save debug values:",t)}}saveVisibility(){if(!Gn)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch(e){console.warn("Failed to save debug visibility:",e)}}setupControls(){if(!(Gn||!this.gui)){this.gui.add(this,"visible").name("Show Controls"),this.gui.add({resetAll:()=>{if(this.gui){for(let e of this.params)this.target[e]=this.initialValues[e];this.saveValues(!0),this.gui.destroy(),this.gui=new NM,this.setupControls()}}},"resetAll").name("Reset All Parameters");for(let e of this.params){let t=this.target[e],n=this.paramsMeta[e]??{};if(typeof t=="number"){let r=n.min??t-Math.abs(t*2),s=n.max??t+Math.abs(t*2),a=n.step??Math.abs(t)/100;this.gui.add(this.target,e,r,s,a).onChange(()=>this.saveValues())}else if(typeof t=="boolean")this.gui.add(this.target,e).onChange(()=>this.saveValues());else if(typeof t=="string"&&["x","y","z"].includes(e)){let r=n.min??-10,s=n.max??10,a=n.step??.1;this.gui.add(this.target,e,r,s,a).onChange(()=>this.saveValues())}else Array.isArray(t)&&this.gui.add(this.target,e,t).onChange(()=>this.saveValues())}}}save(){Gn||(this.saveValues(),this.saveVisibility())}destroy(){Gn||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};h();p();d();h();p();d();var Y7=class{currentAnimation=null;isAnimating=!1;cancelRequested=!1;completionCallbacks=[];currentCancelCallback=null;async startAnimation(e,t){return this.isAnimating&&await this.cancelCurrentAnimation(),new Promise(n=>{this.isAnimating=!0,this.cancelRequested=!1,this.currentCancelCallback=t??null,this.currentAnimation=e(),this.completionCallbacks.push(()=>{this.isAnimating=!1,this.currentAnimation=null,n()})})}async cancelCurrentAnimation(){if(this.isAnimating){if(this.currentCancelCallback){let e=this.currentCancelCallback;this.currentCancelCallback=null,e()}return new Promise(e=>{this.cancelRequested=!0,this.completionCallbacks.push(()=>{e()})})}}animationCycleFinish(){this.cancelRequested&&this.forceFinish()}forceFinish(e=!0){if(!this.isAnimating)return;if(this.currentAnimation){for(let n of this.currentAnimation.getAll())n.stop();this.currentAnimation.removeAll(),this.currentAnimation=null}this.isAnimating=!1,this.cancelRequested=!1;let t=[...this.completionCallbacks];if(this.completionCallbacks=[],e)for(let n of t)n()}update(){this.currentAnimation&&this.currentAnimation.update()}get isActive(){return this.isAnimating}get shouldCancel(){return this.cancelRequested}};var gFe={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},nu=class{constructor(e,t,n){this.getState=e;this.setState=t;this.speeds={...gFe},n&&Object.assign(this.speeds,n),this.defaultState=this.getState()}animationController=new Y7;defaultState;speeds;currentStateName="";transitioningToStateName="";calculateDuration(e){let t=0,n=this.getState();for(let[r,s]of Object.entries(e)){let a=n[r],o=Math.abs(s-a),l=this.getPropertySpeed(r),c=o/l*1e3;t=Math.max(t,c)}return Math.min(Math.max(t,200),2e3)}getPropertySpeed(e){return e in this.speeds?this.speeds[e]:e.toLowerCase().includes("rotation")?this.speeds.rotation:e.toLowerCase().includes("scale")?this.speeds.scale:e.toLowerCase()==="x"||e.toLowerCase()==="y"||e.toLowerCase()==="z"?this.speeds[e]:this.speeds.default}startTransition(e,t,n,r=ar.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=t??"";let a=this.getState(),o=this.calculateDuration(e);this.animationController.startAnimation(()=>{let l=new ih;return new gr(a,l).to(e,o).easing(r).onUpdate(c=>{for(let u of Object.keys(c))this.setState(u,c[u])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",n?.()}).start(),l},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(e,t,n,r){this.startTransition(e,t,n,ar.Linear.None,r)}getCurrentValue(e){return this.getState()[e]}get isTransitioning(){return this.animationController.isActive}};h();p();d();function J7(i,e,t,n,r){let s=0,a,o=async()=>{let l=++s,c=await i(e[t]);l===s?(a&&r?.(a),n(c),a=c):r?.(c)};return o(),Io(e,t,o)}h();p();d();var B5e=Math.PI/180;function K7(i){let{walkDist:e,prevWalkDist:t,bob:n,prevBob:r,partialTick:s}=i,a=e-t,o=-(e+a*s),l=r+(n-r)*s,c=Math.sin(o*Math.PI),u=Math.cos(o*Math.PI);return{position:{x:c*l*.5,y:-Math.abs(u*l)},rotation:{x:Math.abs(Math.cos(o*Math.PI-.2)*l)*5*B5e,z:c*l*3*B5e}}}var Gr=new ht;function yFe(i,e){let t=new ht,n=1,r=Math.sqrt(i),s=-.3*Math.sin(r*Math.PI),a=.4*Math.sin(r*2*Math.PI),o=-.4*Math.sin(i*Math.PI);return t.multiply(Gr.makeTranslation(n*(s+.64),a-.6+e*-.6,o-.72)),t.multiply(Gr.makeRotationY(n*45*Math.PI/180)),t.multiply(Gr.makeRotationY(n*Math.sin(r*Math.PI)*70*Math.PI/180)),t.multiply(Gr.makeRotationZ(n*Math.sin(i*i*Math.PI)*-20*Math.PI/180)),t.multiply(Gr.makeTranslation(n*-1,3.6,3.5)),t.multiply(Gr.makeRotationZ(n*120*Math.PI/180)),t.multiply(Gr.makeRotationX(200*Math.PI/180)),t.multiply(Gr.makeRotationY(n*-135*Math.PI/180)),t.multiply(Gr.makeTranslation(n*5.6,0,0)),t.multiply(Gr.makeTranslation(n*-5/16,2/16,0)),t}function _Fe(i,e){let t=new ht,n=1,r=Math.sqrt(i),s=-.4*Math.sin(r*Math.PI),a=.2*Math.sin(r*2*Math.PI),o=-.2*Math.sin(i*Math.PI);t.multiply(Gr.makeTranslation(n*s,a,o)),t.multiply(Gr.makeTranslation(n*.56,-.52+e*-.6,-.72));let l=Math.sin(i*i*Math.PI),c=Math.sin(r*Math.PI);return t.multiply(Gr.makeRotationY(n*(45+l*-20)*Math.PI/180)),t.multiply(Gr.makeRotationZ(n*c*-20*Math.PI/180)),t.multiply(Gr.makeRotationX(c*-80*Math.PI/180)),t.multiply(Gr.makeRotationY(n*-45*Math.PI/180)),t}var xp=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;this.initCameraGroup(),this.unsubs.push(this.worldRenderer.onReactivePlayerStateUpdated("heldItemMain",()=>{this.offHand||this.updateItem()},!1),this.worldRenderer.onReactivePlayerStateUpdated("heldItemOff",()=>{this.offHand&&this.updateItem()},!1)),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Sp().then(n=>{this.disposed||(this.playerHand=n,this.updateItem())}).then(()=>{if(this.disposed)return;let n=J7(async()=>Sp(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",r=>{r&&(this.playerHand=r,this.updateItem())},r=>{Zn(r,!0)});this.unsubs.push(n)})}holdingBlock=void 0;blockSwapAnimation=void 0;cameraGroup=new Xe;armTransformGroup=new ot;camera=new rn(70,1,.05,100);equipProgress=0;stopUpdate=!1;lastHeldItem;currentDisplayType="hand";isSwinging=!1;nextIterStopCallbacks;idleAnimator;ready=!1;lastUpdate=0;xBob=0;yBob=0;lastBobUpdateTime=0;lastBobWalkDist=0;lastBobTickTime=0;playerHand;offHandDisplay=!1;offHandModeLegacy=!1;swingAnimator;config;disposed=!1;unsubs=[];dispose(){this.disposed=!0,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,Zn(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&Zn(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(Zn(this.playerHand,!0),this.playerHand=void 0),this.ready=!1}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new Xe,this.armTransformGroup=new ot,this.armTransformGroup.matrixAutoUpdate=!1,this.cameraGroup.add(this.armTransformGroup)}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,n,r){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),(this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage)&&this.swingAnimator?.update(),this.blockSwapAnimation?.switcher.update();let a=new pi;a.add(this.cameraGroup);let o=t.getSize(new Ve),l=o.height>o.width;l?this.camera.aspect!==1&&(this.camera.aspect=1,this.camera.updateProjectionMatrix()):this.camera.aspect!==e.aspect&&(this.camera.aspect=e.aspect,this.camera.updateProjectionMatrix()),this.updateCameraGroup(),a.add(n.clone()),a.add(r.clone());let{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),l){let u=Math.min(o.width,o.height);c?t.setViewport(0,0,u,u):t.setViewport(o.width-u,0,u,u)}t.render(a,this.camera),l&&t.setViewport(0,0,o.width,o.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??={switcher:new nu(()=>({progress:this.equipProgress}),(r,s)=>{r==="progress"&&(this.equipProgress=s)},{progress:4})};let t=e==="disappeared"?1:0,n=!1;return new Promise(r=>{this.blockSwapAnimation.switcher.transitionTo({progress:t},e,()=>{n||r(!0)},()=>{n=!0,r(!1)})})}isDifferentItem(e){let t=(0,N5e.default)(this.worldRenderer.version);return!this.lastHeldItem||this.lastHeldItem.name!==e?.name||!t.equal(this.lastHeldItem.fullItem,e?.fullItem??{})||JSON.stringify(this.lastHeldItem.fullItem.components)!==JSON.stringify(e?.fullItem?.components)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this,t=performance.now(),n=this.worldRenderer.cameraShake.getBaseRotation(),r=n.pitch,s=n.yaw;if(this.lastBobUpdateTime===0)this.xBob=r,this.yBob=s,this.lastBobUpdateTime=t;else{let m=Math.min((t-this.lastBobUpdateTime)/1e3,.1);this.lastBobUpdateTime=t;let v=1-Math.pow(.5,m*20);this.xBob+=(r-this.xBob)*v,this.yBob+=(s-this.yBob)*v}let a=(r-this.xBob)*-.1,o=(s-this.yBob)*-.1;if(this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let m=this.worldRenderer.playerStateReactive;m.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=t,this.lastBobWalkDist=m.walkDist);let v=Math.min((t-this.lastBobTickTime)/50,1),y=K7({walkDist:m.walkDist,prevWalkDist:m.prevWalkDist,bob:m.bob,prevBob:m.prevBob,partialTick:v});this.cameraGroup.position.x+=y.position.x,this.cameraGroup.position.y+=y.position.y,this.cameraGroup.rotation.z+=y.rotation.z,this.cameraGroup.rotation.x+=y.rotation.x}this.cameraGroup.rotation.x+=a,this.cameraGroup.rotation.y+=o;let c=this.currentDisplayType,u=this.swingAnimator?.getSwingProgress()??0,f;c==="hand"?f=yFe(u,this.equipProgress):f=_Fe(u,this.equipProgress),this.armTransformGroup.matrix.copy(f),this.armTransformGroup.matrixWorldNeedsUpdate=!0}lastItemModelName;async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let n=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},{"minecraft:display_context":"firstperson","minecraft:use_duration":this.worldRenderer.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!this.worldRenderer.playerStateReactive.itemUsageTicks},!1,this.lastItemModelName);if(n){let{mesh:r,isBlock:s,modelName:a}=n;s?(t=r,e.type="block"):(t=r,e.type="item"),this.lastItemModelName=a}}else t=this.playerHand;if(t){if(e.type==="item"||e.type==="block"){let n=new ot;n.name="displayTransform",e.type==="item"?(n.position.set(1.13/16,3.2/16,1.13/16),n.rotation.set(0,Et.degToRad(-90),Et.degToRad(25),"XYZ"),n.scale.set(.68,.68,.68)):(n.rotation.set(0,Et.degToRad(45),0,"XYZ"),n.scale.set(.4,.4,.4)),n.add(t),t=n}return t.name="holdingBlock",{model:t,type:e.type}}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.currentDisplayType="hand",this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.currentDisplayType=t.type,this.armTransformGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}switchRequest=0;async setNewItem(e){if(!this.isDifferentItem(e))return;this.lastItemModelName=void 0;let t=++this.switchRequest;this.lastHeldItem=e;let n=!1;if(this.holdingBlock){if(n=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock.removeFromParent(),this.holdingBlock!==this.playerHand&&Zn(this.holdingBlock,!1),this.holdingBlock=void 0}if(!e){this.currentDisplayType="hand",this.swingAnimator=void 0,this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(t!==this.switchRequest)return;let r=await this.createItemModel(e);!r||t!==this.switchRequest||(this.holdingBlock=r.model,this.currentDisplayType=r.type,this.armTransformGroup.add(this.holdingBlock),n&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator=new OM,this.swingAnimator.type=r.type,this.idleAnimator=void 0)}};var OM=class{animationTimer=0;lastTime=0;isAnimating=!1;stopRequested=!1;swingProgress=0;type="hand";debugParams={animationTime:250,animationStage:0};debugGui;constructor(){this.debugGui=new $o("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01}})}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.swingProgress=0;return}let e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let n=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(n>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.swingProgress=0;return}this.animationTimer=0,this.swingProgress=0;return}this.swingProgress=n}getSwingProgress(){return this.swingProgress}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}},O5e=(i,e,t,n,r)=>{let s=n.transformModel(e,{name:t,properties:{}});return JE(i,[[s]],void 0,"plains",r)};h();p();d();Dt();function bFe(i,e){let{depth:t,pixelSize:n}=e;if(i.width<=0||i.height<=0)throw new Error(`Invalid canvas dimensions: ${i.width}x${i.height}`);let s=i.getContext("2d").getImageData(0,0,i.width,i.height),{data:a}=s,o=i.width,l=i.height,c=t/2,u=n??1/Math.max(o,l),f=(C,L)=>{if(C<0||L<0||C>=o||L>=l)return!1;let M=(L*o+C)*4;return a[M+3]>128},m=[],v=[],y=[],b=[],_=0,g=(C,L,M,R,F,Z,D,V)=>(m.push(C,L,M),y.push(R,F),b.push(Z,D,V),_++),x=(C,L,M,R)=>{v.push(C,L,M,C,M,R)},w=(C,L)=>{let M=(C/o-.5)*u*o,R=-(L/l-.5)*u*l;return{x:M,y:R}},S=Array.from({length:l+1},()=>Array.from({length:o+1},()=>null)),A=Array.from({length:l+1},()=>Array.from({length:o+1},()=>null));for(let C=0;C<=l;C++)for(let L=0;L<=o;L++){let{x:M,y:R}=w(L-.5,C-.5),F=L/o,Z=C/l,D=!1,V=[[L-1,C-1],[L,C-1],[L-1,C],[L,C]];for(let[$,se]of V)if(f($,se)){D=!0;break}D&&(S[C][L]=g(M,R,c,F,Z,0,0,1),A[C][L]=g(M,R,-c,F,Z,0,0,-1))}for(let C=0;C<l;C++)for(let L=0;L<o;L++){if(!f(L,C))continue;let M=S[C][L],R=S[C][L+1],F=S[C+1][L+1],Z=S[C+1][L],D=A[C][L],V=A[C][L+1],$=A[C+1][L+1],se=A[C+1][L];M!==null&&R!==null&&F!==null&&Z!==null&&x(M,R,F,Z),D!==null&&V!==null&&$!==null&&se!==null&&x(V,D,se,$)}for(let C=0;C<l;C++)for(let L=0;L<o;L++){if(!f(L,C))continue;let M=(L+.5)/o,R=(C+.5)/l;if(!f(L-1,C)){let F=S[C][L],Z=S[C+1][L],D=A[C][L],V=A[C+1][L];if(F!==null&&Z!==null&&D!==null&&V!==null){let $=g(m[F*3],m[F*3+1],m[F*3+2],M,R,-1,0,0),se=g(m[Z*3],m[Z*3+1],m[Z*3+2],M,R,-1,0,0),Q=g(m[V*3],m[V*3+1],m[V*3+2],M,R,-1,0,0),ne=g(m[D*3],m[D*3+1],m[D*3+2],M,R,-1,0,0);x($,se,Q,ne)}}if(!f(L+1,C)){let F=S[C+1][L+1],Z=S[C][L+1],D=A[C+1][L+1],V=A[C][L+1];if(F!==null&&Z!==null&&D!==null&&V!==null){let $=g(m[F*3],m[F*3+1],m[F*3+2],M,R,1,0,0),se=g(m[Z*3],m[Z*3+1],m[Z*3+2],M,R,1,0,0),Q=g(m[V*3],m[V*3+1],m[V*3+2],M,R,1,0,0),ne=g(m[D*3],m[D*3+1],m[D*3+2],M,R,1,0,0);x($,se,Q,ne)}}if(!f(L,C-1)){let F=S[C][L],Z=S[C][L+1],D=A[C][L],V=A[C][L+1];if(F!==null&&Z!==null&&D!==null&&V!==null){let $=g(m[F*3],m[F*3+1],m[F*3+2],M,R,0,-1,0),se=g(m[Z*3],m[Z*3+1],m[Z*3+2],M,R,0,-1,0),Q=g(m[V*3],m[V*3+1],m[V*3+2],M,R,0,-1,0),ne=g(m[D*3],m[D*3+1],m[D*3+2],M,R,0,-1,0);x($,se,Q,ne)}}if(!f(L,C+1)){let F=S[C+1][L+1],Z=S[C+1][L],D=A[C+1][L+1],V=A[C+1][L];if(F!==null&&Z!==null&&D!==null&&V!==null){let $=g(m[F*3],m[F*3+1],m[F*3+2],M,R,0,1,0),se=g(m[Z*3],m[Z*3+1],m[Z*3+2],M,R,0,1,0),Q=g(m[V*3],m[V*3+1],m[V*3+2],M,R,0,1,0),ne=g(m[D*3],m[D*3+1],m[D*3+2],M,R,0,1,0);x($,se,Q,ne)}}}let P=new at;return P.setAttribute("position",new He(m,3)),P.setAttribute("uv",new He(y,2)),P.setAttribute("normal",new He(b,3)),P.setIndex(v),P.computeVertexNormals(),{geometry:P,totalVertices:_,totalTriangles:v.length/3}}function wFe(i,e){let{u:t,v:n,sizeX:r,sizeY:s}=e,a=Math.max(1,Math.floor(r*i.image.width)),o=Math.max(1,Math.floor(s*i.image.height)),l=document.createElement("canvas");l.width=a,l.height=o;let c=l.getContext("2d");return c.imageSmoothingEnabled=!1,c.drawImage(i.image,t*i.image.width,n*i.image.height,r*i.image.width,s*i.image.height,0,0,l.width,l.height),l}function D5e(i,e,t={}){let{faceCamera:n=!1,use3D:r=!0,depth:s=.04}=t,{u:a,v:o,sizeX:l,sizeY:c}=e;if(n){let b=i.clone();b.flipY=!0,b.offset.set(a,1-o-c),b.repeat.set(l,c),b.needsUpdate=!0,b.magFilter=Qe,b.minFilter=Qe;let _=new ts({map:b,transparent:!0,alphaTest:.1});return{mesh:new Ni(_),itemsTexture:b,cleanup(){b.dispose()}}}if(r)try{let b=wFe(i,e),{geometry:_}=bFe(b,{depth:s}),g=new gn(b);g.magFilter=Qe,g.minFilter=Qe,g.wrapS=g.wrapT=kn,g.flipY=!1,g.needsUpdate=!0;let x=new mr({map:g,side:vn,transparent:!0,alphaTest:.1});return{mesh:new Xe(_,x),itemsTexture:g,cleanup(){g.dispose(),_.dispose(),x.map&&x.map.dispose(),x.dispose()}}}catch(b){console.warn("Failed to create 3D item mesh, falling back to 2D:",b)}let u=i.clone();u.flipY=!0,u.offset.set(a,1-o-c),u.repeat.set(l,c),u.needsUpdate=!0,u.magFilter=Qe,u.minFilter=Qe;let f=u.clone();f.repeat.x*=-1,f.needsUpdate=!0,f.offset.set(a+l,1-o-c);let m=new mr({map:u,transparent:!0,alphaTest:.1}),v=new mr({map:f,transparent:!0,alphaTest:.1});return{mesh:new Xe(new ln(1,1,0),[new lt({color:0}),new lt({color:0}),new lt({color:0}),new lt({color:0}),m,v]),itemsTexture:u,itemsTextureFlipped:f,cleanup(){u.dispose(),f.dispose(),m.dispose(),v.dispose()}}}h();p();d();Dt();h();p();d();h();p();d();Dt();var V5e=parseInt(da.replace(/\D+/g,""));h();p();d();Dt();var xFe=/^[og]\s*(.+)?/,SFe=/^mtllib /,EFe=/^usemtl /,AFe=/^usemap /,U5e=new K,DM=new K,F5e=new K,z5e=new K,ps=new K;function MFe(){let i={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}let n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(r,s){let a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);let o={index:this.materials.length,name:r||"",mtllib:Array.isArray(s)&&s.length>0?s[s.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){let c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(o),o},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(r){let s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.inherited=!1),r&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return r&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},n&&n.name&&typeof n.clone=="function"){let r=n.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){let r=this.vertices,s=this.object.geometry.vertices;s.push(r[e+0],r[e+1],r[e+2]),s.push(r[t+0],r[t+1],r[t+2]),s.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){let r=this.normals,s=this.object.geometry.normals;s.push(r[e+0],r[e+1],r[e+2]),s.push(r[t+0],r[t+1],r[t+2]),s.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){let r=this.vertices,s=this.object.geometry.normals;U5e.fromArray(r,e),DM.fromArray(r,t),F5e.fromArray(r,n),ps.subVectors(F5e,DM),z5e.subVectors(U5e,DM),ps.cross(z5e),ps.normalize(),s.push(ps.x,ps.y,ps.z),s.push(ps.x,ps.y,ps.z),s.push(ps.x,ps.y,ps.z)},addColor:function(e,t,n){let r=this.colors,s=this.object.geometry.colors;r[e]!==void 0&&s.push(r[e+0],r[e+1],r[e+2]),r[t]!==void 0&&s.push(r[t+0],r[t+1],r[t+2]),r[n]!==void 0&&s.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){let r=this.uvs,s=this.object.geometry.uvs;s.push(r[e+0],r[e+1]),s.push(r[t+0],r[t+1]),s.push(r[n+0],r[n+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,s,a,o,l,c){let u=this.vertices.length,f=this.parseVertexIndex(e,u),m=this.parseVertexIndex(t,u),v=this.parseVertexIndex(n,u);if(this.addVertex(f,m,v),this.addColor(f,m,v),o!==void 0&&o!==""){let y=this.normals.length;f=this.parseNormalIndex(o,y),m=this.parseNormalIndex(l,y),v=this.parseNormalIndex(c,y),this.addNormal(f,m,v)}else this.addFaceNormal(f,m,v);if(r!==void 0&&r!==""){let y=this.uvs.length;f=this.parseUVIndex(r,y),m=this.parseUVIndex(s,y),v=this.parseUVIndex(a,y),this.addUV(f,m,v),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let n=0,r=e.length;n<r;n++){let s=this.parseVertexIndex(e[n],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";let n=this.vertices.length,r=this.uvs.length;for(let s=0,a=e.length;s<a;s++)this.addVertexLine(this.parseVertexIndex(e[s],n));for(let s=0,a=t.length;s<a;s++)this.addUVLine(this.parseUVIndex(t[s],r))}};return i.startObject("",!1),i}var Oh=class extends Kn{constructor(e){super(e),this.materials=null}load(e,t,n,r){let s=this,a=new Lr(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},n,r)}setMaterials(e){return this.materials=e,this}parse(e){let t=new MFe;e.indexOf(`\r
|
|
7770
|
+
value:`,a)}addColor(e,t,n=1){return new CM(this,e,t,n)}addFolder(e){let t=new i({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(n=>{n instanceof bp||n._name in e.controllers&&n.load(e.controllers[n._name])}),t&&e.folders&&this.folders.forEach(n=>{n._title in e.folders&&n.load(e.folders[n._title])}),this}save(e=!0){let t={controllers:{},folders:{}};return this.controllers.forEach(n=>{if(!(n instanceof bp)){if(n._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${n._name}"`);t.controllers[n._name]=n.save()}}),e&&this.folders.forEach(n=>{if(n._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${n._title}"`);t.folders[n._title]=n.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");let n=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",n))};this.$children.addEventListener("transitionend",n);let r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=r+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(n=>n.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}},NM=BM;var $o=class{gui=null;storageKey="";target;params=[];paramsMeta={};_visible=!1;initialValues={};initialized=!1;constructor(e,t,n,r){if(!Gn){this.gui=new NM,this.storageKey=`debug_params_${e}`,this.target=t,this.paramsMeta=r??{},this.params=n??Object.keys(t);for(let s of this.params)this.initialValues[s]=t[s];this.gui.domElement.style.display="none"}}activate(){return Gn?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return Gn?!1:this._visible}set visible(e){Gn||!this.gui||(this._visible=e,this.gui.domElement.style.display=e?"block":"none",this.saveVisibility())}loadSavedValues(){if(!Gn)try{let e=localStorage.getItem(this.storageKey);if(e){let t=JSON.parse(e);for(let n of this.params)if(n in t){let r=t[n];r!==null&&(this.target[n]=r)}}}catch(e){console.warn("Failed to load debug values:",e)}}saveValues(e=!1){if(!Gn)try{let t={};for(let n of this.params)t[n]=this.target[n];e?localStorage.removeItem(this.storageKey):localStorage.setItem(this.storageKey,JSON.stringify(t))}catch(t){console.warn("Failed to save debug values:",t)}}saveVisibility(){if(!Gn)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch(e){console.warn("Failed to save debug visibility:",e)}}setupControls(){if(!(Gn||!this.gui)){this.gui.add(this,"visible").name("Show Controls"),this.gui.add({resetAll:()=>{if(this.gui){for(let e of this.params)this.target[e]=this.initialValues[e];this.saveValues(!0),this.gui.destroy(),this.gui=new NM,this.setupControls()}}},"resetAll").name("Reset All Parameters");for(let e of this.params){let t=this.target[e],n=this.paramsMeta[e]??{};if(typeof t=="number"){let r=n.min??t-Math.abs(t*2),s=n.max??t+Math.abs(t*2),a=n.step??Math.abs(t)/100;this.gui.add(this.target,e,r,s,a).onChange(()=>this.saveValues())}else if(typeof t=="boolean")this.gui.add(this.target,e).onChange(()=>this.saveValues());else if(typeof t=="string"&&["x","y","z"].includes(e)){let r=n.min??-10,s=n.max??10,a=n.step??.1;this.gui.add(this.target,e,r,s,a).onChange(()=>this.saveValues())}else Array.isArray(t)&&this.gui.add(this.target,e,t).onChange(()=>this.saveValues())}}}save(){Gn||(this.saveValues(),this.saveVisibility())}destroy(){Gn||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};h();p();d();h();p();d();var Y7=class{currentAnimation=null;isAnimating=!1;cancelRequested=!1;completionCallbacks=[];currentCancelCallback=null;async startAnimation(e,t){return this.isAnimating&&await this.cancelCurrentAnimation(),new Promise(n=>{this.isAnimating=!0,this.cancelRequested=!1,this.currentCancelCallback=t??null,this.currentAnimation=e(),this.completionCallbacks.push(()=>{this.isAnimating=!1,this.currentAnimation=null,n()})})}async cancelCurrentAnimation(){if(this.isAnimating){if(this.currentCancelCallback){let e=this.currentCancelCallback;this.currentCancelCallback=null,e()}return new Promise(e=>{this.cancelRequested=!0,this.completionCallbacks.push(()=>{e()})})}}animationCycleFinish(){this.cancelRequested&&this.forceFinish()}forceFinish(e=!0){if(!this.isAnimating)return;if(this.currentAnimation){for(let n of this.currentAnimation.getAll())n.stop();this.currentAnimation.removeAll(),this.currentAnimation=null}this.isAnimating=!1,this.cancelRequested=!1;let t=[...this.completionCallbacks];if(this.completionCallbacks=[],e)for(let n of t)n()}update(){this.currentAnimation&&this.currentAnimation.update()}get isActive(){return this.isAnimating}get shouldCancel(){return this.cancelRequested}};var gFe={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},nu=class{constructor(e,t,n){this.getState=e;this.setState=t;this.speeds={...gFe},n&&Object.assign(this.speeds,n),this.defaultState=this.getState()}animationController=new Y7;defaultState;speeds;currentStateName="";transitioningToStateName="";calculateDuration(e){let t=0,n=this.getState();for(let[r,s]of Object.entries(e)){let a=n[r],o=Math.abs(s-a),l=this.getPropertySpeed(r),c=o/l*1e3;t=Math.max(t,c)}return Math.min(Math.max(t,200),2e3)}getPropertySpeed(e){return e in this.speeds?this.speeds[e]:e.toLowerCase().includes("rotation")?this.speeds.rotation:e.toLowerCase().includes("scale")?this.speeds.scale:e.toLowerCase()==="x"||e.toLowerCase()==="y"||e.toLowerCase()==="z"?this.speeds[e]:this.speeds.default}startTransition(e,t,n,r=ar.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=t??"";let a=this.getState(),o=this.calculateDuration(e);this.animationController.startAnimation(()=>{let l=new ih;return new gr(a,l).to(e,o).easing(r).onUpdate(c=>{for(let u of Object.keys(c))this.setState(u,c[u])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",n?.()}).start(),l},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(e,t,n,r){this.startTransition(e,t,n,ar.Linear.None,r)}getCurrentValue(e){return this.getState()[e]}get isTransitioning(){return this.animationController.isActive}};h();p();d();function J7(i,e,t,n,r){let s=0,a,o=async()=>{let l=++s,c=await i(e[t]);l===s?(a&&r?.(a),n(c),a=c):r?.(c)};return o(),Io(e,t,o)}h();p();d();var B5e=Math.PI/180;function K7(i){let{walkDist:e,prevWalkDist:t,bob:n,prevBob:r,partialTick:s}=i,a=e-t,o=-(e+a*s),l=r+(n-r)*s,c=Math.sin(o*Math.PI),u=Math.cos(o*Math.PI);return{position:{x:c*l*.5,y:-Math.abs(u*l)},rotation:{x:Math.abs(Math.cos(o*Math.PI-.2)*l)*5*B5e,z:c*l*3*B5e}}}var Gr=new ht;function yFe(i,e){let t=new ht,n=1,r=Math.sqrt(i),s=-.3*Math.sin(r*Math.PI),a=.4*Math.sin(r*2*Math.PI),o=-.4*Math.sin(i*Math.PI);return t.multiply(Gr.makeTranslation(n*(s+.64),a-.6+e*-.6,o-.72)),t.multiply(Gr.makeRotationY(n*45*Math.PI/180)),t.multiply(Gr.makeRotationY(n*Math.sin(r*Math.PI)*70*Math.PI/180)),t.multiply(Gr.makeRotationZ(n*Math.sin(i*i*Math.PI)*-20*Math.PI/180)),t.multiply(Gr.makeTranslation(n*-1,3.6,3.5)),t.multiply(Gr.makeRotationZ(n*120*Math.PI/180)),t.multiply(Gr.makeRotationX(200*Math.PI/180)),t.multiply(Gr.makeRotationY(n*-135*Math.PI/180)),t.multiply(Gr.makeTranslation(n*5.6,0,0)),t.multiply(Gr.makeTranslation(n*-5/16,2/16,0)),t}function _Fe(i,e){let t=new ht,n=1,r=Math.sqrt(i),s=-.4*Math.sin(r*Math.PI),a=.2*Math.sin(r*2*Math.PI),o=-.2*Math.sin(i*Math.PI);t.multiply(Gr.makeTranslation(n*s,a,o)),t.multiply(Gr.makeTranslation(n*.56,-.52+e*-.6,-.72));let l=Math.sin(i*i*Math.PI),c=Math.sin(r*Math.PI);return t.multiply(Gr.makeRotationY(n*(45+l*-20)*Math.PI/180)),t.multiply(Gr.makeRotationZ(n*c*-20*Math.PI/180)),t.multiply(Gr.makeRotationX(c*-80*Math.PI/180)),t.multiply(Gr.makeRotationY(n*-45*Math.PI/180)),t}var xp=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;this.initCameraGroup(),this.unsubs.push(this.worldRenderer.onReactivePlayerStateUpdated("heldItemMain",()=>{this.offHand||this.updateItem()},!1),this.worldRenderer.onReactivePlayerStateUpdated("heldItemOff",()=>{this.offHand&&this.updateItem()},!1)),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Sp().then(n=>{this.disposed||(this.playerHand=n,this.updateItem())}).then(()=>{if(this.disposed)return;let n=J7(async()=>Sp(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",r=>{r&&(this.playerHand=r,this.updateItem())},r=>{Zn(r,!0)});this.unsubs.push(n)})}holdingBlock=void 0;blockSwapAnimation=void 0;cameraGroup=new Xe;armTransformGroup=new ot;camera=new rn(70,1,.05,100);equipProgress=0;stopUpdate=!1;lastHeldItem;currentDisplayType="hand";isSwinging=!1;nextIterStopCallbacks;idleAnimator;ready=!1;lastUpdate=0;xBob=0;yBob=0;lastBobUpdateTime=0;lastBobWalkDist=0;lastBobTickTime=0;playerHand;offHandDisplay=!1;offHandModeLegacy=!1;swingAnimator;config;disposed=!1;unsubs=[];dispose(){this.disposed=!0,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,Zn(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&Zn(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(Zn(this.playerHand,!0),this.playerHand=void 0),this.ready=!1}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new Xe,this.armTransformGroup=new ot,this.armTransformGroup.matrixAutoUpdate=!1,this.cameraGroup.add(this.armTransformGroup)}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,n,r){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),(this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage)&&this.swingAnimator?.update(),this.blockSwapAnimation?.switcher.update();let a=new pi;a.add(this.cameraGroup);let o=t.getSize(new Ve),l=o.height>o.width;l?this.camera.aspect!==1&&(this.camera.aspect=1,this.camera.updateProjectionMatrix()):this.camera.aspect!==e.aspect&&(this.camera.aspect=e.aspect,this.camera.updateProjectionMatrix()),this.updateCameraGroup(),a.add(n.clone()),a.add(r.clone());let{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),l){let u=Math.min(o.width,o.height);c?t.setViewport(0,0,u,u):t.setViewport(o.width-u,0,u,u)}t.render(a,this.camera),l&&t.setViewport(0,0,o.width,o.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??={switcher:new nu(()=>({progress:this.equipProgress}),(r,s)=>{r==="progress"&&(this.equipProgress=s)},{progress:4})};let t=e==="disappeared"?1:0,n=!1;return new Promise(r=>{this.blockSwapAnimation.switcher.transitionTo({progress:t},e,()=>{n||r(!0)},()=>{n=!0,r(!1)})})}isDifferentItem(e){let t=(0,N5e.default)(this.worldRenderer.version);return!this.lastHeldItem||this.lastHeldItem.name!==e?.name||!t.equal(this.lastHeldItem.fullItem,e?.fullItem??{})||JSON.stringify(this.lastHeldItem.fullItem.components)!==JSON.stringify(e?.fullItem?.components)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this,t=performance.now(),n=this.worldRenderer.cameraShake.getBaseRotation(),r=n.pitch,s=n.yaw;if(this.lastBobUpdateTime===0)this.xBob=r,this.yBob=s,this.lastBobUpdateTime=t;else{let m=Math.min((t-this.lastBobUpdateTime)/1e3,.1);this.lastBobUpdateTime=t;let v=1-Math.pow(.5,m*20);this.xBob+=(r-this.xBob)*v,this.yBob+=(s-this.yBob)*v}let a=(r-this.xBob)*-.1,o=(s-this.yBob)*-.1;if(this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let m=this.worldRenderer.playerStateReactive;m.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=t,this.lastBobWalkDist=m.walkDist);let v=Math.min((t-this.lastBobTickTime)/50,1),y=1.8,b=K7({walkDist:m.walkDist*y,prevWalkDist:m.prevWalkDist*y,bob:m.bob,prevBob:m.prevBob,partialTick:v});this.cameraGroup.position.x+=b.position.x,this.cameraGroup.position.y+=b.position.y,this.cameraGroup.rotation.z+=b.rotation.z,this.cameraGroup.rotation.x+=b.rotation.x}this.cameraGroup.rotation.x+=a,this.cameraGroup.rotation.y+=o;let c=this.currentDisplayType,u=this.swingAnimator?.getSwingProgress()??0,f;c==="hand"?f=yFe(u,this.equipProgress):f=_Fe(u,this.equipProgress),this.armTransformGroup.matrix.copy(f),this.armTransformGroup.matrixWorldNeedsUpdate=!0}lastItemModelName;async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let n=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},{"minecraft:display_context":"firstperson","minecraft:use_duration":this.worldRenderer.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!this.worldRenderer.playerStateReactive.itemUsageTicks},!1,this.lastItemModelName);if(n){let{mesh:r,isBlock:s,modelName:a}=n;s?(t=r,e.type="block"):(t=r,e.type="item"),this.lastItemModelName=a}}else t=this.playerHand;if(t){if(e.type==="item"||e.type==="block"){let n=new ot;n.name="displayTransform",e.type==="item"?(n.position.set(1.13/16,3.2/16,1.13/16),n.rotation.set(0,Et.degToRad(-90),Et.degToRad(25),"XYZ"),n.scale.set(.68,.68,.68)):(n.rotation.set(0,Et.degToRad(45),0,"XYZ"),n.scale.set(.4,.4,.4)),n.add(t),t=n}return t.name="holdingBlock",{model:t,type:e.type}}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.currentDisplayType="hand",this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.currentDisplayType=t.type,this.armTransformGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}switchRequest=0;async setNewItem(e){if(!this.isDifferentItem(e))return;this.lastItemModelName=void 0;let t=++this.switchRequest;this.lastHeldItem=e;let n=!1;if(this.holdingBlock){if(n=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock.removeFromParent(),this.holdingBlock!==this.playerHand&&Zn(this.holdingBlock,!1),this.holdingBlock=void 0}if(!e){this.currentDisplayType="hand",this.swingAnimator=void 0,this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(t!==this.switchRequest)return;let r=await this.createItemModel(e);!r||t!==this.switchRequest||(this.holdingBlock=r.model,this.currentDisplayType=r.type,this.armTransformGroup.add(this.holdingBlock),n&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator=new OM,this.swingAnimator.type=r.type,this.idleAnimator=void 0)}};var OM=class{animationTimer=0;lastTime=0;isAnimating=!1;stopRequested=!1;swingProgress=0;type="hand";debugParams={animationTime:250,animationStage:0};debugGui;constructor(){this.debugGui=new $o("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01}})}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.swingProgress=0;return}let e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let n=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(n>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.swingProgress=0;return}this.animationTimer=0,this.swingProgress=0;return}this.swingProgress=n}getSwingProgress(){return this.swingProgress}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}},O5e=(i,e,t,n,r)=>{let s=n.transformModel(e,{name:t,properties:{}});return JE(i,[[s]],void 0,"plains",r)};h();p();d();Dt();function bFe(i,e){let{depth:t,pixelSize:n}=e;if(i.width<=0||i.height<=0)throw new Error(`Invalid canvas dimensions: ${i.width}x${i.height}`);let s=i.getContext("2d").getImageData(0,0,i.width,i.height),{data:a}=s,o=i.width,l=i.height,c=t/2,u=n??1/Math.max(o,l),f=(C,L)=>{if(C<0||L<0||C>=o||L>=l)return!1;let M=(L*o+C)*4;return a[M+3]>128},m=[],v=[],y=[],b=[],_=0,g=(C,L,M,R,F,Z,D,V)=>(m.push(C,L,M),y.push(R,F),b.push(Z,D,V),_++),x=(C,L,M,R)=>{v.push(C,L,M,C,M,R)},w=(C,L)=>{let M=(C/o-.5)*u*o,R=-(L/l-.5)*u*l;return{x:M,y:R}},S=Array.from({length:l+1},()=>Array.from({length:o+1},()=>null)),A=Array.from({length:l+1},()=>Array.from({length:o+1},()=>null));for(let C=0;C<=l;C++)for(let L=0;L<=o;L++){let{x:M,y:R}=w(L-.5,C-.5),F=L/o,Z=C/l,D=!1,V=[[L-1,C-1],[L,C-1],[L-1,C],[L,C]];for(let[$,se]of V)if(f($,se)){D=!0;break}D&&(S[C][L]=g(M,R,c,F,Z,0,0,1),A[C][L]=g(M,R,-c,F,Z,0,0,-1))}for(let C=0;C<l;C++)for(let L=0;L<o;L++){if(!f(L,C))continue;let M=S[C][L],R=S[C][L+1],F=S[C+1][L+1],Z=S[C+1][L],D=A[C][L],V=A[C][L+1],$=A[C+1][L+1],se=A[C+1][L];M!==null&&R!==null&&F!==null&&Z!==null&&x(M,R,F,Z),D!==null&&V!==null&&$!==null&&se!==null&&x(V,D,se,$)}for(let C=0;C<l;C++)for(let L=0;L<o;L++){if(!f(L,C))continue;let M=(L+.5)/o,R=(C+.5)/l;if(!f(L-1,C)){let F=S[C][L],Z=S[C+1][L],D=A[C][L],V=A[C+1][L];if(F!==null&&Z!==null&&D!==null&&V!==null){let $=g(m[F*3],m[F*3+1],m[F*3+2],M,R,-1,0,0),se=g(m[Z*3],m[Z*3+1],m[Z*3+2],M,R,-1,0,0),Q=g(m[V*3],m[V*3+1],m[V*3+2],M,R,-1,0,0),ne=g(m[D*3],m[D*3+1],m[D*3+2],M,R,-1,0,0);x($,se,Q,ne)}}if(!f(L+1,C)){let F=S[C+1][L+1],Z=S[C][L+1],D=A[C+1][L+1],V=A[C][L+1];if(F!==null&&Z!==null&&D!==null&&V!==null){let $=g(m[F*3],m[F*3+1],m[F*3+2],M,R,1,0,0),se=g(m[Z*3],m[Z*3+1],m[Z*3+2],M,R,1,0,0),Q=g(m[V*3],m[V*3+1],m[V*3+2],M,R,1,0,0),ne=g(m[D*3],m[D*3+1],m[D*3+2],M,R,1,0,0);x($,se,Q,ne)}}if(!f(L,C-1)){let F=S[C][L],Z=S[C][L+1],D=A[C][L],V=A[C][L+1];if(F!==null&&Z!==null&&D!==null&&V!==null){let $=g(m[F*3],m[F*3+1],m[F*3+2],M,R,0,-1,0),se=g(m[Z*3],m[Z*3+1],m[Z*3+2],M,R,0,-1,0),Q=g(m[V*3],m[V*3+1],m[V*3+2],M,R,0,-1,0),ne=g(m[D*3],m[D*3+1],m[D*3+2],M,R,0,-1,0);x($,se,Q,ne)}}if(!f(L,C+1)){let F=S[C+1][L+1],Z=S[C+1][L],D=A[C+1][L+1],V=A[C+1][L];if(F!==null&&Z!==null&&D!==null&&V!==null){let $=g(m[F*3],m[F*3+1],m[F*3+2],M,R,0,1,0),se=g(m[Z*3],m[Z*3+1],m[Z*3+2],M,R,0,1,0),Q=g(m[V*3],m[V*3+1],m[V*3+2],M,R,0,1,0),ne=g(m[D*3],m[D*3+1],m[D*3+2],M,R,0,1,0);x($,se,Q,ne)}}}let P=new at;return P.setAttribute("position",new He(m,3)),P.setAttribute("uv",new He(y,2)),P.setAttribute("normal",new He(b,3)),P.setIndex(v),P.computeVertexNormals(),{geometry:P,totalVertices:_,totalTriangles:v.length/3}}function wFe(i,e){let{u:t,v:n,sizeX:r,sizeY:s}=e,a=Math.max(1,Math.floor(r*i.image.width)),o=Math.max(1,Math.floor(s*i.image.height)),l=document.createElement("canvas");l.width=a,l.height=o;let c=l.getContext("2d");return c.imageSmoothingEnabled=!1,c.drawImage(i.image,t*i.image.width,n*i.image.height,r*i.image.width,s*i.image.height,0,0,l.width,l.height),l}function D5e(i,e,t={}){let{faceCamera:n=!1,use3D:r=!0,depth:s=.04}=t,{u:a,v:o,sizeX:l,sizeY:c}=e;if(n){let b=i.clone();b.flipY=!0,b.offset.set(a,1-o-c),b.repeat.set(l,c),b.needsUpdate=!0,b.magFilter=Qe,b.minFilter=Qe;let _=new ts({map:b,transparent:!0,alphaTest:.1});return{mesh:new Ni(_),itemsTexture:b,cleanup(){b.dispose()}}}if(r)try{let b=wFe(i,e),{geometry:_}=bFe(b,{depth:s}),g=new gn(b);g.magFilter=Qe,g.minFilter=Qe,g.wrapS=g.wrapT=kn,g.flipY=!1,g.needsUpdate=!0;let x=new mr({map:g,side:vn,transparent:!0,alphaTest:.1});return{mesh:new Xe(_,x),itemsTexture:g,cleanup(){g.dispose(),_.dispose(),x.map&&x.map.dispose(),x.dispose()}}}catch(b){console.warn("Failed to create 3D item mesh, falling back to 2D:",b)}let u=i.clone();u.flipY=!0,u.offset.set(a,1-o-c),u.repeat.set(l,c),u.needsUpdate=!0,u.magFilter=Qe,u.minFilter=Qe;let f=u.clone();f.repeat.x*=-1,f.needsUpdate=!0,f.offset.set(a+l,1-o-c);let m=new mr({map:u,transparent:!0,alphaTest:.1}),v=new mr({map:f,transparent:!0,alphaTest:.1});return{mesh:new Xe(new ln(1,1,0),[new lt({color:0}),new lt({color:0}),new lt({color:0}),new lt({color:0}),m,v]),itemsTexture:u,itemsTextureFlipped:f,cleanup(){u.dispose(),f.dispose(),m.dispose(),v.dispose()}}}h();p();d();Dt();h();p();d();h();p();d();Dt();var V5e=parseInt(da.replace(/\D+/g,""));h();p();d();Dt();var xFe=/^[og]\s*(.+)?/,SFe=/^mtllib /,EFe=/^usemtl /,AFe=/^usemap /,U5e=new K,DM=new K,F5e=new K,z5e=new K,ps=new K;function MFe(){let i={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}let n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(r,s){let a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);let o={index:this.materials.length,name:r||"",mtllib:Array.isArray(s)&&s.length>0?s[s.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){let c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(o),o},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(r){let s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.inherited=!1),r&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return r&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},n&&n.name&&typeof n.clone=="function"){let r=n.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){let r=this.vertices,s=this.object.geometry.vertices;s.push(r[e+0],r[e+1],r[e+2]),s.push(r[t+0],r[t+1],r[t+2]),s.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){let r=this.normals,s=this.object.geometry.normals;s.push(r[e+0],r[e+1],r[e+2]),s.push(r[t+0],r[t+1],r[t+2]),s.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){let r=this.vertices,s=this.object.geometry.normals;U5e.fromArray(r,e),DM.fromArray(r,t),F5e.fromArray(r,n),ps.subVectors(F5e,DM),z5e.subVectors(U5e,DM),ps.cross(z5e),ps.normalize(),s.push(ps.x,ps.y,ps.z),s.push(ps.x,ps.y,ps.z),s.push(ps.x,ps.y,ps.z)},addColor:function(e,t,n){let r=this.colors,s=this.object.geometry.colors;r[e]!==void 0&&s.push(r[e+0],r[e+1],r[e+2]),r[t]!==void 0&&s.push(r[t+0],r[t+1],r[t+2]),r[n]!==void 0&&s.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){let r=this.uvs,s=this.object.geometry.uvs;s.push(r[e+0],r[e+1]),s.push(r[t+0],r[t+1]),s.push(r[n+0],r[n+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,s,a,o,l,c){let u=this.vertices.length,f=this.parseVertexIndex(e,u),m=this.parseVertexIndex(t,u),v=this.parseVertexIndex(n,u);if(this.addVertex(f,m,v),this.addColor(f,m,v),o!==void 0&&o!==""){let y=this.normals.length;f=this.parseNormalIndex(o,y),m=this.parseNormalIndex(l,y),v=this.parseNormalIndex(c,y),this.addNormal(f,m,v)}else this.addFaceNormal(f,m,v);if(r!==void 0&&r!==""){let y=this.uvs.length;f=this.parseUVIndex(r,y),m=this.parseUVIndex(s,y),v=this.parseUVIndex(a,y),this.addUV(f,m,v),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let n=0,r=e.length;n<r;n++){let s=this.parseVertexIndex(e[n],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";let n=this.vertices.length,r=this.uvs.length;for(let s=0,a=e.length;s<a;s++)this.addVertexLine(this.parseVertexIndex(e[s],n));for(let s=0,a=t.length;s<a;s++)this.addUVLine(this.parseUVIndex(t[s],r))}};return i.startObject("",!1),i}var Oh=class extends Kn{constructor(e){super(e),this.materials=null}load(e,t,n,r){let s=this,a=new Lr(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},n,r)}setMaterials(e){return this.materials=e,this}parse(e){let t=new MFe;e.indexOf(`\r
|
|
7771
7771
|
`)!==-1&&(e=e.replace(/\r\n/g,`
|
|
7772
7772
|
`)),e.indexOf(`\\
|
|
7773
7773
|
`)!==-1&&(e=e.replace(/\\\n/g,""));let n=e.split(`
|
package/package.json
CHANGED
|
@@ -386,9 +386,10 @@ export default class HoldingBlock implements IHoldingBlock {
|
|
|
386
386
|
}
|
|
387
387
|
const partialTick = Math.min((now - this.lastBobTickTime) / 50, 1)
|
|
388
388
|
|
|
389
|
+
const handBobSpeedMultiplier = 1.8
|
|
389
390
|
const bob = computeCameraBob({
|
|
390
|
-
walkDist: ps.walkDist,
|
|
391
|
-
prevWalkDist: ps.prevWalkDist,
|
|
391
|
+
walkDist: ps.walkDist * handBobSpeedMultiplier,
|
|
392
|
+
prevWalkDist: ps.prevWalkDist * handBobSpeedMultiplier,
|
|
392
393
|
bob: ps.bob,
|
|
393
394
|
prevBob: ps.prevBob,
|
|
394
395
|
partialTick
|