SunLight.js 814 B

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