Skip to content

Commit

Permalink
Merge branch 'master' into batched-fade
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Dec 25, 2024
2 parents 66c6642 + 177ed9c commit c98cf43
Show file tree
Hide file tree
Showing 27 changed files with 303 additions and 629 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased
## [0.4.0] - Unreleased
### Changed
- Minimum three.js version is now r166
- Remove deprecated functions.

## [0.3.46] - 2024.12.24
### Fixed
- Types: Convert types of use non-wrapper types.
- Types: Adjust GLTF Plugin classes to extend appropriate type.
Expand All @@ -26,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- TilesRenderer: Add types for events.
- GlobeControls: Added `nearMargin` and `farMargin` percentages for controlling camera distances.
- DebugTilesPlugin: `enabled` field to DebugTilesPlugin to enable / disable the debug features.
- DebugTilesPlugin: Added support for `displayParentBounds`.

## [0.3.45] - 2024.12.13
### Fixed
Expand Down
33 changes: 6 additions & 27 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import {
TilesRenderer,
NONE,
SCREEN_ERROR,
GEOMETRIC_ERROR,
DISTANCE,
DEPTH,
RELATIVE_DEPTH,
IS_LEAF,
RANDOM_COLOR,
RANDOM_NODE_COLOR,
CUSTOM_COLOR,
LOAD_ORDER,
} from '3d-tiles-renderer';
import {
DebugTilesPlugin,
Expand Down Expand Up @@ -42,6 +31,7 @@ import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';
import Stats from 'three/examples/jsm/libs/stats.module.js';

const NONE = 0;
const ALL_HITS = 1;
const FIRST_HIT_ONLY = 2;

Expand All @@ -58,7 +48,7 @@ let statsContainer, stats;
const params = {

enableUpdate: true,
raycast: NONE,
raycast: DebugTilesPlugin.ColorModes.NONE,
optimizeRaycast: true,
enableCacheDisplay: false,
enableRendererStats: false,
Expand All @@ -72,6 +62,7 @@ const params = {

up: hashUrl ? '+Z' : '+Y',
enableDebug: true,
displayParentBounds: false,
displayBoxBounds: false,
displaySphereBounds: false,
displayRegionBounds: false,
Expand Down Expand Up @@ -273,24 +264,11 @@ function init() {

const debug = gui.addFolder( 'Debug Options' );
debug.add( params, 'enableDebug' );
debug.add( params, 'displayParentBounds' );
debug.add( params, 'displayBoxBounds' );
debug.add( params, 'displaySphereBounds' );
debug.add( params, 'displayRegionBounds' );
debug.add( params, 'colorMode', {

NONE,
SCREEN_ERROR,
GEOMETRIC_ERROR,
DISTANCE,
DEPTH,
RELATIVE_DEPTH,
IS_LEAF,
RANDOM_COLOR,
RANDOM_NODE_COLOR,
CUSTOM_COLOR,
LOAD_ORDER,

} );
debug.add( params, 'colorMode', DebugTilesPlugin.ColorModes );
debug.open();

const exampleOptions = gui.addFolder( 'Example Options' );
Expand Down Expand Up @@ -489,6 +467,7 @@ function animate() {
const plugin = tiles.getPluginByName( 'DEBUG_TILES_PLUGIN' );
plugin.enabled = params.enableDebug;
plugin.displayBoxBounds = params.displayBoxBounds;
plugin.displayParentBounds = params.displayParentBounds;
plugin.displaySphereBounds = params.displaySphereBounds;
plugin.displayRegionBounds = params.displayRegionBounds;
plugin.colorMode = parseFloat( params.colorMode );
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "3d-tiles-renderer",
"version": "0.3.45",
"version": "0.3.46",
"description": "https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification",
"keywords": [
"3d-tiles",
Expand Down Expand Up @@ -66,7 +66,7 @@
"vite": "^5.3.1"
},
"peerDependencies": {
"three": ">=0.123.0"
"three": ">=0.166.0"
},
"optionalDependencies": {
"@react-three/fiber": "^8.17.9",
Expand Down
12 changes: 0 additions & 12 deletions src/base/plugins/ImplicitTilingPlugin.js

This file was deleted.

25 changes: 25 additions & 0 deletions src/base/traverseFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,3 +488,28 @@ export function toggleTiles( tile, renderer ) {
}

}

/**
* Traverses the ancestry of the tile up to the root tile.
*/
export function traverseAncestors( tile, callback = null ) {

let current = tile;

while ( current ) {

const depth = current.__depth;
const parent = current.parent;

if ( callback ) {

callback( current, parent, depth );

}

current = parent;

}


}
11 changes: 0 additions & 11 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// three.js
export { DebugTilesRenderer } from './three/DebugTilesRenderer';
export { TilesRenderer } from './three/TilesRenderer';
export { TilesGroup } from './three/TilesGroup';
export { B3DMLoader, B3DMScene } from './three/loaders/B3DMLoader';
Expand All @@ -12,16 +11,6 @@ export { Ellipsoid } from './three/math/Ellipsoid';
export { EllipsoidRegion } from './three/math/EllipsoidRegion';
export * as GeoUtils from './three/math/GeoUtils';
export * from './three/math/GeoConstants';
export * from './three/renderers/GoogleTilesRenderer';
export * from './three/renderers/CesiumIonTilesRenderer';

// three.js plugins
export { CesiumIonAuthPlugin } from './three/plugins/CesiumIonAuthPlugin';
export { GoogleCloudAuthPlugin } from './three/plugins/GoogleCloudAuthPlugin';
export * from './three/plugins/DebugTilesPlugin';

// common plugins
export { ImplicitTilingPlugin } from './base/plugins/ImplicitTilingPlugin';

// common
export { TilesRendererBase } from './base/TilesRendererBase';
Expand Down
11 changes: 0 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// three.js
export { DebugTilesRenderer } from './three/DebugTilesRenderer.js';
export { TilesRenderer } from './three/TilesRenderer.js';
export { B3DMLoader } from './three/loaders/B3DMLoader.js';
export { PNTSLoader } from './three/loaders/PNTSLoader.js';
Expand All @@ -14,22 +13,12 @@ export * from './three/math/Ellipsoid.js';
export * from './three/math/EllipsoidRegion.js';
export * as GeoUtils from './three/math/GeoUtils.js';
export * from './three/math/GeoConstants.js';
export * from './three/renderers/GoogleTilesRenderer.js';
export * from './three/renderers/CesiumIonTilesRenderer.js';

// three.js controls
export { GlobeControls } from './three/controls/GlobeControls.js';
export { EnvironmentControls } from './three/controls/EnvironmentControls.js';
export { CameraTransitionManager } from './three/controls/CameraTransitionManager.js';

// three.js plugins
export { CesiumIonAuthPlugin } from './three/plugins/CesiumIonAuthPlugin.js';
export { GoogleCloudAuthPlugin } from './three/plugins/GoogleCloudAuthPlugin.js';
export * from './three/plugins/DebugTilesPlugin.js';

// common plugins
export { ImplicitTilingPlugin } from './base/plugins/ImplicitTilingPlugin.js';

// common
export { TilesRendererBase } from './base/TilesRendererBase.js';
export { LoaderBase } from './base/loaders/LoaderBase.js';
Expand Down
14 changes: 11 additions & 3 deletions src/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,27 +270,35 @@ The callback used if `debugColor` is set to `CUSTOM_COLOR`. Value defaults to `n
### .displayBoxBounds

```js
displayBoxBounds = false : Boolean
displayBoxBounds = false : boolean
```

Display wireframe bounding boxes from the tiles `boundingVolume.box` (or derived from the region bounds) for every visible tile.

### .displaySphereBounds

```js
displaySphereBounds = false : Boolean
displaySphereBounds = false : boolean
```

Display wireframe bounding boxes from the tiles `boundingVolume.sphere` (or derived from the bounding box / region bounds) for every visible tile.

### .displayRegionBounds

```js
displayRegionBounds = false : Boolean
displayRegionBounds = false : boolean
```

Display wireframe bounding rgions from the tiles `boundingVolume.region` for every visible tile if it exists.

### .displayParentBounds

```js
displayParentBounds = false : boolean
```

If true then all the parent bounds of the current leaf tiles will be displayed.

### .maxDebugDepth

```js
Expand Down
Loading

0 comments on commit c98cf43

Please sign in to comment.