Selaa lähdekoodia

update debug color variable names and improve warning docs - review comments

Sean Rennie 4 vuotta sitten
vanhempi
commit
36c34907c6
2 muutettua tiedostoa jossa 9 lisäystä ja 9 poistoa
  1. 5 5
      README.md
  2. 4 4
      src/three/DebugTilesRenderer.js

+ 5 - 5
README.md

@@ -533,16 +533,16 @@ RANDOM_COLOR
 // Render every individual mesh in the scene with a random color.
 RANDOM_NODE_COLOR
 
-// Sets a custom color using the customDebugColor call back. 
+// Sets a custom color using the customColorCallback call back. 
 CUSTOM_COLOR_MODE
 ```
-### .customDebugColor
+### .customColorCallback
 
-```
-customDebugColor: (tile: Tile, child: Object) => void
+```js
+customColorCallback: (tile: Tile, child: Object3D) => void
 ```
 
-The callback used if `debugColor` is set to `CUSTOM_COLOR_MODE`. Value default to `null` and must be explicitly set
+The callback used if `debugColor` is set to `CUSTOM_COLOR_MODE`. Value defaults to `null` and must be set explicitly.
 
 ### .displayBoxBounds
 

+ 4 - 4
src/three/DebugTilesRenderer.js

@@ -37,7 +37,7 @@ export class DebugTilesRenderer extends TilesRenderer {
 		this.displayBoxBounds = false;
 		this.displaySphereBounds = false;
 		this.colorMode = NONE;
-		this.customDebugColor = null;
+		this.customColorCallback = null;
 		this.boxGroup = boxGroup;
 		this.sphereGroup = sphereGroup;
 		this.maxDebugDepth = - 1;
@@ -347,13 +347,13 @@ export class DebugTilesRenderer extends TilesRenderer {
 						}
 						case CUSTOM_COLOR_MODE: {
 
-							if ( this.customDebugColor ) {
+							if ( this.customColorCallback ) {
 
-								this.customDebugColor( tile, c );
+								this.customColorCallback( tile, c );
 
 							} else {
 
-								console.error( 'customDebugColor callback not defined' );
+								console.warn( 'DebugTilesRenderer: customColorCallback not defined' );
 
 							}
 							break;