t2-mapper/docs/assets/PlayerModel-Beu7pkFZ.js

1 line
18 KiB
JavaScript
Raw Normal View History

2026-03-18 06:26:17 -07:00
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{i}from"./react-three-fiber.esm-dhSWjERg.js";import{a}from"./SettingsProvider-2cUUftaX.js";import{S as o,a as s,d as c,f as l,i as u,l as d,p as f,r as p,t as m}from"./GenericShape-DCImTyf2.js";import"./logger-zy3b0zcG.js";import"./traditional-BTL5qX2E.js";import{$ as h,Q as g,bt as _,i as v,o as y,s as b}from"./three.module-CwgFV8Kd.js";import"./mission-CFLOK_Oy.js";import{a as x,i as S,o as C}from"./engineStore-Cio8vU1L.js";import{r as ee}from"./loaders-C_1cX1lR.js";import{n as w}from"./AudioContext-B-BTQZ7_.js";import"./FloatingLabel-CXLHy5vc.js";import{getCachedAudioBuffer as te,getSoundGeneration as ne,playOneShotSound as re,resolveAudioProfile as ie,trackSound as T,untrackSound as E}from"./AudioEmitter-DQcaN3l9.js";import{t as D}from"./DebugSuspense-DTOoTVsz.js";import{n as O}from"./streamPlaybackStore-CszjeINn.js";import{c as ae}from"./globalFogUniforms-DQn9KFk6.js";import{t as k}from"./ShapeErrorBoundary-BDMn5cgT.js";var A=t(),j=e(n(),1),M=.1;function N(e){return-2*Math.atan2(e[1],e[3])}function P(e,t,n,r){if(n)return{animation:`fall`,timeScale:1};if(r)return{animation:`jet`,timeScale:1};if(!e)return{animation:`root`,timeScale:1};let[i,a,o]=e;if(Math.abs(o)>2)return{animation:`root`,timeScale:1};let s=N(t),c=Math.cos(s),l=Math.sin(s),u=i*c+a*l,d=-i*l+a*c,f=d,p=-d,m=-u,h=u,g=Math.max(f,p,m,h);return g<M?{animation:`root`,timeScale:1}:g===f?{animation:`run`,timeScale:1}:g===p?{animation:`back`,timeScale:1}:g===m?{animation:`side`,timeScale:1}:{animation:`side`,timeScale:-1}}var F=-1,I=32,L=1,R=2,z=3,B=4,V=class{states;seqIndexToName;currentStateIndex=0;delayTime=0;lastFireCount=-1;spinTimeScale=0;constructor(e,t){this.states=e,this.seqIndexToName=t,e.length>0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(this.states.length===0)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let r=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&r.push(t)}}this.delayTime-=e;let i=n,a=this.evaluateTickTransitions(t),o=0;for(;a>=0&&o<I;){if(o++,i=!0,a===this.currentStateIndex){this.delayTime=this.states[a].timeoutValue??0;break}let e=this.states[this.currentStateIndex].spin,n=this.delayTime;this.currentStateIndex=a;let s=this.states[a].timeoutValue??0;this.delayTime=s;let c=this.states[a].soundDataBlockId;switch(c>=0&&r.push(c),this.states[a].spin){case L:this.spinTimeScale=0;break;case B:this.spinTimeScale=1;break;case R:e===z&&s>0&&(this.delayTime*=1-n/s);break;case z:e===R&&s>0&&(this.delayTime*=1-n/s);break}a=this.evaluateEntryTransitions(t)}let s=this.states[this.currentStateIndex],c=s.timeoutValue??0;switch(s.spin){case L:this.spinTimeScale=0;break;case R:this.spinTimeScale=c>0?Math.max(0,1-this.delayTime/c):1;break;case B:this.spinTimeScale=1;break;case z:this.spinTimeScale=c>0?Math.max(0,this.delayTime/c):0;break}return{sequenceName:this.resolveSequenceName(s),isFiring:s.fire,spinTimeScale:this.spinTimeScale,reverse:!s.direction,scaleAnimation:s.scaleAnimation,timeoutValue:s.timeoutValue??0,transitioned:i,soundDataBlockIds:r,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return-1;let r=this.evaluateConditions(t,e);if(r!==-1)return r;if(n){let e=t.transitionOnTimeout;if(e!==F)return e}return-1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(n!==F)return n;let r=t.amm