Browse Source

Somehow DirectionalLightHelper init color fix escaped the last commit.

I wonder how this could happen, built lib from that commit does have corresponding change.
alteredq 12 years ago
parent
commit
4b25251aae
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/extras/helpers/DirectionalLightHelper.js

+ 5 - 3
src/extras/helpers/DirectionalLightHelper.js

@@ -23,9 +23,11 @@ THREE.DirectionalLightHelper = function ( light, sphereSize, arrowLength ) {
 
 	this.color = light.color.clone();
 
-	this.color.r *= light.intensity;
-	this.color.g *= light.intensity;
-	this.color.b *= light.intensity;
+	var intensity = THREE.Math.clamp( light.intensity, 0, 1 );
+
+	this.color.r *= intensity;
+	this.color.g *= intensity;
+	this.color.b *= intensity;
 
 	var hexColor = this.color.getHex();