@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) • 754 B
JavaScript
function t(t){const n=t>65535?new Uint32Array(t):new Uint16Array(t);for(let r=0;r<t;r++)n[r]=r;return n}function n(t,n,r){const o=new Float32Array(3*r),e=n.length>0,c=e?n.length/3|0:r/3|0;for(let r=0;r<c;r++){const c=e?n[3*r]:3*r,l=e?n[3*r+1]:3*r+1,a=e?n[3*r+2]:3*r+2,f=t[3*c],h=t[3*c+1],i=t[3*c+2],s=t[3*l]-f,u=t[3*l+1]-h,y=t[3*l+2]-i,w=t[3*a]-f,A=t[3*a+1]-h,g=t[3*a+2]-i,p=u*g-y*A,U=y*w-s*g,x=s*A-u*w;o[3*c]+=p,o[3*c+1]+=U,o[3*c+2]+=x,o[3*l]+=p,o[3*l+1]+=U,o[3*l+2]+=x,o[3*a]+=p,o[3*a+1]+=U,o[3*a+2]+=x}for(let t=0;t<r;t++){const n=o[3*t],r=o[3*t+1],e=o[3*t+2],c=Math.hypot(n,r,e)||1;o[3*t]=n/c,o[3*t+1]=r/c,o[3*t+2]=e/c}return o}export{n as computeSmoothNormals,t as createSequentialIndices};
//# sourceMappingURL=gltf-normals-BSzLZia6.esm.min.js.map