Parcourir la source

Merge pull request #11634 from WestLangley/dev-light_helpers

Light Helpers: prevent console warning from undefined color
Mr.doob il y a 8 ans
Parent
commit
373f2f135f

+ 1 - 1
src/helpers/DirectionalLightHelper.js

@@ -34,7 +34,7 @@ function DirectionalLightHelper( light, size, color ) {
 		- size,   size, 0
 		- size,   size, 0
 	], 3 ) );
 	], 3 ) );
 
 
-	var material = new LineBasicMaterial( { fog: false, color: this.color } );
+	var material = new LineBasicMaterial( { fog: false } );
 
 
 	this.lightPlane = new Line( geometry, material );
 	this.lightPlane = new Line( geometry, material );
 	this.add( this.lightPlane );
 	this.add( this.lightPlane );

+ 1 - 1
src/helpers/HemisphereLightHelper.js

@@ -28,7 +28,7 @@ function HemisphereLightHelper( light, size, color ) {
 	var geometry = new OctahedronBufferGeometry( size );
 	var geometry = new OctahedronBufferGeometry( size );
 	geometry.rotateY( Math.PI * 0.5 );
 	geometry.rotateY( Math.PI * 0.5 );
 
 
-	this.material = new MeshBasicMaterial( { wireframe: true, fog: false, color: this.color } );
+	this.material = new MeshBasicMaterial( { wireframe: true, fog: false } );
 	if ( this.color === undefined ) this.material.vertexColors = VertexColors;
 	if ( this.color === undefined ) this.material.vertexColors = VertexColors;
 
 
 	var position = geometry.getAttribute( 'position' );
 	var position = geometry.getAttribute( 'position' );

+ 1 - 1
src/helpers/PointLightHelper.js

@@ -15,7 +15,7 @@ function PointLightHelper( light, sphereSize, color ) {
 	this.color = color;
 	this.color = color;
 
 
 	var geometry = new SphereBufferGeometry( sphereSize, 4, 2 );
 	var geometry = new SphereBufferGeometry( sphereSize, 4, 2 );
-	var material = new MeshBasicMaterial( { wireframe: true, fog: false, color: this.color } );
+	var material = new MeshBasicMaterial( { wireframe: true, fog: false } );
 
 
 	Mesh.call( this, geometry, material );
 	Mesh.call( this, geometry, material );
 
 

+ 1 - 1
src/helpers/RectAreaLightHelper.js

@@ -22,7 +22,7 @@ function RectAreaLightHelper( light, color ) {
 
 
 	this.color = color;
 	this.color = color;
 
 
-	var material = new LineBasicMaterial( { fog: false, color: this.color } );
+	var material = new LineBasicMaterial( { fog: false } );
 
 
 	var geometry = new BufferGeometry();
 	var geometry = new BufferGeometry();
 
 

+ 1 - 1
src/helpers/SpotLightHelper.js

@@ -47,7 +47,7 @@ function SpotLightHelper( light, color ) {
 
 
 	geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
 	geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
 
 
-	var material = new LineBasicMaterial( { fog: false, color: this.color } );
+	var material = new LineBasicMaterial( { fog: false } );
 
 
 	this.cone = new LineSegments( geometry, material );
 	this.cone = new LineSegments( geometry, material );
 	this.add( this.cone );
 	this.add( this.cone );