Geometry constructor
Geometry(
- Float32List vertices,
- Uint16List indices, {
- Float32List? normals,
- Float32List? uvs,
- PrimitiveType primitiveType = PrimitiveType.TRIANGLES,
Implementation
Geometry(
this.vertices,
this.indices, {
Float32List? normals,
Float32List? uvs,
this.primitiveType = PrimitiveType.TRIANGLES,
}) {
this.uvs = uvs ?? Float32List(0);
this.normals = normals ?? Float32List(0);
if (this.uvs.length != 0 && this.uvs.length != (vertices.length ~/ 3 * 2)) {
throw Exception(
"Expected either ${indices.length * 2} UVs, got ${this.uvs!.length}");
}
}