DirectionalLight.js 875 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { Light } from './Light.js';
  2. import { DirectionalLightShadow } from './DirectionalLightShadow.js';
  3. import { Object3D } from '../core/Object3D.js';
  4. /**
  5. * @author mrdoob / http://mrdoob.com/
  6. * @author alteredq / http://alteredqualia.com/
  7. */
  8. function DirectionalLight( color, intensity ) {
  9. Light.call( this, color, intensity );
  10. this.type = 'DirectionalLight';
  11. this.position.copy( Object3D.DefaultUp );
  12. this.updateMatrix();
  13. this.target = new Object3D();
  14. this.shadow = new DirectionalLightShadow();
  15. }
  16. DirectionalLight.prototype = Object.assign( Object.create( Light.prototype ), {
  17. constructor: DirectionalLight,
  18. isDirectionalLight: true,
  19. copy: function ( source ) {
  20. Light.prototype.copy.call( this, source );
  21. this.target = source.target.clone();
  22. this.shadow = source.shadow.clone();
  23. return this;
  24. }
  25. } );
  26. export { DirectionalLight };
粤ICP备19079148号