PointLight.js 789 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. THREE.PointLight = function ( color, intensity, distance, decay ) {
  5. THREE.Light.call( this, color );
  6. this.type = 'PointLight';
  7. this.intensity = ( intensity !== undefined ) ? intensity : 1;
  8. this.distance = ( distance !== undefined ) ? distance : 0;
  9. this.decay = ( decay !== undefined ) ? decay : 1; // for physically correct lights, should be 2.
  10. };
  11. THREE.PointLight.prototype = Object.create( THREE.Light.prototype );
  12. THREE.PointLight.prototype.constructor = THREE.PointLight;
  13. THREE.PointLight.prototype.clone = function () {
  14. var light = new THREE.PointLight();
  15. THREE.Light.prototype.clone.call( this, light );
  16. light.intensity = this.intensity;
  17. light.distance = this.distance;
  18. light.decay = this.decay;
  19. return light;
  20. };