itowns 2.45.1 → 2.45.2-next.0
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/455.js +1 -1
- package/dist/455.js.map +1 -1
- package/dist/debug.js +1 -1
- package/dist/debug.js.LICENSE.txt +8 -2
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.LICENSE.txt +1 -1
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_lasparser.js +1 -1
- package/dist/itowns_lasparser.js.map +1 -1
- package/dist/itowns_lasworker.js +1 -1
- package/dist/itowns_lasworker.js.map +1 -1
- package/dist/itowns_potree2worker.js +1 -1
- package/dist/itowns_potree2worker.js.map +1 -1
- package/dist/itowns_widgets.js +1 -1
- package/dist/itowns_widgets.js.map +1 -1
- package/examples/copc_simple_loader.html +3 -3
- package/examples/entwine_3d_loader.html +2 -2
- package/examples/entwine_simple_loader.html +10 -6
- package/examples/view_3d_map_webxr.html +2 -5
- package/lib/Controls/FirstPersonControls.d.ts +90 -0
- package/lib/Controls/FlyControls.d.ts +36 -0
- package/lib/Controls/GlobeControls.d.ts +274 -0
- package/lib/Controls/PlanarControls.d.ts +339 -0
- package/lib/Controls/StateControl.d.ts +140 -0
- package/lib/Controls/StreetControls.d.ts +134 -0
- package/lib/Controls/VRControls.d.ts +56 -0
- package/lib/Controls/VRControls.js +409 -0
- package/lib/Converter/Feature2Mesh.d.ts +42 -0
- package/lib/Converter/Feature2Texture.d.ts +5 -0
- package/lib/Converter/convertToTile.d.ts +5 -0
- package/lib/Converter/convertToTile.js +2 -2
- package/lib/Converter/textureConverter.d.ts +4 -0
- package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
- package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
- package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
- package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
- package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
- package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
- package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
- package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
- package/lib/Core/AnimationPlayer.d.ts +53 -0
- package/lib/Core/CopcNode.d.ts +67 -0
- package/lib/Core/CopcNode.js +50 -69
- package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
- package/lib/Core/EntwinePointTileNode.d.ts +58 -0
- package/lib/Core/EntwinePointTileNode.js +6 -34
- package/lib/Core/Feature.d.ts +323 -0
- package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
- package/lib/Core/Label.d.ts +86 -0
- package/lib/Core/MainLoop.d.ts +23 -0
- package/lib/Core/Picking.d.ts +6 -0
- package/lib/Core/Picking.js +4 -0
- package/lib/Core/PointCloudNode.d.ts +14 -0
- package/lib/Core/PointCloudNode.js +28 -0
- package/lib/Core/Potree2Node.d.ts +11 -0
- package/lib/Core/Potree2Node.js +3 -57
- package/lib/Core/Potree2PointAttributes.d.ts +97 -0
- package/lib/Core/PotreeNode.d.ts +13 -0
- package/lib/Core/PotreeNode.js +17 -17
- package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
- package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
- package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
- package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
- package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
- package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
- package/lib/Core/Prefab/GlobeView.d.ts +65 -0
- package/lib/Core/Prefab/GlobeView.js +9 -0
- package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
- package/lib/Core/Prefab/PlanarView.d.ts +33 -0
- package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
- package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
- package/lib/Core/Scheduler/Cache.d.ts +25 -0
- package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
- package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
- package/lib/Core/Style.d.ts +248 -0
- package/lib/Core/StyleOptions.d.ts +455 -0
- package/lib/Core/System/Capabilities.d.ts +9 -0
- package/lib/Core/Tile/Tile.d.ts +70 -0
- package/lib/Core/Tile/TileGrid.d.ts +12 -0
- package/lib/Core/TileGeometry.d.ts +46 -0
- package/lib/Core/TileMesh.d.ts +50 -0
- package/lib/Core/TileMesh.js +2 -4
- package/lib/Core/View.d.ts +403 -0
- package/lib/Core/View.js +1 -7
- package/lib/Layer/C3DTilesLayer.d.ts +140 -0
- package/lib/Layer/ColorLayer.d.ts +128 -0
- package/lib/Layer/ColorLayer.js +4 -4
- package/lib/Layer/CopcLayer.d.ts +42 -0
- package/lib/Layer/CopcLayer.js +3 -6
- package/lib/Layer/ElevationLayer.d.ts +96 -0
- package/lib/Layer/ElevationLayer.js +3 -3
- package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
- package/lib/Layer/EntwinePointTileLayer.js +4 -3
- package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
- package/lib/Layer/GeoidLayer.d.ts +41 -0
- package/lib/Layer/GeometryLayer.d.ts +120 -0
- package/lib/Layer/InfoLayer.d.ts +24 -0
- package/lib/Layer/InfoLayer.js +1 -1
- package/lib/Layer/LabelLayer.d.ts +93 -0
- package/lib/Layer/LabelLayer.js +2 -2
- package/lib/Layer/Layer.d.ts +185 -0
- package/lib/Layer/LayerUpdateState.d.ts +24 -0
- package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
- package/lib/Layer/LayerUpdateStrategy.js +2 -7
- package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
- package/lib/Layer/OGC3DTilesLayer.js +21 -0
- package/lib/Layer/OrientedImageLayer.d.ts +53 -0
- package/lib/Layer/PointCloudLayer.d.ts +103 -0
- package/lib/Layer/PointCloudLayer.js +1 -1
- package/lib/Layer/Potree2Layer.d.ts +56 -0
- package/lib/Layer/PotreeLayer.d.ts +55 -0
- package/lib/Layer/RasterLayer.d.ts +8 -0
- package/lib/Layer/RasterLayer.js +2 -2
- package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
- package/lib/Layer/ReferencingLayerProperties.js +0 -12
- package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
- package/lib/Layer/TiledGeometryLayer.js +4 -3
- package/lib/Main.d.ts +89 -0
- package/lib/Main.js +3 -1
- package/lib/Parser/B3dmParser.d.ts +26 -0
- package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
- package/lib/Parser/GDFParser.d.ts +24 -0
- package/lib/Parser/GTXParser.d.ts +28 -0
- package/lib/Parser/GeoJsonParser.d.ts +12 -0
- package/lib/Parser/GpxParser.d.ts +12 -0
- package/lib/Parser/ISGParser.d.ts +23 -0
- package/lib/Parser/KMLParser.d.ts +12 -0
- package/lib/Parser/LASParser.d.ts +61 -0
- package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
- package/lib/Parser/PntsParser.d.ts +4 -0
- package/lib/Parser/Potree2BinParser.d.ts +8 -0
- package/lib/Parser/PotreeBinParser.d.ts +4 -0
- package/lib/Parser/PotreeCinParser.d.ts +4 -0
- package/lib/Parser/ShapefileParser.d.ts +25 -0
- package/lib/Parser/VectorTileParser.d.ts +34 -0
- package/lib/Parser/XbilParser.d.ts +18 -0
- package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
- package/lib/Parser/iGLTFLoader.d.ts +104 -0
- package/lib/Process/3dTilesProcessing.d.ts +43 -0
- package/lib/Process/FeatureProcessing.d.ts +4 -0
- package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
- package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
- package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
- package/lib/Process/handlerNodeError.d.ts +1 -0
- package/lib/Provider/3dTilesProvider.d.ts +7 -0
- package/lib/Provider/DataSourceProvider.d.ts +4 -0
- package/lib/Provider/Fetcher.d.ts +101 -0
- package/lib/Provider/PointCloudProvider.d.ts +4 -0
- package/lib/Provider/TileProvider.d.ts +4 -0
- package/lib/Provider/URLBuilder.d.ts +28 -0
- package/lib/Renderer/Camera.d.ts +95 -0
- package/lib/Renderer/Color.d.ts +3 -0
- package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
- package/lib/Renderer/ColorLayersOrdering.js +2 -2
- package/lib/Renderer/CommonMaterial.d.ts +6 -0
- package/lib/Renderer/Label2DRenderer.d.ts +31 -0
- package/lib/Renderer/LayeredMaterial.d.ts +121 -0
- package/lib/Renderer/LayeredMaterial.js +221 -141
- package/lib/Renderer/OBB.d.ts +65 -0
- package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
- package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
- package/lib/Renderer/PointsMaterial.d.ts +226 -0
- package/lib/Renderer/PointsMaterial.js +60 -22
- package/lib/Renderer/RasterTile.d.ts +53 -0
- package/lib/Renderer/RasterTile.js +8 -9
- package/lib/Renderer/RenderMode.d.ts +11 -0
- package/lib/Renderer/RenderMode.js +1 -0
- package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
- package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
- package/lib/Renderer/WebXR.d.ts +33 -0
- package/lib/Renderer/WebXR.js +128 -47
- package/lib/Renderer/c3DEngine.d.ts +55 -0
- package/lib/Renderer/c3DEngine.js +5 -1
- package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
- package/lib/Source/C3DTilesIonSource.d.ts +31 -0
- package/lib/Source/C3DTilesSource.d.ts +17 -0
- package/lib/Source/CopcSource.d.ts +79 -0
- package/lib/Source/EntwinePointTileSource.d.ts +40 -0
- package/lib/Source/EntwinePointTileSource.js +0 -5
- package/lib/Source/FileSource.d.ts +118 -0
- package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
- package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
- package/lib/Source/OGC3DTilesSource.d.ts +21 -0
- package/lib/Source/OrientedImageSource.d.ts +48 -0
- package/lib/Source/Potree2Source.d.ts +157 -0
- package/lib/Source/PotreeSource.d.ts +69 -0
- package/lib/Source/Source.d.ts +122 -0
- package/lib/Source/TMSSource.d.ts +77 -0
- package/lib/Source/VectorTilesSource.d.ts +56 -0
- package/lib/Source/WFSSource.d.ts +110 -0
- package/lib/Source/WMSSource.d.ts +85 -0
- package/lib/Source/WMTSSource.d.ts +65 -0
- package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
- package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
- package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
- package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
- package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
- package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
- package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
- package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
- package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
- package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
- package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
- package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
- package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
- package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
- package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
- package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
- package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
- package/lib/Utils/CameraUtils.d.ts +132 -0
- package/lib/Utils/DEMUtils.d.ts +84 -0
- package/lib/Utils/DEMUtils.js +2 -2
- package/lib/Utils/FeaturesUtils.d.ts +17 -0
- package/lib/Utils/Gradients.d.ts +13 -0
- package/lib/Utils/ThreeUtils.d.ts +14 -0
- package/lib/Utils/placeObjectOnGround.d.ts +28 -0
- package/lib/global.d.js +0 -0
- package/package.json +18 -15
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export default C3DTExtensions;
|
|
2
|
+
/**
|
|
3
|
+
* Class for managing
|
|
4
|
+
* [3D Tiles extensions](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions).
|
|
5
|
+
* Extensions used in a 3D Tiles tileset must be registered in the iTowns' layer
|
|
6
|
+
* holding the tileset by the user with the {@link registerExtension}
|
|
7
|
+
* method. The extension must be registered together with a class holding the
|
|
8
|
+
* code to interpret the extension.
|
|
9
|
+
* An example of extension class is {@link C3DTBatchTableHierarchyExtension}.
|
|
10
|
+
* This extension has only one part situated in the batch table (but other
|
|
11
|
+
* extensions can have multiple parts, stored in different 3D Tiles classes
|
|
12
|
+
* such as tileset or bounding volume).
|
|
13
|
+
* @example
|
|
14
|
+
* // Create a C3DTExtensions object
|
|
15
|
+
* const extensions = new itowns.C3DTExtensions();
|
|
16
|
+
* // Register an extension to it named "3DTILES_batch_table_hierarchy" and
|
|
17
|
+
* // a class itowns.C3DTBatchTableHierarchyExtension to the batch table part
|
|
18
|
+
* // (with [itowns.C3DTilesTypes.batchtable]). see {@link C3DTilesTypes}
|
|
19
|
+
* extensions.registerExtension("3DTILES_batch_table_hierarchy",
|
|
20
|
+
* { [itowns.C3DTilesTypes.batchtable]: itowns.C3DTBatchTableHierarchyExtension });
|
|
21
|
+
*
|
|
22
|
+
* // Create a 3D Tiles layer with registered extensions
|
|
23
|
+
* var $3dTilesLayerBTHierarchy = new itowns.C3DTilesLayer('3d-tiles-bt-hierarchy', {
|
|
24
|
+
* name: 'BTHierarchy',
|
|
25
|
+
* source: new itowns.C3DTilesSource({
|
|
26
|
+
* url: 'https://raw.githubusercontent.com/AnalyticalGraphicsInc/cesium/master/Apps/SampleData/Cesium3DTiles/Hierarchy/BatchTableHierarchy/tileset.json',
|
|
27
|
+
* }),
|
|
28
|
+
* registeredExtensions: extensions,
|
|
29
|
+
* },
|
|
30
|
+
* view);
|
|
31
|
+
*/
|
|
32
|
+
declare class C3DTExtensions {
|
|
33
|
+
/**
|
|
34
|
+
* Register a 3D Tiles extension: Maps an extension name to the
|
|
35
|
+
* extensionsManagers (i.e. one class per 3D Tiles class (e.g.
|
|
36
|
+
* batch table or bounding volume).
|
|
37
|
+
* @param {string} extensionName - Name of the extension
|
|
38
|
+
* @param {object} extensionManagers - An object mapping 3D Tiles
|
|
39
|
+
* classes names (see @link{C3DTilesTypes} to the extension managers
|
|
40
|
+
* corresponding to this class. These extension managers should be able
|
|
41
|
+
* to parse the extension fragment (done in the constructor) and should
|
|
42
|
+
* have a getInfoById method if they are related to the batch table class.
|
|
43
|
+
* See {@link C3DTBatchTableHierarchyExtension} for an example of
|
|
44
|
+
* extension class.
|
|
45
|
+
*/
|
|
46
|
+
registerExtension(extensionName: string, extensionManagers: object): void;
|
|
47
|
+
/**
|
|
48
|
+
* Get an extension manager from its name and C3DTilesType
|
|
49
|
+
* @param {string} extensionName - name of the extension.
|
|
50
|
+
* @param {C3DTilesTypes} type - type of 3DTiles class (e.g. batch
|
|
51
|
+
* table, bounding volume, tileset, etc.)
|
|
52
|
+
* @returns {object} - the extension manager corresponding to the
|
|
53
|
+
* extensioNname and type.
|
|
54
|
+
*/
|
|
55
|
+
getExtension(extensionName: string, type: C3DTilesTypes): object;
|
|
56
|
+
/**
|
|
57
|
+
* Test if an extension is registered
|
|
58
|
+
* @param {string} extensionName - Name of the extension
|
|
59
|
+
* @returns {boolean} - true if the extension is registered and false
|
|
60
|
+
* otherwise.
|
|
61
|
+
*/
|
|
62
|
+
isExtensionRegistered(extensionName: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Parses the extensions from a given JSON (extensionsJSON) by
|
|
65
|
+
* instanciating the right class from the registered extensions.
|
|
66
|
+
* @param {object} extensionsJSON - the JSON to parse extensions from.
|
|
67
|
+
* @param {C3DTilesTypes} type - type of class asking for extensions parsing
|
|
68
|
+
* has been called. For instance, if {@link C3DTBatchTable} needs to
|
|
69
|
+
* parse its extensions, it will call parseExtension with the JSON to
|
|
70
|
+
* parse and C3DTilesTypes.batchtable as type.
|
|
71
|
+
* @returns {object} - An object with keys being the names of the
|
|
72
|
+
* extensions and values the instances of the extensions managers.
|
|
73
|
+
*/
|
|
74
|
+
parseExtensions(extensionsJSON: object, type: C3DTilesTypes): object;
|
|
75
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export default C3DTFeature;
|
|
2
|
+
/**
|
|
3
|
+
* C3DTFeature is a feature of a 3DTiles
|
|
4
|
+
*
|
|
5
|
+
* @class C3DTFeature
|
|
6
|
+
* @param {number} tileId - tileId
|
|
7
|
+
* @param {number} batchId - batch id
|
|
8
|
+
* @param {Array<{start:number,count:number}>} groups - groups in geometry.attributes matching batchId
|
|
9
|
+
* @param {object} [userData] - some userData
|
|
10
|
+
* @param {Object3D} object3d - object3d in which feature is present
|
|
11
|
+
* @property {number} tileId - tile id
|
|
12
|
+
* @property {Object3D} object3d - object3d in which feature is present
|
|
13
|
+
* @property {number} batchId - batch id
|
|
14
|
+
* @property {Array<{start:number,count:number}>} groups - groups in geometry.attributes matching batchId
|
|
15
|
+
* @property {object} [userData] - some userData
|
|
16
|
+
*/
|
|
17
|
+
declare class C3DTFeature {
|
|
18
|
+
constructor(tileId: any, batchId: any, groups: any, userData: any, object3d: any);
|
|
19
|
+
/** @type {Object3D} */
|
|
20
|
+
object3d: Object3D;
|
|
21
|
+
/** @type {number} */
|
|
22
|
+
batchId: number;
|
|
23
|
+
/** @type {Array<{start:number,count:number}>} */
|
|
24
|
+
groups: Array<{
|
|
25
|
+
start: number;
|
|
26
|
+
count: number;
|
|
27
|
+
}>;
|
|
28
|
+
/** @type {object} */
|
|
29
|
+
userData: object;
|
|
30
|
+
/** @type {number} */
|
|
31
|
+
tileId: number;
|
|
32
|
+
/**
|
|
33
|
+
* Compute world box3 of this
|
|
34
|
+
*
|
|
35
|
+
* @param {Box3} target - target of the result
|
|
36
|
+
* @returns {Box3}
|
|
37
|
+
*/
|
|
38
|
+
computeWorldBox3(target?: Box3): Box3;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the information from the tile batch table for this C3DTFeature batch id.
|
|
41
|
+
* @returns {object} - batchTable info
|
|
42
|
+
*/
|
|
43
|
+
getInfo(): object;
|
|
44
|
+
#private;
|
|
45
|
+
}
|
|
46
|
+
import { Object3D } from 'three';
|
|
47
|
+
import { Box3 } from 'three';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C3DTilesTypes
|
|
3
|
+
*/
|
|
4
|
+
export type C3DTilesTypes = Object;
|
|
5
|
+
export namespace C3DTilesTypes {
|
|
6
|
+
let tileset: string;
|
|
7
|
+
let batchtable: string;
|
|
8
|
+
let boundingVolume: string;
|
|
9
|
+
}
|
|
10
|
+
export namespace C3DTilesBoundingVolumeTypes {
|
|
11
|
+
let region: string;
|
|
12
|
+
let box: string;
|
|
13
|
+
let sphere: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export default C3DTileset;
|
|
2
|
+
/**
|
|
3
|
+
* A 3D Tiles
|
|
4
|
+
* [Tileset](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/tileset.schema.json).
|
|
5
|
+
* @property {C3DTilesTypes} type - Used by 3D Tiles extensions
|
|
6
|
+
* (e.g. {@link C3DTBatchTableHierarchyExtension}) to know in which context
|
|
7
|
+
* (i.e. for which 3D Tiles class) the parsing of the extension should be done.
|
|
8
|
+
* @property {object} asset - Generic information about the tileset, see
|
|
9
|
+
* [asset specification]https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/asset.schema.json
|
|
10
|
+
* @property {object} properties - Properties associated with the tileset, see
|
|
11
|
+
* [tileset specification](https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/tileset.schema.json#L11)
|
|
12
|
+
* @property {number} geometricError - see [tileset
|
|
13
|
+
* specification](https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/tileset.schema.json#L18)
|
|
14
|
+
* @property {string[]} extensionsUsed - see [tileset
|
|
15
|
+
* specification](https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/tileset.schema.json#L27)
|
|
16
|
+
* @property {array} extensionsRequired - see [tileset specification](https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/tileset.schema.json#L36)
|
|
17
|
+
* @property {object[]} tiles - an array holding all the
|
|
18
|
+
* [tiles](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/tile.schema.json)
|
|
19
|
+
* (not their content which is stored in the attribute object3d of the
|
|
20
|
+
* layer). This list represents a flattened tileset.
|
|
21
|
+
* @property {object} extensions - Extensions of the tileset in the form:
|
|
22
|
+
* {extensioName1: extensionObject1, extensioName2: extensionObject2, ...}
|
|
23
|
+
*/
|
|
24
|
+
declare class C3DTileset {
|
|
25
|
+
constructor(json: any, baseURL: any, registeredExtensions: any);
|
|
26
|
+
type: string;
|
|
27
|
+
asset: any;
|
|
28
|
+
properties: any;
|
|
29
|
+
geometricError: any;
|
|
30
|
+
extensionsUsed: any;
|
|
31
|
+
extensionsRequired: any;
|
|
32
|
+
tiles: any[];
|
|
33
|
+
extensions: any;
|
|
34
|
+
/**
|
|
35
|
+
* Recursion on the 3DTiles tileset (which is a tree) to parse the tiles
|
|
36
|
+
* (nodes of the tree).
|
|
37
|
+
* @param {object} tile - current tile
|
|
38
|
+
* @param {string} baseURL - url of the source tileset and tiles
|
|
39
|
+
* @param {object} parent - parent tile (used for computing the transform
|
|
40
|
+
* matrix from local to global coordinates)
|
|
41
|
+
* @param {object} registeredExtensions - 3D Tiles extensions registered
|
|
42
|
+
* in the C3DTilesLayer (see {@link C3DTExtensions}
|
|
43
|
+
*/
|
|
44
|
+
parseTiles(tile: object, baseURL: string, parent: object, registeredExtensions: object): void;
|
|
45
|
+
extendTileset(tileset: any, nodeId: any, baseURL: any, registeredExtensions: any): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default binaryPropertyAccessor;
|
|
2
|
+
/**
|
|
3
|
+
* Parses a 3D Tiles binary property. Used for batch table and feature table parsing. See the 3D Tiles spec for more
|
|
4
|
+
* information on how these values are encoded:
|
|
5
|
+
* [3D Tiles spec](https://github.com/CesiumGS/3d-tiles/blob/main/specification/TileFormats/BatchTable/README.md#binary-body))
|
|
6
|
+
* @param {ArrayBuffer} buffer The buffer to parse values from.
|
|
7
|
+
* @param {Number} batchLength number of objects in the batch (= number of elements to parse).
|
|
8
|
+
* @param {Number} byteOffset the offset in bytes into the buffer.
|
|
9
|
+
* @param {String} componentType the type of component to parse (one of componentTypeBytesSize keys)
|
|
10
|
+
* @param {String} type the type of element to parse (one of typeComponentsNumber keys)
|
|
11
|
+
* @returns {Array} an array of values parsed from the buffer. An array of componentType if type is SCALAR. An array
|
|
12
|
+
* of Threejs Vector2, Vector3 or Vector4 if type is VEC2, VEC3 or VEC4 respectively.
|
|
13
|
+
*/
|
|
14
|
+
declare function binaryPropertyAccessor(buffer: ArrayBuffer, batchLength: number, byteOffset: number, componentType: string, type: string): any[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export default AnimationPlayer;
|
|
2
|
+
/**
|
|
3
|
+
* It can play, pause or stop Animation or AnimationExpression (See below).
|
|
4
|
+
* AnimationPlayer is needed to use Animation or AnimationExpression
|
|
5
|
+
* AnimationPlayer emits events :
|
|
6
|
+
* - for each animation's frame;
|
|
7
|
+
* - when Animation is stopped
|
|
8
|
+
* - when Animation is ending
|
|
9
|
+
*/
|
|
10
|
+
declare class AnimationPlayer extends THREE.EventDispatcher<any> {
|
|
11
|
+
constructor();
|
|
12
|
+
id: NodeJS.Timer | null;
|
|
13
|
+
keyframe: number;
|
|
14
|
+
duration: number;
|
|
15
|
+
state: number;
|
|
16
|
+
waitTimer: number | null;
|
|
17
|
+
callback: () => void;
|
|
18
|
+
isPlaying(): boolean;
|
|
19
|
+
isStopped(): boolean;
|
|
20
|
+
isEnded(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Set the Player `callback` property. This callback is executed at each animation frame.
|
|
23
|
+
*
|
|
24
|
+
* @param {function} callback - The callback to execute at each animation frame.
|
|
25
|
+
*/
|
|
26
|
+
setCallback(callback: Function): void;
|
|
27
|
+
/**
|
|
28
|
+
* Play one animation.
|
|
29
|
+
* If another animation is playing, it's stopped and the new animation is played.
|
|
30
|
+
*
|
|
31
|
+
* @param {number} duration - The duration to play
|
|
32
|
+
*/
|
|
33
|
+
play(duration: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Play an animation after a number of frames.
|
|
36
|
+
*
|
|
37
|
+
* @param {number} duration The duration to play
|
|
38
|
+
* @param {number} waitingFrame The waiting time before start animation (time in frame)
|
|
39
|
+
*/
|
|
40
|
+
playLater(duration: number, waitingFrame: number): void;
|
|
41
|
+
/**
|
|
42
|
+
* Stop the current animation.
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
stop(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Executed for each frame.
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
private frame;
|
|
52
|
+
}
|
|
53
|
+
import * as THREE from 'three';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export default CopcNode;
|
|
2
|
+
/**
|
|
3
|
+
* @extends PointCloudNode
|
|
4
|
+
*
|
|
5
|
+
* @property {boolean} isCopcNode - Used to checkout whether this
|
|
6
|
+
* node is a CopcNode. Default is `true`. You should not change
|
|
7
|
+
* this, as it is used internally for optimisation.
|
|
8
|
+
* @property {number} entryOffset - Offset from the beginning of the file of
|
|
9
|
+
* the node entry
|
|
10
|
+
* @property {number} entryLength - Size of the node entry
|
|
11
|
+
* @property {CopcLayer} layer - COPC layer the node belongs to.
|
|
12
|
+
* @property {number} depth - Depth within the octree
|
|
13
|
+
* @property {number} x - X position within the octree
|
|
14
|
+
* @property {number} y - Y position within the octree
|
|
15
|
+
* @property {number} z - Z position within the octree
|
|
16
|
+
* @property {string} id - The id of the node, constituted of the four
|
|
17
|
+
* components: `depth-x-y-z`.
|
|
18
|
+
*/
|
|
19
|
+
declare class CopcNode extends PointCloudNode {
|
|
20
|
+
/**
|
|
21
|
+
* Constructs a new instance of a COPC Octree node
|
|
22
|
+
*
|
|
23
|
+
* @param {number} depth - Depth within the octree
|
|
24
|
+
* @param {number} x - X position within the octree
|
|
25
|
+
* @param {number} y - Y position within the octree
|
|
26
|
+
* @param {number} z - Z position with the octree
|
|
27
|
+
* @param {number} entryOffset - Offset from the beginning of the file to
|
|
28
|
+
* the node entry
|
|
29
|
+
* @param {number} entryLength - Size of the node entry
|
|
30
|
+
* @param {CopcLayer} layer - Parent COPC layer
|
|
31
|
+
* @param {number} [numPoints=0] - Number of points given by this entry
|
|
32
|
+
*/
|
|
33
|
+
constructor(depth: number, x: number, y: number, z: number, entryOffset: number, entryLength: number, layer: CopcLayer, numPoints?: number);
|
|
34
|
+
isCopcNode: boolean;
|
|
35
|
+
entryOffset: number;
|
|
36
|
+
entryLength: number;
|
|
37
|
+
depth: number;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
z: number;
|
|
41
|
+
id: string;
|
|
42
|
+
get octreeIsLoaded(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* @param {number} offset
|
|
45
|
+
* @param {number} size
|
|
46
|
+
*/
|
|
47
|
+
_fetch(offset: number, size: number): Promise<any>;
|
|
48
|
+
loadOctree(): Promise<undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Create a CopcNode from the provided subtree and add it as child
|
|
51
|
+
* of the current node.
|
|
52
|
+
* @param {number} depth - Child node depth in the octree
|
|
53
|
+
* @param {number} x - Child node x position in the octree
|
|
54
|
+
* @param {number} y - Child node y position in the octree
|
|
55
|
+
* @param {number} z - Child node z position in the octree
|
|
56
|
+
* @param {Hierarchy.Subtree} hierarchy - Octree's subtree
|
|
57
|
+
* @param {CopcNode[]} stack - Stack of node candidates for traversal
|
|
58
|
+
*/
|
|
59
|
+
findAndCreateChild(depth: number, x: number, y: number, z: number, hierarchy: Hierarchy.Subtree, stack: CopcNode[]): void;
|
|
60
|
+
/**
|
|
61
|
+
* Load the COPC Buffer geometry for this node.
|
|
62
|
+
* @returns {Promise<THREE.BufferGeometry>}
|
|
63
|
+
*/
|
|
64
|
+
load(): Promise<THREE.BufferGeometry>;
|
|
65
|
+
}
|
|
66
|
+
import PointCloudNode from '../Core/PointCloudNode';
|
|
67
|
+
import { Hierarchy } from 'copc';
|
package/lib/Core/CopcNode.js
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
1
|
import { Hierarchy } from 'copc';
|
|
3
2
|
import PointCloudNode from "./PointCloudNode.js";
|
|
4
|
-
const size = new THREE.Vector3();
|
|
5
|
-
const position = new THREE.Vector3();
|
|
6
|
-
const translation = new THREE.Vector3();
|
|
7
3
|
function buildId(depth, x, y, z) {
|
|
8
4
|
return `${depth}-${x}-${y}-${z}`;
|
|
9
5
|
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @extends PointCloudNode
|
|
9
|
+
*
|
|
10
|
+
* @property {boolean} isCopcNode - Used to checkout whether this
|
|
11
|
+
* node is a CopcNode. Default is `true`. You should not change
|
|
12
|
+
* this, as it is used internally for optimisation.
|
|
13
|
+
* @property {number} entryOffset - Offset from the beginning of the file of
|
|
14
|
+
* the node entry
|
|
15
|
+
* @property {number} entryLength - Size of the node entry
|
|
16
|
+
* @property {CopcLayer} layer - COPC layer the node belongs to.
|
|
17
|
+
* @property {number} depth - Depth within the octree
|
|
18
|
+
* @property {number} x - X position within the octree
|
|
19
|
+
* @property {number} y - Y position within the octree
|
|
20
|
+
* @property {number} z - Z position within the octree
|
|
21
|
+
* @property {string} id - The id of the node, constituted of the four
|
|
22
|
+
* components: `depth-x-y-z`.
|
|
23
|
+
*/
|
|
10
24
|
class CopcNode extends PointCloudNode {
|
|
11
25
|
/**
|
|
12
26
|
* Constructs a new instance of a COPC Octree node
|
|
@@ -15,7 +29,7 @@ class CopcNode extends PointCloudNode {
|
|
|
15
29
|
* @param {number} x - X position within the octree
|
|
16
30
|
* @param {number} y - Y position within the octree
|
|
17
31
|
* @param {number} z - Z position with the octree
|
|
18
|
-
* @param {number} entryOffset - Offset from the beginning of the file
|
|
32
|
+
* @param {number} entryOffset - Offset from the beginning of the file to
|
|
19
33
|
* the node entry
|
|
20
34
|
* @param {number} entryLength - Size of the node entry
|
|
21
35
|
* @param {CopcLayer} layer - Parent COPC layer
|
|
@@ -32,9 +46,7 @@ class CopcNode extends PointCloudNode {
|
|
|
32
46
|
this.x = x;
|
|
33
47
|
this.y = y;
|
|
34
48
|
this.z = z;
|
|
35
|
-
|
|
36
|
-
get id() {
|
|
37
|
-
return buildId(this.depth, this.x, this.y, this.z);
|
|
49
|
+
this.id = buildId(depth, x, y, z);
|
|
38
50
|
}
|
|
39
51
|
get octreeIsLoaded() {
|
|
40
52
|
return this.numPoints >= 0;
|
|
@@ -53,36 +65,38 @@ class CopcNode extends PointCloudNode {
|
|
|
53
65
|
}
|
|
54
66
|
});
|
|
55
67
|
}
|
|
68
|
+
async loadOctree() {
|
|
69
|
+
// Load hierarchy
|
|
70
|
+
const buffer = await this._fetch(this.entryOffset, this.entryLength);
|
|
71
|
+
const hierarchy = await Hierarchy.parse(new Uint8Array(buffer));
|
|
56
72
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// size of the child node bbox (Vector3), based on the size of the
|
|
67
|
-
// parent node, and divided by the factor
|
|
68
|
-
this.bbox.getSize(size).divideScalar(f);
|
|
69
|
-
|
|
70
|
-
// initialize the child node bbox at the location of the parent node bbox
|
|
71
|
-
node.bbox.min.copy(this.bbox.min);
|
|
72
|
-
|
|
73
|
-
// position of the parent node, if it was at the same depth as the
|
|
74
|
-
// child, found by multiplying the tree position by the factor
|
|
75
|
-
position.copy(this).multiplyScalar(f);
|
|
76
|
-
|
|
77
|
-
// difference in position between the two nodes, at child depth, and
|
|
78
|
-
// scale it using the size
|
|
79
|
-
translation.subVectors(node, position).multiply(size);
|
|
80
|
-
|
|
81
|
-
// apply the translation to the child node bbox
|
|
82
|
-
node.bbox.min.add(translation);
|
|
73
|
+
// Update current node entry from loaded subtree
|
|
74
|
+
const node = hierarchy.nodes[this.id];
|
|
75
|
+
if (!node) {
|
|
76
|
+
return Promise.reject('[CopcNode]: Ill-formed data, entry not found in hierarchy.');
|
|
77
|
+
}
|
|
78
|
+
this.numPoints = node.pointCount;
|
|
79
|
+
this.entryOffset = node.pointDataOffset;
|
|
80
|
+
this.entryLength = node.pointDataLength;
|
|
83
81
|
|
|
84
|
-
//
|
|
85
|
-
|
|
82
|
+
// Load subtree entries
|
|
83
|
+
const stack = [];
|
|
84
|
+
stack.push(this);
|
|
85
|
+
while (stack.length) {
|
|
86
|
+
const node = stack.shift();
|
|
87
|
+
const depth = node.depth + 1;
|
|
88
|
+
const x = node.x * 2;
|
|
89
|
+
const y = node.y * 2;
|
|
90
|
+
const z = node.z * 2;
|
|
91
|
+
node.findAndCreateChild(depth, x, y, z, hierarchy, stack);
|
|
92
|
+
node.findAndCreateChild(depth, x + 1, y, z, hierarchy, stack);
|
|
93
|
+
node.findAndCreateChild(depth, x, y + 1, z, hierarchy, stack);
|
|
94
|
+
node.findAndCreateChild(depth, x + 1, y + 1, z, hierarchy, stack);
|
|
95
|
+
node.findAndCreateChild(depth, x, y, z + 1, hierarchy, stack);
|
|
96
|
+
node.findAndCreateChild(depth, x + 1, y, z + 1, hierarchy, stack);
|
|
97
|
+
node.findAndCreateChild(depth, x, y + 1, z + 1, hierarchy, stack);
|
|
98
|
+
node.findAndCreateChild(depth, x + 1, y + 1, z + 1, hierarchy, stack);
|
|
99
|
+
}
|
|
86
100
|
}
|
|
87
101
|
|
|
88
102
|
/**
|
|
@@ -118,39 +132,6 @@ class CopcNode extends PointCloudNode {
|
|
|
118
132
|
this.add(child);
|
|
119
133
|
stack.push(child);
|
|
120
134
|
}
|
|
121
|
-
async loadOctree() {
|
|
122
|
-
// Load hierarchy
|
|
123
|
-
const buffer = await this._fetch(this.entryOffset, this.entryLength);
|
|
124
|
-
const hierarchy = await Hierarchy.parse(new Uint8Array(buffer));
|
|
125
|
-
|
|
126
|
-
// Update current node entry from loaded subtree
|
|
127
|
-
const node = hierarchy.nodes[this.id];
|
|
128
|
-
if (!node) {
|
|
129
|
-
return Promise.reject('[CopcNode]: Ill-formed data, entry not found in hierarchy.');
|
|
130
|
-
}
|
|
131
|
-
this.numPoints = node.pointCount;
|
|
132
|
-
this.entryOffset = node.pointDataOffset;
|
|
133
|
-
this.entryLength = node.pointDataLength;
|
|
134
|
-
|
|
135
|
-
// Load subtree entries
|
|
136
|
-
const stack = [];
|
|
137
|
-
stack.push(this);
|
|
138
|
-
while (stack.length) {
|
|
139
|
-
const node = stack.shift();
|
|
140
|
-
const depth = node.depth + 1;
|
|
141
|
-
const x = node.x * 2;
|
|
142
|
-
const y = node.y * 2;
|
|
143
|
-
const z = node.z * 2;
|
|
144
|
-
node.findAndCreateChild(depth, x, y, z, hierarchy, stack);
|
|
145
|
-
node.findAndCreateChild(depth, x + 1, y, z, hierarchy, stack);
|
|
146
|
-
node.findAndCreateChild(depth, x, y + 1, z, hierarchy, stack);
|
|
147
|
-
node.findAndCreateChild(depth, x + 1, y + 1, z, hierarchy, stack);
|
|
148
|
-
node.findAndCreateChild(depth, x, y, z + 1, hierarchy, stack);
|
|
149
|
-
node.findAndCreateChild(depth, x + 1, y, z + 1, hierarchy, stack);
|
|
150
|
-
node.findAndCreateChild(depth, x, y + 1, z + 1, hierarchy, stack);
|
|
151
|
-
node.findAndCreateChild(depth, x + 1, y + 1, z + 1, hierarchy, stack);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
135
|
|
|
155
136
|
/**
|
|
156
137
|
* Load the COPC Buffer geometry for this node.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function deprecatedColorLayerOptions(options: any): any;
|
|
2
|
+
export function deprecatedParsingOptionsToNewOne(options: any): any;
|
|
3
|
+
export function deprecatedFeature2MeshOptions(options: any): void;
|
|
4
|
+
export function deprecatedC3DEngineWebGLOptions(options: any): void;
|
|
5
|
+
declare const _default: {};
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export default EntwinePointTileNode;
|
|
2
|
+
/**
|
|
3
|
+
* @extends PointCloudNode
|
|
4
|
+
*
|
|
5
|
+
* @property {boolean} isEntwinePointTileNode - Used to checkout whether this
|
|
6
|
+
* node is a EntwinePointTileNode. Default is `true`. You should not change
|
|
7
|
+
* this, as it is used internally for optimisation.
|
|
8
|
+
* @property {number} depth - The depth of the node in the tree - see the
|
|
9
|
+
* [Entwine
|
|
10
|
+
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
11
|
+
* @property {number} x - The x coordinate of the node in the tree - see the
|
|
12
|
+
* [Entwine
|
|
13
|
+
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
14
|
+
* @property {number} y - The y coordinate of the node in the tree - see the
|
|
15
|
+
* [Entwine
|
|
16
|
+
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
17
|
+
* @property {number} z - The z coordinate of the node in the tree - see the
|
|
18
|
+
* [Entwine
|
|
19
|
+
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
20
|
+
* @property {string} id - The id of the node, constituted of the four
|
|
21
|
+
* components: `depth-x-y-z`.
|
|
22
|
+
*/
|
|
23
|
+
declare class EntwinePointTileNode extends PointCloudNode {
|
|
24
|
+
/**
|
|
25
|
+
* Constructs a new instance of EntwinePointTileNode.
|
|
26
|
+
*
|
|
27
|
+
* @constructor
|
|
28
|
+
*
|
|
29
|
+
* @param {number} depth - The depth of the node in the tree - see the
|
|
30
|
+
* [Entwine
|
|
31
|
+
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
32
|
+
* @param {number} x - The x coordinate of the node in the tree - see the
|
|
33
|
+
* [Entwine
|
|
34
|
+
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
35
|
+
* @param {number} y - The y coordinate of the node in the tree - see the
|
|
36
|
+
* [Entwine
|
|
37
|
+
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
38
|
+
* @param {number} z - The z coordinate of the node in the tree - see the
|
|
39
|
+
* [Entwine
|
|
40
|
+
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
41
|
+
* @param {EntwinePointTileLayer} layer - The layer the node is attached to.
|
|
42
|
+
* @param {number} [numPoints=0] - The number of points in this node. If
|
|
43
|
+
* `-1`, it means that the octree hierarchy associated to this node needs to
|
|
44
|
+
* be loaded.
|
|
45
|
+
*/
|
|
46
|
+
constructor(depth: number, x: number, y: number, z: number, layer: EntwinePointTileLayer, numPoints?: number);
|
|
47
|
+
isEntwinePointTileNode: boolean;
|
|
48
|
+
depth: number;
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
z: number;
|
|
52
|
+
id: string;
|
|
53
|
+
url: string;
|
|
54
|
+
get octreeIsLoaded(): boolean;
|
|
55
|
+
loadOctree(): Promise<void>;
|
|
56
|
+
findAndCreateChild(depth: any, x: any, y: any, z: any, hierarchy: any, stack: any): void;
|
|
57
|
+
}
|
|
58
|
+
import PointCloudNode from '../Core/PointCloudNode';
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
1
|
import Fetcher from "../Provider/Fetcher.js";
|
|
3
2
|
import PointCloudNode from "./PointCloudNode.js";
|
|
4
|
-
const size = new THREE.Vector3();
|
|
5
|
-
const position = new THREE.Vector3();
|
|
6
|
-
const translation = new THREE.Vector3();
|
|
7
3
|
function buildId(depth, x, y, z) {
|
|
8
4
|
return `${depth}-${x}-${y}-${z}`;
|
|
9
5
|
}
|
|
@@ -20,10 +16,10 @@ function buildId(depth, x, y, z) {
|
|
|
20
16
|
* @property {number} x - The x coordinate of the node in the tree - see the
|
|
21
17
|
* [Entwine
|
|
22
18
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
23
|
-
* @property {number} y - The
|
|
19
|
+
* @property {number} y - The y coordinate of the node in the tree - see the
|
|
24
20
|
* [Entwine
|
|
25
21
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
26
|
-
* @property {number} z - The
|
|
22
|
+
* @property {number} z - The z coordinate of the node in the tree - see the
|
|
27
23
|
* [Entwine
|
|
28
24
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
29
25
|
* @property {string} id - The id of the node, constituted of the four
|
|
@@ -41,10 +37,10 @@ class EntwinePointTileNode extends PointCloudNode {
|
|
|
41
37
|
* @param {number} x - The x coordinate of the node in the tree - see the
|
|
42
38
|
* [Entwine
|
|
43
39
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
44
|
-
* @param {number} y - The
|
|
40
|
+
* @param {number} y - The y coordinate of the node in the tree - see the
|
|
45
41
|
* [Entwine
|
|
46
42
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
47
|
-
* @param {number} z - The
|
|
43
|
+
* @param {number} z - The z coordinate of the node in the tree - see the
|
|
48
44
|
* [Entwine
|
|
49
45
|
* documentation](https://entwine.io/entwine-point-tile.html#ept-data)
|
|
50
46
|
* @param {EntwinePointTileLayer} layer - The layer the node is attached to.
|
|
@@ -63,36 +59,12 @@ class EntwinePointTileNode extends PointCloudNode {
|
|
|
63
59
|
this.id = buildId(depth, x, y, z);
|
|
64
60
|
this.url = `${this.layer.source.url}/ept-data/${this.id}.${this.layer.source.extension}`;
|
|
65
61
|
}
|
|
66
|
-
createChildAABB(node) {
|
|
67
|
-
// factor to apply, based on the depth difference (can be > 1)
|
|
68
|
-
const f = 2 ** (node.depth - this.depth);
|
|
69
|
-
|
|
70
|
-
// size of the child node bbox (Vector3), based on the size of the
|
|
71
|
-
// parent node, and divided by the factor
|
|
72
|
-
this.bbox.getSize(size).divideScalar(f);
|
|
73
|
-
|
|
74
|
-
// initialize the child node bbox at the location of the parent node bbox
|
|
75
|
-
node.bbox.min.copy(this.bbox.min);
|
|
76
|
-
|
|
77
|
-
// position of the parent node, if it was at the same depth than the
|
|
78
|
-
// child, found by multiplying the tree position by the factor
|
|
79
|
-
position.copy(this).multiplyScalar(f);
|
|
80
|
-
|
|
81
|
-
// difference in position between the two nodes, at child depth, and
|
|
82
|
-
// scale it using the size
|
|
83
|
-
translation.subVectors(node, position).multiply(size);
|
|
84
|
-
|
|
85
|
-
// apply the translation to the child node bbox
|
|
86
|
-
node.bbox.min.add(translation);
|
|
87
|
-
|
|
88
|
-
// use the size computed above to set the max
|
|
89
|
-
node.bbox.max.copy(node.bbox.min).add(size);
|
|
90
|
-
}
|
|
91
62
|
get octreeIsLoaded() {
|
|
92
63
|
return this.numPoints >= 0;
|
|
93
64
|
}
|
|
94
65
|
loadOctree() {
|
|
95
|
-
|
|
66
|
+
const hierarchyUrl = `${this.layer.source.url}/ept-hierarchy/${this.id}.json`;
|
|
67
|
+
return Fetcher.json(hierarchyUrl, this.layer.source.networkOptions).then(hierarchy => {
|
|
96
68
|
this.numPoints = hierarchy[this.id];
|
|
97
69
|
const stack = [];
|
|
98
70
|
stack.push(this);
|