copy method

  1. @override
MeshPhysicalMaterial copy(
  1. Material source
)
override

Copy the parameters from the passed material into this material.

Implementation

@override
MeshPhysicalMaterial copy(Material source) {
  super.copy(source);

  defines = {'STANDARD': '', 'PHYSICAL': ''};

  clearcoat = source.clearcoat;
  clearcoatMap = source.clearcoatMap;
  clearcoatRoughness = source.clearcoatRoughness;
  clearcoatRoughnessMap = source.clearcoatRoughnessMap;
  clearcoatNormalMap = source.clearcoatNormalMap;
  clearcoatNormalScale!.setFrom(source.clearcoatNormalScale!);

  ior = source.ior;

  if (source.sheenColor != null) {
    sheenColor!.setFrom(source.sheenColor!);
  } else {
    sheenColor = null;
  }

  sheenColorMap = source.sheenColorMap;
  sheenRoughness = source.sheenRoughness;
  sheenRoughnessMap = source.sheenRoughnessMap;

  transmission = source.transmission;
  transmissionMap = source.transmissionMap;

  thickness = source.thickness;
  thicknessMap = source.thicknessMap;

  attenuationColor!.setFrom(source.attenuationColor!);
  attenuationDistance = source.attenuationDistance;

  specularIntensity = source.specularIntensity;
  specularIntensityMap = source.specularIntensityMap;
  specularColor!.setFrom(source.specularColor!);
  specularColorMap = source.specularColorMap;

  return this;
}