HemisphereLight.js 605 B

12345678910111213141516171819202122232425262728293031323334
  1. import { Light } from './Light.js';
  2. import { Color } from '../math/Color.js';
  3. import { Object3D } from '../core/Object3D.js';
  4. class HemisphereLight extends Light {
  5. constructor( skyColor, groundColor, intensity ) {
  6. super( skyColor, intensity );
  7. this.isHemisphereLight = true;
  8. this.type = 'HemisphereLight';
  9. this.position.copy( Object3D.DEFAULT_UP );
  10. this.updateMatrix();
  11. this.groundColor = new Color( groundColor );
  12. }
  13. copy( source, recursive ) {
  14. super.copy( source, recursive );
  15. this.groundColor.copy( source.groundColor );
  16. return this;
  17. }
  18. }
  19. export { HemisphereLight };