createMaterialType method

dynamic createMaterialType(
  1. dynamic materialType,
  2. Map<String, dynamic> materialParams
)

Implementation

createMaterialType(materialType, Map<String, dynamic> materialParams) {
  if (materialType == GLTFMeshStandardSGMaterial) {
    return GLTFMeshStandardSGMaterial(materialParams);
  } else if (materialType == MeshBasicMaterial) {
    return MeshBasicMaterial(materialParams);
  } else if (materialType == MeshPhysicalMaterial) {
    return MeshPhysicalMaterial(materialParams);
  } else if (materialType == MeshStandardMaterial) {
    return MeshStandardMaterial(materialParams);
  } else {
    throw ("GLTFParser createMaterialType materialType: ${materialType.runtimeType.toString()} is not support ");
  }
}