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) 850 B
import{i as e,ai as t,d as n,B as s}from"./index-DFZFpUG-.esm.min.js";function f(f,r,i,u,o,l,g){const h=f._device,a=4*u,w=h.createTexture({size:[a,1],format:"rgba32float",usage:e.TEXTURE_BINDING|e.COPY_DST});h.queue.writeTexture({texture:w},o.buffer,{bytesPerRow:16*a},{width:a,height:1});const B=new t(r.length);for(let e=0;e<r.length;e++)B[e]=r[e];const E=n(f,B,s.VERTEX),T=n(f,i,s.VERTEX);let c=null,j=null;if(l&&g){const e=new t(l.length);for(let t=0;t<l.length;t++)e[t]=l[t];c=n(f,e,s.VERTEX),j=n(f,g,s.VERTEX)}return{boneTexture:w,boneCount:u,jointsBuffer:E,weightsBuffer:T,joints:r,weights:i,boneMatrices:o,joints1Buffer:c,weights1Buffer:j,joints1:l??null,weights1:g??null,_skinBuffers:{jointsBuffer:E,weightsBuffer:T,joints1Buffer:c,weights1Buffer:j}}}export{f as createSkeleton}; //# sourceMappingURL=create-skeleton-D2YG0BI_.esm.min.js.map