addQuantizedVertex Method

Add a vertex to the mesh and return its index in positions.

addQuantizedVertex(position: XYAndZ, uv: XAndY, normal?: number): number

@see addUnquantizedVertex if your vertex data is not already quantized.

@returns the index of the new vertex in positions.

@throws Error if normal is undefined but wantNormals was specified at construction of the builder, or vice-versa.

Parameter Type Description
position XYAndZ The 3d position, quantized to the positionRange supplied to the builder's constructor.
uv XAndY The texture coordinates, quantized to the uvRange supplied to the builder's constructor.
normal number The unsigned 16-bit OctEncodedNormal integer representation of the normal vector, to be supplied if and only if
wantNormals was true when the builder was constructed.

Returns - number

the index of the new vertex in positions.

Defined in

Last Updated: 04 June, 2026