Sfoglia il codice sorgente

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 anni fa
parent
commit
4b25251aae
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  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 = 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();
 	var hexColor = this.color.getHex();