Geometry constructor

Geometry(
  1. Float32List vertices,
  2. List<int> indices, {
  3. Float32List? normals,
  4. Float32List? uvs,
  5. PrimitiveType primitiveType = PrimitiveType.TRIANGLES,
})

Implementation

Geometry(
  this.vertices,
  List<int> indices, {
  Float32List? normals,
  Float32List? uvs,
  this.primitiveType = PrimitiveType.TRIANGLES,
})  : indices = Uint16List.fromList(indices),
      normals = normals ?? Float32List(0),
      uvs = uvs ?? Float32List(0) {
  assert(this.uvs.length == 0 || this.uvs.length == (vertices.length ~/ 3) * 2);
}