UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 1.17 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */ import{newLayout as e}from"../../../support/buffer/InterleavedLayout.js";import{NoParameters as t}from"../../../../webgl/NoParameters.js";class s{constructor(e,t,s,o,r){this.vertices=e,this.positions=t,this.indices=s,this.componentOffsets=o,this.parameters=r}}class o extends t{constructor(e,t,s,o){super(),this.layout=e,this.shadeNormals=t,this.textureCoordinateType=s,this.hasModelRotationScale=o}get hasVertexColors(){return this.layout.some(({name:e})=>"color"===e)}get hasNormals(){return this.layout.some(({name:e})=>"normalCompressed"===e)}}class r extends t{constructor(e,t,s){super(),this.hasVertexColors=e,this.hasNormals=t,this.textureCoordinateType=s}}function a(t){const s=e().vec3f("position");return t.hasNormals&&s.vec2i16("normalCompressed",{glNormalized:!0}),1===t.textureCoordinateType?s.vec2f("uv0"):2===t.textureCoordinateType&&(s.vec2f("uv0"),s.vec4u16("uvRegion",{glNormalized:!0})),t.hasVertexColors&&s.vec4u8("color",{glNormalized:!0}),s.freeze()}export{o as ComponentGeometryParameters,s as SourceGeometry,r as VertexBufferLayoutCreationParameters,a as createVertexBufferLayout};