ReadonlyvertexReadonlyindexReadonlyindexOptional ReadonlycolorOptional per-vertex color buffer (linear RGBA vec4 per vertex), bound at
vertex slot 1 by passes that compile the HAS_VERTEX_COLOR variant. Present
only when colors was supplied to Mesh.fromData.
Optional Readonlyuv1Optional second-UV-set buffer (glTF TEXCOORD_1, vec2 per vertex), bound at
vertex slot 2 by passes that compile the HAS_UV1 variant. Present only when
uv1 was supplied to Mesh.fromData.
Optional ReadonlyvertexInterleaved vertex floats kept when keepData was requested at creation.
Optional ReadonlyindexTriangle-list indices kept when keepData was requested at creation.
ReadonlyboundsLocal-space bounding-sphere center X (origin if the mesh had no vertices).
ReadonlyboundsLocal-space bounding-sphere center Y.
ReadonlyboundsLocal-space bounding-sphere center Z.
ReadonlyboundsLocal-space bounding-sphere radius. Used for frustum culling; transformed to world space per-instance by scaling with the model matrix.
True when this mesh carries a per-vertex colorBuffer.
True when this mesh carries a second UV set (uv1Buffer).
Destroys the underlying GPU vertex and index buffers (and color buffer, if any).
StaticfromCreates a mesh from interleaved vertex data and 32-bit indices.
The WebGPU device.
Interleaved vertex data laid out per VERTEX_ATTRIBUTES (12 floats per vertex).
Triangle list indices.
Optionalopts: MeshDataRetentionOptional retention flags. Default: GPU upload only, CPU arrays are not held.
A new mesh owning the uploaded GPU buffers.
StaticaddAppends a single axis-aligned box to an accumulator array.
Each vertex uses 12 floats (position/normal/uv/tangent — matching VERTEX_ATTRIBUTES). The box face set is identical to the one produced by createBox but allows multiple boxes to be packed into one combined mesh.
Accumulated vertex floats (12 per vertex).
Accumulated triangle-list indices.
Box center X.
Box center Y.
Box center Z.
Half-extent along X.
Half-extent along Y.
Half-extent along Z.
StaticcreateStaticcreateStaticcreateCreates a UV sphere centered at the origin with outward normals.
Tangents follow the +phi (longitude) direction.
The WebGPU device.
Sphere radius (defaults to 0.5).
Latitude (theta) subdivisions.
Longitude (phi) subdivisions.
Optionalopts: MeshDataRetentionThe sphere mesh.
StaticcreateCreates the upper half of a sphere — a dome with its apex at (0, radius, 0)
and its open rim on the XZ plane (the equator, y = 0). Outward normals,
CCW winding (front-facing from outside the dome). The rim is left open (no
base cap).
Rotate π about X to turn it into a ceiling dome bulging downward.
The WebGPU device.
Sphere radius (defaults to 0.5).
Subdivisions from apex to rim (defaults to 16).
Subdivisions around the axis (defaults to 32).
Optionalopts: MeshDataRetentionThe hemisphere (dome) mesh.
StaticcreateCreates a cone with apex at (0, height, 0) and base circle on the XZ plane.
Rotate the returned mesh so local +Y aligns with the desired axis.
The WebGPU device.
Base circle radius (defaults to 0.5).
Apex height above the base (defaults to 1.0).
Number of base ring segments.
Optionalopts: MeshDataRetentionThe cone mesh.
StaticcreateCreates a torus centered at the origin with its major axis aligned to +Y.
The WebGPU device.
Distance from the torus center to the tube center.
Tube radius.
Ring subdivisions around the major axis.
Ring subdivisions around the tube cross-section.
Optionalopts: MeshDataRetentionThe torus mesh with outward normals and CCW winding.
StaticcreateCreates a flat plane on the XZ plane (normal +Y) centered at the origin.
The WebGPU device.
Size along X (defaults to 10).
Size along Z (defaults to 10).
Subdivisions along X.
Subdivisions along Z.
Optionalopts: MeshDataRetentionThe plane mesh.
Static (non-skinned) GPU mesh: an interleaved vertex buffer plus a 32-bit index buffer.
Vertex layout matches
VERTEX_STRIDE/VERTEX_ATTRIBUTES. The mesh owns both buffers; calldestroy()to release them.When created with
keepData: true, the originalvertexDataandindexDataarrays are also retained on the instance.