extendParams method
dynamic
extendParams()
Implementation
extendParams(Map<String, dynamic> materialParams, Map<String, dynamic> materialDef, parser) async {
List<Future> pending = [];
materialParams["color"] = Color(1.0, 1.0, 1.0);
materialParams["opacity"] = 1.0;
Map<String, dynamic> metallicRoughness = materialDef["pbrMetallicRoughness"];
if (metallicRoughness["baseColorFactor"] is List) {
List<double> array = List<double>.from(metallicRoughness["baseColorFactor"].map((e) => e.toDouble()).toList());
materialParams["color"].fromArray(array);
materialParams["opacity"] = array[3];
}
if (metallicRoughness["baseColorTexture"] != null) {
pending.add(parser.assignTexture(materialParams, 'map', metallicRoughness["baseColorTexture"]));
}
return Future.wait(pending);
}