11import * as THREE from 'three' ;
22import Extent from 'Core/Geographic/Extent' ;
33
4+ /** @module 3dTilesProcessing
5+ */
6+
47function requestNewTile ( view , scheduler , geometryLayer , metadata , parent , redraw ) {
58 const command = {
69 /* mandatory */
@@ -120,6 +123,15 @@ function _subdivideNodeSubstractive(context, layer, node) {
120123 }
121124}
122125
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+ */
123135export function $3dTilesCulling ( layer , camera , node , tileMatrixWorld ) {
124136 // For viewer Request Volume
125137 // https://github.com/AnalyticalGraphicsInc/3d-tiles-samples/tree/master/tilesets/TilesetWithRequestVolume
@@ -299,6 +311,16 @@ function markForDeletion(layer, elt) {
299311 }
300312}
301313
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+ */
302324export function process3dTilesNode ( cullingTest = $3dTilesCulling , subdivisionTest = $3dTilesSubdivisionControl ) {
303325 return function _process3dTilesNodes ( context , layer , node ) {
304326 // early exit if parent's subdivision is in progress
@@ -338,6 +360,17 @@ export function process3dTilesNode(cullingTest = $3dTilesCulling, subdivisionTes
338360 } ;
339361}
340362
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+ */
341374export function $3dTilesSubdivisionControl ( context , layer , node ) {
342375 if ( layer . tileset . tiles [ node . tileId ] . children === undefined ) {
343376 return false ;
@@ -348,3 +381,5 @@ export function $3dTilesSubdivisionControl(context, layer, node) {
348381 const sse = computeNodeSSE ( context . camera , node ) ;
349382 return sse > layer . sseThreshold ;
350383}
384+
385+
0 commit comments