DirectionalLight.js 678 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Light } from './Light.js';
  2. import { DirectionalLightShadow } from './DirectionalLightShadow.js';
  3. import { Object3D } from '../core/Object3D.js';
  4. class DirectionalLight extends Light {
  5. constructor( color, intensity ) {
  6. super( color, intensity );
  7. this.type = 'DirectionalLight';
  8. this.position.copy( Object3D.DefaultUp );
  9. this.updateMatrix();
  10. this.target = new Object3D();
  11. this.shadow = new DirectionalLightShadow();
  12. }
  13. copy( source ) {
  14. super.copy( source );
  15. this.target = source.target.clone();
  16. this.shadow = source.shadow.clone();
  17. return this;
  18. }
  19. }
  20. DirectionalLight.prototype.isDirectionalLight = true;
  21. export { DirectionalLight };