@loaders.gl/tiles 3.4.0-alpha.1 → 3.4.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +723 -259
- package/dist/es5/constants.js +0 -2
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/tileset/format-3d-tiles/tileset-3d-traverser.js +0 -2
- package/dist/es5/tileset/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
- package/dist/es5/tileset/format-i3s/i3s-pending-tiles-register.js +3 -8
- package/dist/es5/tileset/format-i3s/i3s-pending-tiles-register.js.map +1 -1
- package/dist/es5/tileset/format-i3s/i3s-tile-manager.js +4 -14
- package/dist/es5/tileset/format-i3s/i3s-tile-manager.js.map +1 -1
- package/dist/es5/tileset/format-i3s/i3s-tileset-traverser.js +19 -25
- package/dist/es5/tileset/format-i3s/i3s-tileset-traverser.js.map +1 -1
- package/dist/es5/tileset/helpers/3d-tiles-options.js.map +1 -1
- package/dist/es5/tileset/helpers/bounding-volume.js +87 -6
- package/dist/es5/tileset/helpers/bounding-volume.js.map +1 -1
- package/dist/es5/tileset/helpers/frame-state.js +4 -14
- package/dist/es5/tileset/helpers/frame-state.js.map +1 -1
- package/dist/es5/tileset/helpers/i3s-lod.js +0 -5
- package/dist/es5/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/es5/tileset/helpers/tiles-3d-lod.js +0 -7
- package/dist/es5/tileset/helpers/tiles-3d-lod.js.map +1 -1
- package/dist/es5/tileset/helpers/transform-utils.js +0 -7
- package/dist/es5/tileset/helpers/transform-utils.js.map +1 -1
- package/dist/es5/tileset/helpers/zoom.js +0 -4
- package/dist/es5/tileset/helpers/zoom.js.map +1 -1
- package/dist/es5/tileset/tile-3d.js +98 -166
- package/dist/es5/tileset/tile-3d.js.map +1 -1
- package/dist/es5/tileset/tileset-3d.js +86 -142
- package/dist/es5/tileset/tileset-3d.js.map +1 -1
- package/dist/es5/tileset/tileset-cache.js +0 -3
- package/dist/es5/tileset/tileset-cache.js.map +1 -1
- package/dist/es5/tileset/tileset-traverser.js +12 -51
- package/dist/es5/tileset/tileset-traverser.js.map +1 -1
- package/dist/es5/utils/doubly-linked-list-node.js.map +1 -1
- package/dist/es5/utils/doubly-linked-list.js +3 -11
- package/dist/es5/utils/doubly-linked-list.js.map +1 -1
- package/dist/es5/utils/managed-array.js +10 -30
- package/dist/es5/utils/managed-array.js.map +1 -1
- package/dist/esm/bundle.js +0 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/constants.js +0 -5
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tileset/format-3d-tiles/tileset-3d-traverser.js +0 -4
- package/dist/esm/tileset/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
- package/dist/esm/tileset/format-i3s/i3s-pending-tiles-register.js +0 -2
- package/dist/esm/tileset/format-i3s/i3s-pending-tiles-register.js.map +1 -1
- package/dist/esm/tileset/format-i3s/i3s-tile-manager.js +0 -6
- package/dist/esm/tileset/format-i3s/i3s-tile-manager.js.map +1 -1
- package/dist/esm/tileset/format-i3s/i3s-tileset-traverser.js +0 -3
- package/dist/esm/tileset/format-i3s/i3s-tileset-traverser.js.map +1 -1
- package/dist/esm/tileset/helpers/3d-tiles-options.js.map +1 -1
- package/dist/esm/tileset/helpers/bounding-volume.js +81 -8
- package/dist/esm/tileset/helpers/bounding-volume.js.map +1 -1
- package/dist/esm/tileset/helpers/frame-state.js +3 -13
- package/dist/esm/tileset/helpers/frame-state.js.map +1 -1
- package/dist/esm/tileset/helpers/i3s-lod.js +0 -6
- package/dist/esm/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/esm/tileset/helpers/tiles-3d-lod.js +0 -8
- package/dist/esm/tileset/helpers/tiles-3d-lod.js.map +1 -1
- package/dist/esm/tileset/helpers/transform-utils.js +0 -8
- package/dist/esm/tileset/helpers/transform-utils.js.map +1 -1
- package/dist/esm/tileset/helpers/zoom.js +0 -5
- package/dist/esm/tileset/helpers/zoom.js.map +1 -1
- package/dist/esm/tileset/tile-3d.js +8 -52
- package/dist/esm/tileset/tile-3d.js.map +1 -1
- package/dist/esm/tileset/tileset-3d.js +0 -38
- package/dist/esm/tileset/tileset-3d.js.map +1 -1
- package/dist/esm/tileset/tileset-cache.js +0 -3
- package/dist/esm/tileset/tileset-cache.js.map +1 -1
- package/dist/esm/tileset/tileset-traverser.js +0 -27
- package/dist/esm/tileset/tileset-traverser.js.map +1 -1
- package/dist/esm/utils/doubly-linked-list-node.js +0 -1
- package/dist/esm/utils/doubly-linked-list-node.js.map +1 -1
- package/dist/esm/utils/doubly-linked-list.js +0 -7
- package/dist/esm/utils/doubly-linked-list.js.map +1 -1
- package/dist/esm/utils/managed-array.js +0 -12
- package/dist/esm/utils/managed-array.js.map +1 -1
- package/dist/tileset/helpers/bounding-volume.d.ts +10 -0
- package/dist/tileset/helpers/bounding-volume.d.ts.map +1 -1
- package/dist/tileset/helpers/bounding-volume.js +117 -1
- package/dist/tileset/tile-3d.d.ts +7 -0
- package/dist/tileset/tile-3d.d.ts.map +1 -1
- package/dist/tileset/tile-3d.js +10 -0
- package/package.json +5 -5
- package/src/tileset/helpers/bounding-volume.ts +136 -0
- package/src/tileset/tile-3d.ts +18 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-utils.js","names":["Ellipsoid","Matrix4","Vector3","assert","calculateTransformProps","tileHeader","tile","rtcCenter","gltfUpAxis","computedTransform","boundingVolume","center","modelMatrix","translate","rotationY","rotateX","Math","PI","multiplyRight","rotationX","rotateY","isQuantized","quantizedVolumeOffset","scale","quantizedVolumeScale","cartesianOrigin","cartesianModelMatrix","cartographicOrigin","WGS84","cartesianToCartographic","fromFixedFrameMatrix","eastNorthUpToFixedFrame","toFixedFrameMatrix","invert","cartographicModelMatrix","coordinateSystem"],"sources":["../../../../src/tileset/helpers/transform-utils.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {assert} from '@loaders.gl/loader-utils';\n\nexport function calculateTransformProps(tileHeader, tile) {\n assert(tileHeader);\n assert(tile);\n\n const {rtcCenter, gltfUpAxis} = tile;\n const {\n computedTransform,\n boundingVolume: {center}\n } = tileHeader;\n\n let modelMatrix = new Matrix4(computedTransform);\n\n // Translate if appropriate\n if (rtcCenter) {\n modelMatrix.translate(rtcCenter);\n }\n\n // glTF models need to be rotated from Y to Z up\n // https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#y-up-to-z-up\n switch (gltfUpAxis) {\n case 'Z':\n break;\n case 'Y':\n const rotationY = new Matrix4().rotateX(Math.PI / 2);\n modelMatrix = modelMatrix.multiplyRight(rotationY);\n break;\n case 'X':\n const rotationX = new Matrix4().rotateY(-Math.PI / 2);\n modelMatrix = modelMatrix.multiplyRight(rotationX);\n break;\n default:\n break;\n }\n\n // Scale/offset positions if normalized integers\n if (tile.isQuantized) {\n modelMatrix.translate(tile.quantizedVolumeOffset).scale(tile.quantizedVolumeScale);\n }\n\n // Option 1: Cartesian matrix and origin\n const cartesianOrigin = new Vector3(center);\n\n tile.cartesianModelMatrix = modelMatrix;\n tile.cartesianOrigin = cartesianOrigin;\n\n // Option 2: Cartographic matrix and origin\n const cartographicOrigin = Ellipsoid.WGS84.cartesianToCartographic(\n cartesianOrigin,\n new Vector3()\n );\n const fromFixedFrameMatrix = Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin);\n const toFixedFrameMatrix = fromFixedFrameMatrix.invert();\n\n tile.cartographicModelMatrix = toFixedFrameMatrix.multiplyRight(modelMatrix);\n tile.cartographicOrigin = cartographicOrigin;\n\n // Deprecated, drop\n if (!tile.coordinateSystem) {\n tile.modelMatrix = tile.cartographicModelMatrix;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform-utils.js","names":["Ellipsoid","Matrix4","Vector3","assert","calculateTransformProps","tileHeader","tile","rtcCenter","gltfUpAxis","computedTransform","boundingVolume","center","modelMatrix","translate","rotationY","rotateX","Math","PI","multiplyRight","rotationX","rotateY","isQuantized","quantizedVolumeOffset","scale","quantizedVolumeScale","cartesianOrigin","cartesianModelMatrix","cartographicOrigin","WGS84","cartesianToCartographic","fromFixedFrameMatrix","eastNorthUpToFixedFrame","toFixedFrameMatrix","invert","cartographicModelMatrix","coordinateSystem"],"sources":["../../../../src/tileset/helpers/transform-utils.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {assert} from '@loaders.gl/loader-utils';\n\nexport function calculateTransformProps(tileHeader, tile) {\n assert(tileHeader);\n assert(tile);\n\n const {rtcCenter, gltfUpAxis} = tile;\n const {\n computedTransform,\n boundingVolume: {center}\n } = tileHeader;\n\n let modelMatrix = new Matrix4(computedTransform);\n\n // Translate if appropriate\n if (rtcCenter) {\n modelMatrix.translate(rtcCenter);\n }\n\n // glTF models need to be rotated from Y to Z up\n // https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#y-up-to-z-up\n switch (gltfUpAxis) {\n case 'Z':\n break;\n case 'Y':\n const rotationY = new Matrix4().rotateX(Math.PI / 2);\n modelMatrix = modelMatrix.multiplyRight(rotationY);\n break;\n case 'X':\n const rotationX = new Matrix4().rotateY(-Math.PI / 2);\n modelMatrix = modelMatrix.multiplyRight(rotationX);\n break;\n default:\n break;\n }\n\n // Scale/offset positions if normalized integers\n if (tile.isQuantized) {\n modelMatrix.translate(tile.quantizedVolumeOffset).scale(tile.quantizedVolumeScale);\n }\n\n // Option 1: Cartesian matrix and origin\n const cartesianOrigin = new Vector3(center);\n\n tile.cartesianModelMatrix = modelMatrix;\n tile.cartesianOrigin = cartesianOrigin;\n\n // Option 2: Cartographic matrix and origin\n const cartographicOrigin = Ellipsoid.WGS84.cartesianToCartographic(\n cartesianOrigin,\n new Vector3()\n );\n const fromFixedFrameMatrix = Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin);\n const toFixedFrameMatrix = fromFixedFrameMatrix.invert();\n\n tile.cartographicModelMatrix = toFixedFrameMatrix.multiplyRight(modelMatrix);\n tile.cartographicOrigin = cartographicOrigin;\n\n // Deprecated, drop\n if (!tile.coordinateSystem) {\n tile.modelMatrix = tile.cartographicModelMatrix;\n }\n}\n"],"mappings":"AAEA,SAAQA,SAAS,QAAO,qBAAqB;AAC7C,SAAQC,OAAO,EAAEC,OAAO,QAAO,eAAe;AAC9C,SAAQC,MAAM,QAAO,0BAA0B;AAE/C,OAAO,SAASC,uBAAuBA,CAACC,UAAU,EAAEC,IAAI,EAAE;EACxDH,MAAM,CAACE,UAAU,CAAC;EAClBF,MAAM,CAACG,IAAI,CAAC;EAEZ,MAAM;IAACC,SAAS;IAAEC;EAAU,CAAC,GAAGF,IAAI;EACpC,MAAM;IACJG,iBAAiB;IACjBC,cAAc,EAAE;MAACC;IAAM;EACzB,CAAC,GAAGN,UAAU;EAEd,IAAIO,WAAW,GAAG,IAAIX,OAAO,CAACQ,iBAAiB,CAAC;EAGhD,IAAIF,SAAS,EAAE;IACbK,WAAW,CAACC,SAAS,CAACN,SAAS,CAAC;EAClC;EAIA,QAAQC,UAAU;IAChB,KAAK,GAAG;MACN;IACF,KAAK,GAAG;MACN,MAAMM,SAAS,GAAG,IAAIb,OAAO,EAAE,CAACc,OAAO,CAACC,IAAI,CAACC,EAAE,GAAG,CAAC,CAAC;MACpDL,WAAW,GAAGA,WAAW,CAACM,aAAa,CAACJ,SAAS,CAAC;MAClD;IACF,KAAK,GAAG;MACN,MAAMK,SAAS,GAAG,IAAIlB,OAAO,EAAE,CAACmB,OAAO,CAAC,CAACJ,IAAI,CAACC,EAAE,GAAG,CAAC,CAAC;MACrDL,WAAW,GAAGA,WAAW,CAACM,aAAa,CAACC,SAAS,CAAC;MAClD;IACF;MACE;EAAM;EAIV,IAAIb,IAAI,CAACe,WAAW,EAAE;IACpBT,WAAW,CAACC,SAAS,CAACP,IAAI,CAACgB,qBAAqB,CAAC,CAACC,KAAK,CAACjB,IAAI,CAACkB,oBAAoB,CAAC;EACpF;EAGA,MAAMC,eAAe,GAAG,IAAIvB,OAAO,CAACS,MAAM,CAAC;EAE3CL,IAAI,CAACoB,oBAAoB,GAAGd,WAAW;EACvCN,IAAI,CAACmB,eAAe,GAAGA,eAAe;EAGtC,MAAME,kBAAkB,GAAG3B,SAAS,CAAC4B,KAAK,CAACC,uBAAuB,CAChEJ,eAAe,EACf,IAAIvB,OAAO,EAAE,CACd;EACD,MAAM4B,oBAAoB,GAAG9B,SAAS,CAAC4B,KAAK,CAACG,uBAAuB,CAACN,eAAe,CAAC;EACrF,MAAMO,kBAAkB,GAAGF,oBAAoB,CAACG,MAAM,EAAE;EAExD3B,IAAI,CAAC4B,uBAAuB,GAAGF,kBAAkB,CAACd,aAAa,CAACN,WAAW,CAAC;EAC5EN,IAAI,CAACqB,kBAAkB,GAAGA,kBAAkB;EAG5C,IAAI,CAACrB,IAAI,CAAC6B,gBAAgB,EAAE;IAC1B7B,IAAI,CAACM,WAAW,GAAGN,IAAI,CAAC4B,uBAAuB;EACjD;AACF"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
import { Vector3 } from '@math.gl/core';
|
|
4
2
|
import { BoundingSphere, OrientedBoundingBox } from '@math.gl/culling';
|
|
5
3
|
import { Ellipsoid } from '@math.gl/geospatial';
|
|
@@ -7,7 +5,6 @@ const WGS84_RADIUS_X = 6378137.0;
|
|
|
7
5
|
const WGS84_RADIUS_Y = 6378137.0;
|
|
8
6
|
const WGS84_RADIUS_Z = 6356752.3142451793;
|
|
9
7
|
const scratchVector = new Vector3();
|
|
10
|
-
|
|
11
8
|
export function getZoomFromBoundingVolume(boundingVolume, cartorgraphicCenter) {
|
|
12
9
|
if (boundingVolume instanceof OrientedBoundingBox) {
|
|
13
10
|
const {
|
|
@@ -31,13 +28,11 @@ export function getZoomFromBoundingVolume(boundingVolume, cartorgraphicCenter) {
|
|
|
31
28
|
}
|
|
32
29
|
return 1;
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
export function getZoomFromFullExtent(fullExtent, cartorgraphicCenter, cartesianCenter) {
|
|
36
32
|
const extentVertex = Ellipsoid.WGS84.cartographicToCartesian([fullExtent.xmax, fullExtent.ymax, fullExtent.zmax], new Vector3());
|
|
37
33
|
const extentSize = Math.sqrt(Math.pow(extentVertex[0] - cartesianCenter[0], 2) + Math.pow(extentVertex[1] - cartesianCenter[1], 2) + Math.pow(extentVertex[2] - cartesianCenter[2], 2));
|
|
38
34
|
return Math.log2(WGS84_RADIUS_Z / (extentSize + cartorgraphicCenter[2]));
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
export function getZoomFromExtent(extent, cartorgraphicCenter, cartesianCenter) {
|
|
42
37
|
const [xmin, ymin, xmax, ymax] = extent;
|
|
43
38
|
return getZoomFromFullExtent({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoom.js","names":["Vector3","BoundingSphere","OrientedBoundingBox","Ellipsoid","WGS84_RADIUS_X","WGS84_RADIUS_Y","WGS84_RADIUS_Z","scratchVector","getZoomFromBoundingVolume","boundingVolume","cartorgraphicCenter","halfAxes","obbSize","getObbSize","Math","log2","radius","width","height","zoomX","zoomY","getZoomFromFullExtent","fullExtent","cartesianCenter","extentVertex","WGS84","cartographicToCartesian","xmax","ymax","zmax","extentSize","sqrt","pow","getZoomFromExtent","extent","xmin","ymin","zmin","getColumn","axeY","axeZ","farthestVertex","add","size","len"],"sources":["../../../../src/tileset/helpers/zoom.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {Vector3} from '@math.gl/core';\nimport {BoundingSphere, OrientedBoundingBox} from '@math.gl/culling';\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {BoundingRectangle} from '../../types';\n\nconst WGS84_RADIUS_X = 6378137.0;\nconst WGS84_RADIUS_Y = 6378137.0;\nconst WGS84_RADIUS_Z = 6356752.3142451793;\n\nconst scratchVector = new Vector3();\n\n/**\n * Calculate appropriate zoom value for a particular boundingVolume\n * @param boundingVolume - the instance of bounding volume\n * @param cartorgraphicCenter - cartographic center of the bounding volume\n * @returns {number} - zoom value\n */\nexport function getZoomFromBoundingVolume(\n boundingVolume: BoundingSphere | OrientedBoundingBox | BoundingRectangle,\n cartorgraphicCenter: Vector3\n) {\n if (boundingVolume instanceof OrientedBoundingBox) {\n // OrientedBoundingBox\n const {halfAxes} = boundingVolume;\n const obbSize = getObbSize(halfAxes);\n // Use WGS84_RADIUS_Z to allign with BoundingSphere algorithm\n // Add the tile elevation value for correct zooming to elevated tiles\n return Math.log2(WGS84_RADIUS_Z / (obbSize + cartorgraphicCenter[2]));\n } else if (boundingVolume instanceof BoundingSphere) {\n // BoundingSphere\n const {radius} = boundingVolume;\n // Add the tile elevation value for correct zooming to elevated tiles\n return Math.log2(WGS84_RADIUS_Z / (radius + cartorgraphicCenter[2]));\n } else if (boundingVolume.width && boundingVolume.height) {\n // BoundingRectangle\n const {width, height} = boundingVolume;\n const zoomX = Math.log2(WGS84_RADIUS_X / width);\n const zoomY = Math.log2(WGS84_RADIUS_Y / height);\n\n return (zoomX + zoomY) / 2;\n }\n\n return 1;\n}\n\n/**\n * Calculate initial zoom for the tileset from 3D `fullExtent` defined in\n * the tileset metadata\n * @param fullExtent - 3D extent of the tileset\n * @param fullExtent.xmin - minimal longitude in decimal degrees\n * @param fullExtent.xmax - maximal longitude in decimal degrees\n * @param fullExtent.ymin - minimal latitude in decimal degrees\n * @param fullExtent.ymax - maximal latitude in decimal degrees\n * @param fullExtent.zmin - minimal elevation in meters\n * @param fullExtent.zmax - maximal elevation in meters\n * @param cartorgraphicCenter - tileset center in cartographic coordinate system\n * @param cartesianCenter - tileset center in cartesian coordinate system\n * @returns - initial zoom for the tileset\n */\nexport function getZoomFromFullExtent(\n fullExtent: {\n xmin: number;\n xmax: number;\n ymin: number;\n ymax: number;\n zmin: number;\n zmax: number;\n },\n cartorgraphicCenter: Vector3,\n cartesianCenter: Vector3\n) {\n const extentVertex = Ellipsoid.WGS84.cartographicToCartesian(\n [fullExtent.xmax, fullExtent.ymax, fullExtent.zmax],\n new Vector3()\n );\n const extentSize = Math.sqrt(\n Math.pow(extentVertex[0] - cartesianCenter[0], 2) +\n Math.pow(extentVertex[1] - cartesianCenter[1], 2) +\n Math.pow(extentVertex[2] - cartesianCenter[2], 2)\n );\n return Math.log2(WGS84_RADIUS_Z / (extentSize + cartorgraphicCenter[2]));\n}\n\n/**\n * Calculate initial zoom for the tileset from 2D `extent` defined in\n * the tileset metadata\n * @param extent - 2D extent of the tileset. It is array of 4 elements [xmin, ymin, xmax, ymax]\n * @param extent[0] - minimal longitude in decimal degrees\n * @param extent[1] - minimal latitude in decimal degrees\n * @param extent[2] - maximal longitude in decimal degrees\n * @param extent[3] - maximal latitude in decimal degrees\n * @param cartorgraphicCenter - tileset center in cartographic coordinate system\n * @param cartesianCenter - tileset center in cartesian coordinate system\n * @returns - initial zoom for the tileset\n */\nexport function getZoomFromExtent(\n extent: [number, number, number, number],\n cartorgraphicCenter: Vector3,\n cartesianCenter: Vector3\n) {\n const [xmin, ymin, xmax, ymax] = extent;\n return getZoomFromFullExtent(\n {xmin, xmax, ymin, ymax, zmin: 0, zmax: 0},\n cartorgraphicCenter,\n cartesianCenter\n );\n}\n\nfunction getObbSize(halfAxes) {\n halfAxes.getColumn(0, scratchVector);\n const axeY = halfAxes.getColumn(1);\n const axeZ = halfAxes.getColumn(2);\n const farthestVertex = scratchVector.add(axeY).add(axeZ);\n const size = farthestVertex.len();\n return size;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"zoom.js","names":["Vector3","BoundingSphere","OrientedBoundingBox","Ellipsoid","WGS84_RADIUS_X","WGS84_RADIUS_Y","WGS84_RADIUS_Z","scratchVector","getZoomFromBoundingVolume","boundingVolume","cartorgraphicCenter","halfAxes","obbSize","getObbSize","Math","log2","radius","width","height","zoomX","zoomY","getZoomFromFullExtent","fullExtent","cartesianCenter","extentVertex","WGS84","cartographicToCartesian","xmax","ymax","zmax","extentSize","sqrt","pow","getZoomFromExtent","extent","xmin","ymin","zmin","getColumn","axeY","axeZ","farthestVertex","add","size","len"],"sources":["../../../../src/tileset/helpers/zoom.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport {Vector3} from '@math.gl/core';\nimport {BoundingSphere, OrientedBoundingBox} from '@math.gl/culling';\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {BoundingRectangle} from '../../types';\n\nconst WGS84_RADIUS_X = 6378137.0;\nconst WGS84_RADIUS_Y = 6378137.0;\nconst WGS84_RADIUS_Z = 6356752.3142451793;\n\nconst scratchVector = new Vector3();\n\n/**\n * Calculate appropriate zoom value for a particular boundingVolume\n * @param boundingVolume - the instance of bounding volume\n * @param cartorgraphicCenter - cartographic center of the bounding volume\n * @returns {number} - zoom value\n */\nexport function getZoomFromBoundingVolume(\n boundingVolume: BoundingSphere | OrientedBoundingBox | BoundingRectangle,\n cartorgraphicCenter: Vector3\n) {\n if (boundingVolume instanceof OrientedBoundingBox) {\n // OrientedBoundingBox\n const {halfAxes} = boundingVolume;\n const obbSize = getObbSize(halfAxes);\n // Use WGS84_RADIUS_Z to allign with BoundingSphere algorithm\n // Add the tile elevation value for correct zooming to elevated tiles\n return Math.log2(WGS84_RADIUS_Z / (obbSize + cartorgraphicCenter[2]));\n } else if (boundingVolume instanceof BoundingSphere) {\n // BoundingSphere\n const {radius} = boundingVolume;\n // Add the tile elevation value for correct zooming to elevated tiles\n return Math.log2(WGS84_RADIUS_Z / (radius + cartorgraphicCenter[2]));\n } else if (boundingVolume.width && boundingVolume.height) {\n // BoundingRectangle\n const {width, height} = boundingVolume;\n const zoomX = Math.log2(WGS84_RADIUS_X / width);\n const zoomY = Math.log2(WGS84_RADIUS_Y / height);\n\n return (zoomX + zoomY) / 2;\n }\n\n return 1;\n}\n\n/**\n * Calculate initial zoom for the tileset from 3D `fullExtent` defined in\n * the tileset metadata\n * @param fullExtent - 3D extent of the tileset\n * @param fullExtent.xmin - minimal longitude in decimal degrees\n * @param fullExtent.xmax - maximal longitude in decimal degrees\n * @param fullExtent.ymin - minimal latitude in decimal degrees\n * @param fullExtent.ymax - maximal latitude in decimal degrees\n * @param fullExtent.zmin - minimal elevation in meters\n * @param fullExtent.zmax - maximal elevation in meters\n * @param cartorgraphicCenter - tileset center in cartographic coordinate system\n * @param cartesianCenter - tileset center in cartesian coordinate system\n * @returns - initial zoom for the tileset\n */\nexport function getZoomFromFullExtent(\n fullExtent: {\n xmin: number;\n xmax: number;\n ymin: number;\n ymax: number;\n zmin: number;\n zmax: number;\n },\n cartorgraphicCenter: Vector3,\n cartesianCenter: Vector3\n) {\n const extentVertex = Ellipsoid.WGS84.cartographicToCartesian(\n [fullExtent.xmax, fullExtent.ymax, fullExtent.zmax],\n new Vector3()\n );\n const extentSize = Math.sqrt(\n Math.pow(extentVertex[0] - cartesianCenter[0], 2) +\n Math.pow(extentVertex[1] - cartesianCenter[1], 2) +\n Math.pow(extentVertex[2] - cartesianCenter[2], 2)\n );\n return Math.log2(WGS84_RADIUS_Z / (extentSize + cartorgraphicCenter[2]));\n}\n\n/**\n * Calculate initial zoom for the tileset from 2D `extent` defined in\n * the tileset metadata\n * @param extent - 2D extent of the tileset. It is array of 4 elements [xmin, ymin, xmax, ymax]\n * @param extent[0] - minimal longitude in decimal degrees\n * @param extent[1] - minimal latitude in decimal degrees\n * @param extent[2] - maximal longitude in decimal degrees\n * @param extent[3] - maximal latitude in decimal degrees\n * @param cartorgraphicCenter - tileset center in cartographic coordinate system\n * @param cartesianCenter - tileset center in cartesian coordinate system\n * @returns - initial zoom for the tileset\n */\nexport function getZoomFromExtent(\n extent: [number, number, number, number],\n cartorgraphicCenter: Vector3,\n cartesianCenter: Vector3\n) {\n const [xmin, ymin, xmax, ymax] = extent;\n return getZoomFromFullExtent(\n {xmin, xmax, ymin, ymax, zmin: 0, zmax: 0},\n cartorgraphicCenter,\n cartesianCenter\n );\n}\n\nfunction getObbSize(halfAxes) {\n halfAxes.getColumn(0, scratchVector);\n const axeY = halfAxes.getColumn(1);\n const axeZ = halfAxes.getColumn(2);\n const farthestVertex = scratchVector.add(axeY).add(axeZ);\n const size = farthestVertex.len();\n return size;\n}\n"],"mappings":"AAEA,SAAQA,OAAO,QAAO,eAAe;AACrC,SAAQC,cAAc,EAAEC,mBAAmB,QAAO,kBAAkB;AACpE,SAAQC,SAAS,QAAO,qBAAqB;AAG7C,MAAMC,cAAc,GAAG,SAAS;AAChC,MAAMC,cAAc,GAAG,SAAS;AAChC,MAAMC,cAAc,GAAG,kBAAkB;AAEzC,MAAMC,aAAa,GAAG,IAAIP,OAAO,EAAE;AAQnC,OAAO,SAASQ,yBAAyBA,CACvCC,cAAwE,EACxEC,mBAA4B,EAC5B;EACA,IAAID,cAAc,YAAYP,mBAAmB,EAAE;IAEjD,MAAM;MAACS;IAAQ,CAAC,GAAGF,cAAc;IACjC,MAAMG,OAAO,GAAGC,UAAU,CAACF,QAAQ,CAAC;IAGpC,OAAOG,IAAI,CAACC,IAAI,CAACT,cAAc,IAAIM,OAAO,GAAGF,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;EACvE,CAAC,MAAM,IAAID,cAAc,YAAYR,cAAc,EAAE;IAEnD,MAAM;MAACe;IAAM,CAAC,GAAGP,cAAc;IAE/B,OAAOK,IAAI,CAACC,IAAI,CAACT,cAAc,IAAIU,MAAM,GAAGN,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;EACtE,CAAC,MAAM,IAAID,cAAc,CAACQ,KAAK,IAAIR,cAAc,CAACS,MAAM,EAAE;IAExD,MAAM;MAACD,KAAK;MAAEC;IAAM,CAAC,GAAGT,cAAc;IACtC,MAAMU,KAAK,GAAGL,IAAI,CAACC,IAAI,CAACX,cAAc,GAAGa,KAAK,CAAC;IA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B;AACH;AAEA,SAASV,UAAUA,CAACF,QAAQ,EAAE;EAC5BA,QAAQ,CAAC2B,SAAS,CAAC,CAAC,EAAE/B,aAAa,CAAC;EACpC,MAAMgC,IAAI,GAAG5B,QAAQ,CAAC2B,SAAS,CAAC,CAAC,CAAC;EAClC,MAAME,IAAI,GAAG7B,QAAQ,CAAC2B,SAAS,CAAC,CAAC,CAAC;EAClC,MAAMG,cAAc,GAAGlC,aAAa,CAACmC,GAAG,CAACH,IAAI,CAAC,CAACG,GAAG,CAACF,IAAI,CAAC;EACxD,MAAMG,IAAI,GAAGF,cAAc,CAACG,GAAG,EAAE;EACjC,OAAOD,IAAI;AACb"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
|
|
3
2
|
import { Vector3, Matrix4 } from '@math.gl/core';
|
|
4
3
|
import { CullingVolume } from '@math.gl/culling';
|
|
5
4
|
import { load } from '@loaders.gl/core';
|
|
6
|
-
|
|
7
5
|
import { TILE_REFINEMENT, TILE_CONTENT_STATE, TILESET_TYPE } from '../constants';
|
|
8
|
-
import { createBoundingVolume } from './helpers/bounding-volume';
|
|
6
|
+
import { createBoundingVolume, getCartographicBounds } from './helpers/bounding-volume';
|
|
9
7
|
import { getTiles3DScreenSpaceError } from './helpers/tiles-3d-lod';
|
|
10
8
|
import { getProjectedRadius } from './helpers/i3s-lod';
|
|
11
9
|
import { get3dTilesOptions } from './helpers/3d-tiles-options';
|
|
@@ -14,9 +12,7 @@ const scratchVector = new Vector3();
|
|
|
14
12
|
function defined(x) {
|
|
15
13
|
return x !== undefined && x !== null;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
export class Tile3D {
|
|
19
|
-
|
|
20
16
|
constructor(tileset, header, parentHeader) {
|
|
21
17
|
let extendedId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
22
18
|
_defineProperty(this, "tileset", void 0);
|
|
@@ -50,6 +46,7 @@ export class Tile3D {
|
|
|
50
46
|
_defineProperty(this, "_expireDate", void 0);
|
|
51
47
|
_defineProperty(this, "_expiredContent", void 0);
|
|
52
48
|
_defineProperty(this, "_shouldRefine", void 0);
|
|
49
|
+
_defineProperty(this, "_boundingBox", void 0);
|
|
53
50
|
_defineProperty(this, "_distanceToCamera", void 0);
|
|
54
51
|
_defineProperty(this, "_centerZDepth", void 0);
|
|
55
52
|
_defineProperty(this, "_screenSpaceError", void 0);
|
|
@@ -67,34 +64,26 @@ export class Tile3D {
|
|
|
67
64
|
_defineProperty(this, "_viewerRequestVolume", void 0);
|
|
68
65
|
_defineProperty(this, "_initialTransform", void 0);
|
|
69
66
|
this.header = header;
|
|
70
|
-
|
|
71
67
|
this.tileset = tileset;
|
|
72
68
|
this.id = extendedId || header.id;
|
|
73
69
|
this.url = header.url;
|
|
74
|
-
|
|
75
70
|
this.parent = parentHeader;
|
|
76
71
|
this.refine = this._getRefine(header.refine);
|
|
77
72
|
this.type = header.type;
|
|
78
73
|
this.contentUrl = header.contentUrl;
|
|
79
|
-
|
|
80
74
|
this.lodMetricType = 'geometricError';
|
|
81
75
|
this.lodMetricValue = 0;
|
|
82
|
-
|
|
83
76
|
this.boundingVolume = null;
|
|
84
|
-
|
|
85
77
|
this.content = null;
|
|
86
78
|
this.contentState = TILE_CONTENT_STATE.UNLOADED;
|
|
87
79
|
this.gpuMemoryUsageInBytes = 0;
|
|
88
|
-
|
|
89
80
|
this.children = [];
|
|
90
81
|
this.hasEmptyContent = false;
|
|
91
82
|
this.hasTilesetContent = false;
|
|
92
83
|
this.depth = 0;
|
|
93
84
|
this.viewportIds = [];
|
|
94
|
-
|
|
95
85
|
this.userData = {};
|
|
96
86
|
this.extensions = null;
|
|
97
|
-
|
|
98
87
|
this._priority = 0;
|
|
99
88
|
this._touchedFrame = 0;
|
|
100
89
|
this._visitedFrame = 0;
|
|
@@ -119,9 +108,7 @@ export class Tile3D {
|
|
|
119
108
|
this._initializeBoundingVolumes(header);
|
|
120
109
|
this._initializeContent(header);
|
|
121
110
|
this._initializeRenderingState(header);
|
|
122
|
-
|
|
123
111
|
this._lodJudge = null;
|
|
124
|
-
|
|
125
112
|
this._expireDate = null;
|
|
126
113
|
this._expiredContent = null;
|
|
127
114
|
this.implicitTiling = null;
|
|
@@ -142,47 +129,42 @@ export class Tile3D {
|
|
|
142
129
|
get isVisibleAndInRequestVolume() {
|
|
143
130
|
return this._visible && this._inRequestVolume;
|
|
144
131
|
}
|
|
145
|
-
|
|
146
132
|
get hasRenderContent() {
|
|
147
133
|
return !this.hasEmptyContent && !this.hasTilesetContent;
|
|
148
134
|
}
|
|
149
|
-
|
|
150
135
|
get hasChildren() {
|
|
151
136
|
return this.children.length > 0 || this.header.children && this.header.children.length > 0;
|
|
152
137
|
}
|
|
153
|
-
|
|
154
138
|
get contentReady() {
|
|
155
139
|
return this.contentState === TILE_CONTENT_STATE.READY || this.hasEmptyContent;
|
|
156
140
|
}
|
|
157
|
-
|
|
158
141
|
get contentAvailable() {
|
|
159
142
|
return Boolean(this.contentReady && this.hasRenderContent || this._expiredContent && !this.contentFailed);
|
|
160
143
|
}
|
|
161
|
-
|
|
162
144
|
get hasUnloadedContent() {
|
|
163
145
|
return this.hasRenderContent && this.contentUnloaded;
|
|
164
146
|
}
|
|
165
|
-
|
|
166
147
|
get contentUnloaded() {
|
|
167
148
|
return this.contentState === TILE_CONTENT_STATE.UNLOADED;
|
|
168
149
|
}
|
|
169
|
-
|
|
170
150
|
get contentExpired() {
|
|
171
151
|
return this.contentState === TILE_CONTENT_STATE.EXPIRED;
|
|
172
152
|
}
|
|
173
|
-
|
|
174
153
|
get contentFailed() {
|
|
175
154
|
return this.contentState === TILE_CONTENT_STATE.FAILED;
|
|
176
155
|
}
|
|
177
|
-
|
|
178
156
|
get distanceToCamera() {
|
|
179
157
|
return this._distanceToCamera;
|
|
180
158
|
}
|
|
181
|
-
|
|
182
159
|
get screenSpaceError() {
|
|
183
160
|
return this._screenSpaceError;
|
|
184
161
|
}
|
|
185
|
-
|
|
162
|
+
get boundingBox() {
|
|
163
|
+
if (!this._boundingBox) {
|
|
164
|
+
this._boundingBox = getCartographicBounds(this.header.boundingVolume, this.boundingVolume);
|
|
165
|
+
}
|
|
166
|
+
return this._boundingBox;
|
|
167
|
+
}
|
|
186
168
|
getScreenSpaceError(frameState, useParentLodMetric) {
|
|
187
169
|
switch (this.tileset.type) {
|
|
188
170
|
case TILESET_TYPE.I3S:
|
|
@@ -193,19 +175,15 @@ export class Tile3D {
|
|
|
193
175
|
throw new Error('Unsupported tileset type');
|
|
194
176
|
}
|
|
195
177
|
}
|
|
196
|
-
|
|
197
178
|
unselect() {
|
|
198
179
|
this._selectedFrame = 0;
|
|
199
180
|
}
|
|
200
|
-
|
|
201
181
|
_getPriority() {
|
|
202
182
|
const traverser = this.tileset._traverser;
|
|
203
183
|
const {
|
|
204
184
|
skipLevelOfDetail
|
|
205
185
|
} = traverser.options;
|
|
206
|
-
|
|
207
186
|
const maySkipTile = this.refine === TILE_REFINEMENT.ADD || skipLevelOfDetail;
|
|
208
|
-
|
|
209
187
|
if (maySkipTile && !this.isVisible && this._visible !== undefined) {
|
|
210
188
|
return -1;
|
|
211
189
|
}
|
|
@@ -215,15 +193,12 @@ export class Tile3D {
|
|
|
215
193
|
if (this.contentState === TILE_CONTENT_STATE.UNLOADED) {
|
|
216
194
|
return -1;
|
|
217
195
|
}
|
|
218
|
-
|
|
219
196
|
const parent = this.parent;
|
|
220
197
|
const useParentScreenSpaceError = parent && (!maySkipTile || this._screenSpaceError === 0.0 || parent.hasTilesetContent);
|
|
221
198
|
const screenSpaceError = useParentScreenSpaceError ? parent._screenSpaceError : this._screenSpaceError;
|
|
222
199
|
const rootScreenSpaceError = traverser.root ? traverser.root._screenSpaceError : 0.0;
|
|
223
|
-
|
|
224
200
|
return Math.max(rootScreenSpaceError - screenSpaceError, 0);
|
|
225
201
|
}
|
|
226
|
-
|
|
227
202
|
async loadContent() {
|
|
228
203
|
if (this.hasEmptyContent) {
|
|
229
204
|
return false;
|
|
@@ -269,7 +244,6 @@ export class Tile3D {
|
|
|
269
244
|
requestToken.done();
|
|
270
245
|
}
|
|
271
246
|
}
|
|
272
|
-
|
|
273
247
|
unloadContent() {
|
|
274
248
|
if (this.content && this.content.destroy) {
|
|
275
249
|
this.content.destroy();
|
|
@@ -282,7 +256,6 @@ export class Tile3D {
|
|
|
282
256
|
this.contentState = TILE_CONTENT_STATE.UNLOADED;
|
|
283
257
|
return true;
|
|
284
258
|
}
|
|
285
|
-
|
|
286
259
|
updateVisibility(frameState, viewportIds) {
|
|
287
260
|
if (this._frameNumber === frameState.frameNumber) {
|
|
288
261
|
return;
|
|
@@ -301,7 +274,6 @@ export class Tile3D {
|
|
|
301
274
|
this._frameNumber = frameState.frameNumber;
|
|
302
275
|
this.viewportIds = viewportIds;
|
|
303
276
|
}
|
|
304
|
-
|
|
305
277
|
visibility(frameState, parentVisibilityPlaneMask) {
|
|
306
278
|
const {
|
|
307
279
|
cullingVolume
|
|
@@ -309,20 +281,15 @@ export class Tile3D {
|
|
|
309
281
|
const {
|
|
310
282
|
boundingVolume
|
|
311
283
|
} = this;
|
|
312
|
-
|
|
313
284
|
return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);
|
|
314
285
|
}
|
|
315
|
-
|
|
316
286
|
contentVisibility() {
|
|
317
287
|
return true;
|
|
318
|
-
|
|
319
288
|
}
|
|
320
|
-
|
|
321
289
|
distanceToTile(frameState) {
|
|
322
290
|
const boundingVolume = this.boundingVolume;
|
|
323
291
|
return Math.sqrt(Math.max(boundingVolume.distanceSquaredTo(frameState.camera.position), 0));
|
|
324
292
|
}
|
|
325
|
-
|
|
326
293
|
cameraSpaceZDepth(_ref) {
|
|
327
294
|
let {
|
|
328
295
|
camera
|
|
@@ -331,12 +298,10 @@ export class Tile3D {
|
|
|
331
298
|
scratchVector.subVectors(boundingVolume.center, camera.position);
|
|
332
299
|
return camera.direction.dot(scratchVector);
|
|
333
300
|
}
|
|
334
|
-
|
|
335
301
|
insideViewerRequestVolume(frameState) {
|
|
336
302
|
const viewerRequestVolume = this._viewerRequestVolume;
|
|
337
303
|
return !viewerRequestVolume || viewerRequestVolume.distanceSquaredTo(frameState.camera.position) <= 0;
|
|
338
304
|
}
|
|
339
|
-
|
|
340
305
|
updateExpiration() {
|
|
341
306
|
if (defined(this._expireDate) && this.contentReady && !this.hasEmptyContent) {
|
|
342
307
|
const now = Date.now();
|
|
@@ -349,7 +314,6 @@ export class Tile3D {
|
|
|
349
314
|
get extras() {
|
|
350
315
|
return this.header.extras;
|
|
351
316
|
}
|
|
352
|
-
|
|
353
317
|
_initializeLodMetric(header) {
|
|
354
318
|
if ('lodMetricType' in header) {
|
|
355
319
|
this.lodMetricType = header.lodMetricType;
|
|
@@ -357,7 +321,6 @@ export class Tile3D {
|
|
|
357
321
|
this.lodMetricType = this.parent && this.parent.lodMetricType || this.tileset.lodMetricType;
|
|
358
322
|
console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType");
|
|
359
323
|
}
|
|
360
|
-
|
|
361
324
|
if ('lodMetricValue' in header) {
|
|
362
325
|
this.lodMetricValue = header.lodMetricValue;
|
|
363
326
|
} else {
|
|
@@ -386,18 +349,15 @@ export class Tile3D {
|
|
|
386
349
|
};
|
|
387
350
|
this.hasEmptyContent = true;
|
|
388
351
|
this.contentState = TILE_CONTENT_STATE.UNLOADED;
|
|
389
|
-
|
|
390
352
|
this.hasTilesetContent = false;
|
|
391
353
|
if (tileHeader.contentUrl) {
|
|
392
354
|
this.content = null;
|
|
393
355
|
this.hasEmptyContent = false;
|
|
394
356
|
}
|
|
395
357
|
}
|
|
396
|
-
|
|
397
358
|
_initializeRenderingState(header) {
|
|
398
359
|
this.depth = header.level || (this.parent ? this.parent.depth + 1 : 0);
|
|
399
360
|
this._shouldRefine = false;
|
|
400
|
-
|
|
401
361
|
this._distanceToCamera = 0;
|
|
402
362
|
this._centerZDepth = 0;
|
|
403
363
|
this._screenSpaceError = 0;
|
|
@@ -427,7 +387,6 @@ export class Tile3D {
|
|
|
427
387
|
break;
|
|
428
388
|
default:
|
|
429
389
|
}
|
|
430
|
-
|
|
431
390
|
if (this._isTileset()) {
|
|
432
391
|
this.hasTilesetContent = true;
|
|
433
392
|
}
|
|
@@ -438,7 +397,6 @@ export class Tile3D {
|
|
|
438
397
|
if (!content) {
|
|
439
398
|
return;
|
|
440
399
|
}
|
|
441
|
-
|
|
442
400
|
if (content.boundingVolume) {
|
|
443
401
|
this._contentBoundingVolume = createBoundingVolume(content.boundingVolume, this.computedTransform, this._contentBoundingVolume);
|
|
444
402
|
}
|
|
@@ -446,7 +404,6 @@ export class Tile3D {
|
|
|
446
404
|
this._viewerRequestVolume = createBoundingVolume(header.viewerRequestVolume, this.computedTransform, this._viewerRequestVolume);
|
|
447
405
|
}
|
|
448
406
|
}
|
|
449
|
-
|
|
450
407
|
_updateTransform() {
|
|
451
408
|
let parentTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Matrix4();
|
|
452
409
|
const computedTransform = parentTransform.clone().multiplyRight(this.transform);
|
|
@@ -457,7 +414,6 @@ export class Tile3D {
|
|
|
457
414
|
this.computedTransform = computedTransform;
|
|
458
415
|
this._updateBoundingVolume(this.header);
|
|
459
416
|
}
|
|
460
|
-
|
|
461
417
|
_getLoaderSpecificOptions(loaderId) {
|
|
462
418
|
switch (loaderId) {
|
|
463
419
|
case 'i3s':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-3d.js","names":["Vector3","Matrix4","CullingVolume","load","TILE_REFINEMENT","TILE_CONTENT_STATE","TILESET_TYPE","createBoundingVolume","getTiles3DScreenSpaceError","getProjectedRadius","get3dTilesOptions","TilesetTraverser","scratchVector","defined","x","undefined","Tile3D","constructor","tileset","header","parentHeader","extendedId","id","url","parent","refine","_getRefine","type","contentUrl","lodMetricType","lodMetricValue","boundingVolume","content","contentState","UNLOADED","gpuMemoryUsageInBytes","children","hasEmptyContent","hasTilesetContent","depth","viewportIds","userData","extensions","_priority","_touchedFrame","_visitedFrame","_selectedFrame","_requestedFrame","_screenSpaceError","_cacheNode","_frameNumber","traverser","_shouldRefine","_distanceToCamera","_centerZDepth","_visible","_inRequestVolume","_stackLength","_selectionDepth","_initialTransform","transform","_initializeLodMetric","_initializeTransforms","_initializeBoundingVolumes","_initializeContent","_initializeRenderingState","_lodJudge","_expireDate","_expiredContent","implicitTiling","Object","seal","destroy","isDestroyed","selected","isVisible","isVisibleAndInRequestVolume","hasRenderContent","hasChildren","length","contentReady","READY","contentAvailable","Boolean","contentFailed","hasUnloadedContent","contentUnloaded","contentExpired","EXPIRED","FAILED","distanceToCamera","screenSpaceError","getScreenSpaceError","frameState","useParentLodMetric","I3S","TILES3D","Error","unselect","_getPriority","_traverser","skipLevelOfDetail","options","maySkipTile","ADD","useParentScreenSpaceError","rootScreenSpaceError","root","Math","max","loadContent","expired","LOADING","requestToken","_requestScheduler","scheduleRequest","bind","getTileUrl","loader","loadOptions","isTileset","_getLoaderSpecificOptions","contentLoader","_isTileset","_initializeTileHeaders","_onContentLoaded","error","done","unloadContent","updateVisibility","frameNumber","parentVisibilityPlaneMask","_visibilityPlaneMask","MASK_INDETERMINATE","updateTransforms","parentTransform","computedTransform","modelMatrix","_updateTransform","distanceToTile","visibility","MASK_OUTSIDE","insideViewerRequestVolume","cullingVolume","computeVisibilityWithPlaneMask","contentVisibility","sqrt","distanceSquaredTo","camera","position","cameraSpaceZDepth","subVectors","center","direction","dot","viewerRequestVolume","_viewerRequestVolume","updateExpiration","now","Date","lessThan","extras","console","warn","tileHeader","clone","multiplyRight","parentInitialTransform","_contentBoundingVolume","_updateBoundingVolume","_tileset","_tile","level","REPLACE","indexOf","disableSkipLevelOfDetail","didTransformChange","equals","loaderId","i3s","_tileOptions","attributeUrls","textureUrl","textureFormat","textureLoaderOptions","materialDefinition","isDracoGeometry","mbs","_tilesetOptions","store","attributeStorageInfo","fields","isTileHeader"],"sources":["../../../src/tileset/tile-3d.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// This file is derived from the Cesium code base under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\nimport {Vector3, Matrix4} from '@math.gl/core';\nimport {CullingVolume} from '@math.gl/culling';\n\nimport {load} from '@loaders.gl/core';\n\n// Note: circular dependency\nimport type {Tileset3D} from './tileset-3d';\nimport {TILE_REFINEMENT, TILE_CONTENT_STATE, TILESET_TYPE} from '../constants';\n\nimport {FrameState} from './helpers/frame-state';\nimport {createBoundingVolume} from './helpers/bounding-volume';\nimport {getTiles3DScreenSpaceError} from './helpers/tiles-3d-lod';\nimport {getProjectedRadius} from './helpers/i3s-lod';\nimport {get3dTilesOptions} from './helpers/3d-tiles-options';\nimport {TilesetTraverser} from './tileset-traverser';\n\nconst scratchVector = new Vector3();\n\nfunction defined(x) {\n return x !== undefined && x !== null;\n}\n\n/**\n * @param tileset - Tileset3D instance\n * @param header - tile header - JSON loaded from a dataset\n * @param parentHeader - parent Tile3D instance\n * @param extendedId - optional ID to separate copies of a tile for different viewports.\n * const extendedId = `${tile.id}-${frameState.viewport.id}`;\n */\nexport type Tile3DProps = {\n tileset: Tileset3D;\n header: Object;\n parentHeader: Tile3D;\n extendedId: string;\n};\n\n/**\n * A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;\n * the content is loaded on-demand when needed based on the view.\n * Do not construct this directly, instead access tiles through {@link Tileset3D#tileVisible}.\n */\nexport class Tile3D {\n tileset: Tileset3D;\n header: any;\n id: string;\n url: string;\n parent: Tile3D;\n refine: number;\n type: string;\n contentUrl: string;\n lodMetricType: string;\n lodMetricValue: number;\n boundingVolume: any;\n content: any;\n contentState: any;\n gpuMemoryUsageInBytes: number;\n children: Tile3D[];\n depth: number;\n viewportIds: any[];\n transform: Matrix4;\n extensions: any;\n implicitTiling?: any;\n\n // Container to store application specific data\n userData: {[key: string]: any};\n computedTransform: any;\n hasEmptyContent: boolean;\n hasTilesetContent: boolean;\n\n traverser: object;\n\n // @ts-ignore\n private _cacheNode: any;\n private _frameNumber: any;\n // TODO i3s specific, needs to remove\n // @ts-ignore\n private _lodJudge: any;\n // TODO Cesium 3d tiles specific\n private _expireDate: any;\n private _expiredContent: any;\n // @ts-ignore\n private _shouldRefine: boolean;\n\n // Members this are updated every frame for tree traversal and rendering optimizations:\n public _distanceToCamera: number;\n // @ts-ignore\n private _centerZDepth: number;\n private _screenSpaceError: number;\n private _visibilityPlaneMask: any;\n private _visible?: boolean;\n private _inRequestVolume: boolean;\n\n // @ts-ignore\n private _stackLength: number;\n // @ts-ignore\n private _selectionDepth: number;\n\n // @ts-ignore\n private _touchedFrame: number;\n // @ts-ignore\n private _visitedFrame: number;\n private _selectedFrame: number;\n // @ts-ignore\n private _requestedFrame: number;\n\n // @ts-ignore\n private _priority: number;\n\n private _contentBoundingVolume: any;\n private _viewerRequestVolume: any;\n\n _initialTransform: Matrix4;\n\n /**\n * @constructs\n * Create a Tile3D instance\n * @param tileset - Tileset3D instance\n * @param header - tile header - JSON loaded from a dataset\n * @param parentHeader - parent Tile3D instance\n * @param extendedId - optional ID to separate copies of a tile for different viewports.\n * const extendedId = `${tile.id}-${frameState.viewport.id}`;\n */\n // eslint-disable-next-line max-statements\n constructor(\n tileset: Tileset3D,\n header: {[key: string]: any},\n parentHeader?: Tile3D,\n extendedId = ''\n ) {\n // PUBLIC MEMBERS\n // original tile data\n this.header = header;\n\n // The tileset containing this tile.\n this.tileset = tileset;\n this.id = extendedId || header.id;\n this.url = header.url;\n\n // This tile's parent or `undefined` if this tile is the root.\n // @ts-ignore\n this.parent = parentHeader;\n this.refine = this._getRefine(header.refine);\n this.type = header.type;\n this.contentUrl = header.contentUrl;\n\n // The error, in meters, introduced if this tile is rendered and its children are not.\n this.lodMetricType = 'geometricError';\n this.lodMetricValue = 0;\n\n // Specifies the type of refine that is used when traversing this tile for rendering.\n this.boundingVolume = null;\n\n // The tile's content. This represents the actual tile's payload,\n // not the content's metadata in the tileset JSON file.\n this.content = null;\n this.contentState = TILE_CONTENT_STATE.UNLOADED;\n this.gpuMemoryUsageInBytes = 0;\n\n // The tile's children - an array of Tile3D objects.\n this.children = [];\n\n this.hasEmptyContent = false;\n this.hasTilesetContent = false;\n\n this.depth = 0;\n this.viewportIds = [];\n\n // Container to store application specific data\n this.userData = {};\n this.extensions = null;\n\n // PRIVATE MEMBERS\n this._priority = 0;\n this._touchedFrame = 0;\n this._visitedFrame = 0;\n this._selectedFrame = 0;\n this._requestedFrame = 0;\n this._screenSpaceError = 0;\n\n this._cacheNode = null;\n this._frameNumber = null;\n this._cacheNode = null;\n\n this.traverser = new TilesetTraverser({});\n this._shouldRefine = false;\n this._distanceToCamera = 0;\n this._centerZDepth = 0;\n this._visible = undefined;\n this._inRequestVolume = false;\n this._stackLength = 0;\n this._selectionDepth = 0;\n this._initialTransform = new Matrix4();\n this.transform = new Matrix4();\n\n this._initializeLodMetric(header);\n this._initializeTransforms(header);\n this._initializeBoundingVolumes(header);\n this._initializeContent(header);\n this._initializeRenderingState(header);\n\n // TODO i3s specific, needs to remove\n this._lodJudge = null;\n\n // TODO Cesium 3d tiles specific\n this._expireDate = null;\n this._expiredContent = null;\n this.implicitTiling = null;\n\n Object.seal(this);\n }\n\n destroy() {\n this.header = null;\n }\n\n isDestroyed() {\n return this.header === null;\n }\n\n get selected() {\n return this._selectedFrame === this.tileset._frameNumber;\n }\n\n get isVisible() {\n return this._visible;\n }\n\n get isVisibleAndInRequestVolume() {\n return this._visible && this._inRequestVolume;\n }\n\n /** Returns true if tile is not an empty tile and not an external tileset */\n get hasRenderContent() {\n return !this.hasEmptyContent && !this.hasTilesetContent;\n }\n\n /** Returns true if tile has children */\n get hasChildren() {\n return this.children.length > 0 || (this.header.children && this.header.children.length > 0);\n }\n\n /**\n * Determines if the tile's content is ready. This is automatically `true` for\n * tiles with empty content.\n */\n get contentReady() {\n return this.contentState === TILE_CONTENT_STATE.READY || this.hasEmptyContent;\n }\n\n /**\n * Determines if the tile has available content to render. `true` if the tile's\n * content is ready or if it has expired content this renders while new content loads; otherwise,\n */\n get contentAvailable() {\n return Boolean(\n (this.contentReady && this.hasRenderContent) || (this._expiredContent && !this.contentFailed)\n );\n }\n\n /** Returns true if tile has renderable content but it's unloaded */\n get hasUnloadedContent() {\n return this.hasRenderContent && this.contentUnloaded;\n }\n\n /**\n * Determines if the tile's content has not be requested. `true` if tile's\n * content has not be requested; otherwise, `false`.\n */\n get contentUnloaded() {\n return this.contentState === TILE_CONTENT_STATE.UNLOADED;\n }\n\n /**\n * Determines if the tile's content is expired. `true` if tile's\n * content is expired; otherwise, `false`.\n */\n get contentExpired() {\n return this.contentState === TILE_CONTENT_STATE.EXPIRED;\n }\n\n // Determines if the tile's content failed to load. `true` if the tile's\n // content failed to load; otherwise, `false`.\n get contentFailed() {\n return this.contentState === TILE_CONTENT_STATE.FAILED;\n }\n\n /**\n * Distance from the tile's bounding volume center to the camera\n */\n get distanceToCamera(): number {\n return this._distanceToCamera;\n }\n\n /**\n * Screen space error for LOD selection\n */\n get screenSpaceError(): number {\n return this._screenSpaceError;\n }\n\n /** Get the tile's screen space error. */\n getScreenSpaceError(frameState, useParentLodMetric) {\n switch (this.tileset.type) {\n case TILESET_TYPE.I3S:\n return getProjectedRadius(this, frameState);\n case TILESET_TYPE.TILES3D:\n return getTiles3DScreenSpaceError(this, frameState, useParentLodMetric);\n default:\n // eslint-disable-next-line\n throw new Error('Unsupported tileset type');\n }\n }\n\n /**\n * Make tile unselected than means it won't be shown\n * but it can be still loaded in memory\n */\n unselect(): void {\n this._selectedFrame = 0;\n }\n\n /*\n * If skipLevelOfDetail is off try to load child tiles as soon as possible so that their parent can refine sooner.\n * Tiles are prioritized by screen space error.\n */\n // eslint-disable-next-line complexity\n _getPriority() {\n const traverser = this.tileset._traverser;\n const {skipLevelOfDetail} = traverser.options;\n\n /*\n * Tiles that are outside of the camera's frustum could be skipped if we are in 'ADD' mode\n * or if we are using 'Skip Traversal' in 'REPLACE' mode.\n * Otherewise, all 'touched' child tiles have to be loaded and displayed,\n * this may include tiles that are outide of the camera frustum (so that we can hide the parent tile).\n */\n const maySkipTile = this.refine === TILE_REFINEMENT.ADD || skipLevelOfDetail;\n\n // Check if any reason to abort\n if (maySkipTile && !this.isVisible && this._visible !== undefined) {\n return -1;\n }\n // Condition used in `cancelOutOfViewRequests` function in CesiumJS/Cesium3DTileset.js\n if (this.tileset._frameNumber - this._touchedFrame >= 1) {\n return -1;\n }\n if (this.contentState === TILE_CONTENT_STATE.UNLOADED) {\n return -1;\n }\n\n // Based on the priority function `getPriorityReverseScreenSpaceError` in CesiumJS. Scheduling priority is based on the parent's screen space error when possible.\n const parent = this.parent;\n const useParentScreenSpaceError =\n parent && (!maySkipTile || this._screenSpaceError === 0.0 || parent.hasTilesetContent);\n const screenSpaceError = useParentScreenSpaceError\n ? parent._screenSpaceError\n : this._screenSpaceError;\n\n const rootScreenSpaceError = traverser.root ? traverser.root._screenSpaceError : 0.0;\n\n // Map higher SSE to lower values (e.g. root tile is highest priority)\n return Math.max(rootScreenSpaceError - screenSpaceError, 0);\n }\n\n /**\n * Requests the tile's content.\n * The request may not be made if the Request Scheduler can't prioritize it.\n */\n // eslint-disable-next-line max-statements, complexity\n async loadContent(): Promise<boolean> {\n if (this.hasEmptyContent) {\n return false;\n }\n\n if (this.content) {\n return true;\n }\n\n const expired = this.contentExpired;\n\n if (expired) {\n this._expireDate = null;\n }\n\n this.contentState = TILE_CONTENT_STATE.LOADING;\n\n const requestToken = await this.tileset._requestScheduler.scheduleRequest(\n this.id,\n this._getPriority.bind(this)\n );\n\n if (!requestToken) {\n // cancelled\n this.contentState = TILE_CONTENT_STATE.UNLOADED;\n return false;\n }\n\n try {\n const contentUrl = this.tileset.getTileUrl(this.contentUrl);\n // The content can be a binary tile ot a JSON tileset\n const loader = this.tileset.loader;\n const options = {\n ...this.tileset.loadOptions,\n [loader.id]: {\n ...this.tileset.loadOptions[loader.id],\n isTileset: this.type === 'json',\n ...this._getLoaderSpecificOptions(loader.id)\n }\n };\n\n this.content = await load(contentUrl, loader, options);\n\n if (this.tileset.options.contentLoader) {\n await this.tileset.options.contentLoader(this);\n }\n\n if (this._isTileset()) {\n // Add tile headers for the nested tilset's subtree\n // Async update of the tree should be fine since there would never be edits to the same node\n // TODO - we need to capture the child tileset's URL\n this.tileset._initializeTileHeaders(this.content, this);\n }\n\n this.contentState = TILE_CONTENT_STATE.READY;\n this._onContentLoaded();\n return true;\n } catch (error) {\n // Tile is unloaded before the content finishes loading\n this.contentState = TILE_CONTENT_STATE.FAILED;\n throw error;\n } finally {\n requestToken.done();\n }\n }\n\n // Unloads the tile's content.\n unloadContent() {\n if (this.content && this.content.destroy) {\n this.content.destroy();\n }\n this.content = null;\n if (this.header.content && this.header.content.destroy) {\n this.header.content.destroy();\n }\n this.header.content = null;\n this.contentState = TILE_CONTENT_STATE.UNLOADED;\n return true;\n }\n\n /**\n * Update the tile's visibility\n * @param {Object} frameState - frame state for tile culling\n * @param {string[]} viewportIds - a list of viewport ids that show this tile\n * @return {void}\n */\n updateVisibility(frameState, viewportIds) {\n if (this._frameNumber === frameState.frameNumber) {\n // Return early if visibility has already been checked during the traversal.\n // The visibility may have already been checked if the cullWithChildrenBounds optimization is used.\n return;\n }\n\n const parent = this.parent;\n const parentVisibilityPlaneMask = parent\n ? parent._visibilityPlaneMask\n : CullingVolume.MASK_INDETERMINATE;\n\n if (this.tileset._traverser.options.updateTransforms) {\n const parentTransform = parent ? parent.computedTransform : this.tileset.modelMatrix;\n this._updateTransform(parentTransform);\n }\n\n this._distanceToCamera = this.distanceToTile(frameState);\n this._screenSpaceError = this.getScreenSpaceError(frameState, false);\n this._visibilityPlaneMask = this.visibility(frameState, parentVisibilityPlaneMask); // Use parent's plane mask to speed up visibility test\n this._visible = this._visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE;\n this._inRequestVolume = this.insideViewerRequestVolume(frameState);\n\n this._frameNumber = frameState.frameNumber;\n this.viewportIds = viewportIds;\n }\n\n // Determines whether the tile's bounding volume intersects the culling volume.\n // @param {FrameState} frameState The frame state.\n // @param {Number} parentVisibilityPlaneMask The parent's plane mask to speed up the visibility check.\n // @returns {Number} A plane mask as described above in {@link CullingVolume#computeVisibilityWithPlaneMask}.\n visibility(frameState, parentVisibilityPlaneMask) {\n const {cullingVolume} = frameState;\n const {boundingVolume} = this;\n\n // TODO Cesium specific - restore clippingPlanes\n // const {clippingPlanes, clippingPlanesOriginMatrix} = tileset;\n // if (clippingPlanes && clippingPlanes.enabled) {\n // const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n // boundingVolume,\n // clippingPlanesOriginMatrix\n // );\n // this._isClipped = intersection !== Intersect.INSIDE;\n // if (intersection === Intersect.OUTSIDE) {\n // return CullingVolume.MASK_OUTSIDE;\n // }\n // }\n\n // return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);\n return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);\n }\n\n // Assuming the tile's bounding volume intersects the culling volume, determines\n // whether the tile's content's bounding volume intersects the culling volume.\n // @param {FrameState} frameState The frame state.\n // @returns {Intersect} The result of the intersection: the tile's content is completely outside, completely inside, or intersecting the culling volume.\n contentVisibility() {\n return true;\n\n // TODO restore\n /*\n // Assumes the tile's bounding volume intersects the culling volume already, so\n // just return Intersect.INSIDE if there is no content bounding volume.\n if (!defined(this.contentBoundingVolume)) {\n return Intersect.INSIDE;\n }\n\n if (this._visibilityPlaneMask === CullingVolume.MASK_INSIDE) {\n // The tile's bounding volume is completely inside the culling volume so\n // the content bounding volume must also be inside.\n return Intersect.INSIDE;\n }\n\n // PERFORMANCE_IDEA: is it possible to burn less CPU on this test since we know the\n // tile's (not the content's) bounding volume intersects the culling volume?\n const cullingVolume = frameState.cullingVolume;\n const boundingVolume = tile.contentBoundingVolume;\n\n const tileset = this.tileset;\n const clippingPlanes = tileset.clippingPlanes;\n if (defined(clippingPlanes) && clippingPlanes.enabled) {\n const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n boundingVolume,\n tileset.clippingPlanesOriginMatrix\n );\n this._isClipped = intersection !== Intersect.INSIDE;\n if (intersection === Intersect.OUTSIDE) {\n return Intersect.OUTSIDE;\n }\n }\n\n return cullingVolume.computeVisibility(boundingVolume);\n */\n }\n\n /**\n * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.\n * @param frameState The frame state.\n * @returns {Number} The distance, in meters, or zero if the camera is inside the bounding volume.\n */\n distanceToTile(frameState: FrameState): number {\n const boundingVolume = this.boundingVolume;\n return Math.sqrt(Math.max(boundingVolume.distanceSquaredTo(frameState.camera.position), 0));\n }\n\n /**\n * Computes the tile's camera-space z-depth.\n * @param frameState The frame state.\n * @returns The distance, in meters.\n */\n cameraSpaceZDepth({camera}): number {\n const boundingVolume = this.boundingVolume; // Gets the underlying OrientedBoundingBox or BoundingSphere\n scratchVector.subVectors(boundingVolume.center, camera.position);\n return camera.direction.dot(scratchVector);\n }\n\n /**\n * Checks if the camera is inside the viewer request volume.\n * @param {FrameState} frameState The frame state.\n * @returns {Boolean} Whether the camera is inside the volume.\n */\n insideViewerRequestVolume(frameState: FrameState) {\n const viewerRequestVolume = this._viewerRequestVolume;\n return (\n !viewerRequestVolume || viewerRequestVolume.distanceSquaredTo(frameState.camera.position) <= 0\n );\n }\n\n // TODO Cesium specific\n\n // Update whether the tile has expired.\n updateExpiration() {\n if (defined(this._expireDate) && this.contentReady && !this.hasEmptyContent) {\n const now = Date.now();\n // @ts-ignore Date.lessThan - replace with ms compare?\n if (Date.lessThan(this._expireDate, now)) {\n this.contentState = TILE_CONTENT_STATE.EXPIRED;\n this._expiredContent = this.content;\n }\n }\n }\n\n get extras() {\n return this.header.extras;\n }\n\n // INTERNAL METHODS\n\n _initializeLodMetric(header) {\n if ('lodMetricType' in header) {\n this.lodMetricType = header.lodMetricType;\n } else {\n this.lodMetricType = (this.parent && this.parent.lodMetricType) || this.tileset.lodMetricType;\n // eslint-disable-next-line\n console.warn(`3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType`);\n }\n\n // This is used to compute screen space error, i.e., the error measured in pixels.\n if ('lodMetricValue' in header) {\n this.lodMetricValue = header.lodMetricValue;\n } else {\n this.lodMetricValue =\n (this.parent && this.parent.lodMetricValue) || this.tileset.lodMetricValue;\n // eslint-disable-next-line\n console.warn(\n '3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue'\n );\n }\n }\n\n _initializeTransforms(tileHeader) {\n // The local transform of this tile.\n this.transform = tileHeader.transform ? new Matrix4(tileHeader.transform) : new Matrix4();\n\n const parent = this.parent;\n const tileset = this.tileset;\n\n const parentTransform =\n parent && parent.computedTransform\n ? parent.computedTransform.clone()\n : tileset.modelMatrix.clone();\n this.computedTransform = new Matrix4(parentTransform).multiplyRight(this.transform);\n\n const parentInitialTransform =\n parent && parent._initialTransform ? parent._initialTransform.clone() : new Matrix4();\n this._initialTransform = new Matrix4(parentInitialTransform).multiplyRight(this.transform);\n }\n\n _initializeBoundingVolumes(tileHeader) {\n this._contentBoundingVolume = null;\n this._viewerRequestVolume = null;\n\n this._updateBoundingVolume(tileHeader);\n }\n\n _initializeContent(tileHeader) {\n // Empty tile by default\n this.content = {_tileset: this.tileset, _tile: this};\n this.hasEmptyContent = true;\n this.contentState = TILE_CONTENT_STATE.UNLOADED;\n\n // When `true`, the tile's content points to an external tileset.\n // This is `false` until the tile's content is loaded.\n this.hasTilesetContent = false;\n\n if (tileHeader.contentUrl) {\n this.content = null;\n this.hasEmptyContent = false;\n }\n }\n\n // TODO - remove anything not related to basic visibility detection\n _initializeRenderingState(header) {\n this.depth = header.level || (this.parent ? this.parent.depth + 1 : 0);\n this._shouldRefine = false;\n\n // Members this are updated every frame for tree traversal and rendering optimizations:\n this._distanceToCamera = 0;\n this._centerZDepth = 0;\n this._screenSpaceError = 0;\n this._visibilityPlaneMask = CullingVolume.MASK_INDETERMINATE;\n this._visible = undefined;\n this._inRequestVolume = false;\n\n this._stackLength = 0;\n this._selectionDepth = 0;\n\n this._frameNumber = 0;\n this._touchedFrame = 0;\n this._visitedFrame = 0;\n this._selectedFrame = 0;\n this._requestedFrame = 0;\n\n this._priority = 0.0;\n }\n\n _getRefine(refine) {\n // Inherit from parent tile if omitted.\n return refine || (this.parent && this.parent.refine) || TILE_REFINEMENT.REPLACE;\n }\n\n _isTileset() {\n return this.contentUrl.indexOf('.json') !== -1;\n }\n\n _onContentLoaded() {\n // Vector and Geometry tile rendering do not support the skip LOD optimization.\n switch (this.content && this.content.type) {\n case 'vctr':\n case 'geom':\n // @ts-ignore\n this.tileset._traverser.disableSkipLevelOfDetail = true;\n break;\n default:\n }\n\n // The content may be tileset json\n if (this._isTileset()) {\n this.hasTilesetContent = true;\n }\n }\n\n _updateBoundingVolume(header) {\n // Update the bounding volumes\n this.boundingVolume = createBoundingVolume(\n header.boundingVolume,\n this.computedTransform,\n this.boundingVolume\n );\n\n const content = header.content;\n if (!content) {\n return;\n }\n\n // TODO Cesium specific\n // Non-leaf tiles may have a content bounding-volume, which is a tight-fit bounding volume\n // around only the features in the tile. This box is useful for culling for rendering,\n // but not for culling for traversing the tree since it does not guarantee spatial coherence, i.e.,\n // since it only bounds features in the tile, not the entire tile, children may be\n // outside of this box.\n if (content.boundingVolume) {\n this._contentBoundingVolume = createBoundingVolume(\n content.boundingVolume,\n this.computedTransform,\n this._contentBoundingVolume\n );\n }\n if (header.viewerRequestVolume) {\n this._viewerRequestVolume = createBoundingVolume(\n header.viewerRequestVolume,\n this.computedTransform,\n this._viewerRequestVolume\n );\n }\n }\n\n // Update the tile's transform. The transform is applied to the tile's bounding volumes.\n _updateTransform(parentTransform = new Matrix4()) {\n const computedTransform = parentTransform.clone().multiplyRight(this.transform);\n const didTransformChange = !computedTransform.equals(this.computedTransform);\n\n if (!didTransformChange) {\n return;\n }\n\n this.computedTransform = computedTransform;\n\n this._updateBoundingVolume(this.header);\n }\n\n // Get options which are applicable only for the particular loader\n _getLoaderSpecificOptions(loaderId) {\n switch (loaderId) {\n case 'i3s':\n return {\n ...this.tileset.options.i3s,\n _tileOptions: {\n attributeUrls: this.header.attributeUrls,\n textureUrl: this.header.textureUrl,\n textureFormat: this.header.textureFormat,\n textureLoaderOptions: this.header.textureLoaderOptions,\n materialDefinition: this.header.materialDefinition,\n isDracoGeometry: this.header.isDracoGeometry,\n mbs: this.header.mbs\n },\n _tilesetOptions: {\n store: this.tileset.tileset.store,\n attributeStorageInfo: this.tileset.tileset.attributeStorageInfo,\n fields: this.tileset.tileset.fields\n },\n isTileHeader: false\n };\n case '3d-tiles':\n case 'cesium-ion':\n default:\n return get3dTilesOptions(this.tileset.tileset);\n }\n }\n}\n"],"mappings":";;AAKA,SAAQA,OAAO,EAAEC,OAAO,QAAO,eAAe;AAC9C,SAAQC,aAAa,QAAO,kBAAkB;AAE9C,SAAQC,IAAI,QAAO,kBAAkB;;AAIrC,SAAQC,eAAe,EAAEC,kBAAkB,EAAEC,YAAY,QAAO,cAAc;AAG9E,SAAQC,oBAAoB,QAAO,2BAA2B;AAC9D,SAAQC,0BAA0B,QAAO,wBAAwB;AACjE,SAAQC,kBAAkB,QAAO,mBAAmB;AACpD,SAAQC,iBAAiB,QAAO,4BAA4B;AAC5D,SAAQC,gBAAgB,QAAO,qBAAqB;AAEpD,MAAMC,aAAa,GAAG,IAAIZ,OAAO,EAAE;AAEnC,SAASa,OAAO,CAACC,CAAC,EAAE;EAClB,OAAOA,CAAC,KAAKC,SAAS,IAAID,CAAC,KAAK,IAAI;AACtC;;AAqBA,OAAO,MAAME,MAAM,CAAC;;EAkFlBC,WAAW,CACTC,OAAkB,EAClBC,MAA4B,EAC5BC,YAAqB,EAErB;IAAA,IADAC,UAAU,uEAAG,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAA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E,IAAI,CAACvK,MAAM,CAACuK,eAAe;YAC5CC,GAAG,EAAE,IAAI,CAACxK,MAAM,CAACwK;UACnB,CAAC;UACDC,eAAe,EAAE;YACfC,KAAK,EAAE,IAAI,CAAC3K,OAAO,CAACA,OAAO,CAAC2K,KAAK;YACjCC,oBAAoB,EAAE,IAAI,CAAC5K,OAAO,CAACA,OAAO,CAAC4K,oBAAoB;YAC/DC,MAAM,EAAE,IAAI,CAAC7K,OAAO,CAACA,OAAO,CAAC6K;UAC/B,CAAC;UACDC,YAAY,EAAE;QAChB,CAAC;MACH,KAAK,UAAU;MACf,KAAK,YAAY;MACjB;QACE,OAAOtL,iBAAiB,CAAC,IAAI,CAACQ,OAAO,CAACA,OAAO,CAAC;IAAC;EAErD;AACF"}
|
|
1
|
+
{"version":3,"file":"tile-3d.js","names":["Vector3","Matrix4","CullingVolume","load","TILE_REFINEMENT","TILE_CONTENT_STATE","TILESET_TYPE","createBoundingVolume","getCartographicBounds","getTiles3DScreenSpaceError","getProjectedRadius","get3dTilesOptions","TilesetTraverser","scratchVector","defined","x","undefined","Tile3D","constructor","tileset","header","parentHeader","extendedId","arguments","length","_defineProperty","id","url","parent","refine","_getRefine","type","contentUrl","lodMetricType","lodMetricValue","boundingVolume","content","contentState","UNLOADED","gpuMemoryUsageInBytes","children","hasEmptyContent","hasTilesetContent","depth","viewportIds","userData","extensions","_priority","_touchedFrame","_visitedFrame","_selectedFrame","_requestedFrame","_screenSpaceError","_cacheNode","_frameNumber","traverser","_shouldRefine","_distanceToCamera","_centerZDepth","_visible","_inRequestVolume","_stackLength","_selectionDepth","_initialTransform","transform","_initializeLodMetric","_initializeTransforms","_initializeBoundingVolumes","_initializeContent","_initializeRenderingState","_lodJudge","_expireDate","_expiredContent","implicitTiling","Object","seal","destroy","isDestroyed","selected","isVisible","isVisibleAndInRequestVolume","hasRenderContent","hasChildren","contentReady","READY","contentAvailable","Boolean","contentFailed","hasUnloadedContent","contentUnloaded","contentExpired","EXPIRED","FAILED","distanceToCamera","screenSpaceError","boundingBox","_boundingBox","getScreenSpaceError","frameState","useParentLodMetric","I3S","TILES3D","Error","unselect","_getPriority","_traverser","skipLevelOfDetail","options","maySkipTile","ADD","useParentScreenSpaceError","rootScreenSpaceError","root","Math","max","loadContent","expired","LOADING","requestToken","_requestScheduler","scheduleRequest","bind","getTileUrl","loader","loadOptions","isTileset","_getLoaderSpecificOptions","contentLoader","_isTileset","_initializeTileHeaders","_onContentLoaded","error","done","unloadContent","updateVisibility","frameNumber","parentVisibilityPlaneMask","_visibilityPlaneMask","MASK_INDETERMINATE","updateTransforms","parentTransform","computedTransform","modelMatrix","_updateTransform","distanceToTile","visibility","MASK_OUTSIDE","insideViewerRequestVolume","cullingVolume","computeVisibilityWithPlaneMask","contentVisibility","sqrt","distanceSquaredTo","camera","position","cameraSpaceZDepth","_ref","subVectors","center","direction","dot","viewerRequestVolume","_viewerRequestVolume","updateExpiration","now","Date","lessThan","extras","console","warn","tileHeader","clone","multiplyRight","parentInitialTransform","_contentBoundingVolume","_updateBoundingVolume","_tileset","_tile","level","REPLACE","indexOf","disableSkipLevelOfDetail","didTransformChange","equals","loaderId","i3s","_tileOptions","attributeUrls","textureUrl","textureFormat","textureLoaderOptions","materialDefinition","isDracoGeometry","mbs","_tilesetOptions","store","attributeStorageInfo","fields","isTileHeader"],"sources":["../../../src/tileset/tile-3d.ts"],"sourcesContent":["// loaders.gl, MIT license\n\n// This file is derived from the Cesium code base under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\nimport {Vector3, Matrix4} from '@math.gl/core';\nimport {CullingVolume} from '@math.gl/culling';\n\nimport {load} from '@loaders.gl/core';\n\n// Note: circular dependency\nimport type {Tileset3D} from './tileset-3d';\nimport {TILE_REFINEMENT, TILE_CONTENT_STATE, TILESET_TYPE} from '../constants';\n\nimport {FrameState} from './helpers/frame-state';\nimport {\n createBoundingVolume,\n getCartographicBounds,\n CartographicBounds\n} from './helpers/bounding-volume';\nimport {getTiles3DScreenSpaceError} from './helpers/tiles-3d-lod';\nimport {getProjectedRadius} from './helpers/i3s-lod';\nimport {get3dTilesOptions} from './helpers/3d-tiles-options';\nimport {TilesetTraverser} from './tileset-traverser';\n\nconst scratchVector = new Vector3();\n\nfunction defined(x) {\n return x !== undefined && x !== null;\n}\n\n/**\n * @param tileset - Tileset3D instance\n * @param header - tile header - JSON loaded from a dataset\n * @param parentHeader - parent Tile3D instance\n * @param extendedId - optional ID to separate copies of a tile for different viewports.\n * const extendedId = `${tile.id}-${frameState.viewport.id}`;\n */\nexport type Tile3DProps = {\n tileset: Tileset3D;\n header: Object;\n parentHeader: Tile3D;\n extendedId: string;\n};\n\n/**\n * A Tile3DHeader represents a tile as Tileset3D. When a tile is first created, its content is not loaded;\n * the content is loaded on-demand when needed based on the view.\n * Do not construct this directly, instead access tiles through {@link Tileset3D#tileVisible}.\n */\nexport class Tile3D {\n tileset: Tileset3D;\n header: any;\n id: string;\n url: string;\n parent: Tile3D;\n refine: number;\n type: string;\n contentUrl: string;\n lodMetricType: string;\n lodMetricValue: number;\n boundingVolume: any;\n content: any;\n contentState: any;\n gpuMemoryUsageInBytes: number;\n children: Tile3D[];\n depth: number;\n viewportIds: any[];\n transform: Matrix4;\n extensions: any;\n implicitTiling?: any;\n\n // Container to store application specific data\n userData: {[key: string]: any};\n computedTransform: any;\n hasEmptyContent: boolean;\n hasTilesetContent: boolean;\n\n traverser: object;\n\n // @ts-ignore\n private _cacheNode: any;\n private _frameNumber: any;\n // TODO i3s specific, needs to remove\n // @ts-ignore\n private _lodJudge: any;\n // TODO Cesium 3d tiles specific\n private _expireDate: any;\n private _expiredContent: any;\n // @ts-ignore\n private _shouldRefine: boolean;\n\n private _boundingBox?: CartographicBounds;\n\n // Members this are updated every frame for tree traversal and rendering optimizations:\n public _distanceToCamera: number;\n // @ts-ignore\n private _centerZDepth: number;\n private _screenSpaceError: number;\n private _visibilityPlaneMask: any;\n private _visible?: boolean;\n private _inRequestVolume: boolean;\n\n // @ts-ignore\n private _stackLength: number;\n // @ts-ignore\n private _selectionDepth: number;\n\n // @ts-ignore\n private _touchedFrame: number;\n // @ts-ignore\n private _visitedFrame: number;\n private _selectedFrame: number;\n // @ts-ignore\n private _requestedFrame: number;\n\n // @ts-ignore\n private _priority: number;\n\n private _contentBoundingVolume: any;\n private _viewerRequestVolume: any;\n\n _initialTransform: Matrix4;\n\n /**\n * @constructs\n * Create a Tile3D instance\n * @param tileset - Tileset3D instance\n * @param header - tile header - JSON loaded from a dataset\n * @param parentHeader - parent Tile3D instance\n * @param extendedId - optional ID to separate copies of a tile for different viewports.\n * const extendedId = `${tile.id}-${frameState.viewport.id}`;\n */\n // eslint-disable-next-line max-statements\n constructor(\n tileset: Tileset3D,\n header: {[key: string]: any},\n parentHeader?: Tile3D,\n extendedId = ''\n ) {\n // PUBLIC MEMBERS\n // original tile data\n this.header = header;\n\n // The tileset containing this tile.\n this.tileset = tileset;\n this.id = extendedId || header.id;\n this.url = header.url;\n\n // This tile's parent or `undefined` if this tile is the root.\n // @ts-ignore\n this.parent = parentHeader;\n this.refine = this._getRefine(header.refine);\n this.type = header.type;\n this.contentUrl = header.contentUrl;\n\n // The error, in meters, introduced if this tile is rendered and its children are not.\n this.lodMetricType = 'geometricError';\n this.lodMetricValue = 0;\n\n // Specifies the type of refine that is used when traversing this tile for rendering.\n this.boundingVolume = null;\n\n // The tile's content. This represents the actual tile's payload,\n // not the content's metadata in the tileset JSON file.\n this.content = null;\n this.contentState = TILE_CONTENT_STATE.UNLOADED;\n this.gpuMemoryUsageInBytes = 0;\n\n // The tile's children - an array of Tile3D objects.\n this.children = [];\n\n this.hasEmptyContent = false;\n this.hasTilesetContent = false;\n\n this.depth = 0;\n this.viewportIds = [];\n\n // Container to store application specific data\n this.userData = {};\n this.extensions = null;\n\n // PRIVATE MEMBERS\n this._priority = 0;\n this._touchedFrame = 0;\n this._visitedFrame = 0;\n this._selectedFrame = 0;\n this._requestedFrame = 0;\n this._screenSpaceError = 0;\n\n this._cacheNode = null;\n this._frameNumber = null;\n this._cacheNode = null;\n\n this.traverser = new TilesetTraverser({});\n this._shouldRefine = false;\n this._distanceToCamera = 0;\n this._centerZDepth = 0;\n this._visible = undefined;\n this._inRequestVolume = false;\n this._stackLength = 0;\n this._selectionDepth = 0;\n this._initialTransform = new Matrix4();\n this.transform = new Matrix4();\n\n this._initializeLodMetric(header);\n this._initializeTransforms(header);\n this._initializeBoundingVolumes(header);\n this._initializeContent(header);\n this._initializeRenderingState(header);\n\n // TODO i3s specific, needs to remove\n this._lodJudge = null;\n\n // TODO Cesium 3d tiles specific\n this._expireDate = null;\n this._expiredContent = null;\n this.implicitTiling = null;\n\n Object.seal(this);\n }\n\n destroy() {\n this.header = null;\n }\n\n isDestroyed() {\n return this.header === null;\n }\n\n get selected() {\n return this._selectedFrame === this.tileset._frameNumber;\n }\n\n get isVisible() {\n return this._visible;\n }\n\n get isVisibleAndInRequestVolume() {\n return this._visible && this._inRequestVolume;\n }\n\n /** Returns true if tile is not an empty tile and not an external tileset */\n get hasRenderContent() {\n return !this.hasEmptyContent && !this.hasTilesetContent;\n }\n\n /** Returns true if tile has children */\n get hasChildren() {\n return this.children.length > 0 || (this.header.children && this.header.children.length > 0);\n }\n\n /**\n * Determines if the tile's content is ready. This is automatically `true` for\n * tiles with empty content.\n */\n get contentReady() {\n return this.contentState === TILE_CONTENT_STATE.READY || this.hasEmptyContent;\n }\n\n /**\n * Determines if the tile has available content to render. `true` if the tile's\n * content is ready or if it has expired content this renders while new content loads; otherwise,\n */\n get contentAvailable() {\n return Boolean(\n (this.contentReady && this.hasRenderContent) || (this._expiredContent && !this.contentFailed)\n );\n }\n\n /** Returns true if tile has renderable content but it's unloaded */\n get hasUnloadedContent() {\n return this.hasRenderContent && this.contentUnloaded;\n }\n\n /**\n * Determines if the tile's content has not be requested. `true` if tile's\n * content has not be requested; otherwise, `false`.\n */\n get contentUnloaded() {\n return this.contentState === TILE_CONTENT_STATE.UNLOADED;\n }\n\n /**\n * Determines if the tile's content is expired. `true` if tile's\n * content is expired; otherwise, `false`.\n */\n get contentExpired() {\n return this.contentState === TILE_CONTENT_STATE.EXPIRED;\n }\n\n // Determines if the tile's content failed to load. `true` if the tile's\n // content failed to load; otherwise, `false`.\n get contentFailed() {\n return this.contentState === TILE_CONTENT_STATE.FAILED;\n }\n\n /**\n * Distance from the tile's bounding volume center to the camera\n */\n get distanceToCamera(): number {\n return this._distanceToCamera;\n }\n\n /**\n * Screen space error for LOD selection\n */\n get screenSpaceError(): number {\n return this._screenSpaceError;\n }\n\n /**\n * Get bounding box in cartographic coordinates\n * @returns [min, max] each in [longitude, latitude, altitude]\n */\n get boundingBox(): CartographicBounds {\n if (!this._boundingBox) {\n this._boundingBox = getCartographicBounds(this.header.boundingVolume, this.boundingVolume);\n }\n return this._boundingBox;\n }\n\n /** Get the tile's screen space error. */\n getScreenSpaceError(frameState, useParentLodMetric) {\n switch (this.tileset.type) {\n case TILESET_TYPE.I3S:\n return getProjectedRadius(this, frameState);\n case TILESET_TYPE.TILES3D:\n return getTiles3DScreenSpaceError(this, frameState, useParentLodMetric);\n default:\n // eslint-disable-next-line\n throw new Error('Unsupported tileset type');\n }\n }\n\n /**\n * Make tile unselected than means it won't be shown\n * but it can be still loaded in memory\n */\n unselect(): void {\n this._selectedFrame = 0;\n }\n\n /*\n * If skipLevelOfDetail is off try to load child tiles as soon as possible so that their parent can refine sooner.\n * Tiles are prioritized by screen space error.\n */\n // eslint-disable-next-line complexity\n _getPriority() {\n const traverser = this.tileset._traverser;\n const {skipLevelOfDetail} = traverser.options;\n\n /*\n * Tiles that are outside of the camera's frustum could be skipped if we are in 'ADD' mode\n * or if we are using 'Skip Traversal' in 'REPLACE' mode.\n * Otherewise, all 'touched' child tiles have to be loaded and displayed,\n * this may include tiles that are outide of the camera frustum (so that we can hide the parent tile).\n */\n const maySkipTile = this.refine === TILE_REFINEMENT.ADD || skipLevelOfDetail;\n\n // Check if any reason to abort\n if (maySkipTile && !this.isVisible && this._visible !== undefined) {\n return -1;\n }\n // Condition used in `cancelOutOfViewRequests` function in CesiumJS/Cesium3DTileset.js\n if (this.tileset._frameNumber - this._touchedFrame >= 1) {\n return -1;\n }\n if (this.contentState === TILE_CONTENT_STATE.UNLOADED) {\n return -1;\n }\n\n // Based on the priority function `getPriorityReverseScreenSpaceError` in CesiumJS. Scheduling priority is based on the parent's screen space error when possible.\n const parent = this.parent;\n const useParentScreenSpaceError =\n parent && (!maySkipTile || this._screenSpaceError === 0.0 || parent.hasTilesetContent);\n const screenSpaceError = useParentScreenSpaceError\n ? parent._screenSpaceError\n : this._screenSpaceError;\n\n const rootScreenSpaceError = traverser.root ? traverser.root._screenSpaceError : 0.0;\n\n // Map higher SSE to lower values (e.g. root tile is highest priority)\n return Math.max(rootScreenSpaceError - screenSpaceError, 0);\n }\n\n /**\n * Requests the tile's content.\n * The request may not be made if the Request Scheduler can't prioritize it.\n */\n // eslint-disable-next-line max-statements, complexity\n async loadContent(): Promise<boolean> {\n if (this.hasEmptyContent) {\n return false;\n }\n\n if (this.content) {\n return true;\n }\n\n const expired = this.contentExpired;\n\n if (expired) {\n this._expireDate = null;\n }\n\n this.contentState = TILE_CONTENT_STATE.LOADING;\n\n const requestToken = await this.tileset._requestScheduler.scheduleRequest(\n this.id,\n this._getPriority.bind(this)\n );\n\n if (!requestToken) {\n // cancelled\n this.contentState = TILE_CONTENT_STATE.UNLOADED;\n return false;\n }\n\n try {\n const contentUrl = this.tileset.getTileUrl(this.contentUrl);\n // The content can be a binary tile ot a JSON tileset\n const loader = this.tileset.loader;\n const options = {\n ...this.tileset.loadOptions,\n [loader.id]: {\n ...this.tileset.loadOptions[loader.id],\n isTileset: this.type === 'json',\n ...this._getLoaderSpecificOptions(loader.id)\n }\n };\n\n this.content = await load(contentUrl, loader, options);\n\n if (this.tileset.options.contentLoader) {\n await this.tileset.options.contentLoader(this);\n }\n\n if (this._isTileset()) {\n // Add tile headers for the nested tilset's subtree\n // Async update of the tree should be fine since there would never be edits to the same node\n // TODO - we need to capture the child tileset's URL\n this.tileset._initializeTileHeaders(this.content, this);\n }\n\n this.contentState = TILE_CONTENT_STATE.READY;\n this._onContentLoaded();\n return true;\n } catch (error) {\n // Tile is unloaded before the content finishes loading\n this.contentState = TILE_CONTENT_STATE.FAILED;\n throw error;\n } finally {\n requestToken.done();\n }\n }\n\n // Unloads the tile's content.\n unloadContent() {\n if (this.content && this.content.destroy) {\n this.content.destroy();\n }\n this.content = null;\n if (this.header.content && this.header.content.destroy) {\n this.header.content.destroy();\n }\n this.header.content = null;\n this.contentState = TILE_CONTENT_STATE.UNLOADED;\n return true;\n }\n\n /**\n * Update the tile's visibility\n * @param {Object} frameState - frame state for tile culling\n * @param {string[]} viewportIds - a list of viewport ids that show this tile\n * @return {void}\n */\n updateVisibility(frameState, viewportIds) {\n if (this._frameNumber === frameState.frameNumber) {\n // Return early if visibility has already been checked during the traversal.\n // The visibility may have already been checked if the cullWithChildrenBounds optimization is used.\n return;\n }\n\n const parent = this.parent;\n const parentVisibilityPlaneMask = parent\n ? parent._visibilityPlaneMask\n : CullingVolume.MASK_INDETERMINATE;\n\n if (this.tileset._traverser.options.updateTransforms) {\n const parentTransform = parent ? parent.computedTransform : this.tileset.modelMatrix;\n this._updateTransform(parentTransform);\n }\n\n this._distanceToCamera = this.distanceToTile(frameState);\n this._screenSpaceError = this.getScreenSpaceError(frameState, false);\n this._visibilityPlaneMask = this.visibility(frameState, parentVisibilityPlaneMask); // Use parent's plane mask to speed up visibility test\n this._visible = this._visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE;\n this._inRequestVolume = this.insideViewerRequestVolume(frameState);\n\n this._frameNumber = frameState.frameNumber;\n this.viewportIds = viewportIds;\n }\n\n // Determines whether the tile's bounding volume intersects the culling volume.\n // @param {FrameState} frameState The frame state.\n // @param {Number} parentVisibilityPlaneMask The parent's plane mask to speed up the visibility check.\n // @returns {Number} A plane mask as described above in {@link CullingVolume#computeVisibilityWithPlaneMask}.\n visibility(frameState, parentVisibilityPlaneMask) {\n const {cullingVolume} = frameState;\n const {boundingVolume} = this;\n\n // TODO Cesium specific - restore clippingPlanes\n // const {clippingPlanes, clippingPlanesOriginMatrix} = tileset;\n // if (clippingPlanes && clippingPlanes.enabled) {\n // const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n // boundingVolume,\n // clippingPlanesOriginMatrix\n // );\n // this._isClipped = intersection !== Intersect.INSIDE;\n // if (intersection === Intersect.OUTSIDE) {\n // return CullingVolume.MASK_OUTSIDE;\n // }\n // }\n\n // return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);\n return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);\n }\n\n // Assuming the tile's bounding volume intersects the culling volume, determines\n // whether the tile's content's bounding volume intersects the culling volume.\n // @param {FrameState} frameState The frame state.\n // @returns {Intersect} The result of the intersection: the tile's content is completely outside, completely inside, or intersecting the culling volume.\n contentVisibility() {\n return true;\n\n // TODO restore\n /*\n // Assumes the tile's bounding volume intersects the culling volume already, so\n // just return Intersect.INSIDE if there is no content bounding volume.\n if (!defined(this.contentBoundingVolume)) {\n return Intersect.INSIDE;\n }\n\n if (this._visibilityPlaneMask === CullingVolume.MASK_INSIDE) {\n // The tile's bounding volume is completely inside the culling volume so\n // the content bounding volume must also be inside.\n return Intersect.INSIDE;\n }\n\n // PERFORMANCE_IDEA: is it possible to burn less CPU on this test since we know the\n // tile's (not the content's) bounding volume intersects the culling volume?\n const cullingVolume = frameState.cullingVolume;\n const boundingVolume = tile.contentBoundingVolume;\n\n const tileset = this.tileset;\n const clippingPlanes = tileset.clippingPlanes;\n if (defined(clippingPlanes) && clippingPlanes.enabled) {\n const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n boundingVolume,\n tileset.clippingPlanesOriginMatrix\n );\n this._isClipped = intersection !== Intersect.INSIDE;\n if (intersection === Intersect.OUTSIDE) {\n return Intersect.OUTSIDE;\n }\n }\n\n return cullingVolume.computeVisibility(boundingVolume);\n */\n }\n\n /**\n * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.\n * @param frameState The frame state.\n * @returns {Number} The distance, in meters, or zero if the camera is inside the bounding volume.\n */\n distanceToTile(frameState: FrameState): number {\n const boundingVolume = this.boundingVolume;\n return Math.sqrt(Math.max(boundingVolume.distanceSquaredTo(frameState.camera.position), 0));\n }\n\n /**\n * Computes the tile's camera-space z-depth.\n * @param frameState The frame state.\n * @returns The distance, in meters.\n */\n cameraSpaceZDepth({camera}): number {\n const boundingVolume = this.boundingVolume; // Gets the underlying OrientedBoundingBox or BoundingSphere\n scratchVector.subVectors(boundingVolume.center, camera.position);\n return camera.direction.dot(scratchVector);\n }\n\n /**\n * Checks if the camera is inside the viewer request volume.\n * @param {FrameState} frameState The frame state.\n * @returns {Boolean} Whether the camera is inside the volume.\n */\n insideViewerRequestVolume(frameState: FrameState) {\n const viewerRequestVolume = this._viewerRequestVolume;\n return (\n !viewerRequestVolume || viewerRequestVolume.distanceSquaredTo(frameState.camera.position) <= 0\n );\n }\n\n // TODO Cesium specific\n\n // Update whether the tile has expired.\n updateExpiration() {\n if (defined(this._expireDate) && this.contentReady && !this.hasEmptyContent) {\n const now = Date.now();\n // @ts-ignore Date.lessThan - replace with ms compare?\n if (Date.lessThan(this._expireDate, now)) {\n this.contentState = TILE_CONTENT_STATE.EXPIRED;\n this._expiredContent = this.content;\n }\n }\n }\n\n get extras() {\n return this.header.extras;\n }\n\n // INTERNAL METHODS\n\n _initializeLodMetric(header) {\n if ('lodMetricType' in header) {\n this.lodMetricType = header.lodMetricType;\n } else {\n this.lodMetricType = (this.parent && this.parent.lodMetricType) || this.tileset.lodMetricType;\n // eslint-disable-next-line\n console.warn(`3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType`);\n }\n\n // This is used to compute screen space error, i.e., the error measured in pixels.\n if ('lodMetricValue' in header) {\n this.lodMetricValue = header.lodMetricValue;\n } else {\n this.lodMetricValue =\n (this.parent && this.parent.lodMetricValue) || this.tileset.lodMetricValue;\n // eslint-disable-next-line\n console.warn(\n '3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue'\n );\n }\n }\n\n _initializeTransforms(tileHeader) {\n // The local transform of this tile.\n this.transform = tileHeader.transform ? new Matrix4(tileHeader.transform) : new Matrix4();\n\n const parent = this.parent;\n const tileset = this.tileset;\n\n const parentTransform =\n parent && parent.computedTransform\n ? parent.computedTransform.clone()\n : tileset.modelMatrix.clone();\n this.computedTransform = new Matrix4(parentTransform).multiplyRight(this.transform);\n\n const parentInitialTransform =\n parent && parent._initialTransform ? parent._initialTransform.clone() : new Matrix4();\n this._initialTransform = new Matrix4(parentInitialTransform).multiplyRight(this.transform);\n }\n\n _initializeBoundingVolumes(tileHeader) {\n this._contentBoundingVolume = null;\n this._viewerRequestVolume = null;\n\n this._updateBoundingVolume(tileHeader);\n }\n\n _initializeContent(tileHeader) {\n // Empty tile by default\n this.content = {_tileset: this.tileset, _tile: this};\n this.hasEmptyContent = true;\n this.contentState = TILE_CONTENT_STATE.UNLOADED;\n\n // When `true`, the tile's content points to an external tileset.\n // This is `false` until the tile's content is loaded.\n this.hasTilesetContent = false;\n\n if (tileHeader.contentUrl) {\n this.content = null;\n this.hasEmptyContent = false;\n }\n }\n\n // TODO - remove anything not related to basic visibility detection\n _initializeRenderingState(header) {\n this.depth = header.level || (this.parent ? this.parent.depth + 1 : 0);\n this._shouldRefine = false;\n\n // Members this are updated every frame for tree traversal and rendering optimizations:\n this._distanceToCamera = 0;\n this._centerZDepth = 0;\n this._screenSpaceError = 0;\n this._visibilityPlaneMask = CullingVolume.MASK_INDETERMINATE;\n this._visible = undefined;\n this._inRequestVolume = false;\n\n this._stackLength = 0;\n this._selectionDepth = 0;\n\n this._frameNumber = 0;\n this._touchedFrame = 0;\n this._visitedFrame = 0;\n this._selectedFrame = 0;\n this._requestedFrame = 0;\n\n this._priority = 0.0;\n }\n\n _getRefine(refine) {\n // Inherit from parent tile if omitted.\n return refine || (this.parent && this.parent.refine) || TILE_REFINEMENT.REPLACE;\n }\n\n _isTileset() {\n return this.contentUrl.indexOf('.json') !== -1;\n }\n\n _onContentLoaded() {\n // Vector and Geometry tile rendering do not support the skip LOD optimization.\n switch (this.content && this.content.type) {\n case 'vctr':\n case 'geom':\n // @ts-ignore\n this.tileset._traverser.disableSkipLevelOfDetail = true;\n break;\n default:\n }\n\n // The content may be tileset json\n if (this._isTileset()) {\n this.hasTilesetContent = true;\n }\n }\n\n _updateBoundingVolume(header) {\n // Update the bounding volumes\n this.boundingVolume = createBoundingVolume(\n header.boundingVolume,\n this.computedTransform,\n this.boundingVolume\n );\n\n const content = header.content;\n if (!content) {\n return;\n }\n\n // TODO Cesium specific\n // Non-leaf tiles may have a content bounding-volume, which is a tight-fit bounding volume\n // around only the features in the tile. This box is useful for culling for rendering,\n // but not for culling for traversing the tree since it does not guarantee spatial coherence, i.e.,\n // since it only bounds features in the tile, not the entire tile, children may be\n // outside of this box.\n if (content.boundingVolume) {\n this._contentBoundingVolume = createBoundingVolume(\n content.boundingVolume,\n this.computedTransform,\n this._contentBoundingVolume\n );\n }\n if (header.viewerRequestVolume) {\n this._viewerRequestVolume = createBoundingVolume(\n header.viewerRequestVolume,\n this.computedTransform,\n this._viewerRequestVolume\n );\n }\n }\n\n // Update the tile's transform. The transform is applied to the tile's bounding volumes.\n _updateTransform(parentTransform = new Matrix4()) {\n const computedTransform = parentTransform.clone().multiplyRight(this.transform);\n const didTransformChange = !computedTransform.equals(this.computedTransform);\n\n if (!didTransformChange) {\n return;\n }\n\n this.computedTransform = computedTransform;\n\n this._updateBoundingVolume(this.header);\n }\n\n // Get options which are applicable only for the particular loader\n _getLoaderSpecificOptions(loaderId) {\n switch (loaderId) {\n case 'i3s':\n return {\n ...this.tileset.options.i3s,\n _tileOptions: {\n attributeUrls: this.header.attributeUrls,\n textureUrl: this.header.textureUrl,\n textureFormat: this.header.textureFormat,\n textureLoaderOptions: this.header.textureLoaderOptions,\n materialDefinition: this.header.materialDefinition,\n isDracoGeometry: this.header.isDracoGeometry,\n mbs: this.header.mbs\n },\n _tilesetOptions: {\n store: this.tileset.tileset.store,\n attributeStorageInfo: this.tileset.tileset.attributeStorageInfo,\n fields: this.tileset.tileset.fields\n },\n isTileHeader: false\n };\n case '3d-tiles':\n case 'cesium-ion':\n default:\n return get3dTilesOptions(this.tileset.tileset);\n }\n }\n}\n"],"mappings":";AAKA,SAAQA,OAAO,EAAEC,OAAO,QAAO,eAAe;AAC9C,SAAQC,aAAa,QAAO,kBAAkB;AAE9C,SAAQC,IAAI,QAAO,kBAAkB;AAIrC,SAAQC,eAAe,EAAEC,kBAAkB,EAAEC,YAAY,QAAO,cAAc;AAG9E,SACEC,oBAAoB,EACpBC,qBAAqB,QAEhB,2BAA2B;AAClC,SAAQC,0BAA0B,QAAO,wBAAwB;AACjE,SAAQC,kBAAkB,QAAO,mBAAmB;AACpD,SAAQC,iBAAiB,QAAO,4BAA4B;AAC5D,SAAQC,gBAAgB,QAAO,qBAAqB;AAEpD,MAAMC,aAAa,GAAG,IAAIb,OAAO,EAAE;AAEnC,SAASc,OAAOA,CAACC,CAAC,EAAE;EAClB,OAAOA,CAAC,KAAKC,SAAS,IAAID,CAAC,KAAK,IAAI;AACtC;AAqBA,OAAO,MAAME,MAAM,CAAC;EAoFlBC,WAAWA,CACTC,OAAkB,EAClBC,MAA4B,EAC5BC,YAAqB,EAErB;IAAA,IADAC,UAAU,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAP,SAAA,GAAAO,SAAA,MAAG,EAAE;IAAAE,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAA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