Skip to content

Commit 7e96e4f

Browse files
committed
Revert moved function, update core plugins
1 parent 63d3370 commit 7e96e4f

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed

src/core/plugins/SUBTREELoader.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
* Structure almost identical to Cesium, also the comments and the names are kept
33
* https://github.com/CesiumGS/cesium/blob/0a69f67b393ba194eefb7254600811c4b712ddc0/packages/engine/Source/Scene/Implicit3DTileContent.js
44
*/
5-
import { LoaderBase } from '../renderer/loaders/LoaderBase.js';
5+
import { LoaderBase } from '3d-tiles-renderer/core';
6+
7+
// TODO
68
import { readMagicBytes } from '../renderer/utilities/readMagicBytes.js';
79
import { arrayToString } from '../renderer/utilities/arrayToString.js';
810

src/core/plugins/loaders/QuantizedMeshLoaderBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LoaderBase } from '../../renderer/loaders/LoaderBase.js';
1+
import { LoaderBase } from '3d-tiles-renderer/core';
22

33
export function zigZagDecode( value ) {
44

src/core/renderer/tiles/traverseFunctions.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,26 @@ export function toggleTiles( tile, renderer ) {
509509

510510
}
511511

512+
513+
// Traverses the ancestry of the tile up to the root tile.
514+
export function traverseAncestors( tile, callback = null ) {
515+
516+
let current = tile;
517+
518+
while ( current ) {
519+
520+
const depth = current.__depth;
521+
const parent = current.parent;
522+
523+
if ( callback ) {
524+
525+
callback( current, parent, depth );
526+
527+
}
528+
529+
current = parent;
530+
531+
}
532+
533+
534+
}

src/three/plugins/DebugTilesPlugin.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Box3Helper, Group, MeshStandardMaterial, PointsMaterial, Sphere, Color, MeshBasicMaterial } from 'three';
22
import { SphereHelper } from './objects/SphereHelper.js';
33
import { EllipsoidRegionLineHelper } from './objects/EllipsoidRegionHelper.js';
4+
import { traverseAncestors } from '../../core/renderer/tiles/traverseFunctions.js';
45

56
const ORIGINAL_MATERIAL = Symbol( 'ORIGINAL_MATERIAL' );
67
const HAS_RANDOM_COLOR = Symbol( 'HAS_RANDOM_COLOR' );
@@ -28,23 +29,6 @@ function getIndexedRandomColor( index ) {
2829

2930
}
3031

31-
// Traverses the ancestry of the tile up to the root tile.
32-
function traverseAncestors( tile, callback ) {
33-
34-
let current = tile;
35-
36-
while ( current ) {
37-
38-
const depth = current.__depth;
39-
const parent = current.parent;
40-
callback( current, parent, depth );
41-
42-
current = parent;
43-
44-
}
45-
46-
}
47-
4832
// color modes
4933
const NONE = 0;
5034
const SCREEN_ERROR = 1;

0 commit comments

Comments
 (0)