/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{sub as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewVec3f as e}from"../../../../geometry/support/buffer/BufferView.js";import{intersectRenderGeometryTriangles as o}from"../lib/RayIntersections.js";import{writeAttributes as i}from"./internal/bufferWriterUtils.js";class s{constructor(t){this.layout=t}elementCount(t){return t.get("position").indices.length}write(t,r,e,o,s,n){return i(e,o,this.layout,t,r,s,n)}intersect(r,i,s,f,l,u,c){const m=this.layout.createView(r).getField("position",e);if(null==m)return;const p=t(n,u,l),a=0,y=m.count/3,d=f.options.normalRequired,g=(t,r,e)=>c(t,e,r);o(l,p,a,y,m.typedBuffer,m.typedBufferStride,d,g)}}const n=r();export{s as DefaultBufferWriter};
