xushiting 3 years ago
commit
204d9da734
100 changed files with 21672 additions and 0 deletions
  1. 56 0
      .drone.yml
  2. 1 0
      .eslintignore
  3. 13 0
      .eslintrc.cjs
  4. 6 0
      .gitignore
  5. 7 0
      .prettierrc
  6. 59 0
      CHANGELOG.md
  7. 6 0
      CODEOWNERS
  8. 47 0
      CODE_OF_CONDUCT.md
  9. 45 0
      CONTRIBUTING.md
  10. 9 0
      LICENSE
  11. 186 0
      README.md
  12. 7 0
      SECURITY.md
  13. 30 0
      api-extractor.json
  14. 172 0
      dist/three-loader-3dtiles.d.ts
  15. 18365 0
      dist/three-loader-3dtiles.esm.js
  16. 1 0
      dist/three-loader-3dtiles.esm.js.map
  17. 16 0
      dist/three-loader-3dtiles.esm.min.js
  18. 1 0
      dist/three-loader-3dtiles.esm.min.js.map
  19. 16 0
      dist/three-loader-3dtiles.min.js
  20. 1 0
      dist/three-loader-3dtiles.min.js.map
  21. 11 0
      dist/tsdoc-metadata.json
  22. 12 0
      docs/index.md
  23. 11 0
      docs/three-loader-3dtiles.geocoord.height.md
  24. 11 0
      docs/three-loader-3dtiles.geocoord.lat.md
  25. 11 0
      docs/three-loader-3dtiles.geocoord.long.md
  26. 22 0
      docs/three-loader-3dtiles.geocoord.md
  27. 20 0
      docs/three-loader-3dtiles.geotransform.md
  28. 29 0
      docs/three-loader-3dtiles.loader3dtiles.load.md
  29. 20 0
      docs/three-loader-3dtiles.loader3dtiles.md
  30. 13 0
      docs/three-loader-3dtiles.loaderoptions.basistranscoderpath.md
  31. 13 0
      docs/three-loader-3dtiles.loaderoptions.cesiumiontoken.md
  32. 13 0
      docs/three-loader-3dtiles.loaderoptions.computenormals.md
  33. 13 0
      docs/three-loader-3dtiles.loaderoptions.debug.md
  34. 13 0
      docs/three-loader-3dtiles.loaderoptions.dracodecoderpath.md
  35. 13 0
      docs/three-loader-3dtiles.loaderoptions.geotransform.md
  36. 13 0
      docs/three-loader-3dtiles.loaderoptions.material.md
  37. 13 0
      docs/three-loader-3dtiles.loaderoptions.maxconcurrency.md
  38. 13 0
      docs/three-loader-3dtiles.loaderoptions.maximummemoryusage.md
  39. 13 0
      docs/three-loader-3dtiles.loaderoptions.maximumscreenspaceerror.md
  40. 13 0
      docs/three-loader-3dtiles.loaderoptions.maxrequests.md
  41. 43 0
      docs/three-loader-3dtiles.loaderoptions.md
  42. 13 0
      docs/three-loader-3dtiles.loaderoptions.pointcloudcoloring.md
  43. 13 0
      docs/three-loader-3dtiles.loaderoptions.pointsize.md
  44. 13 0
      docs/three-loader-3dtiles.loaderoptions.preloadtilescount.md
  45. 13 0
      docs/three-loader-3dtiles.loaderoptions.shadercallback.md
  46. 13 0
      docs/three-loader-3dtiles.loaderoptions.shading.md
  47. 13 0
      docs/three-loader-3dtiles.loaderoptions.skiplevelofdetail.md
  48. 13 0
      docs/three-loader-3dtiles.loaderoptions.throttlerequests.md
  49. 13 0
      docs/three-loader-3dtiles.loaderoptions.transparent.md
  50. 13 0
      docs/three-loader-3dtiles.loaderoptions.updateinterval.md
  51. 13 0
      docs/three-loader-3dtiles.loaderoptions.updatetransforms.md
  52. 13 0
      docs/three-loader-3dtiles.loaderoptions.viewdistancescale.md
  53. 13 0
      docs/three-loader-3dtiles.loaderoptions.wireframe.md
  54. 13 0
      docs/three-loader-3dtiles.loaderoptions.worker.md
  55. 13 0
      docs/three-loader-3dtiles.loaderprops.loadingmanager.md
  56. 29 0
      docs/three-loader-3dtiles.loaderprops.md
  57. 25 0
      docs/three-loader-3dtiles.loaderprops.onprogress.md
  58. 13 0
      docs/three-loader-3dtiles.loaderprops.options.md
  59. 13 0
      docs/three-loader-3dtiles.loaderprops.renderer.md
  60. 13 0
      docs/three-loader-3dtiles.loaderprops.url.md
  61. 29 0
      docs/three-loader-3dtiles.md
  62. 24 0
      docs/three-loader-3dtiles.pointcloudcoloring.md
  63. 17 0
      docs/three-loader-3dtiles.runtime.dispose.md
  64. 24 0
      docs/three-loader-3dtiles.runtime.getcamerafrustum.md
  65. 24 0
      docs/three-loader-3dtiles.runtime.getlatlongheightfromposition.md
  66. 24 0
      docs/three-loader-3dtiles.runtime.getpositionfromlatlongheight.md
  67. 19 0
      docs/three-loader-3dtiles.runtime.getstats.md
  68. 17 0
      docs/three-loader-3dtiles.runtime.gettileboxes.md
  69. 19 0
      docs/three-loader-3dtiles.runtime.gettileset.md
  70. 38 0
      docs/three-loader-3dtiles.runtime.md
  71. 24 0
      docs/three-loader-3dtiles.runtime.setdebug.md
  72. 24 0
      docs/three-loader-3dtiles.runtime.setelevationrange.md
  73. 24 0
      docs/three-loader-3dtiles.runtime.sethideground.md
  74. 24 0
      docs/three-loader-3dtiles.runtime.setintensitycontrast.md
  75. 24 0
      docs/three-loader-3dtiles.runtime.setmaxintensity.md
  76. 24 0
      docs/three-loader-3dtiles.runtime.setpointalpha.md
  77. 24 0
      docs/three-loader-3dtiles.runtime.setpointcloudcoloring.md
  78. 24 0
      docs/three-loader-3dtiles.runtime.setshading.md
  79. 24 0
      docs/three-loader-3dtiles.runtime.setviewdistancescale.md
  80. 24 0
      docs/three-loader-3dtiles.runtime.setwireframe.md
  81. 24 0
      docs/three-loader-3dtiles.runtime.showtiles.md
  82. 26 0
      docs/three-loader-3dtiles.runtime.update.md
  83. 22 0
      docs/three-loader-3dtiles.shading.md
  84. 131 0
      etc/three-loader-3dtiles.api.md
  85. 200 0
      examples/demos/cesium/index.html
  86. 4 0
      examples/demos/ic_code_black_24dp.svg
  87. 41 0
      examples/demos/index.html
  88. 1 0
      examples/demos/map-overlay/README.md
  89. 256 0
      examples/demos/map-overlay/index.html
  90. 106 0
      examples/demos/realitycapture/index.html
  91. 147 0
      examples/demos/realitycapture/js/App.js
  92. 26 0
      examples/demos/realitycapture/js/Constant.js
  93. 203 0
      examples/demos/realitycapture/js/Control.js
  94. 71 0
      examples/demos/realitycapture/js/LoaderTileFiles.js
  95. 172 0
      examples/demos/realitycapture/js/MergeScene.js
  96. 12 0
      examples/demos/realitycapture/js/ModelManager.js
  97. 72 0
      examples/demos/realitycapture/js/Render.js
  98. 24 0
      examples/installation/es-module/index.html
  99. 7 0
      examples/installation/es-module/index.js
  100. 0 0
      examples/installation/webpack/README.md

+ 56 - 0
.drone.yml

@@ -0,0 +1,56 @@
+kind: pipeline
+type: docker
+name: default
+   
+steps:
+  - name: install
+    image: node:14
+    commands:
+      - npm install
+
+  - name: build
+    image: node:14
+    commands:
+      - npm run build:production
+    when:
+      branch:
+      - main
+      - dev
+
+  - name: build-npm
+    image: node:14
+    commands:
+      - npm run build:production
+    when:
+      event:
+      - tag
+
+  - name: test
+    image: node:14
+    commands:
+      - npm run test
+    when:
+      branch:
+      - main
+      - dev
+
+  - name: docs
+    image: node:14
+    commands:
+      - npm run docs:production
+    when:
+      branch:
+      - main
+      - dev
+
+  - name: npm
+    image: plugins/npm
+    settings:
+      token: 
+        from_secret: npm_token
+      email: 
+        from_secret: npm_email
+    when:
+      event:
+      - tag
+

+ 1 - 0
.eslintignore

@@ -0,0 +1 @@
+*.js

+ 13 - 0
.eslintrc.cjs

@@ -0,0 +1,13 @@
+module.exports = {
+  env: {
+    browser: true,
+    es6: true,
+  },
+  parser: '@typescript-eslint/parser',
+  extends: ['plugin:@typescript-eslint/recommended'],
+  parserOptions: {
+    ecmaVersion: 2018,
+    sourceType: 'module',
+  },
+  ignorePatterns: ['dist/**', 'lib/**', 'examples/installation/**']
+}

+ 6 - 0
.gitignore

@@ -0,0 +1,6 @@
+*.swp
+*.swo
+node_modules
+lib
+temp
+dist/three-loader-3dtiles.js*

+ 7 - 0
.prettierrc

@@ -0,0 +1,7 @@
+{
+  "bracketSpacing": true,
+  "printWidth": 120,
+  "singleQuote": true,
+  "tabWidth": 2, 
+  "trailingComma": "all"
+}

+ 59 - 0
CHANGELOG.md

@@ -0,0 +1,59 @@
+## v1.1
+
+### v1.1.6
+ -  Support a three.js loading manager with a specified preloading tiles count. 
+ 
+### v1.1.4
+ -  Support setting point cloud opacity and material transparency.
+
+### v1.1.12
+ -  Point cloud shader fixes: support 16bit intensity values and a custom point size.
+
+### v1.1.10
+- Detect and reset the tileset orientation when it is deeper in the hierarchy (workaround for DJI Terra exports).
+
+### v1.1.8
+- Added a `GeoTransform` option, supporting Web Mercator. New demo with _OpenStreetMap_.
+
+### v1.1.5
+ - Fixed a bug where tileset geo-transformations were not correctly reset to 0.
+ - Dispose KTX2 and DRACO loaders.
+ - Support the `material` option in point cloud tilesets.
+
+### v1.1.4
+ - Bump to Three.js r137.
+
+### v1.1.3
+ - Bump to Three.js r133 and loaders.gl 3.1.4 ([issue #12](https://github.com/nytimes/three-loader-3dtiles/issues/12)).
+ - Remove `loadersGlGltf`, `RDGLTFLoader.js`: Now supporting glTF parsing only via Three.JS.
+ - Remove `initialTransform`: Now supoorting tileset transformation only via setting the matrix of the root Object3D.
+ - Bug fixes in glTF tranversal and tile transformations ([issue #11](https://github.com/nytimes/three-loader-3dtiles/issues/11)).
+ - Support for tilesets with shifted bounding volumes but no `transformMatrix` property (e.g. from _DJI Terra_).
+
+## v1.0
+
+### v1.0.9
+Orientation bug fix for point cloud elevation shader.
+
+### v1.0.8
+Better disposal of materials and textures.
+
+### v1.0.7
+Set tile transform by the root object3d's transform. Update transforms by default.
+
+### v1.0.6
+- Added UMD build.
+
+### v1.0.3
+
+- Fixes for NPM build.
+- Updates Webpack example.
+
+### v1.0.1
+
+- Name change.
+- Drone CI Integration.
+
+### v1.0.0
+
+- First public release!

+ 6 - 0
CODEOWNERS

@@ -0,0 +1,6 @@
+# Each line is a file pattern followed by one or more owners.
+
+# These owners will be the default owners for everything in the
+# repo. Unless a later match takes precedence, these owners will be
+# requested for review when someone opens a pull request.
+* @Avnerus

File diff suppressed because it is too large
+ 47 - 0
CODE_OF_CONDUCT.md


+ 45 - 0
CONTRIBUTING.md

@@ -0,0 +1,45 @@
+# Introduction
+
+Thank you for considering contributing the 3D Tiles loader.
+
+Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.
+
+There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into the loader itself.
+
+**HINT**: Check the [Roadmap section](https://github.com/nytimes/three-loader-3dtiles#roadmap) in the README, as well as `//TODO` comments within the code hinting at pending tasks.
+
+# Ground Rules
+
+ * Use Typescript and proper typings for all of the code that you write.
+ * Create a test for any new feature.
+ * Write [typedoc comments](https://api-extractor.com/pages/tsdoc/doc_comment_syntax/) for new information.
+ * Ensure cross-browser compatibility for every change. Refer to the `browserslist` field in [package.json](./package.json) for target browsers.
+ * Keep feature versions as small as possible, preferably one new feature per version.
+ * Refer to [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
+ 
+
+# Getting started
+
+Build instructions are available in the main [README](./README.md). To contribute, follow these steps:
+
+1. Create your own fork of the code
+2. Do the changes in your fork (**don't forget to write tests and generate documentation!**).
+
+3. If you like the change and think the project could use it. Send a pull request. Thank you!
+
+# How to report a bug
+If you find a security vulnerability, do NOT open an issue. Please report the vulnerability to the person or team maintaining the code. (refer to [SECURITY.md](./SECURITY.md)).
+
+ When filing an issue, make sure to answer these five questions:
+
+1. What version of Three.js you are using?
+2. What browser and operating system are you using? What graphics card?
+3. What did you do?
+4. What did you expect to see?
+5. What did you see instead?
+
+# How to suggest a feature or enhancement
+
+If you find yourself wishing for a feature that doesn't exist in the 3D tiles loader, you are probably not alone. There are bound to be others out there with similar needs. Open an issue on our issues list on GitHub which describes the feature you would like to see, why you need it, and how it should work.
+
+Thank you for contributing!

+ 9 - 0
LICENSE

@@ -0,0 +1,9 @@
+Copyright (c) 2020 The New York Times Company
+ 
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use this library except in compliance with the License.
+You may obtain a copy of the License at
+ 
+[www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
+ 
+Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

+ 186 - 0
README.md

@@ -0,0 +1,186 @@
+# three-loader-3dtiles  
+![license](https://img.shields.io/badge/License-Apache%202.0-yellow.svg) [![npm version](https://badge.fury.io/js/three-loader-3dtiles.svg)](https://badge.fury.io/js/three-loader-3dtiles)
+[![Build Status](https://cloud.drone.io/api/badges/nytimes/three-loader-3dtiles/status.svg)](https://cloud.drone.io/nytimes/three-loader-3dtiles)
+
+[Demos](#demos) —
+[Usage](#basic-usage) —
+[Roadmap](#roadmap) —
+[Contributing](#contributing) —
+[Docs](#docs) —
+[Alternatives](#alternatives)
+
+This is a [Three.js](https://threejs.org/) loader module for handling [OGC 3D Tiles](https://www.ogc.org/standards/3DTiles), created by [Cesium](https://github.com/CesiumGS/3d-tiles). It currently supports the two main formats:
+
+1. Batched 3D Model (b3dm) - based on glTF.
+2. Point cloud.
+
+Internally, the loader uses the [loaders.gl library](https://github.com/visgl/loaders.gl), which is part of the [vis.gl platform](https://vis.gl/), openly governed by the [Urban Computing Foundation](https://uc.foundation/). Cesium has [worked closely with loaders.gl](https://cesium.com/blog/2019/11/06/cesium-uber/) to create a platform-independent implementation of their 3D Tiles viewer.
+
+Development of this library started at The New York Times R&D as an effort to create a clean bridge between the 3D Tiles specification and the widely used 3D library Three.js. The library helps us deliver massive 3D and Geographical journalism to desktops and mobile readers alike. From **Re**porting to **Tele**porting!
+
+---
+
+## Demos
+* [Photogrammetry exported to 3D Tiles in RealityCapture](https://nytimes.github.io/three-loader-3dtiles/examples/demos/realitycapture)
+* [LiDAR Point Cloud hosted as 3D Tiles in Cesium ION](https://nytimes.github.io/three-loader-3dtiles/examples/demos/cesium)
+* [Map overlay with OpenStreetMap](https://nytimes.github.io/three-loader-3dtiles/examples/demos/map-overlay)
+
+---
+
+## Basic Usage
+Here is a simple example using the `Loader3DTiles` module to view a `tileset.json` containing a 3d tile hierarchy.
+
+```javascript
+import { 
+  Scene, 
+  PerspectiveCamera, 
+  WebGLRenderer, 
+  Clock 
+} from 'three'
+import { Loader3DTiles } from 'three-loader-3dtiles';
+
+const scene = new Scene()
+const camera = new PerspectiveCamera()
+const renderer = new WebGLRenderer()
+const clock = new Clock()
+
+renderer.setSize(window.innerWidth, window.innerHeight)
+document.body.appendChild(renderer.domElement)
+
+let tilesRuntime = null;
+
+async function loadTileset() {
+  const result = await Loader3DTiles.load(
+      url: 'https://<TILESET URL>/tileset.json',
+      renderer: renderer,
+      options: {
+        dracoDecoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/draco',
+        basisTranscoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/basis',
+      }
+  )
+  const {model, runtime} = result
+  tilesRuntime = runtime
+  scene.add(model)
+}
+
+function render() {
+  const dt = clock.getDelta()
+  if (tilesRuntime) {
+    tilesRuntime.update(dt, renderer, camera)
+  }
+  renderer.render(scene, camera)
+  window.requestAnimationFrame(render)
+}
+
+loadTileset()
+render()
+```
+
+---
+
+## Installation
+
+The library supports [three.js](https://threejs.org/) r137 and uses its GLTF, Draco, and KTX2/Basis loaders.
+Refer to the `browserslist` field in [package.json](./package.json) for target browsers.
+
+### 1. ES Module
+Download [dist/three-loader-3dtiles.esm.min.js](dist/three-loader-3dtiles.esm.min.js) and use an `importmap` to import the dependencies. See [here](examples/installation/es-module) for a full example. The [demos](examples/demos) also use this method of installation:
+
+#### **`index.html`**
+  ```html
+  <script async src="https://ga.jspm.io/npm:es-module-shims@1.4.4/dist/es-module-shims.js"></script>
+  <script type="importmap">
+    {
+      "imports": {
+        "three": "https://cdn.skypack.dev/three@0.137.0",
+        "three/examples/jsm/loaders/GLTFLoader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/GLTFLoader",
+        "three/examples/jsm/loaders/DRACOLoader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/DRACOLoader",
+        "three/examples/jsm/loaders/KTX2Loader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/KTX2Loader",
+        "three-loader-3dtiles" : "./three-loader-3dtiles.esm.min.js"
+      }
+    }
+  </script>
+  <script src='index.js' type='module'>
+
+  ```
+#### **`index.js`**
+  ```javascript
+  import { Scene, PerspectiveCamera } from 'three';
+  import { Loader3DTiles } from 'three-loader-3dtiles';
+  ```
+
+### 3. NPM
+If you use a build system such as Webpack / Parcel / Rollup etc, you should also install the library along with three.js from npm:
+```
+npm install -s three three-loader-3dtiles
+```
+The application script would be the same as in the ES Module example (when using `importmap`).
+
+See [here](examples/installation/webpack) for a complete webpack example.
+
+### 4. A-Frame
+Refer to our dedicated A-Frame component: [aframe-loader-3dtiles-component](https://github.com/nytimes/aframe-loader-3dtiles-component).
+
+### 5. React-Three-Fiber
+Refer to [examples/r3f](examples/r3f).
+
+---
+## Roadmap 
+
+### Supporting 3D Tiles Next
+The [3D Tiles Next specification](https://cesium.com/blog/2021/11/10/introducing-3d-tiles-next/) is in the works, with some of the features already supported in loaders.gl. Supporting the new extensions opens up possibilities for new applications.
+
+### Skip-traversal
+Implementing the [Skip traversal mechanism](https://cesium.com/blog/2017/05/05/skipping-levels-of-detail/) could greatly improve performance of b3dm (mesh) tiles, but requires a shader/Stencil buffer-based implementation which manually manges Z-culling. This is a very wanted feature and contributions would be greatly appreciated.
+
+
+## Contributing
+
+Refer to [CONTRIBUTING.MD](./CONTRIBUTING.md) for general contribution instructions.
+
+### Developing
+The library is built using rollup. To run a simple development server type:
+```
+npm run dev
+```
+It is also possible to develop the library while developing loaders.gl. Just clone the source of loaders.gl and run:
+```
+LOADERS_GL_SRC=<path to loaders.gl> npm run dev
+```
+
+### Building
+To build the library run:
+```
+npm run build
+```
+To build the production minified version run:
+```
+npm run build:production
+```
+And to build the API documentation run:
+```
+npm run docs
+```
+
+
+### Tests
+A rudimentary test spec is available at [./test](./test). To run it type:
+```
+npm run test
+```
+
+
+## Docs
+* API documentation is available [here](docs/three-loader-3dtiles.md). 
+* Code for the demos is in [`examples/demos`](examples/demos).
+
+## Alternatives
+To our knowledge, this is the only [loaders.gl](https://github.com/visgl/loaders.gl)-based Three.js library, but there are several implementations of 3D Tiles for Three.js. Notable examples:
+
+ - [NASSA-AMMOS / 3DTilesRendererJS](https://github.com/NASA-AMMOS/3DTilesRendererJS)
+ - [ebeaufay / 3DTilesViewer](https://github.com/ebeaufay/3DTilesViewer)
+ - [iTowns](https://github.com/iTowns/itowns)
+
+ ---
+
+> This repository is maintained by the Research & Development team at The New York Times and is provided as-is for your own use. For more information about R&D at the Times visit [rd.nytimes.com](https://rd.nytimes.com)

+ 7 - 0
SECURITY.md

@@ -0,0 +1,7 @@
+# Security Issues
+
+The New York Times takes security bugs in the NYTimes authored or maintained OSS seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
+
+To report a security issue, email rd@nytimes.com with security bug title as a subject line and you will get a response indicating the next steps in handing your report.
+
+If you find vulnerabilities in software, libraries or modules used by NYTimes authored or maintained OSS but written by third-party, please report the vulnerability to the person or team maintaining the code. 

+ 30 - 0
api-extractor.json

@@ -0,0 +1,30 @@
+
+{
+  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
+  "mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
+  "apiReport": {
+    "enabled": true,
+    "reportFileName": "three-loader-3dtiles.api.md"
+  },
+  "docModel": {
+    "enabled": true,
+    "apiJsonFilePath": "<projectFolder>/temp/three-loader-3dtiles.api.json"
+  },
+  "dtsRollup": {
+    "enabled": true,
+    "untrimmedFilePath": "<projectFolder>/dist/three-loader-3dtiles.d.ts"
+  },
+  "messages": {
+    "compilerMessageReporting": {
+      "default": {
+        "logLevel": "warning"
+      }
+    },
+    "extractorMessageReporting": {
+      "ae-missing-release-tag": {
+        "logLevel": "none",
+        "addToApiReportFile": false
+      }
+    }
+  }
+}

+ 172 - 0
dist/three-loader-3dtiles.d.ts

@@ -0,0 +1,172 @@
+import { LoadingManager } from 'three';
+import { Material } from 'three';
+import { Object3D } from 'three';
+import { Shader } from 'three';
+import { Stats } from '@probe.gl/stats';
+import { Tileset3D } from '@loaders.gl/tiles';
+import { Vector3 } from 'three';
+import { WebGLRenderer } from 'three';
+
+/** Container object for interfacing with lat/long/height coordinates */
+export declare interface GeoCoord {
+    long: number;
+    lat: number;
+    height: number;
+}
+
+export declare enum GeoTransform {
+    Reset = 1,
+    Mercator = 2,
+    WGS84Cartesian = 3
+}
+
+/** 3D Tiles Loader */
+export declare class Loader3DTiles {
+    /**
+    * Loads a tileset of 3D Tiles according to the given {@link LoaderProps}
+    * @public
+    *
+    * @param props - Properties for this load call {@link LoaderProps}.
+    * @returns An object containing the 3D Model to be added to the scene
+    * and a runtime engine to be updated every frame.
+    */
+    static load(props: LoaderProps): Promise<{
+        model: Object3D;
+        runtime: Runtime;
+    }>;
+}
+
+/** Advanced loader options */
+export declare interface LoaderOptions {
+    /** A Cesium ION access token when loading tilesets from Cesium ION. */
+    cesiumIONToken?: string;
+    /** Whether to check if the tileset was transformed, set to `true` if the model is changes position in runtime. Default: `true` */
+    updateTransforms?: boolean;
+    /** Interval in seconds for the traverser to check in an update is needed - Default: `0.1`. */
+    updateInterval?: number;
+    /** Maximum GPU memory (MB) to use for displaying tiles. May go over the limit if tiles within the camera viewport exceed that ammount - Default: `32`. */
+    maximumMemoryUsage?: number;
+    /** determines the distance from tiles in which they are refined, depending on their geometrical size. increase the value to load lower lod tiles from the same view distance (increases performnace) - default: `16`.*/
+    maximumScreenSpaceError?: number;
+    /** 0-1 scale for the LOD quality. A lower value loads tiles from lower LODs (increases performance). */
+    viewDistanceScale?: number;
+    /** Maximum worker thread concurrency when processing DRACO-compressed tiles - Default: `1` worker. */
+    maxConcurrency?: number;
+    /** Whether to use workers when processing DRACO-compressed tiles - Default: `true`. */
+    worker?: boolean;
+    /** Whether to throttle network requests so that tiles got out of the frame before the request launched, would not be requested - Default: `true` */
+    throttleRequests?: boolean;
+    /** When thorttling requests, how many requests can launch simultaneously - Default: `64` */
+    maxRequests?: number;
+    /** _EXPERIMENTAL_: Skip traversal mechanism, not yet supported. Default: `false` */
+    skipLevelOfDetail?: boolean;
+    /** When viewing b3dm (mesh) tiles, which type of {@link Shading} is used - Default: `Shading.FlatTexture` */
+    shading?: Shading;
+    /** Whether to set the material as transparent - Default: `false` */
+    transparent?: boolean;
+    /** Apply a custom material, supports both b3dm (mesh) tiles and Point Cloud tiles - Default: `undefined` **/
+    material?: Material;
+    /** When viewing b3dm (mesh) tiles, a callback to update shader uniforms - Default: `undefined` */
+    shaderCallback?: (shader: Shader, renderer: WebGLRenderer) => void;
+    /** When viewing b3dm (mesh) tiles, show meshes as wireframe - Default: `false`. */
+    wireframe?: boolean;
+    /** When viewing b3dm (mesh) tiles, compute the vertex normals - Default: `false`. */
+    computeNormals?: boolean;
+    /** When viewing Point Cloud tiles, how should the points be colored ({@link PointCloudColoring}) - Default: `PointCloudColoring.White` */
+    pointCloudColoring?: PointCloudColoring;
+    /** Point size for Point Cloud tiles -  Default: `1.0` */
+    pointSize?: number;
+    /** Debug mode: Show tile bounding boxes. Make sure to add the boxes to the scene from {@link Runtime.getTileBoxes} - Default: `false` */
+    debug?: boolean;
+    /** A path to that contains the basis universal library. e.g: `https://unpkg.com/three@0.129.0/examples/js/libs/basis` - Default: `undefined` */
+    basisTranscoderPath?: string;
+    /** A path to that contains the draco library. e.g: `https://unpkg.com/three@0.129.0/examples/js/libs/draco` - Default: `undefined` */
+    dracoDecoderPath?: string;
+    /** How to handle geo transformations: Reset any geo location and place the model at (0,0,0), Apply Mercator projection (for use with ccommon 2D mapping applications, or convert WGS84 long/lat to 3D cartesian coordinates)- Default: `Reset` */
+    geoTransform?: GeoTransform;
+    /** When using a three.js loading manager, do not call `onLoad` until this number of tiles were loaded - Default: `undefined` */
+    preloadTilesCount?: number;
+}
+
+/** Properties for loading a tileset */
+export declare interface LoaderProps {
+    /** The URL of the tileset. For example if using Cesium ION,
+    * it would have the form: `https://assets.cesium.com/[ASSET_ID]/tileset.json`.
+    */
+    url: string;
+    /** Required when using compressed textures (basis universal) for GPU feature detection. */
+    renderer?: WebGLRenderer;
+    /** Advanced options for loading the tileset ({@link LoaderOptions}) */
+    options?: LoaderOptions;
+    /** a loading progress callback function */
+    onProgress?(progress: number | ProgressEvent<EventTarget>, total?: number): void;
+    /** Use a Three JS loading manager */
+    loadingManager?: LoadingManager;
+}
+
+/** Types of coloring used when viewing point cloud tiles */
+export declare enum PointCloudColoring {
+    Intensity = 1,
+    Classification = 2,
+    Elevation = 3,
+    RGB = 4,
+    White = 5
+}
+
+/** Runtime methods that can be used once a tileset is loaded */
+export declare interface Runtime {
+    /**
+    * Get a reference to the loaders.gl {@link https://github.com/visgl/loaders.gl/blob/master/modules/tiles/docs/api-reference/tileset-3d.md | Tileset3D} object.
+    *
+    * @returns {@link https://github.com/visgl/loaders.gl/blob/master/modules/tiles/docs/api-reference/tileset-3d.md | Tileset3D}
+    */
+    getTileset(): Tileset3D;
+    /**
+    * Get a reference to the probe.gl {@link https://github.com/uber-web/probe.gl/blob/master/docs/api-reference/stats/stats.md | Stats} object.
+    * @returns {@link https://github.com/uber-web/probe.gl/blob/master/docs/api-reference/stats/stats.md | Stats}
+    */
+    getStats(): Stats;
+    /** Get the tile bounding boxes group when `debug: true` is set. */
+    getTileBoxes(): Object3D;
+    /** Show or hide the tile bounding boxes. */
+    showTiles(boolean: any): void;
+    /** Enable or disable wireframe mode. */
+    setWireframe(boolean: any): void;
+    /** Enable or disable deubg mode. */
+    setDebug(boolean: any): void;
+    /** Set the current shading mode for b3dm tiles. See {@link Shading}. */
+    setShading(Shading: any): void;
+    /** Set the current view distance scale. See {@link LoaderOptions} */
+    setViewDistanceScale(number: any): void;
+    /** In point clouds wher the points are classified as `Ground`, hide the ground level points - Default: `false`.*/
+    setHideGround(boolean: any): void;
+    /** In point clouds set the type of coloring used. See {@link PointCloudColoring} */
+    setPointCloudColoring(PointCloudColoring: any): void;
+    /** In point clouds when coloring by `PointCloudColoring.Elevation`, set the min/max elevation values - Default: `[0, 400]`. */
+    setElevationRange(range: ReadonlyArray<number>): void;
+    /** In point clouds when coloring by `PointCloudColoring.Intensity`, set the max intensity value -  Default: `1.0` */
+    setMaxIntensity(number: any): void;
+    /** In point clouds when coloring by `PointCloudColoring.Intensity`, set the contrast factor. Default: `1.0`. */
+    setIntensityContrast(number: any): void;
+    /** In point clouds when, set the alpha value. Default: `1.0`. */
+    setPointAlpha(number: any): void;
+    /** When viewing a Geo-located tileset, get the {@link GeoCoord} value from a world-space `Vector3`. */
+    getLatLongHeightFromPosition(Vector3: any): GeoCoord;
+    /** When viewing a Geo-located tileset, world-space `Vector3` from a {@link GeoCoord}. */
+    getPositionFromLatLongHeight(GeoCoord: any): Vector3;
+    /** Get the current camera frustum as mesh planes (for debugging purposes). */
+    getCameraFrustum(Camera: any): Object3D;
+    /** Update the tileset for rendering. */
+    update(number: any, WebGLRenderer: any, Camera: any): void;
+    /** Dispose of all of the tileset's assets in memory. */
+    dispose(): void;
+}
+
+/** Types of shading used when viewing b3dm (mesh) tiles */
+export declare enum Shading {
+    FlatTexture = 1,
+    ShadedTexture = 2,
+    ShadedNoTexture = 3
+}
+
+export { }

File diff suppressed because it is too large
+ 18365 - 0
dist/three-loader-3dtiles.esm.js


File diff suppressed because it is too large
+ 1 - 0
dist/three-loader-3dtiles.esm.js.map


File diff suppressed because it is too large
+ 16 - 0
dist/three-loader-3dtiles.esm.min.js


File diff suppressed because it is too large
+ 1 - 0
dist/three-loader-3dtiles.esm.min.js.map


File diff suppressed because it is too large
+ 16 - 0
dist/three-loader-3dtiles.min.js


File diff suppressed because it is too large
+ 1 - 0
dist/three-loader-3dtiles.min.js.map


+ 11 - 0
dist/tsdoc-metadata.json

@@ -0,0 +1,11 @@
+// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
+// It should be published with your NPM package.  It should not be tracked by Git.
+{
+  "tsdocVersion": "0.12",
+  "toolPackages": [
+    {
+      "packageName": "@microsoft/api-extractor",
+      "packageVersion": "7.17.0"
+    }
+  ]
+}

+ 12 - 0
docs/index.md

@@ -0,0 +1,12 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md)
+
+## API Reference
+
+## Packages
+
+|  Package | Description |
+|  --- | --- |
+|  [three-loader-3dtiles](./three-loader-3dtiles.md) |  |
+

+ 11 - 0
docs/three-loader-3dtiles.geocoord.height.md

@@ -0,0 +1,11 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [GeoCoord](./three-loader-3dtiles.geocoord.md) &gt; [height](./three-loader-3dtiles.geocoord.height.md)
+
+## GeoCoord.height property
+
+<b>Signature:</b>
+
+```typescript
+height: number;
+```

+ 11 - 0
docs/three-loader-3dtiles.geocoord.lat.md

@@ -0,0 +1,11 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [GeoCoord](./three-loader-3dtiles.geocoord.md) &gt; [lat](./three-loader-3dtiles.geocoord.lat.md)
+
+## GeoCoord.lat property
+
+<b>Signature:</b>
+
+```typescript
+lat: number;
+```

+ 11 - 0
docs/three-loader-3dtiles.geocoord.long.md

@@ -0,0 +1,11 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [GeoCoord](./three-loader-3dtiles.geocoord.md) &gt; [long](./three-loader-3dtiles.geocoord.long.md)
+
+## GeoCoord.long property
+
+<b>Signature:</b>
+
+```typescript
+long: number;
+```

+ 22 - 0
docs/three-loader-3dtiles.geocoord.md

@@ -0,0 +1,22 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [GeoCoord](./three-loader-3dtiles.geocoord.md)
+
+## GeoCoord interface
+
+Container object for interfacing with lat/long/height coordinates
+
+<b>Signature:</b>
+
+```typescript
+interface GeoCoord 
+```
+
+## Properties
+
+|  Property | Type | Description |
+|  --- | --- | --- |
+|  [height](./three-loader-3dtiles.geocoord.height.md) | number |  |
+|  [lat](./three-loader-3dtiles.geocoord.lat.md) | number |  |
+|  [long](./three-loader-3dtiles.geocoord.long.md) | number |  |
+

+ 20 - 0
docs/three-loader-3dtiles.geotransform.md

@@ -0,0 +1,20 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [GeoTransform](./three-loader-3dtiles.geotransform.md)
+
+## GeoTransform enum
+
+<b>Signature:</b>
+
+```typescript
+declare enum GeoTransform 
+```
+
+## Enumeration Members
+
+|  Member | Value | Description |
+|  --- | --- | --- |
+|  Mercator | <code>2</code> |  |
+|  Reset | <code>1</code> |  |
+|  WGS84Cartesian | <code>3</code> |  |
+

+ 29 - 0
docs/three-loader-3dtiles.loader3dtiles.load.md

@@ -0,0 +1,29 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Loader3DTiles](./three-loader-3dtiles.loader3dtiles.md) &gt; [load](./three-loader-3dtiles.loader3dtiles.load.md)
+
+## Loader3DTiles.load() method
+
+Loads a tileset of 3D Tiles according to the given [LoaderProps](./three-loader-3dtiles.loaderprops.md)
+
+<b>Signature:</b>
+
+```typescript
+static load(props: LoaderProps): Promise<{
+        model: Object3D;
+        runtime: Runtime;
+    }>;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  props | LoaderProps | Properties for this load call [LoaderProps](./three-loader-3dtiles.loaderprops.md)<!-- -->. |
+
+<b>Returns:</b>
+
+Promise&lt;{ model: Object3D; runtime: Runtime; }&gt;
+
+An object containing the 3D Model to be added to the scene and a runtime engine to be updated every frame.
+

+ 20 - 0
docs/three-loader-3dtiles.loader3dtiles.md

@@ -0,0 +1,20 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Loader3DTiles](./three-loader-3dtiles.loader3dtiles.md)
+
+## Loader3DTiles class
+
+3D Tiles Loader
+
+<b>Signature:</b>
+
+```typescript
+declare class Loader3DTiles 
+```
+
+## Methods
+
+|  Method | Modifiers | Description |
+|  --- | --- | --- |
+|  [load(props)](./three-loader-3dtiles.loader3dtiles.load.md) | <code>static</code> | Loads a tileset of 3D Tiles according to the given [LoaderProps](./three-loader-3dtiles.loaderprops.md) |
+

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.basistranscoderpath.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [basisTranscoderPath](./three-loader-3dtiles.loaderoptions.basistranscoderpath.md)
+
+## LoaderOptions.basisTranscoderPath property
+
+A path to that contains the basis universal library. e.g: `https://unpkg.com/three@0.129.0/examples/js/libs/basis` - Default: `undefined`
+
+<b>Signature:</b>
+
+```typescript
+basisTranscoderPath?: string;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.cesiumiontoken.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [cesiumIONToken](./three-loader-3dtiles.loaderoptions.cesiumiontoken.md)
+
+## LoaderOptions.cesiumIONToken property
+
+A Cesium ION access token when loading tilesets from Cesium ION.
+
+<b>Signature:</b>
+
+```typescript
+cesiumIONToken?: string;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.computenormals.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [computeNormals](./three-loader-3dtiles.loaderoptions.computenormals.md)
+
+## LoaderOptions.computeNormals property
+
+When viewing b3dm (mesh) tiles, compute the vertex normals - Default: `false`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+computeNormals?: boolean;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.debug.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [debug](./three-loader-3dtiles.loaderoptions.debug.md)
+
+## LoaderOptions.debug property
+
+Debug mode: Show tile bounding boxes. Make sure to add the boxes to the scene from [Runtime.getTileBoxes()](./three-loader-3dtiles.runtime.gettileboxes.md) - Default: `false`
+
+<b>Signature:</b>
+
+```typescript
+debug?: boolean;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.dracodecoderpath.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [dracoDecoderPath](./three-loader-3dtiles.loaderoptions.dracodecoderpath.md)
+
+## LoaderOptions.dracoDecoderPath property
+
+A path to that contains the draco library. e.g: `https://unpkg.com/three@0.129.0/examples/js/libs/draco` - Default: `undefined`
+
+<b>Signature:</b>
+
+```typescript
+dracoDecoderPath?: string;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.geotransform.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [geoTransform](./three-loader-3dtiles.loaderoptions.geotransform.md)
+
+## LoaderOptions.geoTransform property
+
+How to handle geo transformations: Reset any geo location and place the model at (0,0,0), Apply Mercator projection (for use with ccommon 2D mapping applications, or convert WGS84 long/lat to 3D cartesian coordinates)- Default: `Reset`
+
+<b>Signature:</b>
+
+```typescript
+geoTransform?: GeoTransform;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.material.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [material](./three-loader-3dtiles.loaderoptions.material.md)
+
+## LoaderOptions.material property
+
+Apply a custom material, supports both b3dm (mesh) tiles and Point Cloud tiles - Default: `undefined` \*
+
+<b>Signature:</b>
+
+```typescript
+material?: Material;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.maxconcurrency.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [maxConcurrency](./three-loader-3dtiles.loaderoptions.maxconcurrency.md)
+
+## LoaderOptions.maxConcurrency property
+
+Maximum worker thread concurrency when processing DRACO-compressed tiles - Default: `1` worker.
+
+<b>Signature:</b>
+
+```typescript
+maxConcurrency?: number;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.maximummemoryusage.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [maximumMemoryUsage](./three-loader-3dtiles.loaderoptions.maximummemoryusage.md)
+
+## LoaderOptions.maximumMemoryUsage property
+
+Maximum GPU memory (MB) to use for displaying tiles. May go over the limit if tiles within the camera viewport exceed that ammount - Default: `32`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+maximumMemoryUsage?: number;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.maximumscreenspaceerror.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [maximumScreenSpaceError](./three-loader-3dtiles.loaderoptions.maximumscreenspaceerror.md)
+
+## LoaderOptions.maximumScreenSpaceError property
+
+determines the distance from tiles in which they are refined, depending on their geometrical size. increase the value to load lower lod tiles from the same view distance (increases performnace) - default: `16`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+maximumScreenSpaceError?: number;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.maxrequests.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [maxRequests](./three-loader-3dtiles.loaderoptions.maxrequests.md)
+
+## LoaderOptions.maxRequests property
+
+When thorttling requests, how many requests can launch simultaneously - Default: `64`
+
+<b>Signature:</b>
+
+```typescript
+maxRequests?: number;
+```

+ 43 - 0
docs/three-loader-3dtiles.loaderoptions.md

@@ -0,0 +1,43 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md)
+
+## LoaderOptions interface
+
+Advanced loader options
+
+<b>Signature:</b>
+
+```typescript
+interface LoaderOptions 
+```
+
+## Properties
+
+|  Property | Type | Description |
+|  --- | --- | --- |
+|  [basisTranscoderPath?](./three-loader-3dtiles.loaderoptions.basistranscoderpath.md) | string | <i>(Optional)</i> A path to that contains the basis universal library. e.g: <code>https://unpkg.com/three@0.129.0/examples/js/libs/basis</code> - Default: <code>undefined</code> |
+|  [cesiumIONToken?](./three-loader-3dtiles.loaderoptions.cesiumiontoken.md) | string | <i>(Optional)</i> A Cesium ION access token when loading tilesets from Cesium ION. |
+|  [computeNormals?](./three-loader-3dtiles.loaderoptions.computenormals.md) | boolean | <i>(Optional)</i> When viewing b3dm (mesh) tiles, compute the vertex normals - Default: <code>false</code>. |
+|  [debug?](./three-loader-3dtiles.loaderoptions.debug.md) | boolean | <i>(Optional)</i> Debug mode: Show tile bounding boxes. Make sure to add the boxes to the scene from [Runtime.getTileBoxes()](./three-loader-3dtiles.runtime.gettileboxes.md) - Default: <code>false</code> |
+|  [dracoDecoderPath?](./three-loader-3dtiles.loaderoptions.dracodecoderpath.md) | string | <i>(Optional)</i> A path to that contains the draco library. e.g: <code>https://unpkg.com/three@0.129.0/examples/js/libs/draco</code> - Default: <code>undefined</code> |
+|  [geoTransform?](./three-loader-3dtiles.loaderoptions.geotransform.md) | GeoTransform | <i>(Optional)</i> How to handle geo transformations: Reset any geo location and place the model at (0,0,0), Apply Mercator projection (for use with ccommon 2D mapping applications, or convert WGS84 long/lat to 3D cartesian coordinates)- Default: <code>Reset</code> |
+|  [material?](./three-loader-3dtiles.loaderoptions.material.md) | Material | <i>(Optional)</i> Apply a custom material, supports both b3dm (mesh) tiles and Point Cloud tiles - Default: <code>undefined</code> \* |
+|  [maxConcurrency?](./three-loader-3dtiles.loaderoptions.maxconcurrency.md) | number | <i>(Optional)</i> Maximum worker thread concurrency when processing DRACO-compressed tiles - Default: <code>1</code> worker. |
+|  [maximumMemoryUsage?](./three-loader-3dtiles.loaderoptions.maximummemoryusage.md) | number | <i>(Optional)</i> Maximum GPU memory (MB) to use for displaying tiles. May go over the limit if tiles within the camera viewport exceed that ammount - Default: <code>32</code>. |
+|  [maximumScreenSpaceError?](./three-loader-3dtiles.loaderoptions.maximumscreenspaceerror.md) | number | <i>(Optional)</i> determines the distance from tiles in which they are refined, depending on their geometrical size. increase the value to load lower lod tiles from the same view distance (increases performnace) - default: <code>16</code>. |
+|  [maxRequests?](./three-loader-3dtiles.loaderoptions.maxrequests.md) | number | <i>(Optional)</i> When thorttling requests, how many requests can launch simultaneously - Default: <code>64</code> |
+|  [pointCloudColoring?](./three-loader-3dtiles.loaderoptions.pointcloudcoloring.md) | PointCloudColoring | <i>(Optional)</i> When viewing Point Cloud tiles, how should the points be colored ([PointCloudColoring](./three-loader-3dtiles.pointcloudcoloring.md)<!-- -->) - Default: <code>PointCloudColoring.White</code> |
+|  [pointSize?](./three-loader-3dtiles.loaderoptions.pointsize.md) | number | <i>(Optional)</i> Point size for Point Cloud tiles - Default: <code>1.0</code> |
+|  [preloadTilesCount?](./three-loader-3dtiles.loaderoptions.preloadtilescount.md) | number | <i>(Optional)</i> When using a three.js loading manager, do not call <code>onLoad</code> until this number of tiles were loaded - Default: <code>undefined</code> |
+|  [shaderCallback?](./three-loader-3dtiles.loaderoptions.shadercallback.md) | (shader: Shader, renderer: WebGLRenderer) =&gt; void | <i>(Optional)</i> When viewing b3dm (mesh) tiles, a callback to update shader uniforms - Default: <code>undefined</code> |
+|  [shading?](./three-loader-3dtiles.loaderoptions.shading.md) | Shading | <i>(Optional)</i> When viewing b3dm (mesh) tiles, which type of [Shading](./three-loader-3dtiles.shading.md) is used - Default: <code>Shading.FlatTexture</code> |
+|  [skipLevelOfDetail?](./three-loader-3dtiles.loaderoptions.skiplevelofdetail.md) | boolean | <i>(Optional)</i> \_EXPERIMENTAL\_: Skip traversal mechanism, not yet supported. Default: <code>false</code> |
+|  [throttleRequests?](./three-loader-3dtiles.loaderoptions.throttlerequests.md) | boolean | <i>(Optional)</i> Whether to throttle network requests so that tiles got out of the frame before the request launched, would not be requested - Default: <code>true</code> |
+|  [transparent?](./three-loader-3dtiles.loaderoptions.transparent.md) | boolean | <i>(Optional)</i> Whether to set the material as transparent - Default: <code>false</code> |
+|  [updateInterval?](./three-loader-3dtiles.loaderoptions.updateinterval.md) | number | <i>(Optional)</i> Interval in seconds for the traverser to check in an update is needed - Default: <code>0.1</code>. |
+|  [updateTransforms?](./three-loader-3dtiles.loaderoptions.updatetransforms.md) | boolean | <i>(Optional)</i> Whether to check if the tileset was transformed, set to <code>true</code> if the model is changes position in runtime. Default: <code>true</code> |
+|  [viewDistanceScale?](./three-loader-3dtiles.loaderoptions.viewdistancescale.md) | number | <i>(Optional)</i> 0-1 scale for the LOD quality. A lower value loads tiles from lower LODs (increases performance). |
+|  [wireframe?](./three-loader-3dtiles.loaderoptions.wireframe.md) | boolean | <i>(Optional)</i> When viewing b3dm (mesh) tiles, show meshes as wireframe - Default: <code>false</code>. |
+|  [worker?](./three-loader-3dtiles.loaderoptions.worker.md) | boolean | <i>(Optional)</i> Whether to use workers when processing DRACO-compressed tiles - Default: <code>true</code>. |
+

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.pointcloudcoloring.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [pointCloudColoring](./three-loader-3dtiles.loaderoptions.pointcloudcoloring.md)
+
+## LoaderOptions.pointCloudColoring property
+
+When viewing Point Cloud tiles, how should the points be colored ([PointCloudColoring](./three-loader-3dtiles.pointcloudcoloring.md)<!-- -->) - Default: `PointCloudColoring.White`
+
+<b>Signature:</b>
+
+```typescript
+pointCloudColoring?: PointCloudColoring;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.pointsize.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [pointSize](./three-loader-3dtiles.loaderoptions.pointsize.md)
+
+## LoaderOptions.pointSize property
+
+Point size for Point Cloud tiles - Default: `1.0`
+
+<b>Signature:</b>
+
+```typescript
+pointSize?: number;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.preloadtilescount.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [preloadTilesCount](./three-loader-3dtiles.loaderoptions.preloadtilescount.md)
+
+## LoaderOptions.preloadTilesCount property
+
+When using a three.js loading manager, do not call `onLoad` until this number of tiles were loaded - Default: `undefined`
+
+<b>Signature:</b>
+
+```typescript
+preloadTilesCount?: number;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.shadercallback.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [shaderCallback](./three-loader-3dtiles.loaderoptions.shadercallback.md)
+
+## LoaderOptions.shaderCallback property
+
+When viewing b3dm (mesh) tiles, a callback to update shader uniforms - Default: `undefined`
+
+<b>Signature:</b>
+
+```typescript
+shaderCallback?: (shader: Shader, renderer: WebGLRenderer) => void;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.shading.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [shading](./three-loader-3dtiles.loaderoptions.shading.md)
+
+## LoaderOptions.shading property
+
+When viewing b3dm (mesh) tiles, which type of [Shading](./three-loader-3dtiles.shading.md) is used - Default: `Shading.FlatTexture`
+
+<b>Signature:</b>
+
+```typescript
+shading?: Shading;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.skiplevelofdetail.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [skipLevelOfDetail](./three-loader-3dtiles.loaderoptions.skiplevelofdetail.md)
+
+## LoaderOptions.skipLevelOfDetail property
+
+\_EXPERIMENTAL\_: Skip traversal mechanism, not yet supported. Default: `false`
+
+<b>Signature:</b>
+
+```typescript
+skipLevelOfDetail?: boolean;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.throttlerequests.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [throttleRequests](./three-loader-3dtiles.loaderoptions.throttlerequests.md)
+
+## LoaderOptions.throttleRequests property
+
+Whether to throttle network requests so that tiles got out of the frame before the request launched, would not be requested - Default: `true`
+
+<b>Signature:</b>
+
+```typescript
+throttleRequests?: boolean;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.transparent.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [transparent](./three-loader-3dtiles.loaderoptions.transparent.md)
+
+## LoaderOptions.transparent property
+
+Whether to set the material as transparent - Default: `false`
+
+<b>Signature:</b>
+
+```typescript
+transparent?: boolean;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.updateinterval.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [updateInterval](./three-loader-3dtiles.loaderoptions.updateinterval.md)
+
+## LoaderOptions.updateInterval property
+
+Interval in seconds for the traverser to check in an update is needed - Default: `0.1`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+updateInterval?: number;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.updatetransforms.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [updateTransforms](./three-loader-3dtiles.loaderoptions.updatetransforms.md)
+
+## LoaderOptions.updateTransforms property
+
+Whether to check if the tileset was transformed, set to `true` if the model is changes position in runtime. Default: `true`
+
+<b>Signature:</b>
+
+```typescript
+updateTransforms?: boolean;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.viewdistancescale.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [viewDistanceScale](./three-loader-3dtiles.loaderoptions.viewdistancescale.md)
+
+## LoaderOptions.viewDistanceScale property
+
+0-1 scale for the LOD quality. A lower value loads tiles from lower LODs (increases performance).
+
+<b>Signature:</b>
+
+```typescript
+viewDistanceScale?: number;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.wireframe.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [wireframe](./three-loader-3dtiles.loaderoptions.wireframe.md)
+
+## LoaderOptions.wireframe property
+
+When viewing b3dm (mesh) tiles, show meshes as wireframe - Default: `false`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+wireframe?: boolean;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderoptions.worker.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) &gt; [worker](./three-loader-3dtiles.loaderoptions.worker.md)
+
+## LoaderOptions.worker property
+
+Whether to use workers when processing DRACO-compressed tiles - Default: `true`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+worker?: boolean;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderprops.loadingmanager.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderProps](./three-loader-3dtiles.loaderprops.md) &gt; [loadingManager](./three-loader-3dtiles.loaderprops.loadingmanager.md)
+
+## LoaderProps.loadingManager property
+
+Use a Three JS loading manager
+
+<b>Signature:</b>
+
+```typescript
+loadingManager?: LoadingManager;
+```

+ 29 - 0
docs/three-loader-3dtiles.loaderprops.md

@@ -0,0 +1,29 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderProps](./three-loader-3dtiles.loaderprops.md)
+
+## LoaderProps interface
+
+Properties for loading a tileset
+
+<b>Signature:</b>
+
+```typescript
+interface LoaderProps 
+```
+
+## Properties
+
+|  Property | Type | Description |
+|  --- | --- | --- |
+|  [loadingManager?](./three-loader-3dtiles.loaderprops.loadingmanager.md) | LoadingManager | <i>(Optional)</i> Use a Three JS loading manager |
+|  [options?](./three-loader-3dtiles.loaderprops.options.md) | LoaderOptions | <i>(Optional)</i> Advanced options for loading the tileset ([LoaderOptions](./three-loader-3dtiles.loaderoptions.md)<!-- -->) |
+|  [renderer?](./three-loader-3dtiles.loaderprops.renderer.md) | WebGLRenderer | <i>(Optional)</i> Required when using compressed textures (basis universal) for GPU feature detection. |
+|  [url](./three-loader-3dtiles.loaderprops.url.md) | string | The URL of the tileset. For example if using Cesium ION, it would have the form: <code>https://assets.cesium.com/[ASSET_ID]/tileset.json</code>. |
+
+## Methods
+
+|  Method | Description |
+|  --- | --- |
+|  [onProgress(progress, total)?](./three-loader-3dtiles.loaderprops.onprogress.md) | <i>(Optional)</i> a loading progress callback function |
+

+ 25 - 0
docs/three-loader-3dtiles.loaderprops.onprogress.md

@@ -0,0 +1,25 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderProps](./three-loader-3dtiles.loaderprops.md) &gt; [onProgress](./three-loader-3dtiles.loaderprops.onprogress.md)
+
+## LoaderProps.onProgress() method
+
+a loading progress callback function
+
+<b>Signature:</b>
+
+```typescript
+onProgress?(progress: number | ProgressEvent<EventTarget>, total?: number): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  progress | number \| ProgressEvent&lt;EventTarget&gt; |  |
+|  total | number |  |
+
+<b>Returns:</b>
+
+void
+

+ 13 - 0
docs/three-loader-3dtiles.loaderprops.options.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderProps](./three-loader-3dtiles.loaderprops.md) &gt; [options](./three-loader-3dtiles.loaderprops.options.md)
+
+## LoaderProps.options property
+
+Advanced options for loading the tileset ([LoaderOptions](./three-loader-3dtiles.loaderoptions.md)<!-- -->)
+
+<b>Signature:</b>
+
+```typescript
+options?: LoaderOptions;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderprops.renderer.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderProps](./three-loader-3dtiles.loaderprops.md) &gt; [renderer](./three-loader-3dtiles.loaderprops.renderer.md)
+
+## LoaderProps.renderer property
+
+Required when using compressed textures (basis universal) for GPU feature detection.
+
+<b>Signature:</b>
+
+```typescript
+renderer?: WebGLRenderer;
+```

+ 13 - 0
docs/three-loader-3dtiles.loaderprops.url.md

@@ -0,0 +1,13 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [LoaderProps](./three-loader-3dtiles.loaderprops.md) &gt; [url](./three-loader-3dtiles.loaderprops.url.md)
+
+## LoaderProps.url property
+
+The URL of the tileset. For example if using Cesium ION, it would have the form: `https://assets.cesium.com/[ASSET_ID]/tileset.json`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+url: string;
+```

+ 29 - 0
docs/three-loader-3dtiles.md

@@ -0,0 +1,29 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md)
+
+## three-loader-3dtiles package
+
+## Classes
+
+|  Class | Description |
+|  --- | --- |
+|  [Loader3DTiles](./three-loader-3dtiles.loader3dtiles.md) | 3D Tiles Loader |
+
+## Enumerations
+
+|  Enumeration | Description |
+|  --- | --- |
+|  [GeoTransform](./three-loader-3dtiles.geotransform.md) |  |
+|  [PointCloudColoring](./three-loader-3dtiles.pointcloudcoloring.md) | Types of coloring used when viewing point cloud tiles |
+|  [Shading](./three-loader-3dtiles.shading.md) | Types of shading used when viewing b3dm (mesh) tiles |
+
+## Interfaces
+
+|  Interface | Description |
+|  --- | --- |
+|  [GeoCoord](./three-loader-3dtiles.geocoord.md) | Container object for interfacing with lat/long/height coordinates |
+|  [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) | Advanced loader options |
+|  [LoaderProps](./three-loader-3dtiles.loaderprops.md) | Properties for loading a tileset |
+|  [Runtime](./three-loader-3dtiles.runtime.md) | Runtime methods that can be used once a tileset is loaded |
+

+ 24 - 0
docs/three-loader-3dtiles.pointcloudcoloring.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [PointCloudColoring](./three-loader-3dtiles.pointcloudcoloring.md)
+
+## PointCloudColoring enum
+
+Types of coloring used when viewing point cloud tiles
+
+<b>Signature:</b>
+
+```typescript
+declare enum PointCloudColoring 
+```
+
+## Enumeration Members
+
+|  Member | Value | Description |
+|  --- | --- | --- |
+|  Classification | <code>2</code> |  |
+|  Elevation | <code>3</code> |  |
+|  Intensity | <code>1</code> |  |
+|  RGB | <code>4</code> |  |
+|  White | <code>5</code> |  |
+

+ 17 - 0
docs/three-loader-3dtiles.runtime.dispose.md

@@ -0,0 +1,17 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [dispose](./three-loader-3dtiles.runtime.dispose.md)
+
+## Runtime.dispose() method
+
+Dispose of all of the tileset's assets in memory.
+
+<b>Signature:</b>
+
+```typescript
+dispose(): void;
+```
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.getcamerafrustum.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [getCameraFrustum](./three-loader-3dtiles.runtime.getcamerafrustum.md)
+
+## Runtime.getCameraFrustum() method
+
+Get the current camera frustum as mesh planes (for debugging purposes).
+
+<b>Signature:</b>
+
+```typescript
+getCameraFrustum(Camera: any): Object3D;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  Camera | any |  |
+
+<b>Returns:</b>
+
+Object3D
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.getlatlongheightfromposition.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [getLatLongHeightFromPosition](./three-loader-3dtiles.runtime.getlatlongheightfromposition.md)
+
+## Runtime.getLatLongHeightFromPosition() method
+
+When viewing a Geo-located tileset, get the [GeoCoord](./three-loader-3dtiles.geocoord.md) value from a world-space `Vector3`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+getLatLongHeightFromPosition(Vector3: any): GeoCoord;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  Vector3 | any |  |
+
+<b>Returns:</b>
+
+GeoCoord
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.getpositionfromlatlongheight.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [getPositionFromLatLongHeight](./three-loader-3dtiles.runtime.getpositionfromlatlongheight.md)
+
+## Runtime.getPositionFromLatLongHeight() method
+
+When viewing a Geo-located tileset, world-space `Vector3` from a [GeoCoord](./three-loader-3dtiles.geocoord.md)<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+getPositionFromLatLongHeight(GeoCoord: any): Vector3;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  GeoCoord | any |  |
+
+<b>Returns:</b>
+
+Vector3
+

+ 19 - 0
docs/three-loader-3dtiles.runtime.getstats.md

@@ -0,0 +1,19 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [getStats](./three-loader-3dtiles.runtime.getstats.md)
+
+## Runtime.getStats() method
+
+Get a reference to the probe.gl [Stats](https://github.com/uber-web/probe.gl/blob/master/docs/api-reference/stats/stats.md) object.
+
+<b>Signature:</b>
+
+```typescript
+getStats(): Stats;
+```
+<b>Returns:</b>
+
+Stats
+
+[Stats](https://github.com/uber-web/probe.gl/blob/master/docs/api-reference/stats/stats.md)
+

+ 17 - 0
docs/three-loader-3dtiles.runtime.gettileboxes.md

@@ -0,0 +1,17 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [getTileBoxes](./three-loader-3dtiles.runtime.gettileboxes.md)
+
+## Runtime.getTileBoxes() method
+
+Get the tile bounding boxes group when `debug: true` is set.
+
+<b>Signature:</b>
+
+```typescript
+getTileBoxes(): Object3D;
+```
+<b>Returns:</b>
+
+Object3D
+

+ 19 - 0
docs/three-loader-3dtiles.runtime.gettileset.md

@@ -0,0 +1,19 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [getTileset](./three-loader-3dtiles.runtime.gettileset.md)
+
+## Runtime.getTileset() method
+
+Get a reference to the loaders.gl [Tileset3D](https://github.com/visgl/loaders.gl/blob/master/modules/tiles/docs/api-reference/tileset-3d.md) object.
+
+<b>Signature:</b>
+
+```typescript
+getTileset(): Tileset3D;
+```
+<b>Returns:</b>
+
+Tileset3D
+
+[Tileset3D](https://github.com/visgl/loaders.gl/blob/master/modules/tiles/docs/api-reference/tileset-3d.md)
+

+ 38 - 0
docs/three-loader-3dtiles.runtime.md

@@ -0,0 +1,38 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md)
+
+## Runtime interface
+
+Runtime methods that can be used once a tileset is loaded
+
+<b>Signature:</b>
+
+```typescript
+interface Runtime 
+```
+
+## Methods
+
+|  Method | Description |
+|  --- | --- |
+|  [dispose()](./three-loader-3dtiles.runtime.dispose.md) | Dispose of all of the tileset's assets in memory. |
+|  [getCameraFrustum(Camera)](./three-loader-3dtiles.runtime.getcamerafrustum.md) | Get the current camera frustum as mesh planes (for debugging purposes). |
+|  [getLatLongHeightFromPosition(Vector3)](./three-loader-3dtiles.runtime.getlatlongheightfromposition.md) | When viewing a Geo-located tileset, get the [GeoCoord](./three-loader-3dtiles.geocoord.md) value from a world-space <code>Vector3</code>. |
+|  [getPositionFromLatLongHeight(GeoCoord)](./three-loader-3dtiles.runtime.getpositionfromlatlongheight.md) | When viewing a Geo-located tileset, world-space <code>Vector3</code> from a [GeoCoord](./three-loader-3dtiles.geocoord.md)<!-- -->. |
+|  [getStats()](./three-loader-3dtiles.runtime.getstats.md) | Get a reference to the probe.gl [Stats](https://github.com/uber-web/probe.gl/blob/master/docs/api-reference/stats/stats.md) object. |
+|  [getTileBoxes()](./three-loader-3dtiles.runtime.gettileboxes.md) | Get the tile bounding boxes group when <code>debug: true</code> is set. |
+|  [getTileset()](./three-loader-3dtiles.runtime.gettileset.md) | Get a reference to the loaders.gl [Tileset3D](https://github.com/visgl/loaders.gl/blob/master/modules/tiles/docs/api-reference/tileset-3d.md) object. |
+|  [setDebug(boolean)](./three-loader-3dtiles.runtime.setdebug.md) | Enable or disable deubg mode. |
+|  [setElevationRange(range)](./three-loader-3dtiles.runtime.setelevationrange.md) | In point clouds when coloring by <code>PointCloudColoring.Elevation</code>, set the min/max elevation values - Default: <code>[0, 400]</code>. |
+|  [setHideGround(boolean)](./three-loader-3dtiles.runtime.sethideground.md) | In point clouds wher the points are classified as <code>Ground</code>, hide the ground level points - Default: <code>false</code>. |
+|  [setIntensityContrast(number)](./three-loader-3dtiles.runtime.setintensitycontrast.md) | In point clouds when coloring by <code>PointCloudColoring.Intensity</code>, set the contrast factor. Default: <code>1.0</code>. |
+|  [setMaxIntensity(number)](./three-loader-3dtiles.runtime.setmaxintensity.md) | In point clouds when coloring by <code>PointCloudColoring.Intensity</code>, set the max intensity value - Default: <code>1.0</code> |
+|  [setPointAlpha(number)](./three-loader-3dtiles.runtime.setpointalpha.md) | In point clouds when, set the alpha value. Default: <code>1.0</code>. |
+|  [setPointCloudColoring(PointCloudColoring)](./three-loader-3dtiles.runtime.setpointcloudcoloring.md) | In point clouds set the type of coloring used. See [PointCloudColoring](./three-loader-3dtiles.pointcloudcoloring.md) |
+|  [setShading(Shading)](./three-loader-3dtiles.runtime.setshading.md) | Set the current shading mode for b3dm tiles. See [Shading](./three-loader-3dtiles.shading.md)<!-- -->. |
+|  [setViewDistanceScale(number)](./three-loader-3dtiles.runtime.setviewdistancescale.md) | Set the current view distance scale. See [LoaderOptions](./three-loader-3dtiles.loaderoptions.md) |
+|  [setWireframe(boolean)](./three-loader-3dtiles.runtime.setwireframe.md) | Enable or disable wireframe mode. |
+|  [showTiles(boolean)](./three-loader-3dtiles.runtime.showtiles.md) | Show or hide the tile bounding boxes. |
+|  [update(number, WebGLRenderer, Camera)](./three-loader-3dtiles.runtime.update.md) | Update the tileset for rendering. |
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setdebug.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setDebug](./three-loader-3dtiles.runtime.setdebug.md)
+
+## Runtime.setDebug() method
+
+Enable or disable deubg mode.
+
+<b>Signature:</b>
+
+```typescript
+setDebug(boolean: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  boolean | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setelevationrange.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setElevationRange](./three-loader-3dtiles.runtime.setelevationrange.md)
+
+## Runtime.setElevationRange() method
+
+In point clouds when coloring by `PointCloudColoring.Elevation`<!-- -->, set the min/max elevation values - Default: `[0, 400]`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+setElevationRange(range: ReadonlyArray<number>): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  range | ReadonlyArray&lt;number&gt; |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.sethideground.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setHideGround](./three-loader-3dtiles.runtime.sethideground.md)
+
+## Runtime.setHideGround() method
+
+In point clouds wher the points are classified as `Ground`<!-- -->, hide the ground level points - Default: `false`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+setHideGround(boolean: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  boolean | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setintensitycontrast.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setIntensityContrast](./three-loader-3dtiles.runtime.setintensitycontrast.md)
+
+## Runtime.setIntensityContrast() method
+
+In point clouds when coloring by `PointCloudColoring.Intensity`<!-- -->, set the contrast factor. Default: `1.0`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+setIntensityContrast(number: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  number | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setmaxintensity.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setMaxIntensity](./three-loader-3dtiles.runtime.setmaxintensity.md)
+
+## Runtime.setMaxIntensity() method
+
+In point clouds when coloring by `PointCloudColoring.Intensity`<!-- -->, set the max intensity value - Default: `1.0`
+
+<b>Signature:</b>
+
+```typescript
+setMaxIntensity(number: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  number | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setpointalpha.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setPointAlpha](./three-loader-3dtiles.runtime.setpointalpha.md)
+
+## Runtime.setPointAlpha() method
+
+In point clouds when, set the alpha value. Default: `1.0`<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+setPointAlpha(number: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  number | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setpointcloudcoloring.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setPointCloudColoring](./three-loader-3dtiles.runtime.setpointcloudcoloring.md)
+
+## Runtime.setPointCloudColoring() method
+
+In point clouds set the type of coloring used. See [PointCloudColoring](./three-loader-3dtiles.pointcloudcoloring.md)
+
+<b>Signature:</b>
+
+```typescript
+setPointCloudColoring(PointCloudColoring: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  PointCloudColoring | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setshading.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setShading](./three-loader-3dtiles.runtime.setshading.md)
+
+## Runtime.setShading() method
+
+Set the current shading mode for b3dm tiles. See [Shading](./three-loader-3dtiles.shading.md)<!-- -->.
+
+<b>Signature:</b>
+
+```typescript
+setShading(Shading: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  Shading | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setviewdistancescale.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setViewDistanceScale](./three-loader-3dtiles.runtime.setviewdistancescale.md)
+
+## Runtime.setViewDistanceScale() method
+
+Set the current view distance scale. See [LoaderOptions](./three-loader-3dtiles.loaderoptions.md)
+
+<b>Signature:</b>
+
+```typescript
+setViewDistanceScale(number: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  number | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.setwireframe.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [setWireframe](./three-loader-3dtiles.runtime.setwireframe.md)
+
+## Runtime.setWireframe() method
+
+Enable or disable wireframe mode.
+
+<b>Signature:</b>
+
+```typescript
+setWireframe(boolean: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  boolean | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 24 - 0
docs/three-loader-3dtiles.runtime.showtiles.md

@@ -0,0 +1,24 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [showTiles](./three-loader-3dtiles.runtime.showtiles.md)
+
+## Runtime.showTiles() method
+
+Show or hide the tile bounding boxes.
+
+<b>Signature:</b>
+
+```typescript
+showTiles(boolean: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  boolean | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 26 - 0
docs/three-loader-3dtiles.runtime.update.md

@@ -0,0 +1,26 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Runtime](./three-loader-3dtiles.runtime.md) &gt; [update](./three-loader-3dtiles.runtime.update.md)
+
+## Runtime.update() method
+
+Update the tileset for rendering.
+
+<b>Signature:</b>
+
+```typescript
+update(number: any, WebGLRenderer: any, Camera: any): void;
+```
+
+## Parameters
+
+|  Parameter | Type | Description |
+|  --- | --- | --- |
+|  number | any |  |
+|  WebGLRenderer | any |  |
+|  Camera | any |  |
+
+<b>Returns:</b>
+
+void
+

+ 22 - 0
docs/three-loader-3dtiles.shading.md

@@ -0,0 +1,22 @@
+<!-- Do not edit this file. It is automatically generated by API Documenter. -->
+
+[Home](./index.md) &gt; [three-loader-3dtiles](./three-loader-3dtiles.md) &gt; [Shading](./three-loader-3dtiles.shading.md)
+
+## Shading enum
+
+Types of shading used when viewing b3dm (mesh) tiles
+
+<b>Signature:</b>
+
+```typescript
+declare enum Shading 
+```
+
+## Enumeration Members
+
+|  Member | Value | Description |
+|  --- | --- | --- |
+|  FlatTexture | <code>1</code> |  |
+|  ShadedNoTexture | <code>3</code> |  |
+|  ShadedTexture | <code>2</code> |  |
+

+ 131 - 0
etc/three-loader-3dtiles.api.md

@@ -0,0 +1,131 @@
+## API Report File for "three-loader-3dtiles"
+
+> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
+
+```ts
+
+import { LoadingManager } from 'three';
+import { Material } from 'three';
+import { Object3D } from 'three';
+import { Shader } from 'three';
+import { Stats } from '@probe.gl/stats';
+import { Tileset3D } from '@loaders.gl/tiles';
+import { Vector3 } from 'three';
+import { WebGLRenderer } from 'three';
+
+// @public
+export interface GeoCoord {
+    // (undocumented)
+    height: number;
+    // (undocumented)
+    lat: number;
+    // (undocumented)
+    long: number;
+}
+
+// @public (undocumented)
+export enum GeoTransform {
+    // (undocumented)
+    Mercator = 2,
+    // (undocumented)
+    Reset = 1,
+    // (undocumented)
+    WGS84Cartesian = 3
+}
+
+// @public
+export class Loader3DTiles {
+    static load(props: LoaderProps): Promise<{
+        model: Object3D;
+        runtime: Runtime;
+    }>;
+}
+
+// @public
+export interface LoaderOptions {
+    basisTranscoderPath?: string;
+    cesiumIONToken?: string;
+    computeNormals?: boolean;
+    debug?: boolean;
+    dracoDecoderPath?: string;
+    geoTransform?: GeoTransform;
+    material?: Material;
+    maxConcurrency?: number;
+    maximumMemoryUsage?: number;
+    maximumScreenSpaceError?: number;
+    maxRequests?: number;
+    pointCloudColoring?: PointCloudColoring;
+    pointSize?: number;
+    preloadTilesCount?: number;
+    shaderCallback?: (shader: Shader, renderer: WebGLRenderer) => void;
+    shading?: Shading;
+    skipLevelOfDetail?: boolean;
+    throttleRequests?: boolean;
+    transparent?: boolean;
+    updateInterval?: number;
+    updateTransforms?: boolean;
+    viewDistanceScale?: number;
+    wireframe?: boolean;
+    worker?: boolean;
+}
+
+// @public
+export interface LoaderProps {
+    loadingManager?: LoadingManager;
+    onProgress?(progress: number | ProgressEvent<EventTarget>, total?: number): void;
+    options?: LoaderOptions;
+    renderer?: WebGLRenderer;
+    url: string;
+}
+
+// @public
+export enum PointCloudColoring {
+    // (undocumented)
+    Classification = 2,
+    // (undocumented)
+    Elevation = 3,
+    // (undocumented)
+    Intensity = 1,
+    // (undocumented)
+    RGB = 4,
+    // (undocumented)
+    White = 5
+}
+
+// @public
+export interface Runtime {
+    dispose(): void;
+    getCameraFrustum(Camera: any): Object3D;
+    getLatLongHeightFromPosition(Vector3: any): GeoCoord;
+    getPositionFromLatLongHeight(GeoCoord: any): Vector3;
+    getStats(): Stats;
+    getTileBoxes(): Object3D;
+    getTileset(): Tileset3D;
+    setDebug(boolean: any): void;
+    setElevationRange(range: ReadonlyArray<number>): void;
+    setHideGround(boolean: any): void;
+    setIntensityContrast(number: any): void;
+    setMaxIntensity(number: any): void;
+    setPointAlpha(number: any): void;
+    setPointCloudColoring(PointCloudColoring: any): void;
+    setShading(Shading: any): void;
+    setViewDistanceScale(number: any): void;
+    setWireframe(boolean: any): void;
+    showTiles(boolean: any): void;
+    update(number: any, WebGLRenderer: any, Camera: any): void;
+}
+
+// @public
+export enum Shading {
+    // (undocumented)
+    FlatTexture = 1,
+    // (undocumented)
+    ShadedNoTexture = 3,
+    // (undocumented)
+    ShadedTexture = 2
+}
+
+
+// (No @packageDocumentation comment for this package)
+
+```

+ 200 - 0
examples/demos/cesium/index.html

@@ -0,0 +1,200 @@
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>3D Tiles Loader: Cesium ION</title>
+  <style>
+    * {
+      margin: 0;
+      padding: 0;
+    }
+    body {
+      width: 100vw;
+      height: 100vh;
+      overflow: hidden;
+    }
+    #canvas-parent {
+      width: 100vw;
+      height: 100vh;
+      touch-action: none;
+    }
+    #guide {
+      position: fixed;
+      top: 0;
+      right: 0;
+      width: 300px;
+      padding: 1rem 2rem;
+      font-family:'Courier New', Courier, monospace;
+      line-height: 1.2;
+      background-color: white;
+      color: black;
+    }
+
+    #guide p {
+      margin-top: 10px;
+    }
+
+    #stats-widget {
+      position: absolute;
+      top: 70px;
+      left: 10px;
+      background-color: rgb(255 255 255 / 83%);
+      padding: 10px;
+      width: 300px;
+      word-break: break-all;
+      visibility: hidden;
+    }
+    #button {
+      position: fixed;
+      bottom: 16px;
+      right: 16px;
+      padding: 12px;
+      border-radius: 50%;
+      margin-bottom: 0px;
+      background-color: #FFF;
+      opacity: .9;
+      z-index: 999;
+      box-shadow: 0 0 4px rgb(0 0 0 / 15%);
+    }
+    @media (max-width:480px) {
+      #guide, #stats-widget { display: none; }
+    }
+  </style>
+</head>
+<body>
+  <div id="canvas-parent"></div>
+  <div id="stats-widget"></div>
+
+  <div id="guide">
+    Use arrow keys, mouse wheel/trackpad, or right click to move around, and left click and drag to turn/rotate the camera.
+    <p>
+      <u>Available URL parameters:</u>
+      <ul>
+        <li><b>assetId</b>: Load another Cesium ion asset id.</li>
+        <li><b>ionToken</b>: Set the Cesium ion access token.</li>
+      </ul>
+    </p>
+  </div>
+
+  <script async src="https://ga.jspm.io/npm:es-module-shims@1.4.4/dist/es-module-shims.js"></script>
+  <script type="importmap">
+    {
+      "imports": {
+        "three": "https://cdn.skypack.dev/three@0.137.0",
+        "three/examples/jsm/loaders/GLTFLoader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/GLTFLoader",
+        "three/examples/jsm/loaders/DRACOLoader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/DRACOLoader",
+        "three/examples/jsm/loaders/KTX2Loader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/KTX2Loader",
+        "three/examples/jsm/controls/OrbitControls": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/controls/OrbitControls",
+        "three/examples/jsm/libs/stats.module.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/libs/stats.module",
+        "@probe.gl/stats" : "https://cdn.skypack.dev/@probe.gl/stats@3.3.1",
+        "@probe.gl/stats-widget" : "https://cdn.skypack.dev/@probe.gl/stats-widget@3.5.0",
+        "three-loader-3dtiles" : "../../../dist/three-loader-3dtiles.esm.js"
+      }
+    }
+  </script>
+  <script type='module'>
+    import { 
+      Scene, 
+      PerspectiveCamera, 
+      WebGLRenderer, 
+      GridHelper, 
+      Clock,
+      Matrix4,
+      Euler
+    } from 'three';
+
+    import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
+
+    import { Loader3DTiles, PointCloudColoring } from 'three-loader-3dtiles';
+
+    import Stats from 'three/examples/jsm/libs/stats.module.js';
+    import StatsWidget from '@probe.gl/stats-widget';
+
+    const ION_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ';
+
+    const canvasParent = document.querySelector('#canvas-parent');
+    const statsParent = document.querySelector('#stats-widget')
+
+    const scene = new Scene();
+    const camera = new PerspectiveCamera(
+      35,
+      1,
+      0.01,
+      10000,
+    );
+    camera.position.set(0, 2000, 0);
+
+    const renderer = new WebGLRenderer();
+    const clock = new Clock()
+    const controls = new OrbitControls( camera, canvasParent);
+    controls.listenToKeyEvents( window );
+
+    canvasParent.appendChild(renderer.domElement);
+
+    const threeJsStats = new Stats();
+    threeJsStats.domElement.style.position = 'absolute';
+    threeJsStats.domElement.style.top = '10px';
+    threeJsStats.domElement.style.left = '10px';
+
+    canvasParent.appendChild( threeJsStats.domElement );
+
+    const queryParams = new URLSearchParams(document.location.search);
+
+    loadTileset();
+
+    let tilesRuntime = undefined;
+    let statsRuntime = undefined;
+
+    async function loadTileset() {
+      const result = await Loader3DTiles.load(
+        {
+          url: `https://assets.cesium.com/${queryParams.get('assetId') ?? 43978}/tileset.json`,
+          renderer: renderer,
+          options: {
+            cesiumIONToken: queryParams.get('ionToken') ?? ION_TOKEN, 
+            dracoDecoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/draco',
+            pointCloudColoring: PointCloudColoring.RGB,
+            maximumScreenSpaceError: 6
+          }
+        }
+      );
+
+      const {model, runtime} = result;
+      model.rotation.set(-Math.PI / 2, 0, 0);
+
+      tilesRuntime = runtime;
+      scene.add(model);
+
+      statsRuntime = new StatsWidget(runtime.getStats(), {container: statsParent });
+      statsParent.style.visibility = 'visible';
+    }
+
+    function render(t) {
+      const dt = clock.getDelta()
+      controls.update();
+      if (tilesRuntime) {
+        tilesRuntime.update(dt, renderer, camera);
+      }
+      if (statsRuntime) {
+        statsRuntime.update();
+      }
+      renderer.render(scene, camera);
+      threeJsStats.update();
+      window.requestAnimationFrame(render);
+
+    }
+
+    onWindowResize();
+
+    function onWindowResize() {
+      renderer.setSize(canvasParent.clientWidth, canvasParent.clientHeight);
+      camera.aspect = canvasParent.clientWidth / canvasParent.clientHeight;
+      camera.updateProjectionMatrix();
+    }
+    window.addEventListener('resize', onWindowResize)
+
+    render();
+  </script>
+  <a id="button" target="_blank" href="https://github.com/nytimes/three-loader-3dtiles/blob/master/examples/demos/cesium/index.html" title="View source code for demo" style=""><img src="../ic_code_black_24dp.svg"></a>
+</body>
+</html>

+ 4 - 0
examples/demos/ic_code_black_24dp.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="#000000">
+    <path fill="none" d="M0 0h24v24H0V0z"/>
+    <path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/>
+</svg>

+ 41 - 0
examples/demos/index.html

@@ -0,0 +1,41 @@
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>3D Tiles Loader | Demos</title>
+  <style>
+    body {
+      padding: 2rem;
+      font-family: 'Courier New', Courier, monospace;
+      width: 100%;
+      max-width: 700px;
+      box-sizing: border-box;
+    }
+    section {
+      margin-bottom: 2rem;
+    }
+    h1 {
+      margin-bottom: 3rem;
+    }
+    h3 {
+      margin-bottom: 0;
+    }
+    p {
+      margin-top: 0.5rem;
+      line-height: 1.3;
+    }
+  </style>
+</head>
+<body>
+  <h1> 3D Tiles Loader | Demos </h1>
+  <section>
+    <h3> <a href="realitycapture/index.html">RealityCapture LOD Export (glTF tiles)</a> </h3>
+  </section>
+  <section>
+    <h3> <a href="cesium/index.html">Cesium ION (Point cloud tiles)</a> </h3>
+  </section>
+  <section>
+    <h3> <a href="map-overlay/index.html">Map overlay</a> </h3>
+  </section>
+</body>
+</html>

+ 1 - 0
examples/demos/map-overlay/README.md

@@ -0,0 +1 @@
+This example uses the `GeoTranform.Mercator` option to overlay a tileset on map. Mapping is providing by _OpenStreetMap_ using the [geo-three](https://github.com/tentone/geo-three/) library.

+ 256 - 0
examples/demos/map-overlay/index.html

@@ -0,0 +1,256 @@
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>3D Tiles Loader: Map overlay</title>
+  <style>
+    * {
+      margin: 0;
+      padding: 0;
+    }
+    body {
+      width: 100vw;
+      height: 100vh;
+      overflow: hidden;
+    }
+    #canvas-parent {
+      width: 100vw;
+      height: 100vh;
+      touch-action: none;
+    }
+    #guide {
+      position: fixed;
+      top: 0;
+      right: 0;
+      width: 300px;
+      padding: 1rem 2rem;
+      font-family:'Courier New', Courier, monospace;
+      line-height: 1.2;
+      background-color: white;
+      color: black;
+    }
+
+    #guide p {
+      margin-top: 10px;
+    }
+
+    #stats-widget {
+      position: absolute;
+      top: 70px;
+      left: 10px;
+      background-color: rgb(255 255 255 / 83%);
+      padding: 10px;
+      width: 300px;
+      word-break: break-all;
+      visibility: hidden;
+    }
+    #button {
+      position: fixed;
+      bottom: 16px;
+      right: 16px;
+      padding: 12px;
+      border-radius: 50%;
+      margin-bottom: 0px;
+      background-color: #FFF;
+      opacity: .9;
+      z-index: 999;
+      box-shadow: 0 0 4px rgb(0 0 0 / 15%);
+    }
+    @media (max-width:480px) {
+      #guide, #stats-widget { display: none; }
+    }
+  </style>
+</head>
+<body>
+  <div id="canvas-parent"></div>
+  <div id="stats-widget"></div>
+
+  <div id="guide">
+    <p>
+    <span id="example-desc">
+      Map overlay provided by <b>OpenStreetMap</b> using the <b>geo-three</b> library.
+    </span>
+    </p>
+    <p>
+    Use arrow keys, mouse wheel/trackpad, or right click to move around, and left click and drag to turn/rotate the camera.
+    </p>
+    <p>
+      <u>Available URL parameters:</u>
+      <ul>
+        <li><b>tilesetUrl</b>: Load another tileset json.</li>
+      </ul>
+    </p>
+  </div>
+
+  <script async src="https://ga.jspm.io/npm:es-module-shims@1.4.4/dist/es-module-shims.js"></script>
+  <script type="importmap">
+    {
+      "imports": {
+        "three": "https://cdn.skypack.dev/three@0.137.0",
+        "three/examples/jsm/loaders/GLTFLoader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/GLTFLoader",
+        "three/examples/jsm/loaders/DRACOLoader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/DRACOLoader",
+        "three/examples/jsm/loaders/KTX2Loader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/KTX2Loader",
+        "three/examples/jsm/controls/OrbitControls": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/controls/OrbitControls",
+        "three/examples/jsm/libs/stats.module.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/libs/stats.module",
+        "@probe.gl/stats" : "https://cdn.skypack.dev/@probe.gl/stats@3.3.1",
+        "@probe.gl/stats-widget" : "https://cdn.skypack.dev/@probe.gl/stats-widget@3.5.0",
+        "three-loader-3dtiles" : "../../../dist/three-loader-3dtiles.esm.js",
+        "geo-three": "https://cdn.skypack.dev/geo-three@0.0.18",
+        "gsap": "https://cdn.skypack.dev/gsap@3.10.4"
+        
+    }
+  }
+  </script>
+  <script type='module'>
+    import { 
+      Scene, 
+      PerspectiveCamera, 
+      WebGLRenderer, 
+      GridHelper, 
+      Clock,
+      Matrix4,
+      Euler,
+      sRGBEncoding
+    } from 'three';
+
+    import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
+
+    import { Loader3DTiles, PointCloudColoring, GeoTransform } from 'three-loader-3dtiles';
+    import { MapView, OpenStreetMapsProvider } from 'geo-three'
+    import { TweenMax } from 'gsap'
+
+    import Stats from 'three/examples/jsm/libs/stats.module.js';
+    import StatsWidget from '@probe.gl/stats-widget';
+
+    const ION_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ';
+
+    const canvasParent = document.querySelector('#canvas-parent');
+    const statsParent = document.querySelector('#stats-widget')
+
+    const scene = new Scene();
+    const camera = new PerspectiveCamera(
+      45,
+      1,
+      100,
+      1000000,
+    );
+
+    const renderer = new WebGLRenderer();
+    renderer.preserveDrawingBuffer  = true;
+
+    const clock = new Clock()
+    const controls = new OrbitControls( camera, canvasParent);
+    controls.listenToKeyEvents( window );
+
+    canvasParent.appendChild(renderer.domElement);
+
+    const threeJsStats = new Stats();
+    threeJsStats.domElement.style.position = 'absolute';
+    threeJsStats.domElement.style.top = '10px';
+    threeJsStats.domElement.style.left = '10px';
+
+    canvasParent.appendChild( threeJsStats.domElement );
+
+    const queryParams = new URLSearchParams(document.location.search);
+    if (queryParams.get('tilesetUrl')) {
+      renderer.outputEncoding = sRGBEncoding;
+    }
+
+    loadTileset();
+
+    let tilesRuntime = undefined;
+    let tilesModel = undefined;
+    let statsRuntime = undefined;
+
+    const provider = new OpenStreetMapsProvider();
+    const map = new MapView(MapView.PLANAR, provider);
+
+    scene.add(map)
+
+    async function loadTileset() {
+      const result = await Loader3DTiles.load(
+        {
+          url:
+            queryParams.get('tilesetUrl') ??
+            "https://assets.cesium.com/43978/tileset.json",
+          renderer: renderer,
+          options: {
+            cesiumIONToken: queryParams.get('tilesetUrl') ? null : ION_TOKEN, 
+            dracoDecoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/draco',
+            basisTranscoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/basis',
+            pointCloudColoring: PointCloudColoring.RGB,
+            maximumScreenSpaceError: queryParams.get('sse') ?? 6,
+            geoTransform: GeoTransform.Mercator
+          }
+        }
+      );
+
+      const {model, runtime} = result;
+
+      tilesRuntime = runtime;
+      tilesModel = model;
+      scene.add(model);
+
+      statsRuntime = new StatsWidget(runtime.getStats(), {container: statsParent });
+      statsParent.style.visibility = 'visible';
+
+      if (!queryParams.get('tilesetUrl')) {
+        // Scaling the scan to align with Maps, and bringing it up above the map
+        model.scale.set(1.27, 1.27, 1.27);
+        model.translateZ(230);
+      }
+      camera.position.copy(model.position);
+      camera.translateY(80000);
+
+      controls.target.copy(model.position);
+      controls.update();
+
+      zoomIn();
+    }
+
+    function zoomIn() {
+      controls.enabled = false
+      TweenMax.to( camera.position, {
+        duration: 5,
+        y: queryParams.get('tilesetUrl') ? 100 : 3000,
+        onUpdate: function() {
+          controls.update();
+        },
+        onComplete: function() {
+          controls.enabled = true;
+          camera.near = 1;
+          camera.updateProjectionMatrix();
+        }
+      } );
+    }
+
+
+    function render(t) {
+      const dt = clock.getDelta()
+      controls.update();
+      if (tilesRuntime) {
+        tilesRuntime.update(dt, renderer, camera);
+      }
+      if (statsRuntime) {
+        statsRuntime.update();
+      }
+      renderer.render(scene, camera);
+      threeJsStats.update();
+      window.requestAnimationFrame(render);
+
+    }
+
+    onWindowResize();
+
+    function onWindowResize() {
+      renderer.setSize(canvasParent.clientWidth, canvasParent.clientHeight);
+      camera.aspect = canvasParent.clientWidth / canvasParent.clientHeight;
+      camera.updateProjectionMatrix();
+    }
+    window.addEventListener('resize', onWindowResize)
+
+    render();
+  </script>
+  <a id="button" target="_blank" href="https://github.com/nytimes/three-loader-3dtiles/blob/master/examples/demos/map-overlay/index.html" title="View source code for demo" style=""><img src="../ic_code_black_24dp.svg"></a>
+</body>
+</html>

+ 106 - 0
examples/demos/realitycapture/index.html

@@ -0,0 +1,106 @@
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>3D Tiles Loader: RealityCapture</title>
+  <style>
+    * {
+      margin: 0;
+      padding: 0;
+    }
+    body {
+      width: 100vw;
+      height: 100vh;
+      overflow: hidden;
+    }
+    #canvas-parent {
+      width: 100vw;
+      height: 100vh;
+      touch-action: none;
+    }
+    #guide {
+      position: fixed;
+      top: 0;
+      right: 0;
+      width: 300px;
+      padding: 1rem 2rem;
+      font-family:'Courier New', Courier, monospace;
+      line-height: 1.2;
+      background-color: white;
+      color: black;
+    }
+
+    #guide p {
+      margin-top: 10px;
+    }
+
+    #stats-widget {
+      position: absolute;
+      top: 70px;
+      left: 10px;
+      background-color: rgb(255 255 255 / 83%);
+      padding: 10px;
+      width: 300px;
+      word-break: break-all;
+      visibility: hidden;
+    }
+    #button {
+      position: fixed;
+      bottom: 16px;
+      right: 16px;
+      padding: 12px;
+      border-radius: 50%;
+      margin-bottom: 0px;
+      background-color: #FFF;
+      opacity: .9;
+      z-index: 999;
+      box-shadow: 0 0 4px rgb(0 0 0 / 15%);
+    }
+    @media (max-width:480px) {
+      #guide, #stats-widget { display: none; }
+    }
+  </style>
+</head>
+<body>
+  <div id='canvas-parent'></div>
+  <div id="stats-widget"></div>
+
+  <div id="guide">
+    <span id="example-desc">
+      <b>Freeman Alley, New York.</b> Captured using iPhone 12 Pro Max and processed via RealityCapture.
+    </span>
+    <p>Use arrow/WASD keys or mouse wheel/trackpad to move around, and click and drag to turn/rotate the camera.</p>
+    <p>
+      <u>Available URL parameters:</u>
+      <ul>
+        <li><b>tilesetUrl</b>: Load another tileset json.</li>
+        <li><b>sse</b>: Change the maximum screen space error.</li>
+      </ul>
+    </p>
+  </div>
+  
+  <script async src="https://ga.jspm.io/npm:es-module-shims@1.4.4/dist/es-module-shims.js"></script>
+
+  <script type="importmap">
+    {
+      "imports": {
+        "three": "https://cdn.skypack.dev/three@0.137.0",
+        "three/examples/jsm/loaders/GLTFLoader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/GLTFLoader",
+        "three/examples/jsm/loaders/DRACOLoader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/DRACOLoader",
+        "three/examples/jsm/loaders/KTX2Loader.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/loaders/KTX2Loader",
+        "three/examples/jsm/libs/stats.module.js": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/libs/stats.module",
+        "three/examples/jsm/controls/OrbitControls": "https://cdn.skypack.dev/three@v0.137.0/examples/jsm/controls/OrbitControls",
+        "@probe.gl/stats" : "https://cdn.skypack.dev/@probe.gl/stats@3.3.1",
+        "@probe.gl/stats-widget" : "https://cdn.skypack.dev/@probe.gl/stats-widget@3.5.0",
+        "three-loader-3dtiles" : "../../../dist/three-loader-3dtiles.esm.js",
+        "gsap": "https://cdn.skypack.dev/gsap@3.6.1",
+        "three-story-controls" : "https://cdn.skypack.dev/three-story-controls@1.0.0"
+      }
+    }
+  </script>
+
+  <script src="js/App.js" type='module'></script>
+
+  <a id="button" target="_blank" href="https://github.com/nytimes/three-loader-3dtiles/blob/master/examples/demos/realitycapture/index.html" title="View source code for demo" style=""><img src="../ic_code_black_24dp.svg"></a>
+</body>
+</html>

+ 147 - 0
examples/demos/realitycapture/js/App.js

@@ -0,0 +1,147 @@
+// import { 
+//     Scene, 
+//     PerspectiveCamera, 
+//     WebGLRenderer, 
+//     Clock,
+//     Matrix4,
+//     Euler,
+//     sRGBEncoding,
+//     Math as ThreeMath
+//   } from 'three';
+
+//   import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
+
+//   import { Loader3DTiles } from 'three-loader-3dtiles';
+//   import { CameraRig, FreeMovementControls } from 'three-story-controls'
+
+//   import Stats from 'three/examples/jsm/libs/stats.module.js';
+//   import StatsWidget from '@probe.gl/stats-widget';
+
+//   const queryParams = new URLSearchParams(document.location.search);
+
+//   const canvasParent = document.querySelector('#canvas-parent');
+//   const statsParent = document.querySelector('#stats-widget')
+
+//   const scene = new Scene();
+//   const camera = new PerspectiveCamera(
+//     35,
+//     1,
+//     0.01,
+//     1000,
+//   );
+
+//   const renderer = new WebGLRenderer();
+//   renderer.outputEncoding = sRGBEncoding;
+
+//   const clock = new Clock()
+//   const rig = new CameraRig(camera, scene)
+  
+//   let controls = undefined;
+
+//   if (queryParams.get('orbit')) {
+//     controls = new OrbitControls( camera, canvasParent);
+//     controls.listenToKeyEvents( document.body );
+//     camera.position.set(0,200,0);
+//     controls.update();
+//   } else {
+//     controls = new FreeMovementControls(rig, {
+//       panDegreeFactor: 2,
+//       wheelScaleFactor: 0.01,
+//       keyboardScaleFactor: 0.015,
+//       keyboardDampFactor: 0
+//     });
+//     controls.enable();
+//   }
+  
+//   canvasParent.appendChild(renderer.domElement);
+
+//   const threeJsStats = new Stats();
+//   threeJsStats.domElement.style.position = 'absolute';
+//   threeJsStats.domElement.style.top = '10px';
+//   threeJsStats.domElement.style.left = '10px';
+
+//   canvasParent.appendChild( threeJsStats.domElement );
+
+//   let tilesRuntime = undefined;
+//   let statsRuntime = undefined;
+
+//   if (queryParams.get('tilesetUrl')) {
+//     document.querySelector('#example-desc').style.display = 'none';
+//   }
+  
+//   async function loadTileset() {
+//     const result = await Loader3DTiles.load(
+//       {
+//         url:
+//           queryParams.get('tilesetUrl') ??
+//          'https://int.nyt.com/data/3dscenes/ONA360/TILESET/0731_FREEMAN_ALLEY_10M_A_36x8K__10K-PN_50P_DB/tileset_tileset.json',
+//         renderer: renderer,
+//         options: {
+//           dracoDecoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/draco',
+//           basisTranscoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/basis',
+//           maximumScreenSpaceError: queryParams.get('sse') ?? 48,
+//         }
+//       }
+//     );
+
+//     const {model, runtime} = result;
+//     model.rotation.set(-Math.PI / 2, 0, Math.PI / 2);
+
+//     if (!queryParams.get('tilesetUrl')) {
+//       model.position.set(-1, 4, -16);
+//     }
+
+//     tilesRuntime = runtime;
+//     scene.add(model);
+
+//     statsRuntime = new StatsWidget(runtime.getStats(), {container: statsParent });
+//     statsParent.style.visibility = 'visible';
+//   }
+
+//   function render(t) {
+//     const dt = clock.getDelta()
+//     controls.update(t);
+//     if (tilesRuntime) {
+//       tilesRuntime.update(dt, renderer, camera);
+//     }
+//     if (statsRuntime) {
+//       statsRuntime.update();
+//     }
+//     renderer.render(scene, camera);
+//     threeJsStats.update();
+//     window.requestAnimationFrame(render);
+
+//   }
+
+//   function onWindowResize() {
+//     renderer.setSize(canvasParent.clientWidth, canvasParent.clientHeight);
+//     camera.aspect = canvasParent.clientWidth / canvasParent.clientHeight;
+//     camera.updateProjectionMatrix();
+//   }
+  
+//   export default class App{
+//     constructor(){
+//     }
+
+//     start(){
+//         loadTileset();
+//         onWindowResize();
+//         window.addEventListener('resize', onWindowResize);
+//         render();
+//     }
+//   }
+
+//   let app = new App();
+//   app.start();
+
+import { mergeScene } from './MergeScene.js';
+
+export default class App{
+  constructor(){
+    mergeScene.start();
+  }
+}
+
+let app = new App();
+
+//https://threejs.org/examples/?q=editor#webgl_geometry_spline_editor

+ 26 - 0
examples/demos/realitycapture/js/Constant.js

@@ -0,0 +1,26 @@
+import {
+    Color,
+    MeshBasicMaterial
+  } from 'three';
+
+const Constant = {
+    //selectColor:new Color(25,0,0),  //0xff0000
+    selectColor:0xff0000,       //鼠标移动选中
+    defaultColor:0xffffff,      //默认情况
+    clickColor:0x0000ff         //点击选中
+};
+
+Constant.tilesMaterial = new MeshBasicMaterial({
+    transparent: false
+})
+
+// Constant.defaultTilesMaterial = new MeshBasicMaterial({
+//     transparent: false
+// })
+
+// Constant.selectTilesMaterial = new MeshBasicMaterial({
+//     transparent: false,
+//     color:Constant.selectColor
+// })
+
+export default Constant

+ 203 - 0
examples/demos/realitycapture/js/Control.js

@@ -0,0 +1,203 @@
+import { 
+    Raycaster,
+    Vector2,
+    Sprite,
+    Math as ThreeMath
+  } from 'three';
+
+import {render} from './Render.js';
+import Constant from './Constant.js';
+import {modelManager} from './ModelManager.js';
+
+export default class Control{
+    constructor(scene,camera){
+        this.scene = scene;
+        this.camera = camera;
+        this.selectModel = null;
+        this.arrowControls = null;
+        this.onDownPosition = null;
+        this.onUpPosition = null;
+        this.dragging = false;
+        this.raycaster = new Raycaster();
+        this.init();
+    }
+
+    init(){
+        this.bindEvents();
+    }
+
+    bindEvents(){
+        document.addEventListener('pointermove', this.onPointerMove.bind(this));
+        document.addEventListener('pointerdown', this.onPointerDown.bind(this));
+        document.addEventListener('pointerup', this.onPointerUp.bind(this));
+    }
+
+    onPointerMove( event ) {
+        let pointer = new Vector2();
+        pointer.x = ( event.clientX / window.innerWidth ) * 2 - 1;
+        pointer.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
+        this.setSelectModel(pointer);
+    }
+
+    onPointerDown( event ) {
+        this.onDownPosition = new Vector2();
+        this.onDownPosition.x = ( event.clientX / window.innerWidth ) * 2 - 1;
+        this.onDownPosition.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
+        this.dragging = true;
+    }
+
+    onPointerUp( event ) {
+        this.onUpPosition = new Vector2();
+        this.onUpPosition.x = ( event.clientX / window.innerWidth ) * 2 - 1;
+        this.onUpPosition.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
+        this.handleClick();
+        this.dragging = false;
+    }
+
+    setSelectModel(pointer){
+        // 通过摄像机和鼠标位置更新射线
+        this.raycaster.setFromCamera( pointer, this.camera );
+        // 计算物体和射线的焦点
+        var intersects = this.raycaster.intersectObjects( this.scene.children );
+        if(intersects && intersects[0])
+        {
+            for(let i=0;i<intersects.length;++i){
+                let model = intersects[i].object;
+                //if(model.type == "TransformControlsPlane"){
+                if(model.type != "Mesh"&&model.type != "Group"&&model.type != 'Point'){  
+                    continue;
+                }
+
+                if(model.parent && model.parent.type === "Group"){
+                    while(model.parent && model.parent.type === "Group"){
+                        model = model.parent;
+                    }
+                }
+    
+                if(modelManager.tilesMeshesUUIDs.indexOf(model.uuid) == -1&&modelManager.meshesUUIDs.indexOf(model.uuid) == -1&&modelManager.pointMeshesUUIDs.indexOf(model.uuid) == -1)
+                {
+                    continue;
+                }
+                if(this.selectModel == null){
+                    this.selectModel = model;
+                    //选中
+                    render.updateSelectModel(this.selectModel,true);
+                }
+                else if(this.selectModel.uuid == model.uuid){
+                    render.updateSelectModel(this.selectModel,true);
+                }
+                else if(this.selectModel.uuid != model.uuid){
+                    //恢复
+                    render.updateSelectModel(this.selectModel,false);
+                    this.selectModel = model;
+                    //选中
+                    render.updateSelectModel(this.selectModel,true);
+                }
+                return ;
+            }
+            
+        }
+        render.updateSelectModel(this.selectModel,false);
+        this.selectModel = null;
+    }
+
+    /*
+    selectObjects(pointer){
+        // 通过摄像机和鼠标位置更新射线
+        this.raycaster.setFromCamera( pointer, this.camera );
+        // 计算物体和射线的焦点
+        var intersects = this.raycaster.intersectObjects( this.scene.children );
+        if(intersects && intersects[0])
+        {
+            let model = intersects[0].object;
+
+            if(model.parent && model.parent.type === "Group"){
+                while(model.parent && model.parent.type === "Group"){
+                    model = model.parent;
+                }
+            }
+
+            Constant.tilesMaterial.color.set( 0xff0000 );
+        }
+        // for ( var i = 0; i < intersects.length; i++ ) {
+        //     intersects[ i ].object.material.color.set( 0xff0000 );
+        // }
+    }
+    */
+
+    onDocumentTouchStart( event ) {
+        //通知 Web 浏览器不要执行与事件关联的默认动作(如果存在这样的动作)
+        event.preventDefault();
+
+        /*
+        html的坐标轴是以左上角为(0,0),右下方向为正方向
+        event.clientX=event.pageX返回当事件被触发时鼠标指针向对于浏览器可见区域的X坐标
+        event.offsetX返回当前事件相对于事件源元素(srcElement)的X坐标
+        event.screenX鼠标相对于用户显示器屏幕左上角的X坐标
+        */
+        event.clientX = event.touches[0].clientX;
+        event.clientY = event.touches[0].clientY;
+        this.onDocumentMouseDown( event );
+    }
+
+    onDocumentMouseDown( event ) {
+        event.preventDefault();
+
+        /*
+        mouse.x = (2 * event.clientX - renderer.domElement.clientWidth) / renderer.domElement.clientWidth
+        mouse.y = (renderer.domElement.clientHeight - 2 * event.clientY) / renderer.domElement.clientHeight
+        鼠标位置在一个边长为2的正方形内部,正方形中心为(0,0)点
+        因此,mouse.x和mouse.y的取值范围是[-1,1]
+        */
+        mouse.x = ( event.clientX / renderer.domElement.clientWidth ) * 2 - 1;
+        mouse.y = - ( event.clientY / renderer.domElement.clientHeight ) * 2 + 1;
+
+        //设置该射线从相机位置发出,射向视场的鼠标位置
+        raycaster.setFromCamera( mouse, camera );
+
+        //判断射线是否穿过这些物体,参数是数组。返回的是与射线相交的结果数组,按距离从近到远有序排列
+        var intersects = raycaster.intersectObjects( objects );
+
+        if ( intersects.length > 0 ) {
+            /*
+            intersects[ 0 ] {
+                distance: double
+                face: Face3
+                faceIndex: int
+                object: Mesh
+                point: Vector3
+                uv: Vector2
+                __proto__: Object
+            }
+            */
+            //intersects[ 0 ].object.material.color.setHex( Math.random() * 0xffffff );
+
+            var particle = new Sprite( particleMaterial );
+            //vector3不能直接用"等号"赋值。只能用copy进行复制。set方法需要分别传递x,y,z三个标量
+            particle.position.copy( intersects[ 0 ].point );
+            particle.scale.x = particle.scale.y = 16;
+            scene.add( particle );
+        }
+
+        // Parse all the faces
+        for ( var i in intersects ) {
+            //这句已经无效了,因为face下面不存在material,face下存在color,但是即使改变color也改变不了面的颜色
+            //intersects[ i ].face.material[ 0 ].color.setHex( Math.random() * 0xffffff | 0x80000000 );
+            intersects[ i ].object.material.color.setHex( Math.random() * Constant.defaultColor );
+        }
+    }
+
+    handleClick(){
+		if ( this.selectModel != null && this.onDownPosition.distanceTo( this.onUpPosition ) === 0 ) {
+            this.arrowControls.attach( this.selectModel );
+            this.arrowControls.setMode('translate');
+            //this.arrowControls.setMode('rotate');
+		}
+        else if(this.selectModel == null && this.onDownPosition.distanceTo( this.onUpPosition ) === 0){
+            this.arrowControls.detach( );
+        }
+
+        this.onDownPosition = new Vector2();
+        this.onUpPosition = new Vector2();
+    }
+}

+ 71 - 0
examples/demos/realitycapture/js/LoaderTileFiles.js

@@ -0,0 +1,71 @@
+
+
+import { 
+  Vector3
+} from 'three';
+import { Loader3DTiles } from 'three-loader-3dtiles';
+import {modelManager} from './ModelManager.js';
+
+export default class LoaderTileFiles{
+    
+    constructor(scene,renderer){
+        this.offset = new Vector3();    //偏移量
+        this.scene = scene;
+        this.tilesRuntime = null;
+        this.renderer = renderer;
+    }
+
+    async loadTilesets(prefix,fileName){
+
+        const tilesetUrl = prefix + fileName;
+        const response = await fetch(tilesetUrl);
+        const data = await response.json();
+
+        if(data.root){
+            if(data.root.content&&data.root.content.url.indexOf('.b3dm')>-1){
+              await this.loadTileset(tilesetUrl);   //直接加载
+            }
+            else if(!data.root.content&&data.root.children){
+                for(let i=0;i<data.root.children.length;++i){
+                    const item = data.root.children[i];
+                    if(item.content.uri){
+                        const url = prefix + item.content.uri.replace('./','');
+                        await this.loadTileset(url);   //直接加载
+                    }
+                    else{
+                        debugger;
+                    }
+                }
+            }
+        }
+    }
+
+    async loadTileset(tilesetUrl) {
+        const result = await Loader3DTiles.load(
+          {
+            url:tilesetUrl,
+              //queryParams.get('tilesetUrl') ??
+              //tilesetUrl ??
+              //'https://testgis.4dage.com/LVBADUI_qp/tileset.json',  
+              //'https://int.nyt.com/data/3dscenes/ONA360/TILESET/0731_FREEMAN_ALLEY_10M_A_36x8K__10K-PN_50P_DB/tileset_tileset.json',
+            renderer: this.renderer,
+            options: {
+              dracoDecoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/draco',
+              basisTranscoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/basis',
+              maximumScreenSpaceError: 48, //queryParams.get('sse') ?? 48,
+            }
+          }
+        );
+    
+        const {model, modelCenter, runtime} = result;
+        model.rotation.set(-Math.PI / 2, 0, Math.PI / 2);
+    
+        // if (!queryParams.get('tilesetUrl')) {
+        //   model.position.set(-1, 4, -16);
+        // }
+        model.position.set(modelCenter.x,modelCenter.y,modelCenter.z);
+        this.tilesRuntime = runtime;
+        this.scene.add(model);
+        modelManager.tilesMeshesUUIDs.push(model.uuid);
+    }
+}

+ 172 - 0
examples/demos/realitycapture/js/MergeScene.js

@@ -0,0 +1,172 @@
+import { 
+    Scene, 
+    PerspectiveCamera, 
+    WebGLRenderer, 
+    Clock,
+    Matrix4,
+    Euler,
+    sRGBEncoding,
+    Math as ThreeMath
+  } from 'three';
+
+import { OrbitControls } from './lib/OrbitControls.js';
+import { TransformControls } from './lib/TransformControls.js';
+import LoaderTileFiles from './LoaderTileFiles.js';
+import { Loader3DTiles } from 'three-loader-3dtiles';
+import { CameraRig, FreeMovementControls } from 'three-story-controls'
+
+import Stats from './lib/stats.module.js';
+import StatsWidget from '@probe.gl/stats-widget';
+import Control from './Control.js';
+import {render} from './Render.js';
+
+const queryParams = new URLSearchParams(document.location.search);
+const canvasParent = document.querySelector('#canvas-parent');
+const statsParent = document.querySelector('#stats-widget')
+
+export default class MergeScene{
+    constructor(){
+        this.scene = null;
+        this.camera = null;
+        this.renderer = null;
+        this.controls = null;
+        this.threeJsStats = null;
+        //this.tilesRuntime = null;
+        this.statsRuntime = null;
+        this.control = null;
+
+        this.init();
+    }
+
+    init(){
+      this.scene = new Scene();
+      this.camera = new PerspectiveCamera(
+        35,
+        1,
+        0.01,
+        1000,
+      );
+      this.renderer = new WebGLRenderer();
+      this.renderer.outputEncoding = sRGBEncoding;
+      this.clock = new Clock()
+      this.rig = new CameraRig(this.camera, this.scene)
+      
+      /*
+      if (queryParams.get('orbit')) {
+          this.controls = new OrbitControls( this.camera, canvasParent);
+          this.controls.listenToKeyEvents( document.body );
+          this.camera.position.set(0,200,0);
+          this.controls.update();
+      } 
+      else {
+          this.controls = new FreeMovementControls(this.rig, {
+            panDegreeFactor: 2,
+            wheelScaleFactor: 0.01,
+            keyboardScaleFactor: 0.015,
+            keyboardDampFactor: 0
+          });
+          this.controls.enable();
+      }
+      */
+      this.controls = new OrbitControls( this.camera, canvasParent);
+      this.controls.listenToKeyEvents( document.body );
+      this.camera.position.set(0,200,0);
+      this.controls.update();
+
+      canvasParent.appendChild(this.renderer.domElement);
+      this.threeJsStats = new Stats();
+      this.threeJsStats.domElement.style.position = 'absolute';
+      this.threeJsStats.domElement.style.top = '10px';
+      this.threeJsStats.domElement.style.left = '10px';
+
+      this.loaderTileFiles = new LoaderTileFiles(this.scene,this.renderer);
+
+      this.control = new Control(this.scene,this.camera);   //鼠标的选中点击等等
+      this.control.arrowControls = new TransformControls( this.camera , canvasParent );
+      this.scene.add( this.control.arrowControls );
+      this.initTransformControls();
+
+      render.init(this.scene);
+
+      canvasParent.appendChild( this.threeJsStats.domElement );
+      if (queryParams.get('tilesetUrl')) {
+          document.querySelector('#example-desc').style.display = 'none';
+      }   
+      window.addEventListener('resize', this.onWindowResize);
+    }
+
+    initTransformControls(){
+      this.control.arrowControls.addEventListener( 'change', this.render.bind(this) );
+      this.control.arrowControls.addEventListener( 'dragging-changed', function ( event ) {
+        this.controls.enabled = ! event.value;
+      }.bind(this) );
+    }
+
+    async loadTileset() {
+      /*
+      const result = await Loader3DTiles.load(
+        {
+          url:
+            queryParams.get('tilesetUrl') ??
+            //'https://testgis.4dage.com/LVBADUI_qp/tileset.json',  
+            'https://int.nyt.com/data/3dscenes/ONA360/TILESET/0731_FREEMAN_ALLEY_10M_A_36x8K__10K-PN_50P_DB/tileset_tileset.json',
+          renderer: this.renderer,
+          options: {
+            dracoDecoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/draco',
+            basisTranscoderPath: 'https://cdn.jsdelivr.net/npm/three@0.137.0/examples/js/libs/basis',
+            maximumScreenSpaceError: queryParams.get('sse') ?? 48,
+          }
+        }
+      );
+  
+      const {model, runtime} = result;
+      model.rotation.set(-Math.PI / 2, 0, Math.PI / 2);
+  
+      if (!queryParams.get('tilesetUrl')) {
+        model.position.set(-1, 4, -16);
+      }
+  
+      this.tilesRuntime = runtime;
+      this.scene.add(model);
+      modelManager.tilesMeshesUUIDs.push(model.uuid);
+  
+      this.statsRuntime = new StatsWidget(runtime.getStats(), {container: statsParent });
+      statsParent.style.visibility = 'visible';
+      */
+      await this.loaderTileFiles.loadTilesets('https://testgis.4dage.com/LVBADUI_qp/','tileset.json');
+      this.statsRuntime = new StatsWidget(this.loaderTileFiles.tilesRuntime.getStats(), {container: statsParent });
+      statsParent.style.visibility = 'visible';
+    }
+    
+    render(t) {
+        const dt = this.clock.getDelta()
+        this.controls.update(t);
+        // if (this.tilesRuntime) {
+        //     this.tilesRuntime.update(dt, this.renderer, this.camera);
+        // }
+        if (this.loaderTileFiles.tilesRuntime) {
+          this.loaderTileFiles.tilesRuntime.update(dt, this.renderer, this.camera);
+      }
+        if (this.statsRuntime) {
+            this.statsRuntime.update();
+        }
+        this.renderer.render(this.scene, this.camera);
+        this.threeJsStats.update();
+        window.requestAnimationFrame(this.render.bind(this));
+    }
+    
+    onWindowResize() {
+        this.renderer.setSize(canvasParent.clientWidth, canvasParent.clientHeight);
+        this.camera.aspect = canvasParent.clientWidth / canvasParent.clientHeight;
+        this.camera.updateProjectionMatrix();
+    }
+
+    start(){
+        this.loadTileset();
+        this.onWindowResize();
+        this.render();
+    }
+}
+
+let mergeScene = new MergeScene();
+export {mergeScene}

+ 12 - 0
examples/demos/realitycapture/js/ModelManager.js

@@ -0,0 +1,12 @@
+export default class ModelManager{
+    constructor(){
+        this.tilesMeshesUUIDs = [];
+        this.meshesUUIDs = [];
+        this.pointMeshesUUIDs = [];
+    }
+
+
+}
+
+let modelManager = new ModelManager();
+export {modelManager}

+ 72 - 0
examples/demos/realitycapture/js/Render.js

@@ -0,0 +1,72 @@
+import { Color } from 'three';
+import Constant from './Constant.js';
+
+export default class Render{
+    constructor(){
+        this.scene = null;
+    }
+
+    init(scene){
+        this.scene = scene;
+    }
+
+    updateSelectModel(model,selected){
+        if(model){
+            if(selected){
+                Constant.tilesMaterial.color.setHex(Constant.selectColor );
+                if(model.type === "Group"){
+                    this.setSelectMaterialForGroup(model);
+                }
+                else if(model.type === "Mesh"){
+                    this.setSelectMaterialForMesh(model);
+                }
+            }
+            else{
+                Constant.tilesMaterial.color.setHex(0xffffff );
+                if(model.type === "Group"){
+                    this.setDefaultMaterialForGroup(model);
+                }
+                else if(model.type === "Mesh"){
+                    this.setDefaultMaterialForMesh(model);
+                }
+            }
+        }
+    }
+
+    setSelectMaterialForGroup(object3d){
+        for(let i=0;i<object3d.children.length;++i){
+            if(object3d.children[i].type === "Group"){
+                this.setSelectMaterialForGroup(object3d.children[i]);
+            }
+            else{
+                this.setSelectMaterialForMesh(object3d.children[i]);
+            }
+        }
+    }
+
+    setSelectMaterialForMesh(mesh){
+        //mesh.material = Constant.selectTilesMaterial.clone();
+        //mesh.currentHex = mesh.material.color.getHex();
+        mesh.material.color.setHex(Constant.selectColor );
+    }
+
+    setDefaultMaterialForGroup(object3d){
+        for(let i=0;i<object3d.children.length;++i){
+            if(object3d.children[i].type === "Group"){
+                this.setDefaultMaterialForGroup(object3d.children[i]);
+            }
+            else{
+                this.setDefaultMaterialForMesh(object3d.children[i]);
+            }
+        }
+    }
+
+    setDefaultMaterialForMesh(mesh){
+        //mesh.material = Constant.defaultTilesMaterial.clone();
+        //mesh.material.color.setHex(mesh.currentHex);
+        mesh.material.color.setHex(Constant.defaultColor );
+    }
+}
+
+let render = new Render();
+export {render}

+ 24 - 0
examples/installation/es-module/index.html

@@ -0,0 +1,24 @@
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>3D Tiles Loader: ES Module installation example</title>
+</head>
+<body>
+  <script async src="https://unpkg.com/es-module-shims@0.11.1/dist/es-module-shims.js"></script>
+  <script type="importmap-shim">
+    {
+      "imports": {
+        "three": "https://cdn.skypack.dev/three@0.129.0",
+        "three/examples/jsm/loaders/GLTFLoader.js": "https://cdn.skypack.dev/three@v0.129.0/examples/jsm/loaders/GLTFLoader",
+        "three/examples/jsm/loaders/DRACOLoader.js": "https://cdn.skypack.dev/three@v0.129.0/examples/jsm/loaders/DRACOLoader",
+        "three/examples/jsm/loaders/KTX2Loader.js": "https://cdn.skypack.dev/three@v0.129.0/examples/jsm/loaders/KTX2Loader",
+        "three/examples/jsm/loaders/OrbitControls": "https://cdn.skypack.dev/three@v0.129.0/examples/jsm/controls/OrbitControls",
+        "three/examples/jsm/libs/stats.module.js": "https://cdn.skypack.dev/three@v0.129.0/examples/jsm/libs/stats.module",
+        "three-loader-3dtiles" : "../../../dist/three-loader-3dtiles.esm.js"
+      }
+    }
+  </script>
+  <script type='module-shim' src='index.js'></script>
+</body>
+</html>

+ 7 - 0
examples/installation/es-module/index.js

@@ -0,0 +1,7 @@
+import { Scene, PerspectiveCamera } from 'three';
+import { Loader3DTiles } from 'three-loader-3dtiles';
+
+const scene = new Scene();
+const camera = new PerspectiveCamera();
+
+console.log(Loader3DTiles);

+ 0 - 0
examples/installation/webpack/README.md


Some files were not shown because too many files changed in this diff