UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

3 lines (2 loc) 1.46 kB
import{aj as t,F as e,U as n}from"./index-DFZFpUG-.esm.min.js";function i(t){if(t instanceof e)return t;const i=t instanceof n?1/65535:1/255,o=t,s=new e(o.length);for(let t=0;t<o.length;t++)s[t]=o[t]*i;return s}function o(e,n,i,o,s){if(i&&i._attributes.has(e))return i._attributes.get(e);const r=n.attributes?.[e];if(void 0===r)return null;const a=o.accessors[r],c=void 0!==a.bufferView?o.bufferViews[a.bufferView]:void 0,d=5126===a.componentType||5125===a.componentType?4:5123===a.componentType||5122===a.componentType?2:1,u=c?.byteStride;return void 0===c||void 0===u||u===4*d?t(o,s,r)._data:import("./gltf-strided-attribute-DTNaShix.esm.min.js").then(t=>t.copyStridedAttribute(a,c,s,4,d))}const s={id:"_skeleton",async applyMesh(t,e,n){const{_json:s,_binChunk:r,_parentMap:a,_worldMatrixCache:c}=n,d=s.nodes[t._nodeIndex];if(void 0===d.skin||!s.skins)return;const u=t._primitive,p=t._decoded,l=await o("JOINTS_0",u,p,s,r),m=await o("WEIGHTS_0",u,p,s,r);if(!l||!m)return;const f=i(m),_=await o("JOINTS_1",u,p,s,r),w=await o("WEIGHTS_1",u,p,s,r),b=w?i(w):null,[{extractSkin:y,computeBoneTextureData:k},{createSkeleton:T}]=await Promise.all([import("./gltf-animation-hYBmlaQq.esm.min.js"),import("./create-skeleton-D2YG0BI_.esm.min.js")]),h=y(s,r,d.skin,t._worldMatrix,a,c),S=k(h);e.skeleton=T(n._engine,l,f,h.jointNodes.length,S,_,b)},applyAsset:async(t,e,n)=>({})};export{s as default}; //# sourceMappingURL=gltf-feature-skeleton-1ZswGHFZ.esm.min.js.map