12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{mathLogger as e}from"../geometry/support/buffer/math/common.js";function t(t,r,f){if(t.count!==r.count)return void e.error("source and destination buffers need to have the same number of elements");const o=t.count,n=f[0],u=f[1],d=f[2],s=f[3],c=f[4],i=f[5],a=f[6],p=f[7],y=f[8],B=f[9],m=f[10],l=f[11],S=f[12],h=f[13],b=f[14],M=f[15],v=t.typedBuffer,g=t.typedBufferStride,_=r.typedBuffer,j=r.typedBufferStride;for(let e=0;e<o;e++){const t=e*g,r=e*j,f=_[r],o=_[r+1],z=_[r+2],O=_[r+3];v[t]=n*f+c*o+y*z+S*O,v[t+1]=u*f+i*o+B*z+h*O,v[t+2]=d*f+a*o+m*z+b*O,v[t+3]=s*f+p*o+l*z+M*O}}function r(t,r,f){if(t.count!==r.count)return void e.error("source and destination buffers need to have the same number of elements");const o=t.count,n=f[0],u=f[1],d=f[2],s=f[3],c=f[4],i=f[5],a=f[6],p=f[7],y=f[8],B=t.typedBuffer,m=t.typedBufferStride,l=r.typedBuffer,S=r.typedBufferStride;for(let e=0;e<o;e++){const t=e*m,r=e*S,f=l[r],o=l[r+1],h=l[r+2],b=l[r+3];B[t]=n*f+s*o+a*h,B[t+1]=u*f+c*o+p*h,B[t+2]=d*f+i*o+y*h,B[t+3]=b}}function f(e,t){const r=Math.min(e.count,t.count),f=e.typedBuffer,o=e.typedBufferStride,n=t.typedBuffer,u=t.typedBufferStride;for(let d=0;d<r;d++){const e=d*o,t=d*u,r=n[t],s=n[t+1],c=n[t+2],i=r*r+s*s+c*c;if(i>0){const t=1/Math.sqrt(i);f[e]=t*r,f[e+1]=t*s,f[e+2]=t*c}}}function o(e,t,r){const f=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,u=t.typedBuffer,d=t.typedBufferStride;for(let s=0;s<f;s++){const e=s*n,t=s*d;o[e]=r*u[t],o[e+1]=r*u[t+1],o[e+2]=r*u[t+2],o[e+3]=r*u[t+3]}}function n(e,t,r){const f=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,u=t.typedBuffer,d=t.typedBufferStride;for(let s=0;s<f;s++){const e=s*n,t=s*d;o[e]=u[t]>>r,o[e+1]=u[t+1]>>r,o[e+2]=u[t+2]>>r,o[e+3]=u[t+3]>>r}}const u=Object.freeze(Object.defineProperty({__proto__:null,transformMat4:t,transformMat3:r,normalize:f,scale:o,shiftRight:n},Symbol.toStringTag,{value:"Module"}));export{n as a,t as b,f as n,o as s,r as t,u as v};
|