SpotLight constructor

SpotLight(
  1. dynamic color, [
  2. dynamic intensity,
  3. double? distance,
  4. dynamic angle,
  5. dynamic penumbra,
  6. dynamic decay,
])

Implementation

SpotLight(color, [intensity, double? distance, angle, penumbra, decay]) : super(color, intensity) {
  type = "SpotLight";
  position.copy(Object3D.defaultUp);
  updateMatrix();

  target = Object3D();

  // remove default 0  for js 0 is false  but for dart 0 is not.
  // SpotLightShadow.updateMatrices  far value
  this.distance = distance;
  this.angle = angle ?? Math.pi / 3;
  this.penumbra = penumbra ?? 0;
  this.decay = decay ?? 1; // for physically correct lights, should be 2.

  shadow = SpotLightShadow();
}