UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.03 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{a as e}from"../../../../chunks/vec32.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewVec3f as r}from"../../../../geometry/support/buffer/BufferView.js";import{intersectRenderGeometryTriangles as o}from"../lib/RayIntersections.js";import{VertexAttribute as i}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as s}from"./internal/bufferWriterUtils.js";class f{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(i.POSITION).indices.length}write(e,t,r,o,i,f){s(r,o,this.vertexBufferLayout,e,t,i,f)}intersect(t,s,f,u,m){const c=this.vertexBufferLayout.createView(t).getField(i.POSITION,r);if(null==c)return;const l=e(n,u,f),a=0,p=c.elementCount/3,y=s.options.normalRequired,b=(e,t,r)=>{m(e,r,t,!1)};o(f,l,a,p,c.typedBuffer,c.typedBufferStride,y,b)}}const n=t();export{f as DefaultBufferWriter};