@loaders.gl/3d-tiles 4.0.0-alpha.13 → 4.0.0-alpha.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {GLTFPostprocessed} from '@loaders.gl/gltf';\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';\n\nexport type FeatureTableJson = {\n [key: string]: any[];\n};\n\nexport type B3DMContent = {\n batchTableJson?: FeatureTableJson;\n byteLength: number;\n byteOffset: number;\n cartesianModelMatrix: Matrix4;\n cartesianOrigin: Vector3;\n cartographicModelMatrix: Matrix4;\n cartographicOrigin: Vector3;\n featureIds?: number[] | null;\n featureTableBinary?: Uint8Array;\n featureTableJson?: FeatureTableJson;\n gltf?: GLTFPostprocessed;\n gltfUpAxis: string;\n header: GLTFHeader;\n magic: number;\n modelMatrix: Matrix4;\n rotateYtoZ: boolean;\n rtcCenter: [number, number, number];\n type: string;\n version: number;\n};\n\nexport type GLTFHeader = {\n batchLength?: number;\n batchTableBinaryByteLength: number;\n batchTableJsonByteLength: number;\n featureTableBinaryByteLength: number;\n featureTableJsonByteLength: number;\n};\n\n/**\n * A 3D Tiles tileset JSON\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference\n */\nexport type Tiles3DTilesetJSON = {\n /** Metadata about the entire tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset\n */\n asset: {\n /** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */\n version: string;\n /** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */\n tilesetVersion?: string;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n /** Not mentioned in 1.0 spec but some tilesets contain this option */\n gltfUpAxis?: string;\n };\n /** A dictionary object of metadata about per-feature properties. */\n properties?: Record<string, TilesetProperty>;\n /** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /** A tile in a 3D Tiles tileset. */\n root: Tiles3DTileJSON;\n /** Names of 3D Tiles extensions used somewhere in this tileset. */\n extensionsUsed?: string[];\n /** Names of 3D Tiles extensions required to properly load this tileset. */\n extensionsRequired?: string[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** TilesetJSON postprocessed by Tiles3DLoader */\nexport type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {\n /**\n * Loader used\n * @deprecated\n */\n loader: LoaderWithParser;\n /** URL used to load a tileset resource */\n url: string;\n /** HTTP request query string */\n queryString: string;\n /** base path that non-absolute paths in tileset are relative to. */\n basePath: string;\n /** tileset type */\n type: TILESET_TYPE.TILES3D;\n /** LOD metric type */\n lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue: number;\n /** Postprocessed root */\n root: Tiles3DTileJSONPostprocessed;\n};\n\n/**\n * A tile in a 3D Tiles tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile\n */\nexport type Tiles3DTileJSON = {\n /** A bounding volume that encloses a tile or its content. */\n boundingVolume: Tile3DBoundingVolume;\n /** A bounding volume that encloses a tile or its content. */\n viewerRequestVolume?: object;\n /** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: string;\n /** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */\n transform?: number[];\n /** Metadata about the tile's content and a link to the content. */\n content?: Tiles3DTileContentJSON;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSON[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n\n /** 3DTiles v1.1 properties\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json\n */\n /** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */\n implicitTiling?: ImplicitTilingData;\n};\n\nexport type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {\n /** Unique ID */\n id?: string;\n /** Content full URL */\n contentUrl?: string;\n /** LOD metric type */\n lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Duplicate of transform */\n transformMatrix?: number[];\n /** Type of tile */\n type?: TILE_TYPE | string;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: TILE_REFINEMENT | string;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSONPostprocessed[];\n};\n\n/** Metadata about the tile's content and a link to the content. */\nexport type Tiles3DTileContentJSON = {\n /** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */\n uri: string;\n /** url doesn't allign the spec but we support it same way as uri */\n url?: string;\n /** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */\n boundingVolume?: Tile3DBoundingVolume;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** A bounding volume that encloses a tile or its content.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume\n */\nexport type Tile3DBoundingVolume = {\n /** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.\n * The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define\n * the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */\n box?: number[];\n /** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.\n * The last element (with index 3) defines the radius in meters. */\n sphere?: number[];\n /** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].\n * Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */\n region?: number[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/**\n * A dictionary object of metadata about per-feature properties.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties\n */\nexport type TilesetProperty = {\n /** The maximum value of this property of all the features in the tileset. */\n maximum: number;\n /** The minimum value of this property of all the features in the tileset. */\n minimum: number;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\nexport type Tiles3DTileContent = {\n /** Common properties */\n byteOffset?: number;\n type?: string;\n featureIds?: null;\n\n /** 3DTile header */\n magic?: number;\n version?: number;\n byteLength?: number;\n\n /** 3DTile tables header */\n header?: {\n featureTableJsonByteLength?: number;\n featureTableBinaryByteLength?: number;\n batchTableJsonByteLength?: number;\n batchTableBinaryByteLength?: number;\n batchLength?: number;\n };\n\n /** 3DTile tables */\n featureTableJson?:\n | {\n BATCH_LENGTH?: number;\n }\n | Record<string, any>;\n featureTableBinary?: Uint8Array;\n batchTableJson?: Record<string, (string | number)[]>;\n batchTableBinary?: Uint8Array;\n rtcCenter?: number[];\n\n /** 3DTile glTF */\n gltfArrayBuffer?: ArrayBuffer;\n gltfByteOffset?: number;\n gltfByteLength?: number;\n rotateYtoZ?: boolean;\n gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';\n gltfUrl?: string;\n gpuMemoryUsageInBytes?: number;\n gltf?: GLTFPostprocessed;\n\n /** For Composite tiles */\n tilesLength?: number;\n tiles?: Tiles3DTileContent[];\n\n /** For Instances model and Pointcloud tiles */\n featuresLength?: number;\n\n /** For Instanced model tiles */\n gltfFormat?: number;\n eastNorthUp?: boolean;\n normalUp?: number[];\n normalRight?: number[];\n hasCustomOrientation?: boolean;\n octNormalUp?: number[];\n octNormalRight?: number[];\n instances?: {\n modelMatrix: Matrix4;\n batchId: number;\n }[];\n\n /** For Pointcloud tiles */\n attributes?: {\n positions: null | number[];\n colors:\n | null\n | number[]\n | {type: number; value: Uint8ClampedArray; size: number; normalized: boolean};\n normals: null | number[] | {type: number; size: number; value: Float32Array};\n batchIds: null | number[];\n };\n constantRGBA?: number[];\n isQuantized?: boolean;\n isTranslucent?: boolean;\n isRGB565?: boolean;\n isOctEncoded16P?: boolean;\n pointsLength?: number;\n pointCount?: number;\n batchIds?: number[];\n hasPositions?: boolean;\n hasColors?: boolean;\n hasNormals?: boolean;\n hasBatchIds?: boolean;\n quantizedVolumeScale?: Vector3;\n quantizedVolumeOffset?: Vector3;\n quantizedRange?: number;\n isQuantizedDraco?: boolean;\n octEncodedRange?: number;\n isOctEncodedDraco?: boolean;\n};\n\n/**\n * 3DTILES_implicit_tiling types\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json\n * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json\n */\nexport type Subtree = {\n /** An array of buffers. */\n buffers: Buffer[];\n /** An array of buffer views. */\n bufferViews: BufferView[];\n /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index\n * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.\n * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent\n * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.\n */\n tileAvailability: Availability;\n /** It is array by spec but there are tiles that has a single object\n * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -\n * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.\n */\n contentAvailability: Availability | Availability[];\n /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree\n * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,\n * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,\n * then the tileset does not subdivide further.\n */\n childSubtreeAvailability: Availability;\n // TODO: These are unused properties. Improve types when they are required\n propertyTables: unknown;\n tileMetadata: unknown;\n contentMetadata: unknown;\n subtreeMetadata: unknown;\n};\n\nexport type Availability = {\n /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */\n constant?: 0 | 1;\n /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described\n * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */\n bitstream?: number;\n /**\n * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json\n * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json\n * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`\n */\n bufferView?: number;\n /**\n * Postprocessing property\n * contain availability bits loaded from the bufferView\n */\n explicitBitstream?: ExplicitBitstream;\n};\n\nexport type ExplicitBitstream = Uint8Array;\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subdivision-scheme\n */\nexport type SubdivisionScheme = 'QUADTREE' | 'OCTREE';\n\ntype Buffer = {\n name: string;\n uri?: string;\n byteLength: number;\n};\n\n/** Subtree buffer view */\nexport type BufferView = {\n buffer: number;\n byteOffset: number;\n byteLength: number;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n */\nexport type ImplicitTilingExensionData = ImplicitTilingData & {\n maximumLevel?: number;\n};\n\n/** 3DTiles v1.1 types */\n\n/**\n * This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json\n * */\ntype ImplicitTilingData = {\n /** A string describing the subdivision scheme used within the tileset. */\n subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;\n /** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */\n subtreeLevels: number;\n /** The numbers of the levels in the tree with available tiles. */\n availableLevels: number;\n /** An object describing the location of subtree files. */\n subtrees: {\n /** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.\n * The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */\n uri: string;\n };\n};\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {GLTFPostprocessed} from '@loaders.gl/gltf';\nimport {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {TILESET_TYPE, LOD_METRIC_TYPE, TILE_TYPE, TILE_REFINEMENT} from '@loaders.gl/tiles';\n\nexport type FeatureTableJson = {\n [key: string]: any[];\n};\n\nexport type B3DMContent = {\n batchTableJson?: FeatureTableJson;\n byteLength: number;\n byteOffset: number;\n cartesianModelMatrix: Matrix4;\n cartesianOrigin: Vector3;\n cartographicModelMatrix: Matrix4;\n cartographicOrigin: Vector3;\n featureIds?: number[] | null;\n featureTableBinary?: Uint8Array;\n featureTableJson?: FeatureTableJson;\n gltf?: GLTFPostprocessed;\n gltfUpAxis: string;\n header: GLTFHeader;\n magic: number;\n modelMatrix: Matrix4;\n rotateYtoZ: boolean;\n rtcCenter: [number, number, number];\n type: string;\n version: number;\n};\n\nexport type GLTFHeader = {\n batchLength?: number;\n batchTableBinaryByteLength: number;\n batchTableJsonByteLength: number;\n featureTableBinaryByteLength: number;\n featureTableJsonByteLength: number;\n};\n\n/**\n * A 3D Tiles tileset JSON\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#property-reference\n */\nexport type Tiles3DTilesetJSON = {\n /** Metadata about the entire tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#asset\n */\n asset: {\n /** The 3D Tiles version. The version defines the JSON schema for the tileset JSON and the base set of tile formats. */\n version: string;\n /** Application-specific version of this tileset, e.g., for when an existing tileset is updated. */\n tilesetVersion?: string;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n /** Not mentioned in 1.0 spec but some tilesets contain this option */\n gltfUpAxis?: string;\n };\n /** A dictionary object of metadata about per-feature properties. */\n properties?: Record<string, TilesetProperty>;\n /** The error, in meters, introduced if this tileset is not rendered. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /** A tile in a 3D Tiles tileset. */\n root: Tiles3DTileJSON;\n /** Names of 3D Tiles extensions used somewhere in this tileset. */\n extensionsUsed?: string[];\n /** Names of 3D Tiles extensions required to properly load this tileset. */\n extensionsRequired?: string[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** TilesetJSON postprocessed by Tiles3DLoader */\nexport type Tiles3DTilesetJSONPostprocessed = Omit<Tiles3DTilesetJSON, 'root'> & {\n /**\n * Loader used\n * @deprecated\n */\n loader: LoaderWithParser;\n /** URL used to load a tileset resource */\n url: string;\n /** HTTP request query string */\n queryString: string;\n /** base path that non-absolute paths in tileset are relative to. */\n basePath: string;\n /** tileset type */\n type: TILESET_TYPE.TILES3D;\n /** LOD metric type */\n lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue: number;\n /** Postprocessed root */\n root: Tiles3DTileJSONPostprocessed;\n};\n\n/**\n * A tile in a 3D Tiles tileset.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#tile\n */\nexport type Tiles3DTileJSON = {\n /** A bounding volume that encloses a tile or its content. */\n boundingVolume: Tile3DBoundingVolume;\n /** A bounding volume that encloses a tile or its content. */\n viewerRequestVolume?: object;\n /** The error, in meters, introduced if this tile is rendered and its children are not. At runtime, the geometric error is used to compute screen space error (SSE), i.e., the error measured in pixels. */\n geometricError: number;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: string;\n /** A floating-point 4x4 affine transformation matrix, stored in column-major order, that transforms the tile's content */\n transform?: number[];\n /** Metadata about the tile's content and a link to the content. */\n content?: Tiles3DTileContentJSON;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSON[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n\n /** 3DTiles v1.1 properties\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.schema.json\n */\n /** This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally. */\n implicitTiling?: ImplicitTilingData;\n};\n\nexport type Tiles3DTileJSONPostprocessed = Omit<Tiles3DTileJSON, 'refine' | 'children'> & {\n /** Unique ID */\n id?: string;\n /** Content full URL */\n contentUrl?: string;\n /** LOD metric type */\n lodMetricType?: LOD_METRIC_TYPE.GEOMETRIC_ERROR;\n /** LOD metric value */\n lodMetricValue?: number;\n /** Duplicate of transform */\n transformMatrix?: number[];\n /** Type of tile */\n type?: TILE_TYPE | string;\n /**\n * Specifies if additive or replacement refinement is used when traversing the tileset for rendering. This property is required for the root tile of a tileset; it is optional for all other tiles.\n * The default is to inherit from the parent tile.\n */\n refine?: TILE_REFINEMENT | string;\n /** An array of objects that define child tiles. */\n children: Tiles3DTileJSONPostprocessed[];\n};\n\n/** Metadata about the tile's content and a link to the content. */\nexport type Tiles3DTileContentJSON = {\n /** A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file. */\n uri: string;\n /** url doesn't allign the spec but we support it same way as uri */\n url?: string;\n /** A bounding volume that encloses a tile or its content. At least one bounding volume property is required. Bounding volumes include box, region, or sphere. */\n boundingVolume?: Tile3DBoundingVolume;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/** A bounding volume that encloses a tile or its content.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#bounding-volume\n */\nexport type Tile3DBoundingVolume = {\n /** An array of 12 numbers that define an oriented bounding box. The first three elements define the x, y, and z values for the center of the box.\n * The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length. The next three elements (indices 6, 7, and 8) define\n * the y axis direction and half-length. The last three elements (indices 9, 10, and 11) define the z axis direction and half-length. */\n box?: number[];\n /** An array of four numbers that define a bounding sphere. The first three elements define the x, y, and z values for the center of the sphere.\n * The last element (with index 3) defines the radius in meters. */\n sphere?: number[];\n /** An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height].\n * Longitudes and latitudes are in radians, and heights are in meters above (or below) the WGS84 ellipsoid. */\n region?: number[];\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\n/**\n * A dictionary object of metadata about per-feature properties.\n * https://github.com/CesiumGS/3d-tiles/tree/main/specification#properties\n */\nexport type TilesetProperty = {\n /** The maximum value of this property of all the features in the tileset. */\n maximum: number;\n /** The minimum value of this property of all the features in the tileset. */\n minimum: number;\n /** Dictionary object with extension-specific objects. */\n extensions?: object;\n /** Application-specific data. */\n extras?: any;\n};\n\nexport type Tiles3DTileContent = {\n /** Common properties */\n byteOffset?: number;\n type?: string;\n featureIds?: null;\n\n /** 3DTile header */\n magic?: number;\n version?: number;\n byteLength?: number;\n\n /** 3DTile tables header */\n header?: {\n featureTableJsonByteLength?: number;\n featureTableBinaryByteLength?: number;\n batchTableJsonByteLength?: number;\n batchTableBinaryByteLength?: number;\n batchLength?: number;\n };\n\n /** 3DTile tables */\n featureTableJson?:\n | {\n BATCH_LENGTH?: number;\n }\n | Record<string, any>;\n featureTableBinary?: Uint8Array;\n batchTableJson?: Record<string, (string | number)[]>;\n batchTableBinary?: Uint8Array;\n rtcCenter?: number[];\n\n /** 3DTile glTF */\n gltfArrayBuffer?: ArrayBuffer;\n gltfByteOffset?: number;\n gltfByteLength?: number;\n rotateYtoZ?: boolean;\n gltfUpAxis?: 'x' | 'X' | 'y' | 'Y' | 'z' | 'Z';\n gltfUrl?: string;\n gpuMemoryUsageInBytes?: number;\n gltf?: GLTFPostprocessed;\n\n /** For Composite tiles */\n tilesLength?: number;\n tiles?: Tiles3DTileContent[];\n\n /** For Instances model and Pointcloud tiles */\n featuresLength?: number;\n\n /** For Instanced model tiles */\n gltfFormat?: number;\n eastNorthUp?: boolean;\n normalUp?: number[];\n normalRight?: number[];\n hasCustomOrientation?: boolean;\n octNormalUp?: number[];\n octNormalRight?: number[];\n instances?: {\n modelMatrix: Matrix4;\n batchId: number;\n }[];\n\n /** For Pointcloud tiles */\n attributes?: {\n positions: null | number[];\n colors:\n | null\n | number[]\n | {type: number; value: Uint8ClampedArray; size: number; normalized: boolean};\n normals: null | number[] | {type: number; size: number; value: Float32Array};\n batchIds: null | number[];\n };\n constantRGBA?: number[];\n isQuantized?: boolean;\n isTranslucent?: boolean;\n isRGB565?: boolean;\n isOctEncoded16P?: boolean;\n pointsLength?: number;\n pointCount?: number;\n batchIds?: number[];\n hasPositions?: boolean;\n hasColors?: boolean;\n hasNormals?: boolean;\n hasBatchIds?: boolean;\n quantizedVolumeScale?: Vector3;\n quantizedVolumeOffset?: Vector3;\n quantizedRange?: number;\n isQuantizedDraco?: boolean;\n octEncodedRange?: number;\n isOctEncodedDraco?: boolean;\n};\n\n/**\n * 3DTILES_implicit_tiling types\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json\n * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json\n */\nexport type Subtree = {\n /** An array of buffers. */\n buffers: Buffer[];\n /** An array of buffer views. */\n bufferViews: BufferView[];\n /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index\n * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.\n * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent\n * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.\n */\n tileAvailability: Availability;\n /** It is array by spec but there are tiles that has a single object\n * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -\n * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.\n */\n contentAvailability: Availability | Availability[];\n /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree\n * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,\n * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.\n * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,\n * then the tileset does not subdivide further.\n */\n childSubtreeAvailability: Availability;\n // TODO: These are unused properties. Improve types when they are required\n propertyTables: unknown;\n tileMetadata: unknown;\n contentMetadata: unknown;\n subtreeMetadata: unknown;\n};\n\nexport type Availability = {\n /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */\n constant?: 0 | 1;\n /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described\n * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */\n bitstream?: number;\n /**\n * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json\n * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json\n * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`\n */\n bufferView?: number;\n /**\n * Postprocessing property\n * contain availability bits loaded from the bufferView\n */\n explicitBitstream?: ExplicitBitstream;\n};\n\nexport type ExplicitBitstream = Uint8Array;\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subdivision-scheme\n */\nexport type SubdivisionScheme = 'QUADTREE' | 'OCTREE';\n\ntype Buffer = {\n name: string;\n uri?: string;\n byteLength: number;\n};\n\n/** Subtree buffer view */\nexport type BufferView = {\n buffer: number;\n byteOffset: number;\n byteLength: number;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling\n */\nexport type ImplicitTilingExensionData = ImplicitTilingData & {\n /** This property is not part of the schema\n * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json\n * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`\n */\n maximumLevel?: number;\n};\n\n/** 3DTiles v1.1 types */\n\n/**\n * This object allows a tile to be implicitly subdivided. Tile and content availability and metadata is stored in subtrees which are referenced externally.\n * https://github.com/CesiumGS/3d-tiles/blob/draft-1.1/specification/schema/tile.implicitTiling.schema.json\n * */\ntype ImplicitTilingData = {\n /** A string describing the subdivision scheme used within the tileset. */\n subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;\n /** The number of distinct levels in each subtree. For example, a quadtree with `subtreeLevels = 2` will have subtrees with 5 nodes (one root and 4 children). */\n subtreeLevels: number;\n /** The numbers of the levels in the tree with available tiles. */\n availableLevels: number;\n /** An object describing the location of subtree files. */\n subtrees: {\n /** A template URI pointing to subtree files. A subtree is a fixed-depth (defined by `subtreeLevels`) portion of the tree to keep memory use bounded.\n * The URI of each file is substituted with the subtree root's global level, x, and y. For subdivision scheme `OCTREE`, z shall also be given. Relative paths are relative to the tileset JSON. */\n uri: string;\n };\n};\n"],"mappings":""}
@@ -1,5 +1,7 @@
1
1
  import type { Subtree } from '../../../types';
2
2
  import type { S2VolumeInfo } from '../../utils/obb/s2-corners-to-obb';
3
+ import { Tiles3DLoaderOptions } from '../../../tiles-3d-loader';
4
+ import { ImplicitOptions } from '../parse-3d-tile-header';
3
5
  /**
4
6
  * S2VolumeBox is an extention of BoundingVolume of type "box"
5
7
  */
@@ -23,7 +25,7 @@ export type S2VolumeBox = {
23
25
  */
24
26
  export declare function parseImplicitTiles(params: {
25
27
  subtree: Subtree;
26
- options: any;
28
+ implicitOptions: ImplicitOptions;
27
29
  parentData?: {
28
30
  mortonIndex: number;
29
31
  x: number;
@@ -40,6 +42,7 @@ export declare function parseImplicitTiles(params: {
40
42
  z: number;
41
43
  };
42
44
  s2VolumeBox?: S2VolumeBox;
45
+ loaderOptions: Tiles3DLoaderOptions;
43
46
  }): Promise<{
44
47
  children: never[];
45
48
  lodMetricValue: number;
@@ -1 +1 @@
1
- {"version":3,"file":"parse-3d-implicit-tiles.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-implicit-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAMhF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAYpE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,yFAAyF;IACzF,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,uGAAuG;IACvG,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AA6CF;;;;;;;;;;;GAWG;AAEH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACnF,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;;;;GAsIA;AAkJD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE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BAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,MAAM,CAGR"}
@@ -65,7 +65,7 @@ function getChildS2VolumeBox(s2VolumeBox, index, subdivisionScheme) {
65
65
  */
66
66
  // eslint-disable-next-line max-statements
67
67
  async function parseImplicitTiles(params) {
68
- const { options, parentData = {
68
+ const { implicitOptions, parentData = {
69
69
  mortonIndex: 0,
70
70
  x: 0,
71
71
  y: 0,
@@ -76,34 +76,43 @@ async function parseImplicitTiles(params) {
76
76
  x: 0,
77
77
  y: 0,
78
78
  z: 0
79
- }, s2VolumeBox } = params;
79
+ }, s2VolumeBox, loaderOptions } = params;
80
80
  let { subtree, level = 0 } = params;
81
- const { subdivisionScheme, subtreeLevels, maximumLevel, contentUrlTemplate, subtreesUriTemplate, basePath } = options;
81
+ const { subdivisionScheme, subtreeLevels, maximumLevel, contentUrlTemplate, subtreesUriTemplate, basePath } = implicitOptions;
82
82
  const tile = { children: [], lodMetricValue: 0, contentUrl: '' };
83
+ if (!maximumLevel) {
84
+ // eslint-disable-next-line no-console
85
+ log_1.default.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${contentUrlTemplate} won't be loaded...`);
86
+ return tile;
87
+ }
88
+ const lev = level + globalData.level;
89
+ if (lev > maximumLevel) {
90
+ return tile;
91
+ }
83
92
  const childrenPerTile = SUBDIVISION_COUNT_MAP[subdivisionScheme];
84
- // childIndex is in range [0, 7]
93
+ const bitsPerTile = Math.log2(childrenPerTile);
94
+ // childIndex is in range [0,4] for quadtrees and [0, 7] for octrees
85
95
  const childX = childIndex & 0b01; // Get first bit for X
86
96
  const childY = (childIndex >> 1) & 0b01; // Get second bit for Y
87
97
  const childZ = (childIndex >> 2) & 0b01; // Get third bit for Z
88
98
  const levelOffset = (childrenPerTile ** level - 1) / (childrenPerTile - 1);
89
- let childTileMortonIndex = concatBits(parentData.mortonIndex, childIndex);
99
+ let childTileMortonIndex = concatBits(parentData.mortonIndex, childIndex, bitsPerTile);
90
100
  let tileAvailabilityIndex = levelOffset + childTileMortonIndex;
91
101
  // Local tile coordinates
92
- let childTileX = concatBits(parentData.x, childX);
93
- let childTileY = concatBits(parentData.y, childY);
94
- let childTileZ = concatBits(parentData.z, childZ);
102
+ let childTileX = concatBits(parentData.x, childX, 1);
103
+ let childTileY = concatBits(parentData.y, childY, 1);
104
+ let childTileZ = concatBits(parentData.z, childZ, 1);
95
105
  let isChildSubtreeAvailable = false;
96
- if (level + 1 > subtreeLevels) {
106
+ if (level >= subtreeLevels) {
97
107
  isChildSubtreeAvailable = getAvailabilityResult(subtree.childSubtreeAvailability, childTileMortonIndex);
98
108
  }
99
- const x = concatBits(globalData.x, childTileX);
100
- const y = concatBits(globalData.y, childTileY);
101
- const z = concatBits(globalData.z, childTileZ);
102
- const lev = level + globalData.level;
109
+ const x = concatBits(globalData.x, childTileX, level * bitsPerTile);
110
+ const y = concatBits(globalData.y, childTileY, level * bitsPerTile);
111
+ const z = concatBits(globalData.z, childTileZ, level * bitsPerTile);
103
112
  if (isChildSubtreeAvailable) {
104
113
  const subtreePath = `${basePath}/${subtreesUriTemplate}`;
105
114
  const childSubtreeUrl = replaceContentUrlTemplate(subtreePath, lev, x, y, z);
106
- const childSubtree = await (0, core_1.load)(childSubtreeUrl, tile_3d_subtree_loader_1.Tile3DSubtreeLoader);
115
+ const childSubtree = await (0, core_1.load)(childSubtreeUrl, tile_3d_subtree_loader_1.Tile3DSubtreeLoader, loaderOptions);
107
116
  subtree = childSubtree;
108
117
  globalData.mortonIndex = childTileMortonIndex;
109
118
  globalData.x = childTileX;
@@ -118,7 +127,7 @@ async function parseImplicitTiles(params) {
118
127
  level = 0;
119
128
  }
120
129
  const isTileAvailable = getAvailabilityResult(subtree.tileAvailability, tileAvailabilityIndex);
121
- if (!isTileAvailable || level > maximumLevel) {
130
+ if (!isTileAvailable) {
122
131
  return tile;
123
132
  }
124
133
  const isContentAvailable = getAvailabilityResult(subtree.contentAvailability, tileAvailabilityIndex);
@@ -132,17 +141,18 @@ async function parseImplicitTiles(params) {
132
141
  // Recursive calling...
133
142
  const childTileParsed = await parseImplicitTiles({
134
143
  subtree,
135
- options,
144
+ implicitOptions,
145
+ loaderOptions,
136
146
  parentData: pData,
137
147
  childIndex: index,
138
148
  level: childTileLevel,
139
- globalData,
149
+ globalData: { ...globalData },
140
150
  s2VolumeBox: childS2VolumeBox
141
151
  });
142
152
  if (childTileParsed.contentUrl || childTileParsed.children.length) {
143
153
  const globalLevel = lev + 1;
144
154
  const childCoordinates = { childTileX, childTileY, childTileZ };
145
- const formattedTile = formatTileData(childTileParsed, globalLevel, childCoordinates, options, s2VolumeBox);
155
+ const formattedTile = formatTileData(childTileParsed, globalLevel, childCoordinates, implicitOptions, s2VolumeBox);
146
156
  // @ts-ignore
147
157
  tile.children.push(formattedTile);
148
158
  }
@@ -246,11 +256,12 @@ function calculateBoundingVolumeForChildTile(level, rootBoundingVolume, childCoo
246
256
  }
247
257
  /**
248
258
  * Do binary concatenation
249
- * @param first
250
- * @param second
259
+ * @param higher - number to put to higher part of result
260
+ * @param lower - number to put to lower part of result
261
+ * @param shift - number of bits to shift lower number
251
262
  */
252
- function concatBits(first, second) {
253
- return parseInt(first.toString(2) + second.toString(2), 2);
263
+ function concatBits(higher, lower, shift) {
264
+ return (higher << shift) + lower;
254
265
  }
255
266
  /**
256
267
  * Replace implicit tile content url with real coordinates.
@@ -1,6 +1,34 @@
1
1
  import type { Tiles3DLoaderOptions } from '../../tiles-3d-loader';
2
2
  import type { LoaderOptions } from '@loaders.gl/loader-utils';
3
- import { ImplicitTilingExensionData, Subtree, Tiles3DTileJSON, Tiles3DTileJSONPostprocessed, Tiles3DTilesetJSON } from '../../types';
3
+ import { LOD_METRIC_TYPE, TILE_REFINEMENT, TILE_TYPE } from '@loaders.gl/tiles';
4
+ import { ImplicitTilingExensionData, Subtree, Tile3DBoundingVolume, Tiles3DTileJSON, Tiles3DTileJSONPostprocessed, Tiles3DTilesetJSON } from '../../types';
5
+ /** Options for recursive loading implicit subtrees */
6
+ export type ImplicitOptions = {
7
+ /** Template of the full url of the content template */
8
+ contentUrlTemplate: string;
9
+ /** Template of the full url of the subtree */
10
+ subtreesUriTemplate: string;
11
+ /** Implicit subdivision scheme */
12
+ subdivisionScheme: 'QUADTREE' | 'OCTREE' | string;
13
+ /** Levels per subtree */
14
+ subtreeLevels: number;
15
+ /** Maximum implicit level through all subtrees */
16
+ maximumLevel?: number;
17
+ /** 3DTiles refine method (add/replace) */
18
+ refine?: string;
19
+ /** Tileset base path */
20
+ basePath: string;
21
+ /** 3DTiles LOD metric type */
22
+ lodMetricType: LOD_METRIC_TYPE.GEOMETRIC_ERROR;
23
+ /** Root metric value of the root tile of the implicit subtrees */
24
+ rootLodMetricValue: number;
25
+ /** Bounding volume of the root tile of the implicit subtrees */
26
+ rootBoundingVolume: Tile3DBoundingVolume;
27
+ /** Function that detects TILE_TYPE by tile metadata and content URL */
28
+ getTileType: (tile: Tiles3DTileJSON, tileContentUrl?: string) => TILE_TYPE | string;
29
+ /** Function that converts string refine method to enum value */
30
+ getRefine: (refine?: string) => TILE_REFINEMENT | string | undefined;
31
+ };
4
32
  export declare function normalizeTileData(tile: Tiles3DTileJSON | null, basePath: string): Tiles3DTileJSONPostprocessed | null;
5
33
  export declare function normalizeTileHeaders(tileset: Tiles3DTilesetJSON, basePath: string, options: LoaderOptions): Promise<Tiles3DTileJSONPostprocessed | null>;
6
34
  /**
@@ -16,5 +44,5 @@ export declare function normalizeImplicitTileHeaders(tile: Tiles3DTileJSON, tile
16
44
  * @param options
17
45
  * @returns
18
46
  */
19
- export declare function normalizeImplicitTileData(tile: Tiles3DTileJSON, basePath: string, rootSubtree: Subtree, options: any): Promise<Tiles3DTileJSONPostprocessed | null>;
47
+ export declare function normalizeImplicitTileData(tile: Tiles3DTileJSON, basePath: string, rootSubtree: Subtree, implicitOptions: ImplicitOptions, loaderOptions: Tiles3DLoaderOptions): Promise<Tiles3DTileJSONPostprocessed | null>;
20
48
  //# sourceMappingURL=parse-3d-tile-header.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-3d-tile-header.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-3d-tile-header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAI5D,OAAO,EACL,0BAA0B,EAC1B,OAAO,EAEP,eAAe,EACf,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAqDrB,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,GAAG,IAAI,EAC5B,QAAQ,EAAE,MAAM,GACf,4BAA4B,GAAG,IAAI,CAqBrC;AAGD,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CA+C9C;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,MAAM,EAChB,uBAAuB,EAAE,0BAA0B,EACnD,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CAyC9C;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,GAAG,GACX,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CA8B9C"}
1
+ {"version":3,"file":"parse-3d-tile-header.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-3d-tile-header.ts"],"names":[],"mappings":"AAAA,OAA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sB,oBAAoB,CACxC,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CA+C9C;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,MAAM,EAChB,uBAAuB,EAAE,0BAA0B,EACnD,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CA0C9C;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,OAAO,EACpB,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,oBAAoB,GAClC,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CA+B9C"}
@@ -111,7 +111,7 @@ exports.normalizeTileHeaders = normalizeTileHeaders;
111
111
  * @param tileset
112
112
  */
113
113
  async function normalizeImplicitTileHeaders(tile, tileset, basePath, implicitTilingExtension, options) {
114
- const { subdivisionScheme, maximumLevel, subtreeLevels, subtrees: { uri: subtreesUriTemplate } } = implicitTilingExtension;
114
+ const { subdivisionScheme, maximumLevel, availableLevels, subtreeLevels, subtrees: { uri: subtreesUriTemplate } } = implicitTilingExtension;
115
115
  const replacedUrlTemplate = (0, parse_3d_implicit_tiles_1.replaceContentUrlTemplate)(subtreesUriTemplate, 0, 0, 0, 0);
116
116
  const subtreeUrl = resolveUri(replacedUrlTemplate, basePath);
117
117
  const subtree = await (0, core_1.load)(subtreeUrl, tile_3d_subtree_loader_1.Tile3DSubtreeLoader, options);
@@ -132,7 +132,7 @@ async function normalizeImplicitTileHeaders(tile, tileset, basePath, implicitTil
132
132
  subtreesUriTemplate,
133
133
  subdivisionScheme,
134
134
  subtreeLevels,
135
- maximumLevel,
135
+ maximumLevel: Number.isFinite(availableLevels) ? availableLevels - 1 : maximumLevel,
136
136
  refine,
137
137
  basePath,
138
138
  lodMetricType: tiles_1.LOD_METRIC_TYPE.GEOMETRIC_ERROR,
@@ -141,7 +141,7 @@ async function normalizeImplicitTileHeaders(tile, tileset, basePath, implicitTil
141
141
  getTileType,
142
142
  getRefine
143
143
  };
144
- return await normalizeImplicitTileData(tile, basePath, subtree, implicitOptions);
144
+ return await normalizeImplicitTileData(tile, basePath, subtree, implicitOptions, options);
145
145
  }
146
146
  exports.normalizeImplicitTileHeaders = normalizeImplicitTileHeaders;
147
147
  /**
@@ -151,13 +151,14 @@ exports.normalizeImplicitTileHeaders = normalizeImplicitTileHeaders;
151
151
  * @param options
152
152
  * @returns
153
153
  */
154
- async function normalizeImplicitTileData(tile, basePath, rootSubtree, options) {
154
+ async function normalizeImplicitTileData(tile, basePath, rootSubtree, implicitOptions, loaderOptions) {
155
155
  if (!tile) {
156
156
  return null;
157
157
  }
158
158
  const { children, contentUrl } = await (0, parse_3d_implicit_tiles_1.parseImplicitTiles)({
159
159
  subtree: rootSubtree,
160
- options
160
+ implicitOptions,
161
+ loaderOptions
161
162
  });
162
163
  let tileContentUrl;
163
164
  let tileContent = null;
package/dist/types.d.ts CHANGED
@@ -348,6 +348,10 @@ export type BufferView = {
348
348
  * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling
349
349
  */
350
350
  export type ImplicitTilingExensionData = ImplicitTilingData & {
351
+ /** This property is not part of the schema
352
+ * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json
353
+ * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`
354
+ */
351
355
  maximumLevel?: number;
352
356
  };
353
357
  /** 3DTiles v1.1 types */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,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AAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtD,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,0BAA0B;AAC1B,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,GAAG;IAC5D;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,yBAAyB;AAEzB;;;KAGK;AACL,KAAK,kBAAkB,GAAG;IACxB,0EAA0E;IAC1E,iBAAiB,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,iKAAiK;IACjK,aAAa,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,EAAE;QACR;0MACkM;QAClM,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/3d-tiles",
3
- "version": "4.0.0-alpha.13",
3
+ "version": "4.0.0-alpha.15",
4
4
  "description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -34,11 +34,11 @@
34
34
  "build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
35
35
  },
36
36
  "dependencies": {
37
- "@loaders.gl/draco": "4.0.0-alpha.13",
38
- "@loaders.gl/gltf": "4.0.0-alpha.13",
39
- "@loaders.gl/loader-utils": "4.0.0-alpha.13",
40
- "@loaders.gl/math": "4.0.0-alpha.13",
41
- "@loaders.gl/tiles": "4.0.0-alpha.13",
37
+ "@loaders.gl/draco": "4.0.0-alpha.15",
38
+ "@loaders.gl/gltf": "4.0.0-alpha.15",
39
+ "@loaders.gl/loader-utils": "4.0.0-alpha.15",
40
+ "@loaders.gl/math": "4.0.0-alpha.15",
41
+ "@loaders.gl/tiles": "4.0.0-alpha.15",
42
42
  "@math.gl/core": "^3.5.1",
43
43
  "@math.gl/geospatial": "^3.5.1",
44
44
  "@probe.gl/log": "^4.0.4",
@@ -47,5 +47,5 @@
47
47
  "peerDependencies": {
48
48
  "@loaders.gl/core": "^4.0.0-alpha.8"
49
49
  },
50
- "gitHead": "32421ea66db35040f1026be734a7ec9f905ecab7"
50
+ "gitHead": "47467ab23c65917e4642730e99b5d005af333c76"
51
51
  }
@@ -7,6 +7,8 @@ import {getS2CellIdFromToken, getS2ChildCellId, getS2TokenFromCellId} from '../.
7
7
  import type {S2VolumeInfo} from '../../utils/obb/s2-corners-to-obb';
8
8
  import {convertS2BoundingVolumetoOBB} from '../../utils/obb/s2-corners-to-obb';
9
9
  import Long from 'long';
10
+ import {Tiles3DLoaderOptions} from '../../../tiles-3d-loader';
11
+ import {ImplicitOptions} from '../parse-3d-tile-header';
10
12
 
11
13
  const QUADTREE_DEVISION_COUNT = 4;
12
14
  const OCTREE_DEVISION_COUNT = 8;
@@ -84,15 +86,16 @@ function getChildS2VolumeBox(
84
86
  // eslint-disable-next-line max-statements
85
87
  export async function parseImplicitTiles(params: {
86
88
  subtree: Subtree;
87
- options: any;
89
+ implicitOptions: ImplicitOptions;
88
90
  parentData?: {mortonIndex: number; x: number; y: number; z: number};
89
91
  childIndex?: number;
90
92
  level?: number;
91
93
  globalData?: {level: number; mortonIndex: number; x: number; y: number; z: number};
92
94
  s2VolumeBox?: S2VolumeBox;
95
+ loaderOptions: Tiles3DLoaderOptions;
93
96
  }) {
94
97
  const {
95
- options,
98
+ implicitOptions,
96
99
  parentData = {
97
100
  mortonIndex: 0,
98
101
  x: 0,
@@ -107,7 +110,8 @@ export async function parseImplicitTiles(params: {
107
110
  y: 0,
108
111
  z: 0
109
112
  },
110
- s2VolumeBox
113
+ s2VolumeBox,
114
+ loaderOptions
111
115
  } = params;
112
116
  let {subtree, level = 0} = params;
113
117
  const {
@@ -117,44 +121,56 @@ export async function parseImplicitTiles(params: {
117
121
  contentUrlTemplate,
118
122
  subtreesUriTemplate,
119
123
  basePath
120
- } = options;
121
-
124
+ } = implicitOptions;
122
125
  const tile = {children: [], lodMetricValue: 0, contentUrl: ''};
123
126
 
127
+ if (!maximumLevel) {
128
+ // eslint-disable-next-line no-console
129
+ log.once(
130
+ `Missing 'maximumLevel' or 'availableLevels' property. The subtree ${contentUrlTemplate} won't be loaded...`
131
+ );
132
+ return tile;
133
+ }
134
+
135
+ const lev = level + globalData.level;
136
+ if (lev > maximumLevel) {
137
+ return tile;
138
+ }
139
+
124
140
  const childrenPerTile = SUBDIVISION_COUNT_MAP[subdivisionScheme];
141
+ const bitsPerTile = Math.log2(childrenPerTile);
125
142
 
126
- // childIndex is in range [0, 7]
143
+ // childIndex is in range [0,4] for quadtrees and [0, 7] for octrees
127
144
  const childX = childIndex & 0b01; // Get first bit for X
128
145
  const childY = (childIndex >> 1) & 0b01; // Get second bit for Y
129
146
  const childZ = (childIndex >> 2) & 0b01; // Get third bit for Z
130
147
 
131
148
  const levelOffset = (childrenPerTile ** level - 1) / (childrenPerTile - 1);
132
- let childTileMortonIndex = concatBits(parentData.mortonIndex, childIndex);
149
+ let childTileMortonIndex = concatBits(parentData.mortonIndex, childIndex, bitsPerTile);
133
150
  let tileAvailabilityIndex = levelOffset + childTileMortonIndex;
134
151
 
135
152
  // Local tile coordinates
136
- let childTileX = concatBits(parentData.x, childX);
137
- let childTileY = concatBits(parentData.y, childY);
138
- let childTileZ = concatBits(parentData.z, childZ);
153
+ let childTileX = concatBits(parentData.x, childX, 1);
154
+ let childTileY = concatBits(parentData.y, childY, 1);
155
+ let childTileZ = concatBits(parentData.z, childZ, 1);
139
156
 
140
157
  let isChildSubtreeAvailable = false;
141
158
 
142
- if (level + 1 > subtreeLevels) {
159
+ if (level >= subtreeLevels) {
143
160
  isChildSubtreeAvailable = getAvailabilityResult(
144
161
  subtree.childSubtreeAvailability,
145
162
  childTileMortonIndex
146
163
  );
147
164
  }
148
165
 
149
- const x = concatBits(globalData.x, childTileX);
150
- const y = concatBits(globalData.y, childTileY);
151
- const z = concatBits(globalData.z, childTileZ);
152
- const lev = level + globalData.level;
166
+ const x = concatBits(globalData.x, childTileX, level * bitsPerTile);
167
+ const y = concatBits(globalData.y, childTileY, level * bitsPerTile);
168
+ const z = concatBits(globalData.z, childTileZ, level * bitsPerTile);
153
169
 
154
170
  if (isChildSubtreeAvailable) {
155
171
  const subtreePath = `${basePath}/${subtreesUriTemplate}`;
156
172
  const childSubtreeUrl = replaceContentUrlTemplate(subtreePath, lev, x, y, z);
157
- const childSubtree = await load(childSubtreeUrl, Tile3DSubtreeLoader);
173
+ const childSubtree = await load(childSubtreeUrl, Tile3DSubtreeLoader, loaderOptions);
158
174
 
159
175
  subtree = childSubtree;
160
176
 
@@ -174,7 +190,7 @@ export async function parseImplicitTiles(params: {
174
190
 
175
191
  const isTileAvailable = getAvailabilityResult(subtree.tileAvailability, tileAvailabilityIndex);
176
192
 
177
- if (!isTileAvailable || level > maximumLevel) {
193
+ if (!isTileAvailable) {
178
194
  return tile;
179
195
  }
180
196
 
@@ -200,11 +216,12 @@ export async function parseImplicitTiles(params: {
200
216
  // Recursive calling...
201
217
  const childTileParsed = await parseImplicitTiles({
202
218
  subtree,
203
- options,
219
+ implicitOptions,
220
+ loaderOptions,
204
221
  parentData: pData,
205
222
  childIndex: index,
206
223
  level: childTileLevel,
207
- globalData,
224
+ globalData: {...globalData},
208
225
  s2VolumeBox: childS2VolumeBox
209
226
  });
210
227
 
@@ -215,7 +232,7 @@ export async function parseImplicitTiles(params: {
215
232
  childTileParsed,
216
233
  globalLevel,
217
234
  childCoordinates,
218
- options,
235
+ implicitOptions,
219
236
  s2VolumeBox
220
237
  );
221
238
  // @ts-ignore
@@ -274,7 +291,7 @@ function formatTileData(
274
291
  tile,
275
292
  level: number,
276
293
  childCoordinates: {childTileX: number; childTileY: number; childTileZ: number},
277
- options: any,
294
+ options: ImplicitOptions,
278
295
  s2VolumeBox?: S2VolumeBox
279
296
  ) {
280
297
  const {
@@ -363,11 +380,12 @@ function calculateBoundingVolumeForChildTile(
363
380
 
364
381
  /**
365
382
  * Do binary concatenation
366
- * @param first
367
- * @param second
383
+ * @param higher - number to put to higher part of result
384
+ * @param lower - number to put to lower part of result
385
+ * @param shift - number of bits to shift lower number
368
386
  */
369
- function concatBits(first: number, second: number): number {
370
- return parseInt(first.toString(2) + second.toString(2), 2);
387
+ function concatBits(higher: number, lower: number, shift: number): number {
388
+ return (higher << shift) + lower;
371
389
  }
372
390
 
373
391
  /**