PageSourceSearch

https://motifect.io/assets/skeletonDebugLayer-PXa58NUY.js

js motifect.io collected 2026-10-05 22:20:13 UTC 2,724 bytes, 1 lines download raw bytes

1import{G as C,R as V,T as x,y as I,u as ee,p as i,t as te}from"./viewer-vendor-C7Qr0WFJ.js";const B=.08,N=.022,oe=.032,ne=.5,se=.09,le=.32,re=-.04,ce=.18,ae=8,ie=12,de=10,p=new i,D=new i,g=new i,U=new i,ue=new i,L=new i,J=new i,z=new i,b=new i,he=new i(0,1,0),fe=o=>new ee({color:o,roughness:.48,metalness:.04}),pe=(o,S=[])=>{if(!S.length)return o;const u=new Set(S.filter(r=>r>=0));if(!u.size)return o;const l=[];for(let r=0;r*3<o.length;r+=1){if(u.has(r))continue;const c=r*3;l.push(o[c],o[c+1],o[c+2])}return l},Se=(o,S,u)=>{b.copy(u).sub(S);const l=b.length();return l<1e-5?!1:(z.copy(S).add(u).multiplyScalar(.5),o.position.copy(z),o.scale.set(1,l,1),o.quaternion.setFromUnitVectors(he,b.multiplyScalar(1/l)),!0)},we=({skeletonColor:o,faceColor:S})=>{const u=new C,l=new C,r=new C,c=new C;l.frustumCulled=!1,r.frustumCulled=!1,c.frustumCulled=!1,u.add(l,r,c);const a=fe(o),R=new V(N,N,1,ae,1,!1),T=new x(oe,ie,de),H=new x(B,24,24),F=new I(H,a);c.add(F);const m=[],w=[],E=[];let y=!0,A=!1,G=0,O=0;const f=()=>{l.visible=y,r.visible=y,c.visible=y&&A;for(let e=0;e<m.length;e+=1)m[e].visible=y&&e<G&&w[e];for(let e=0;e<E.length;e+=1)E[e].visible=y&&e<O},k=e=>{for(;m.length<e;){const n=new I(R,a);n.frustumCulled=!1,l.add(n),m.push(n),w.push(!1)}},q=e=>{for(;E.length<e;){const n=new I(T,a);n.frustumCulled=!1,r.add(n),E.push(n)}},P=e=>{y=!!e,f()},W=e=>{a.color.set(e)},X=e=>{a.transparent=e,a.opacity=e?.72:1,a.depthTest=!e,a.depthWrite=!e,a.needsUpdate=!0,l.renderOrder=e?20:0,r.renderOrder=e?20:0,c.renderOrder=e?20:0},Y=(e,n,_=[])=>{const M=Math.floor((e?.length||0)/6);k(M),G=M;for(let t=0;t<M;t+=1){const s=t*6;L.set(e[s],e[s+1],e[s+2]),J.set(e[s+3],e[s+4],e[s+5]),w[t]=Se(m[t],L,J)}for(let t=M;t<w.length;t+=1)w[t]=!1;const d=pe(n,_),h=Math.floor(d.length/3);q(h),O=h;for(let t=0;t<h;t+=1){const s=t*3;E[t].position.set(d[s],d[s+1],d[s+2])}f()},j=e=>{const n=e?.neck||null,_=e?.head||null,M=e?.headTop||null,d=e?.leftShoulder||null,h=e?.rightShoulder||null;if(!n||!_){A=!1,f();return}const t=M||_.clone().add(ue.copy(_).sub(n));p.copy(t).sub(n);const s=p.length();if(s<1e-6){A=!1,f();return}if(p.normalize(),d&&h&&(D.copy(d).sub(h),D.lengthSq()>1e-8&&(D.normalize(),g.crossVectors(D,p),g.lengthSq()>1e-8))){g.normalize(),U.crossVectors(p,g).normalize();const $=new te().makeBasis(U,p,g);c.quaternion.setFromRotationMatrix($)}const Z=d&&h?d.distanceTo(h):0,v=Math.max(s*ne,Z*ce,se);c.position.copy(_).lerp(t,le).addScaledVector(p,v*re),c.scale.setScalar(v/B),A=!0,f()},K=()=>{A=!1,f()},Q=()=>{R.dispose(),T.dispose(),H.dispose(),a.dispose(),m.length=0,w.length=0,E.length=0};return f(),{group:u,clearHeadPose:K,dispose:Q,setColors:W,setVisibility:P,setXRayMode:X,updateGeometry:Y,updateHeadPose:j}};export{we as c};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.