@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.34 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{glLayout as e}from"../../../support/buffer/glUtil.js";import{Default3D as t}from"../DefaultVertexAttributeLocations.js";import{GLMaterials as r}from"../GLMaterials.js";import{VertexArrayObject as o}from"../VertexArrayObject.js";import{BufferObject as s}from"../../../../webgl/BufferObject.js";import{Usage as i}from"../../../../webgl/enums.js";class a{constructor(a,n){const m=a.renderContext.rctx,u=n.geometry,f=n.geometry.getRenderGeometry(),g=f.material;this._materials=a.materials,g.setParameters({instancedDoublePrecision:!0}),this.geometry=u,this.material=g,this.glMaterials=new r(g,this._materials),this.vertexBufferLayout=f.vertexBufferLayout,this.vbo=s.createVertex(m,i.STATIC_DRAW,f.buffer),this.vao=new o(m,t,new Map([["geometry",e(f.vertexBufferLayout)]]),new Map([["geometry",this.vbo]])),this.vertexCount=f.elementCount}destroy(){this.glMaterials.dispose(),this.vbo.dispose(),this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}get usedMemory(){return 128+this.vbo.usedMemory+this.vao.usedMemory}intersect(e,t,r,o,s,i,a,n){return this.geometry.intersect(e,t,r,o,s,i,a,n)}}export{a as LodComponentData};