Преглед на файлове

LineMaterial: Set needsupdate when changing worldUnits property (#32952)

Brandon преди 2 седмици
родител
ревизия
0ad0c008bd
променени са 3 файла, в които са добавени 6 реда и са изтрити 4 реда
  1. 6 0
      examples/jsm/lines/LineMaterial.js
  2. 0 1
      examples/webgl_lines_fat.html
  3. 0 3
      examples/webgl_lines_fat_raycasting.html

+ 6 - 0
examples/jsm/lines/LineMaterial.js

@@ -484,6 +484,12 @@ class LineMaterial extends ShaderMaterial {
 
 
 	set worldUnits( value ) {
 	set worldUnits( value ) {
 
 
+		if ( ( value === true ) !== this.worldUnits ) {
+
+			this.needsUpdate = true;
+
+		}
+
 		if ( value === true ) {
 		if ( value === true ) {
 
 
 			this.defines.WORLD_UNITS = '';
 			this.defines.WORLD_UNITS = '';

+ 0 - 1
examples/webgl_lines_fat.html

@@ -228,7 +228,6 @@
 				gui.add( param, 'world units' ).onChange( function ( val ) {
 				gui.add( param, 'world units' ).onChange( function ( val ) {
 
 
 					matLine.worldUnits = val;
 					matLine.worldUnits = val;
-					matLine.needsUpdate = true;
 
 
 				} );
 				} );
 
 

+ 0 - 3
examples/webgl_lines_fat_raycasting.html

@@ -307,10 +307,7 @@
 				gui.add( params, 'world units' ).onChange( function ( val ) {
 				gui.add( params, 'world units' ).onChange( function ( val ) {
 
 
 					matLine.worldUnits = val;
 					matLine.worldUnits = val;
-					matLine.needsUpdate = true;
-
 					matThresholdLine.worldUnits = val;
 					matThresholdLine.worldUnits = val;
-					matThresholdLine.needsUpdate = true;
 
 
 				} );
 				} );
 
 

粤ICP备19079148号