DirectionalLight.js 883 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. * @author alteredq / http://alteredqualia.com/
  4. */
  5. THREE.DirectionalLight = function ( color, intensity ) {
  6. THREE.Light.call( this, color );
  7. this.type = 'DirectionalLight';
  8. this.position.set( 0, 1, 0 );
  9. this.updateMatrix();
  10. this.target = new THREE.Object3D();
  11. this.intensity = ( intensity !== undefined ) ? intensity : 1;
  12. this.shadow = new THREE.LightShadow( new THREE.OrthographicCamera( - 500, 500, 500, - 500, 50, 5000 ) );
  13. };
  14. THREE.DirectionalLight.prototype = Object.create( THREE.Light.prototype );
  15. THREE.DirectionalLight.prototype.constructor = THREE.DirectionalLight;
  16. THREE.DirectionalLight.prototype.copy = function ( source ) {
  17. THREE.Light.prototype.copy.call( this, source );
  18. this.intensity = source.intensity;
  19. this.target = source.target.clone();
  20. this.shadow = source.shadow.clone();
  21. return this;
  22. };
粤ICP备19079148号