Browse Source

make default decayExponent backwards compatible, so existing scenes are unchanged.

Ben Houston 10 năm trước cách đây
mục cha
commit
c622b5be56
2 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 1 1
      src/lights/PointLight.js
  2. 1 1
      src/lights/SpotLight.js

+ 1 - 1
src/lights/PointLight.js

@@ -10,7 +10,7 @@ THREE.PointLight = function ( color, intensity, distance, decayExponent ) {
 
 	this.intensity = ( intensity !== undefined ) ? intensity : 1;
 	this.distance = ( distance !== undefined ) ? distance : 0;
-	this.decayExponent = ( decayExponent !== undefined ) ? decayExponent : 0;;	// for physically correct lights, should be 2.
+	this.decayExponent = ( decayExponent !== undefined ) ? decayExponent : 1;	// for physically correct lights, should be 2.
 
 };
 

+ 1 - 1
src/lights/SpotLight.js

@@ -15,7 +15,7 @@ THREE.SpotLight = function ( color, intensity, distance, angle, exponent, decayE
 	this.distance = ( distance !== undefined ) ? distance : 0;
 	this.angle = ( angle !== undefined ) ? angle : Math.PI / 3;
 	this.exponent = ( exponent !== undefined ) ? exponent : 10;
-	this.decayExponent = ( decayExponent !== undefined ) ? decayExponent : 0;;	// for physically correct lights, should be 2.
+	this.decayExponent = ( decayExponent !== undefined ) ? decayExponent : 1;	// for physically correct lights, should be 2.
 
 	this.castShadow = false;
 	this.onlyShadow = false;