|
@@ -17,6 +17,7 @@ export const RELATIVE_DEPTH = 5;
|
|
|
export const IS_LEAF = 6;
|
|
|
export const RANDOM_COLOR = 7;
|
|
|
export const RANDOM_NODE_COLOR = 8;
|
|
|
+export const CUSTOM_COLOR_MODE = 9;
|
|
|
|
|
|
export class DebugTilesRenderer extends TilesRenderer {
|
|
|
|
|
@@ -36,6 +37,7 @@ export class DebugTilesRenderer extends TilesRenderer {
|
|
|
this.displayBoxBounds = false;
|
|
|
this.displaySphereBounds = false;
|
|
|
this.colorMode = NONE;
|
|
|
+ this.customColorCallback = null;
|
|
|
this.boxGroup = boxGroup;
|
|
|
this.sphereGroup = sphereGroup;
|
|
|
this.maxDebugDepth = - 1;
|
|
@@ -258,7 +260,6 @@ export class DebugTilesRenderer extends TilesRenderer {
|
|
|
delete c.material[ HAS_RANDOM_COLOR ];
|
|
|
|
|
|
}
|
|
|
-
|
|
|
// Set the color on the basic material
|
|
|
switch ( colorMode ) {
|
|
|
|
|
@@ -344,6 +345,20 @@ export class DebugTilesRenderer extends TilesRenderer {
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
+ case CUSTOM_COLOR_MODE: {
|
|
|
+
|
|
|
+ if ( this.customColorCallback ) {
|
|
|
+
|
|
|
+ this.customColorCallback( tile, c );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ console.warn( 'DebugTilesRenderer: customColorCallback not defined' );
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|