Skip to content

Commit

Permalink
CUSTOM_COLOR_MODE -> CUSTOM_COLOR
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Sep 2, 2021
1 parent 938acb4 commit cd768fc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 customColorCallback call back.
CUSTOM_COLOR_MODE
// Sets a custom color using the customColorCallback call back.
CUSTOM_COLOR
```
### .customColorCallback

```js
customColorCallback: (tile: Tile, child: Object3D) => void
```

The callback used if `debugColor` is set to `CUSTOM_COLOR_MODE`. Value defaults to `null` and must be set explicitly.
The callback used if `debugColor` is set to `CUSTOM_COLOR`. Value defaults to `null` and must be set explicitly.

### .displayBoxBounds

Expand Down
6 changes: 3 additions & 3 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
IS_LEAF,
RANDOM_COLOR,
RANDOM_NODE_COLOR,
CUSTOM_COLOR_MODE
CUSTOM_COLOR
} from '../src/index.js';
import {
Scene,
Expand Down Expand Up @@ -104,7 +104,7 @@ function reinstantiateTiles() {
tiles.manager.addHandler( /\.gltf$/, loader );
offsetParent.add( tiles.group );

// Used with CUSTOM_COLOR_MODE
// Used with CUSTOM_COLOR
tiles.customColorCallback = ( tile, object ) => {

const depthIsEven = tile.__depth % 2 === 0;
Expand Down Expand Up @@ -273,7 +273,7 @@ function init() {
IS_LEAF,
RANDOM_COLOR,
RANDOM_NODE_COLOR,
CUSTOM_COLOR_MODE
CUSTOM_COLOR

} );
debug.open();
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
IS_LEAF,
RANDOM_COLOR,
RANDOM_NODE_COLOR,
CUSTOM_COLOR_MODE,
CUSTOM_COLOR,
} from './three/DebugTilesRenderer.js';
import { TilesRenderer } from './three/TilesRenderer.js';
import { B3DMLoader } from './three/B3DMLoader.js';
Expand Down Expand Up @@ -52,5 +52,5 @@ export {
IS_LEAF,
RANDOM_COLOR,
RANDOM_NODE_COLOR,
CUSTOM_COLOR_MODE,
CUSTOM_COLOR,
};
2 changes: 1 addition & 1 deletion src/three/DebugTilesRenderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const RELATIVE_DEPTH : ColorMode;
export const IS_LEAF : ColorMode;
export const RANDOM_COLOR : ColorMode;
export const RANDOM_NODE_COLOR: ColorMode;
export const CUSTOM_COLOR_MODE: ColorMode;
export const CUSTOM_COLOR: ColorMode;
export class DebugTilesRenderer extends TilesRenderer {

displayBoxBounds : Boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/three/DebugTilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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 const CUSTOM_COLOR = 9;

export class DebugTilesRenderer extends TilesRenderer {

Expand Down Expand Up @@ -353,7 +353,7 @@ export class DebugTilesRenderer extends TilesRenderer {
break;

}
case CUSTOM_COLOR_MODE: {
case CUSTOM_COLOR: {

if ( this.customColorCallback ) {

Expand Down

0 comments on commit cd768fc

Please sign in to comment.