All files / engine/Source/Scene SunLight.js

100% Statements 3/3
100% Branches 6/6
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32                            693x           693x             693x        
import Color from "../Core/Color.js";
import Frozen from "../Core/Frozen.js";
 
/**
 * A directional light source that originates from the Sun.
 *
 * @param {object} [options] Object with the following properties:
 * @param {Color} [options.color=Color.WHITE] The light's color.
 * @param {number} [options.intensity=2.0] The light's intensity.
 *
 * @alias SunLight
 * @constructor
 */
function SunLight(options) {
  options = options ?? Frozen.EMPTY_OBJECT;
  /**
   * The color of the light.
   * @type {Color}
   * @default Color.WHITE
   */
  this.color = Color.clone(options.color ?? Color.WHITE);
 
  /**
   * The intensity of the light.
   * @type {number}
   * @default 2.0
   */
  this.intensity = options.intensity ?? 2.0;
}
 
export default SunLight;