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

2 lines
112 KiB
JavaScript
Raw Permalink Normal View History

2026-04-08 23:48:42 -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{a as i,i as a,o}from"./react-three-fiber.esm-El6vNTZj.js";import{t as s}from"./Html-CXAi5FD_.js";import{a as c,i as l,s as u}from"./SettingsProvider-BdqQ2Cm4.js";import{t as d}from"./useQuery-6REtM5HO.js";import{$ as f,B as p,Bt as m,Ct as h,F as g,G as _,Gt as v,I as y,It as b,J as x,K as S,L as C,M as w,Mt as T,Nt as E,O as D,Ot as O,P as k,Pt as ee,Q as A,R as j,St as M,T as N,U as P,Ut as F,V as I,W as L,Wt as R,Y as z,Z as te,a as B,at as V,b as H,bt as U,ct as W,d as G,dt as K,et as ne,f as re,ft as ie,gt as ae,h as oe,ht as se,i as ce,it as le,lt as ue,m as de,mt as fe,nt as pe,o as me,pt as he,q as ge,rt as _e,s as ve,st as q,tt as ye,ut as be,v as xe,vt as Se,wt as Ce,xt as we,yt as Te,z as Ee,zt as De}from"./three.module-DKAirPAO.js";import{_ as Oe,a as ke,c as Ae,g as je,h as Me,i as Ne,l as Pe,s as Fe,t as J,u as Ie,v as Le,y as Re}from"./playbackUtils-DuS6opSR.js";import{t as ze}from"./textureUtils-Bk_jPZib.js";import{d as Be,p as Ve,r as He}from"./loaders-5n1D4iOD.js";import{t as Ue}from"./logger-B058WGzf.js";import{a as We,i as Ge,n as Ke,r as qe,s as Je}from"./engineStore-B1KAgiiF.js";import{t as Ye}from"./useAnisotropy-D9othEmk.js";import{a as Xe,c as Ze,d as Qe,f as $e,i as et,l as tt,o as nt,p as rt,r as it}from"./AudioEmitter-3VHhCc7Y.js";import{r as at}from"./cameraTourStore-CtH3IrnD.js";import{t as ot}from"./DebugBounds-CZKrvsAw.js";import{t as st}from"./DebugSuspense-ChOWTvws.js";import{n as ct}from"./streamPlaybackStore-D5ldcfU5.js";function lt(e){let t=new Map,n=new Map,r=e.clone();return ut(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function ut(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)ut(e.children[r],t.children[r],n)}var dt=.1,ft=20;function pt(e){return-2*Math.atan2(e[1],e[3])}function mt(e,t,n,r){if(n)return{animation:`fall`,timeScale:1};if(!e)return{animation:`root`,timeScale:1};let[i,a,o]=e,s=i*i+a*a;if(Math.abs(o)>2||s>ft*ft)return r?{animation:`jet`,timeScale:1}:{animation:`root`,timeScale:1};let c=pt(t),l=Math.cos(c),u=Math.sin(c),d=i*l+a*u,f=-i*u+a*l,p=f,m=-f,h=-d,g=Math.max(p,m,h,d);return g<dt?{animation:`root`,timeScale:1}:g===p?{animation:`run`,timeScale:1}:g===m?{animation:`back`,timeScale:1}:g===h?{animation:`side`,timeScale:1}:{animation:`side`,timeScale:-1}}var ht=-1,gt=32,_t=1,vt=2,yt=3,bt=4,xt=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<gt;){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 _t:this.spinTimeScale=0;break;case bt:this.spinTimeScale=1;break;case vt:e===yt&&s>0&&(this.delayTime*=1-n/s);break;case yt:e===vt&&s>0&&(this.delayTime*=1-n/s);break}a=this.evaluateEntryTransition
`);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:`init`,decoderConfig:this.decoderConfig}),e.onmessage=function(t){let n=t.data;switch(n.type){case`decode`:e._callbacks[n.id].resolve(n);break;case`error`:e._callbacks[n.id].reject(n);break;default:console.error(`THREE.DRACOLoader: Unexpected message, "`+n.type+`"`)}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log(`Task load: `,this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}};function Nn(){let e,t;onmessage=function(r){let i=r.data;switch(i.type){case`init`:e=i.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case`decode`:let r=i.buffer,a=i.taskConfig;t.then(e=>{let t=e.draco,o=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(r),r.byteLength);try{let e=n(t,o,s,a),r=e.attributes.map(e=>e.array.buffer);e.index&&r.push(e.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(o)}});break}};function n(e,t,n,a){let o=a.attributeIDs,s=a.attributeTypes,c,l,u=t.GetEncodedGeometryType(n);if(u===e.TRIANGULAR_MESH)c=new e.Mesh,l=t.DecodeBufferToMesh(n,c);else if(u===e.POINT_CLOUD)c=new e.PointCloud,l=t.DecodeBufferToPointCloud(n,c);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!l.ok()||c.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+l.error_msg());let d={index:null,attributes:[]};for(let n in o){let r=self[s[n]],l,u;if(a.useUniqueIDs)u=o[n],l=t.GetAttributeByUniqueId(c,u);else{if(u=t.GetAttributeId(c,e[o[n]]),u===-1)continue;l=t.GetAttribute(c,u)}d.attributes.push(i(e,t,c,n,r,l))}return u===e.TRIANGULAR_MESH&&(d.index=r(e,t,c)),e.destroy(c),d}function r(e,t,n){let r=n.num_faces()*3,i=r*4,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}function i(e,t,n,r,i,o){let s=o.num_components(),c=n.num_points()*s,l=c*i.BYTES_PER_ELEMENT,u=a(e,i),d=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,o,u,l,d);let f=new i(e.HEAPF32.buffer,d,c).slice();return e._free(d),{name:r,array:f,itemSize:s}}function a(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}}var Pn,Fn=()=>{if(Pn)return Pn;let e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!=`object`)return{supported:!1};let n=`B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCb