addQuantizedVertex Method

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

addQuantizedVertex(position: Readonly<WritableXYAndZ>, uv: Readonly<WritableXAndY>, 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 Readonly<WritableXYAndZ> The 3d position, quantized to the positionRange supplied to the builder's constructor.
uv Readonly<WritableXAndY> 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: 17 May, 2024