MeshData constructor

MeshData({
  1. required Float32List positions,
  2. required int vertexCount,
  3. Float32List? normals,
  4. Float32List? texCoords,
  5. Float32List? colors,
  6. List<int>? indices,
  7. PrimitiveType primitiveType = gpu.PrimitiveType.triangle,
  8. Map<String, MeshAttributeData> customAttributes = const {},
})

Wraps already-prepared vertex arrays without generating anything.

Prefer MeshData.build, which fills in normals. Use this only when every attribute is already in hand. vertexCount must equal positions.length ~/ 3.

Implementation

MeshData({
  required this.positions,
  required this.vertexCount,
  this.normals,
  this.texCoords,
  this.colors,
  this.indices,
  this.primitiveType = gpu.PrimitiveType.triangle,
  this.customAttributes = const {},
});