GltfPrimitive

One mesh primitive (one draw call's worth of geometry). Attribute arrays are tightly packed: positions are vec3, normals vec3, texCoords vec2, colors vec3 or vec4. Indices are either uint16 (most cases) or uint32 (large b3dms); exactly one will be non-null.

Properties

Link copied to clipboard

Per-vertex _BATCHID from b3dm — one uint16 per vertex (the glTF spec allows UNSIGNED_BYTE / UNSIGNED_SHORT / FLOAT; we normalise to a short, half the size of the original FLOAT path). Bound to the shader as GL_UNSIGNED_SHORT with normalized = false, so the vertex shader sees the actual integer batchId as a float. Null when the source has no _BATCHID attribute. Tiles with more than 65535 batches would overflow — those datasets need a wider format and are out of scope for now.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Index into GltfModel.materials, or -1 for the default white material.

Link copied to clipboard
val mode: Int

glTF primitive mode (4 = TRIANGLES, 1 = LINES, 0 = POINTS, etc.). Default 4.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard