Browse Source

More specific checks.

Mr.doob 12 years ago
parent
commit
7ecf796dc1

+ 2 - 2
src/extras/helpers/DirectionalLightHelper.js

@@ -51,7 +51,7 @@ THREE.DirectionalLightHelper = function ( light, sphereSize ) {
 
 
 	this.targetSphere = null;
 	this.targetSphere = null;
 
 
-	if ( light.target.properties.targetInverse ) {
+	if ( light.target.properties.targetInverse !== undefined ) {
 
 
 		var targetGeo = new THREE.SphereGeometry( sphereSize, 8, 4 );
 		var targetGeo = new THREE.SphereGeometry( sphereSize, 8, 4 );
 		var targetMaterial = new THREE.MeshBasicMaterial( { color: hexColor, wireframe: true, fog: false } );
 		var targetMaterial = new THREE.MeshBasicMaterial( { color: hexColor, wireframe: true, fog: false } );
@@ -100,7 +100,7 @@ THREE.DirectionalLightHelper.prototype.update = function () {
 	this.lightRays.material.color.copy( this.color );
 	this.lightRays.material.color.copy( this.color );
 
 
 	// Only update targetSphere and targetLine if available
 	// Only update targetSphere and targetLine if available
-	if ( this.targetSphere ) {
+	if ( this.targetSphere !== null ) {
 
 
 		this.targetSphere.material.color.copy( this.color );
 		this.targetSphere.material.color.copy( this.color );
 		this.targetLine.material.color.copy( this.color );
 		this.targetLine.material.color.copy( this.color );

+ 3 - 3
src/extras/helpers/SpotLightHelper.js

@@ -70,7 +70,7 @@ THREE.SpotLightHelper = function ( light, sphereSize ) {
 
 
 	this.targetSphere = null;
 	this.targetSphere = null;
 
 
-	if ( light.target.properties.targetInverse ) {
+	if ( light.target.properties.targetInverse !== undefined ) {
 
 
 		var targetGeo = new THREE.SphereGeometry( sphereSize, 8, 4 );
 		var targetGeo = new THREE.SphereGeometry( sphereSize, 8, 4 );
 		var targetMaterial = new THREE.MeshBasicMaterial( { color: hexColor, wireframe: true, fog: false } );
 		var targetMaterial = new THREE.MeshBasicMaterial( { color: hexColor, wireframe: true, fog: false } );
@@ -128,7 +128,7 @@ THREE.SpotLightHelper.prototype.update = function () {
 	this.lightCone.material.color.copy( this.color );
 	this.lightCone.material.color.copy( this.color );
 
 
 	// Only update targetSphere and targetLine if available
 	// Only update targetSphere and targetLine if available
-	if ( this.targetSphere ) {
+	if ( this.targetSphere !== null ) {
 
 
 		this.targetSphere.material.color.copy( this.color );
 		this.targetSphere.material.color.copy( this.color );
 		this.targetLine.material.color.copy( this.color );
 		this.targetLine.material.color.copy( this.color );
@@ -140,7 +140,7 @@ THREE.SpotLightHelper.prototype.update = function () {
 
 
 		this.targetLine.geometry.computeLineDistances();
 		this.targetLine.geometry.computeLineDistances();
 		this.targetLine.geometry.verticesNeedUpdate = true;
 		this.targetLine.geometry.verticesNeedUpdate = true;
-	
+
 	}
 	}
 
 
 };
 };