UArLightEstimate.fromMap constructor

UArLightEstimate.fromMap(
  1. Map<Object?, Object?> map
)

Implementation

factory UArLightEstimate.fromMap(Map<Object?, Object?> map) {
  final List<double> direction = _doubles(map["direction"]);
  final List<double> main = _doubles(map["mainIntensity"]);
  final List<double> correction = _doubles(map["colorCorrection"]);
  return UArLightEstimate(
    intensity: _d(map["intensity"], 1),
    colorTemperature: _d(map["colorTemperature"], 6500),
    colorCorrection: correction.length == 4 ? correction : const <double>[1, 1, 1, 1],
    direction: direction.length == 3 ? UArVector3.fromList(direction) : null,
    mainIntensity: main.length == 3 ? UArVector3.fromList(main) : null,
    sphericalHarmonics: _doubles(map["sh"]),
  );
}