SpotLight constructor
SpotLight([])
color
- (optional) hexadecimal color of the light. Default
is 0xffffff (white).
intensity
- (optional) numeric value of the light's
strength/intensity. Default is 1
.
distance
- Maximum range of the light. Default is 0
(no
limit).
angle
- Maximum angle of light dispersion from its
direction whose upper bound is pi/2.
penumbra
- Percent of the spotlight cone that is attenuated
due to penumbra. Takes values between zero and 1
. Default is zero.
decay
- The amount the light dims along the distance of the
light.
Implementation
SpotLight([super.color, super.intensity, double? distance, double? angle, double? penumbra, double? decay]){
type = "SpotLight";
position.setFrom(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();
}