1
1
import * as THREE from 'three' ;
2
2
import Extent from 'Core/Geographic/Extent' ;
3
3
4
+ /** @module 3dTilesProcessing
5
+ */
6
+
4
7
function requestNewTile ( view , scheduler , geometryLayer , metadata , parent , redraw ) {
5
8
const command = {
6
9
/* mandatory */
@@ -120,6 +123,15 @@ function _subdivideNodeSubstractive(context, layer, node) {
120
123
}
121
124
}
122
125
126
+ /**
127
+ * Check if the node is visible in the camera.
128
+ *
129
+ * @param {C3DTilesLayer } layer node 3D tiles layer
130
+ * @param {Camera } camera camera
131
+ * @param {THREE.Object3D } node The 3d tile node to check.
132
+ * @param {THREE.Matrix4 } tileMatrixWorld The node matrix world
133
+ * @return {boolean } return true if the node is visible
134
+ */
123
135
export function $3dTilesCulling ( layer , camera , node , tileMatrixWorld ) {
124
136
// For viewer Request Volume
125
137
// https://github.com/AnalyticalGraphicsInc/3d-tiles-samples/tree/master/tilesets/TilesetWithRequestVolume
@@ -299,6 +311,16 @@ function markForDeletion(layer, elt) {
299
311
}
300
312
}
301
313
314
+ /**
315
+ * This funcion builds the method to update 3d tiles node.
316
+ *
317
+ * The returned method checks the 3d tile visibility with `cullingTest` function.
318
+ * It subdivises visible node if `subdivisionTest` return `true`.
319
+ *
320
+ * @param {Function } [cullingTest=$3dTilesCulling] The culling test method.
321
+ * @param {Function } [subdivisionTest=$3dTilesSubdivisionControl] The subdivision test method.
322
+ * @return {Function } { description_of_the_return_value }
323
+ */
302
324
export function process3dTilesNode ( cullingTest = $3dTilesCulling , subdivisionTest = $3dTilesSubdivisionControl ) {
303
325
return function _process3dTilesNodes ( context , layer , node ) {
304
326
// early exit if parent's subdivision is in progress
@@ -338,6 +360,17 @@ export function process3dTilesNode(cullingTest = $3dTilesCulling, subdivisionTes
338
360
} ;
339
361
}
340
362
363
+ /**
364
+ *
365
+ *
366
+ * the method returns true if the `node` should be subivised.
367
+ *
368
+ * @param {object } context The current context
369
+ * @param {Camera } context.camera The current camera
370
+ * @param {C3DTilesLayer } layer The 3d tile layer
371
+ * @param {THREE.Object3D } node The 3d tile node
372
+ * @return {boolean }
373
+ */
341
374
export function $3dTilesSubdivisionControl ( context , layer , node ) {
342
375
if ( layer . tileset . tiles [ node . tileId ] . children === undefined ) {
343
376
return false ;
@@ -348,3 +381,5 @@ export function $3dTilesSubdivisionControl(context, layer, node) {
348
381
const sse = computeNodeSSE ( context . camera , node ) ;
349
382
return sse > layer . sseThreshold ;
350
383
}
384
+
385
+
0 commit comments