Mesh constructor

Mesh({
  1. List<Vector3>? vertices,
  2. List<Vector3>? normals,
  3. List<Offset>? texcoords,
  4. List<Triangle>? indices,
  5. List<Color>? colors,
  6. Image? texture,
  7. bool hasTexture = false,
  8. Rect? textureRect,
  9. String? texturePath,
  10. Material? material,
  11. String? name,
})

Implementation

Mesh({
  List<Vector3>? vertices,
  List<Vector3>? normals,
  List<Offset>? texcoords,
  List<Triangle>? indices,
  List<Color>? colors,
  this.texture,
  this.hasTexture = false,
  Rect? textureRect,
  this.texturePath,
  Material? material,
  this.name,
}) {
  this.vertices = vertices ?? <Vector3>[];
  this.normals = normals ?? <Vector3>[];
  this.texcoords = texcoords ?? <Offset>[];
  this.colors = colors ?? <Color>[];
  this.indices = indices ?? <Triangle>[];
  this.material = material ?? Material();
  this.textureRect = textureRect ?? Rect.fromLTWH(0, 0, texture==null?1.0:texture!.width.toDouble(), texture==null?1.0:texture!.height.toDouble());
}