HemisphereLight.js 780 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { Light } from './Light';
  2. import { Color } from '../math/Color';
  3. import { Object3D } from '../core/Object3D';
  4. /**
  5. * @author alteredq / http://alteredqualia.com/
  6. */
  7. function HemisphereLight( skyColor, groundColor, intensity ) {
  8. Light.call( this, skyColor, intensity );
  9. this.type = 'HemisphereLight';
  10. this.castShadow = undefined;
  11. this.position.copy( Object3D.DefaultUp );
  12. this.updateMatrix();
  13. this.groundColor = new Color( groundColor );
  14. }
  15. HemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), {
  16. constructor: HemisphereLight,
  17. isHemisphereLight: true,
  18. copy: function ( source ) {
  19. Light.prototype.copy.call( this, source );
  20. this.groundColor.copy( source.groundColor );
  21. return this;
  22. }
  23. } );
  24. export { HemisphereLight };