File tree Expand file tree Collapse file tree 15 files changed +322
-122
lines changed
Expand file tree Collapse file tree 15 files changed +322
-122
lines changed Original file line number Diff line number Diff line change @@ -286,12 +286,8 @@ if ( intersects.length ) {
286286 // Log the batch data
287287 const batchTable = batchTableObject .batchTable ;
288288 const hoveredBatchid = batchidAttr .getX ( face .a );
289- const batchData = batchTable .getData ( ' BatchTableKey' );
290- if ( batchData ) {
291-
292- console .log ( batchData[ hoveredBatchid ] );
293-
294- }
289+ const batchData = batchTable .getDataFromId ( hoveredBatchid );
290+ console .log ( batchData );
295291
296292 }
297293
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ function init() {
119119 scene . add ( offsetGroup ) ;
120120
121121 new B3DMLoader ( )
122- . loadAsync ( 'https://raw.githubusercontent.com/CesiumGS/3d-tiles-samples /main/1.0/TilesetWithRequestVolume/city/lr .b3dm' )
122+ . loadAsync ( 'https://raw.githubusercontent.com/CesiumGS/cesium /main/Apps/SampleData/Cesium3DTiles/Hierarchy/BatchTableHierarchy/tile .b3dm' )
123123 . then ( res => {
124124
125125 console . log ( res ) ;
@@ -186,12 +186,25 @@ function onMouseMove( e ) {
186186 // Log the batch data
187187 const batchTable = batchTableObject . batchTable ;
188188 hoveredBatchid = batchidAttr . getX ( face . a ) ;
189+ const batchData = batchTable . getDataFromId ( hoveredBatchid ) ;
189190
190191 infoEl . innerText =
191- `_batchid : ${ hoveredBatchid } \n` +
192- `Latitude : ${ batchTable . getData ( 'Latitude' ) [ hoveredBatchid ] . toFixed ( 3 ) } \n` +
193- `Longitude : ${ batchTable . getData ( 'Longitude' ) [ hoveredBatchid ] . toFixed ( 3 ) } \n` +
194- `Height : ${ batchTable . getData ( 'Height' ) [ hoveredBatchid ] . toFixed ( 3 ) } \n` ;
192+ `_batchid : ${ hoveredBatchid } \n` +
193+ `Area : ${ batchData [ 'height' ] . toFixed ( 3 ) } \n` +
194+ `Height : ${ batchData [ 'height' ] . toFixed ( 3 ) } \n` ;
195+
196+ const hierarchyData = batchData [ '3DTILES_batch_table_hierarchy' ] ;
197+ for ( const className in hierarchyData ) {
198+
199+
200+ for ( const instance in hierarchyData [ className ] ) {
201+
202+ infoEl . innerText +=
203+ `${ instance } : ${ hierarchyData [ className ] [ instance ] } \n` ;
204+
205+ }
206+
207+ }
195208
196209 }
197210
Original file line number Diff line number Diff line change 1- import { FeatureTable , BatchTable } from '../../utilities/FeatureTable' ;
1+ import { BatchTable } from '../../utilities/BatchTable' ;
2+ import { FeatureTable } from '../../utilities/FeatureTable' ;
23
34export interface B3DMBaseResult {
45
Original file line number Diff line number Diff line change 11// B3DM File Format
22// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Batched3DModel/README.md
33
4- import { FeatureTable , BatchTable } from '../../utilities/FeatureTable.js' ;
4+ import { BatchTable } from '../../utilities/BatchTable.js' ;
5+ import { FeatureTable } from '../../utilities/FeatureTable.js' ;
56import { LoaderBase } from './LoaderBase.js' ;
67import { readMagicBytes } from '../../utilities/readMagicBytes.js' ;
78
Original file line number Diff line number Diff line change 1- import { FeatureTable , BatchTable } from '../../utilities/FeatureTable' ;
1+ import { BatchTable } from '../../utilities/BatchTable' ;
2+ import { FeatureTable } from '../../utilities/FeatureTable' ;
23
34export interface I3DMBaseResult {
45
Original file line number Diff line number Diff line change 11// I3DM File Format
22// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Instanced3DModel/README.md
33
4- import { FeatureTable , BatchTable } from '../../utilities/FeatureTable.js' ;
4+ import { BatchTable } from '../../utilities/BatchTable.js' ;
5+ import { FeatureTable } from '../../utilities/FeatureTable.js' ;
56import { arrayToString } from '../../utilities/arrayToString.js' ;
67import { LoaderBase } from './LoaderBase.js' ;
78import { readMagicBytes } from '../../utilities/readMagicBytes.js' ;
Original file line number Diff line number Diff line change 1- import { FeatureTable , BatchTable } from '../../utilities/FeatureTable' ;
1+ import { BatchTable } from '../../utilities/BatchTable' ;
2+ import { FeatureTable } from '../../utilities/FeatureTable' ;
23
34export interface PNTSBaseResult {
45
Original file line number Diff line number Diff line change 11// PNTS File Format
22// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/PointCloud/README.md
33
4- import { FeatureTable , BatchTable } from '../../utilities/FeatureTable.js' ;
4+ import { BatchTable } from '../../utilities/BatchTable.js' ;
5+ import { FeatureTable } from '../../utilities/FeatureTable.js' ;
56import { readMagicBytes } from '../../utilities/readMagicBytes.js' ;
67import { LoaderBase } from './LoaderBase.js' ;
78
Original file line number Diff line number Diff line change 11import { B3DMBaseResult } from '../../base/loaders/B3DMLoaderBase' ;
2- import { FeatureTable , BatchTable } from '../../utilities/FeatureTable' ;
2+ import { BatchTable } from '../../utilities/BatchTable' ;
3+ import { FeatureTable } from '../../utilities/FeatureTable' ;
34import { LoadingManager , Group } from 'three' ;
45import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader' ;
56
Original file line number Diff line number Diff line change 11import { I3DMBaseResult } from '../../base/loaders/I3DMLoaderBase' ;
2- import { FeatureTable , BatchTable } from '../../utilities/FeatureTable' ;
2+ import { BatchTable } from '../../utilities/BatchTable' ;
3+ import { FeatureTable } from '../../utilities/FeatureTable' ;
34import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader' ;
45import { Group , LoadingManager } from 'three' ;
56
You can’t perform that action at this time.
0 commit comments