/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{glLayout as e}from"../../../support/buffer/glUtil.js";import{GLMaterialLoader as t}from"../GLMaterialLoader.js";import{VertexArrayObject as r}from"../VertexArrayObject.js";import{VertexBuffer as s}from"../../../../webgl/VertexBuffer.js";class i{constructor(i,o){this.geometry=o;const n=i.renderContext.rctx,a=o.renderGeometry,{material:m,layout:u,buffer:l}=a;this._materials=i.materials,m.setParameters({instancedDoublePrecision:!0}),this.glMaterialLoader=new t(m,this._materials),this.vbo=new s(n,e(u),l),this.vao=new r(n,this.vbo)}destroy(){this.glMaterialLoader.dispose(),this.vbo.dispose(),this.vao.dispose()}get material(){return this.geometry.renderGeometry.material}get emissions(){return this.material.emissions}get layout(){return this.geometry.renderGeometry.layout}get boundingInfo(){return this.geometry.boundingInfo}get numTriangles(){return this.numVertices/3}get numVertices(){return this.geometry.renderGeometry.numVertices}get usedMemory(){return 128+this.vbo.usedMemory+this.vao.usedMemory}intersect(e,t,r,s,i,o,n,a){return this.geometry.intersect(e,t,r,s,i,o,n,a)}}export{i as LodComponentData};
