Creates a new Mesh and uploads the geometry data to the GPU.
The WebGL context.
The geometry data to upload.
The number of elements (indices or vertices) to draw.
The element buffer object (indices).
The GL data type of the indices (e.g., UNSIGNED_SHORT or UNSIGNED_INT).
Whether this mesh uses indices for drawing.
The skinning joints buffer object.
The normal buffer object.
Number of live Object3D instances currently referencing this mesh's geometry.
The tangent buffer object.
The texture coordinate buffer object.
Lazily-built WebGL2 VAO capturing every vertex-attribute pointer at the engine-wide fixed
locations 0-5 (see WebGLProgramCache._FIXED_ATTRIBUTE_LOCATIONS), so a single
bindVertexArray replaces one bindBuffer+vertexAttribPointer+enableVertexAttribArray
per attribute. Never populated on WebGL1.
The vertex buffer object.
The skinning weights buffer object.
The wireframe element buffer object.
The number of wireframe elements.
The GL data type of the wireframe indices.
Whether this mesh can draw through a cached VAO (WebGL2 contexts only).
WebGL1 has no VAO support and keeps using bind().
Binds the buffers and sets the vertex attributes.
The location of the position attribute.
The location of the normal attribute.
The location of the UV attribute.
The location of the tangent attribute.
The location of the joints attribute.
The location of the weights attribute.
Binds this mesh's cached VAO (built lazily on first use), which restores every vertex
attribute pointer in one call instead of re-issuing per-attribute GL calls every draw.
The index buffer is NOT captured here -- draw() rebinds the element buffer it needs.
Deletes all GPU buffers owned by this mesh. Call only once its refCount reaches 0.
Draws the mesh using the appropriate GL call.
The draw mode (e.g. TRIANGLES, LINES).
Updates the GPU buffers with new geometry data. Currently updates vertices, normals and tangents.
The new geometry data.
Wrapper for WebGL vertex and index buffers. Handles both indexed and non-indexed geometry.