@jdultra/threedtiles 11.1.8 → 11.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/InstancedOGC3DTile.html +3 -0
- package/dist/docs/InstancedTile.html +3 -0
- package/dist/docs/InstancedTileLoader.html +3 -0
- package/dist/docs/OGC3DTile.html +3 -0
- package/dist/docs/OGC3DTile.js.html +1451 -0
- package/dist/docs/OcclusionCullingService.html +3 -0
- package/dist/docs/OcclusionCullingService.js.html +84 -0
- package/dist/docs/TileLoader.html +3 -0
- package/dist/docs/TileLoader.js.html +550 -0
- package/dist/docs/data/search.json +1 -0
- package/dist/docs/fonts/Inconsolata-Regular.ttf +0 -0
- package/dist/docs/fonts/OpenSans-Regular.ttf +0 -0
- package/dist/docs/fonts/WorkSans-Bold.ttf +0 -0
- package/dist/docs/global.html +3 -0
- package/dist/docs/index.html +338 -0
- package/dist/docs/instanced_InstancedOGC3DTile.js.html +106 -0
- package/dist/docs/instanced_InstancedTile.js.html +701 -0
- package/dist/docs/instanced_InstancedTileLoader.js.html +497 -0
- package/dist/docs/scripts/core.js +726 -0
- package/dist/docs/scripts/core.min.js +23 -0
- package/dist/docs/scripts/resize.js +90 -0
- package/dist/docs/scripts/search.js +265 -0
- package/dist/docs/scripts/search.min.js +6 -0
- package/dist/docs/scripts/third-party/Apache-License-2.0.txt +202 -0
- package/dist/docs/scripts/third-party/fuse.js +9 -0
- package/dist/docs/scripts/third-party/hljs-line-num-original.js +369 -0
- package/dist/docs/scripts/third-party/hljs-line-num.js +1 -0
- package/dist/docs/scripts/third-party/hljs-original.js +5171 -0
- package/dist/docs/scripts/third-party/hljs.js +1 -0
- package/dist/docs/scripts/third-party/popper.js +5 -0
- package/dist/docs/scripts/third-party/tippy.js +1 -0
- package/dist/docs/scripts/third-party/tocbot.js +672 -0
- package/dist/docs/scripts/third-party/tocbot.min.js +1 -0
- package/dist/docs/styles/clean-jsdoc-theme-base.css +1159 -0
- package/dist/docs/styles/clean-jsdoc-theme-dark.css +412 -0
- package/dist/docs/styles/clean-jsdoc-theme-light.css +482 -0
- package/dist/docs/styles/clean-jsdoc-theme-scrollbar.css +30 -0
- package/dist/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
- package/dist/docs/styles/clean-jsdoc-theme.min.css +1 -0
- package/dist/entry.d.ts +1 -1
- package/dist/threedtiles.min.js +1 -1
- package/dist/threedtiles.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Source: TileLoader.js</title><!--[if lt IE 9]>
|
|
2
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
3
|
+
<![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="InstancedOGC3DTile.html">InstancedOGC3DTile</a></div><div class="sidebar-section-children"><a href="InstancedTile.html">InstancedTile</a></div><div class="sidebar-section-children"><a href="InstancedTileLoader.html">InstancedTileLoader</a></div><div class="sidebar-section-children"><a href="OGC3DTile.html">OGC3DTile</a></div><div class="sidebar-section-children"><a href="OcclusionCullingService.html">OcclusionCullingService</a></div><div class="sidebar-section-children"><a href="TileLoader.html">TileLoader</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#getOGC3DTilesCopyrightInfo">getOGC3DTilesCopyrightInfo</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section id="source-page" class="source-page"><header><h1 id="title" class="has-anchor">TileLoader.js</h1></header><article><pre class="prettyprint source lang-js"><code>import * as THREE from 'three';
|
|
4
|
+
import { LinkedHashMap } from 'js-utils-z';
|
|
5
|
+
import { B3DMDecoder } from "../decoder/B3DMDecoder";
|
|
6
|
+
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
7
|
+
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
|
|
8
|
+
import { KTX2Loader } from "three/addons/loaders/KTX2Loader";
|
|
9
|
+
import { resolveImplicite } from './implicit/ImplicitTileResolver.js';
|
|
10
|
+
import { MeshoptDecoder } from 'meshoptimizer';
|
|
11
|
+
|
|
12
|
+
let concurrentDownloads = 0;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Tile loader that manages caching and load order.
|
|
17
|
+
* The cache is an LRU cache and is defined by the number of items it can hold.
|
|
18
|
+
* The actual number of cached items might grow beyond max if all items are in use.
|
|
19
|
+
*
|
|
20
|
+
* The load order is designed for optimal perceived loading speed (nearby tiles are refined first).
|
|
21
|
+
* @class
|
|
22
|
+
*/
|
|
23
|
+
class TileLoader {
|
|
24
|
+
/**
|
|
25
|
+
* Creates a tile loader with a maximum number of cached items and callbacks.
|
|
26
|
+
* The only required property is a renderer that will be used to visualize the tiles.
|
|
27
|
+
* The maxCachedItems property is the size of the cache in number of objects, mesh tile and tileset.json files.
|
|
28
|
+
* The mesh and point callbacks will be called for every incoming mesh or points.
|
|
29
|
+
*
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} [options] - Optional configuration object.
|
|
33
|
+
* @param {number} [options.maxCachedItems=100] - the cache size.
|
|
34
|
+
* @param {function} [options.meshCallback = undefined] - A callback to call on newly decoded meshes.
|
|
35
|
+
* @param {function} [options.pointsCallback = undefined] - A callback to call on newly decoded points.
|
|
36
|
+
* @param {sring} [options.proxy = undefined] - An optional proxy that tile requests will be directed too as POST requests with the actual tile url in the body of the request.
|
|
37
|
+
* @param {KTX2Loader} [options.ktx2Loader = undefined] - A KTX2Loader (three/addons)
|
|
38
|
+
* @param {DRACOLoader} [options.dracoLoader = undefined] - A DRACOLoader (three/addons)
|
|
39
|
+
* @param {renderer} [options.renderer = undefined] - optional the renderer, this is required only for on the fly ktx2 support. not needed if you pass a ktx2Loader manually
|
|
40
|
+
*/
|
|
41
|
+
constructor(options) {
|
|
42
|
+
this.zUpToYUpMatrix = new THREE.Matrix4();
|
|
43
|
+
this.zUpToYUpMatrix.set(1, 0, 0, 0,
|
|
44
|
+
0, 0, -1, 0,
|
|
45
|
+
0, 1, 0, 0,
|
|
46
|
+
0, 0, 0, 1);
|
|
47
|
+
this.maxCachedItems = 100;
|
|
48
|
+
this.proxy = options.proxy;
|
|
49
|
+
if (!!options) {
|
|
50
|
+
this.meshCallback = options.meshCallback;
|
|
51
|
+
this.pointsCallback = options.pointsCallback;
|
|
52
|
+
if (options.maxCachedItems) this.maxCachedItems = options.maxCachedItems;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
this.gltfLoader = new GLTFLoader();
|
|
56
|
+
if (!!options && !!options.dracoLoader) {
|
|
57
|
+
this.gltfLoader.setDRACOLoader(options.dracoLoader);
|
|
58
|
+
this.hasDracoLoader = true;
|
|
59
|
+
} else {
|
|
60
|
+
const dracoLoader = new DRACOLoader();
|
|
61
|
+
dracoLoader.setDecoderPath('https://storage.googleapis.com/ogc-3d-tiles/draco/');
|
|
62
|
+
this.gltfLoader.setDRACOLoader(dracoLoader);
|
|
63
|
+
this.gltfLoader.hasDracoLoader = true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!!options && !!options.ktx2Loader) {
|
|
67
|
+
this.gltfLoader.setKTX2Loader(options.ktx2Loader);
|
|
68
|
+
this.hasKTX2Loader = true;
|
|
69
|
+
} else if (!!options && !!options.renderer) {
|
|
70
|
+
const ktx2Loader = new KTX2Loader();
|
|
71
|
+
ktx2Loader.setTranscoderPath('https://storage.googleapis.com/ogc-3d-tiles/basis/').detectSupport(options.renderer);
|
|
72
|
+
this.gltfLoader.setKTX2Loader(ktx2Loader);
|
|
73
|
+
this.gltfLoader.hasKTX2Loader = true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
this.gltfLoader.setMeshoptDecoder(MeshoptDecoder);
|
|
77
|
+
this.hasMeshOptDecoder = true;
|
|
78
|
+
|
|
79
|
+
this.b3dmDecoder = new B3DMDecoder(this.gltfLoader);
|
|
80
|
+
|
|
81
|
+
this.cache = new LinkedHashMap();
|
|
82
|
+
this.register = {};
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
this.ready = [];
|
|
86
|
+
this.downloads = [];
|
|
87
|
+
this.nextReady = [];
|
|
88
|
+
this.nextDownloads = [];
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* To be called in the render loop or at regular intervals.
|
|
95
|
+
* launches tile downloading and loading in an orderly fashion.
|
|
96
|
+
*/
|
|
97
|
+
update() {
|
|
98
|
+
|
|
99
|
+
const self = this;
|
|
100
|
+
if (concurrentDownloads < 8) {
|
|
101
|
+
self._download();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
self._loadBatch();
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
_scheduleDownload(f) {
|
|
110
|
+
this.downloads.unshift(f);
|
|
111
|
+
}
|
|
112
|
+
_download() {
|
|
113
|
+
|
|
114
|
+
if (this.nextDownloads.length == 0) {
|
|
115
|
+
this._getNextDownloads();
|
|
116
|
+
if (this.nextDownloads.length == 0) return;
|
|
117
|
+
}
|
|
118
|
+
while (this.nextDownloads.length > 0) {
|
|
119
|
+
const nextDownload = this.nextDownloads.shift();
|
|
120
|
+
if (!!nextDownload && nextDownload.shouldDoDownload()) {
|
|
121
|
+
nextDownload.doDownload();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
_meshReceived(cache, register, key, distanceFunction, getSiblings, level, uuid) {
|
|
127
|
+
this.ready.unshift([cache, register, key, distanceFunction, getSiblings, level, uuid]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
_loadBatch() {
|
|
131
|
+
if (this.nextReady.length == 0) {
|
|
132
|
+
this._getNextReady();
|
|
133
|
+
}
|
|
134
|
+
while(this.nextReady.length > 0){
|
|
135
|
+
const data = this.nextReady.shift();
|
|
136
|
+
if (!data) return;
|
|
137
|
+
const cache = data[0];
|
|
138
|
+
const register = data[1];
|
|
139
|
+
const key = data[2];
|
|
140
|
+
const mesh = cache.get(key);
|
|
141
|
+
|
|
142
|
+
if (!!mesh && !!register[key]) {
|
|
143
|
+
Object.keys(register[key]).forEach(tile => {
|
|
144
|
+
const callback = register[key][tile];
|
|
145
|
+
if (!!callback) {
|
|
146
|
+
callback(mesh);
|
|
147
|
+
register[key][tile] = null;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
if (this.nextReady.length == 0) {
|
|
152
|
+
this._getNextReady();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return;
|
|
157
|
+
|
|
158
|
+
/* while (this.ready.length > 0) {
|
|
159
|
+
const data = this.ready.shift();
|
|
160
|
+
if (!data) return 0;
|
|
161
|
+
const cache = data[0];
|
|
162
|
+
const register = data[1];
|
|
163
|
+
const key = data[2];
|
|
164
|
+
const mesh = cache.get(key);
|
|
165
|
+
|
|
166
|
+
if (!!mesh && !!register[key]) {
|
|
167
|
+
Object.keys(register[key]).forEach(tile => {
|
|
168
|
+
const callback = register[key][tile];
|
|
169
|
+
if (!!callback) {
|
|
170
|
+
callback(mesh);
|
|
171
|
+
register[key][tile] = null;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return;
|
|
176
|
+
} */
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
_getNextDownloads() {
|
|
180
|
+
let smallestDistance = Number.POSITIVE_INFINITY;
|
|
181
|
+
let closest = -1;
|
|
182
|
+
for (let i = this.downloads.length - 1; i >= 0; i--) {
|
|
183
|
+
/* if (!this.downloads[i].shouldDoDownload()) {
|
|
184
|
+
this.downloads.splice(i, 1);
|
|
185
|
+
continue;
|
|
186
|
+
} */
|
|
187
|
+
if (!this.downloads[i].distanceFunction) { // if no distance function, must be a json, give absolute priority!
|
|
188
|
+
this.nextDownloads.push(this.downloads.splice(i, 1)[0]);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (this.nextDownloads.length > 0) return;
|
|
192
|
+
for (let i = this.downloads.length - 1; i >= 0; i--) {
|
|
193
|
+
const dist = this.downloads[i].distanceFunction();
|
|
194
|
+
if (dist <= smallestDistance) {
|
|
195
|
+
smallestDistance = dist;
|
|
196
|
+
closest = i;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (closest >= 0) {
|
|
200
|
+
const closestItem = this.downloads.splice(closest, 1).pop();
|
|
201
|
+
this.nextDownloads.push(closestItem);
|
|
202
|
+
const siblings = closestItem.getSiblings();
|
|
203
|
+
for (let i = this.downloads.length - 1; i >= 0; i--) {
|
|
204
|
+
if (siblings.map(s => s.uuid).includes(this.downloads[i].uuid)) {
|
|
205
|
+
this.nextDownloads.push(this.downloads.splice(i, 1).pop());
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
_getNextReady() {
|
|
212
|
+
let smallestDistance = Number.POSITIVE_INFINITY;
|
|
213
|
+
let closest = -1;
|
|
214
|
+
for (let i = this.ready.length - 1; i >= 0; i--) {
|
|
215
|
+
|
|
216
|
+
if (!this.ready[i][3]) {// if no distance function, must be a json, give absolute priority!
|
|
217
|
+
this.nextReady.push(this.ready.splice(i, 1)[0]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (this.nextReady.length > 0) return;
|
|
221
|
+
for (let i = this.ready.length - 1; i >= 0; i--) {
|
|
222
|
+
const dist = this.ready[i][3]() * this.ready[i][5];
|
|
223
|
+
if (dist <= smallestDistance) {
|
|
224
|
+
smallestDistance = dist;
|
|
225
|
+
closest = i
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (closest >= 0) {
|
|
229
|
+
const closestItem = this.ready.splice(closest, 1).pop();
|
|
230
|
+
this.nextReady.push(closestItem);
|
|
231
|
+
/* const siblings = closestItem[4]();
|
|
232
|
+
for (let i = this.ready.length - 1; i >= 0; i--) {
|
|
233
|
+
if (siblings.map(s=>s.uuid).includes(this.ready[i][6])) {
|
|
234
|
+
this.nextReady.push(this.ready.splice(i, 1).pop());
|
|
235
|
+
}
|
|
236
|
+
} */
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Schedules a tile content to be downloaded
|
|
243
|
+
*
|
|
244
|
+
* @param {AbortController} abortController
|
|
245
|
+
* @param {string|Number} tileIdentifier
|
|
246
|
+
* @param {string} path
|
|
247
|
+
* @param {Function} callback
|
|
248
|
+
* @param {Function} distanceFunction
|
|
249
|
+
* @param {Function} getSiblings
|
|
250
|
+
* @param {Number} level
|
|
251
|
+
* @param {Boolean} sceneZupToYup
|
|
252
|
+
* @param {Boolean} meshZupToYup
|
|
253
|
+
* @param {Number} geometricError
|
|
254
|
+
*/
|
|
255
|
+
get(abortController, tileIdentifier, path, callback, distanceFunction, getSiblings, level, sceneZupToYup, meshZupToYup, geometricError) {
|
|
256
|
+
const self = this;
|
|
257
|
+
const key = _simplifyPath(path);
|
|
258
|
+
|
|
259
|
+
const realAbortController = new AbortController();
|
|
260
|
+
abortController.signal.addEventListener("abort", () => {
|
|
261
|
+
if (!self.register[key] || Object.keys(self.register[key]).length == 0) {
|
|
262
|
+
realAbortController.abort();
|
|
263
|
+
}
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
if (!path.includes(".b3dm") && !path.includes(".json") && !path.includes(".gltf") && !path.includes(".glb")) {
|
|
267
|
+
console.error("the 3DTiles cache can only be used to load B3DM, gltf and json data");
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (!self.register[key]) {
|
|
271
|
+
self.register[key] = {};
|
|
272
|
+
}
|
|
273
|
+
if (!!self.register[key][tileIdentifier]) {
|
|
274
|
+
console.error(" a tile should only be loaded once");
|
|
275
|
+
}
|
|
276
|
+
self.register[key][tileIdentifier] = callback;
|
|
277
|
+
|
|
278
|
+
const cachedObject = self.cache.get(key);
|
|
279
|
+
if (!!cachedObject) {
|
|
280
|
+
this._meshReceived(self.cache, self.register, key, distanceFunction, getSiblings, level, tileIdentifier);
|
|
281
|
+
} else if (Object.keys(self.register[key]).length == 1) {
|
|
282
|
+
let downloadFunction;
|
|
283
|
+
if (path.includes(".b3dm")) {
|
|
284
|
+
downloadFunction = () => {
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
var fetchFunction;
|
|
288
|
+
if (!self.proxy) {
|
|
289
|
+
fetchFunction = () => {
|
|
290
|
+
return fetch(path, { signal: realAbortController.signal });
|
|
291
|
+
}
|
|
292
|
+
} else {
|
|
293
|
+
fetchFunction = () => {
|
|
294
|
+
return fetch(self.proxy,
|
|
295
|
+
{
|
|
296
|
+
method: 'POST',
|
|
297
|
+
body: path,
|
|
298
|
+
signal: realAbortController.signal
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
concurrentDownloads++;
|
|
304
|
+
fetchFunction().then(result => {
|
|
305
|
+
if (!result.ok) {
|
|
306
|
+
console.error("could not load tile with path : " + path)
|
|
307
|
+
throw new Error(`couldn't load "${path}". Request failed with status ${result.status} : ${result.statusText}`);
|
|
308
|
+
}
|
|
309
|
+
return result.arrayBuffer();
|
|
310
|
+
|
|
311
|
+
}).then(resultArrayBuffer => {
|
|
312
|
+
|
|
313
|
+
return this.b3dmDecoder.parseB3DM(resultArrayBuffer, (mesh) => { self.meshCallback(mesh, geometricError) }, sceneZupToYup, meshZupToYup);
|
|
314
|
+
}).then(mesh => {
|
|
315
|
+
self.cache.put(key, mesh);
|
|
316
|
+
self._checkSize();
|
|
317
|
+
this._meshReceived(self.cache, self.register, key, distanceFunction, getSiblings, level, tileIdentifier);
|
|
318
|
+
}).catch((e) => {
|
|
319
|
+
console.error(e)
|
|
320
|
+
}).finally(() => {
|
|
321
|
+
concurrentDownloads--;
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
}
|
|
325
|
+
} else if (path.includes(".glb") || path.includes(".gltf")) {
|
|
326
|
+
downloadFunction = () => {
|
|
327
|
+
var fetchFunction;
|
|
328
|
+
if (!self.proxy) {
|
|
329
|
+
fetchFunction = () => {
|
|
330
|
+
return fetch(path, { signal: realAbortController.signal });
|
|
331
|
+
}
|
|
332
|
+
} else {
|
|
333
|
+
fetchFunction = () => {
|
|
334
|
+
return fetch(self.proxy,
|
|
335
|
+
{
|
|
336
|
+
method: 'POST',
|
|
337
|
+
body: path,
|
|
338
|
+
signal: realAbortController.signal
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
concurrentDownloads++;
|
|
344
|
+
fetchFunction().then(result => {
|
|
345
|
+
if (!result.ok) {
|
|
346
|
+
console.error("could not load tile with path : " + path)
|
|
347
|
+
throw new Error(`couldn't load "${path}". Request failed with status ${result.status} : ${result.statusText}`);
|
|
348
|
+
}
|
|
349
|
+
return result.arrayBuffer();
|
|
350
|
+
}).then(async arrayBuffer => {
|
|
351
|
+
await _checkLoaderInitialized(this.gltfLoader);
|
|
352
|
+
this.gltfLoader.parse(arrayBuffer, null, gltf => {
|
|
353
|
+
gltf.scene.asset = gltf.asset;
|
|
354
|
+
if (sceneZupToYup) {
|
|
355
|
+
gltf.scene.applyMatrix4(this.zUpToYUpMatrix);
|
|
356
|
+
}
|
|
357
|
+
gltf.scene.traverse((o) => {
|
|
358
|
+
|
|
359
|
+
if (o.isMesh) {
|
|
360
|
+
if (meshZupToYup) {
|
|
361
|
+
o.applyMatrix4(this.zUpToYUpMatrix);
|
|
362
|
+
}
|
|
363
|
+
if (!!self.meshCallback) {
|
|
364
|
+
self.meshCallback(o, geometricError);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (o.isPoints) {
|
|
368
|
+
|
|
369
|
+
if (!!self.pointsCallback) {
|
|
370
|
+
self.pointsCallback(o, geometricError);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
self.cache.put(key, gltf.scene);
|
|
376
|
+
self._checkSize();
|
|
377
|
+
self._meshReceived(self.cache, self.register, key, distanceFunction, getSiblings, level, tileIdentifier);
|
|
378
|
+
});
|
|
379
|
+
}).catch((e) => {
|
|
380
|
+
console.error(e)
|
|
381
|
+
}).finally(() => {
|
|
382
|
+
concurrentDownloads--;
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
}
|
|
387
|
+
} else if (path.includes(".json")) {
|
|
388
|
+
downloadFunction = () => {
|
|
389
|
+
var fetchFunction;
|
|
390
|
+
if (!self.proxy) {
|
|
391
|
+
fetchFunction = () => {
|
|
392
|
+
return fetch(path, { signal: realAbortController.signal });
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
fetchFunction = () => {
|
|
396
|
+
return fetch(self.proxy,
|
|
397
|
+
{
|
|
398
|
+
method: 'POST',
|
|
399
|
+
body: path,
|
|
400
|
+
signal: realAbortController.signal
|
|
401
|
+
}
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
concurrentDownloads++;
|
|
406
|
+
fetchFunction().then(result => {
|
|
407
|
+
if (!result.ok) {
|
|
408
|
+
console.error("could not load tile with path : " + path)
|
|
409
|
+
throw new Error(`couldn't load "${path}". Request failed with status ${result.status} : ${result.statusText}`);
|
|
410
|
+
}
|
|
411
|
+
return result.json();
|
|
412
|
+
|
|
413
|
+
}).then(json => {
|
|
414
|
+
return resolveImplicite(json, path)
|
|
415
|
+
}).then(json => {
|
|
416
|
+
self.cache.put(key, json);
|
|
417
|
+
self._checkSize();
|
|
418
|
+
self._meshReceived(self.cache, self.register, key);
|
|
419
|
+
}).catch((e) => {
|
|
420
|
+
console.error(e)
|
|
421
|
+
}).finally(() => {
|
|
422
|
+
concurrentDownloads--;
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
this._scheduleDownload({
|
|
427
|
+
"shouldDoDownload": () => {
|
|
428
|
+
return !abortController.signal.aborted && !!self.register[key] && Object.keys(self.register[key]).length > 0;
|
|
429
|
+
},
|
|
430
|
+
"doDownload": downloadFunction,
|
|
431
|
+
"distanceFunction": distanceFunction,
|
|
432
|
+
"getSiblings": getSiblings,
|
|
433
|
+
"level": level,
|
|
434
|
+
"uuid": tileIdentifier
|
|
435
|
+
})
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Invalidates all the unused cached tiles.
|
|
442
|
+
*/
|
|
443
|
+
clear(){
|
|
444
|
+
const temp = this.maxCachedItems;
|
|
445
|
+
this.maxCachedItems = 0;
|
|
446
|
+
this._checkSize();
|
|
447
|
+
this.maxCachedItems = temp;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* unregisters a tile content for a specific tile, removing it from the cache if no other tile is using the same content.
|
|
452
|
+
* @param {string} path the content path/url
|
|
453
|
+
* @param {string|Number} tileIdentifier the tile ID
|
|
454
|
+
*/
|
|
455
|
+
invalidate(path, tileIdentifier) {
|
|
456
|
+
const key = _simplifyPath(path);
|
|
457
|
+
if (!!this.register[key]) {
|
|
458
|
+
delete this.register[key][tileIdentifier];
|
|
459
|
+
|
|
460
|
+
//this.register[key][tileIdentifier] = undefined;
|
|
461
|
+
//this._checkSize();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
_checkSize() {
|
|
466
|
+
const self = this;
|
|
467
|
+
|
|
468
|
+
let i = 0;
|
|
469
|
+
|
|
470
|
+
while (self.cache.size() > self.maxCachedItems && i < self.cache.size()) {
|
|
471
|
+
i++;
|
|
472
|
+
const entry = self.cache.head();
|
|
473
|
+
const reg = self.register[entry.key];
|
|
474
|
+
if (!!reg) {
|
|
475
|
+
if (Object.keys(reg).length > 0) {
|
|
476
|
+
self.cache.remove(entry.key);
|
|
477
|
+
self.cache.put(entry.key, entry.value);
|
|
478
|
+
} else {
|
|
479
|
+
self.cache.remove(entry.key);
|
|
480
|
+
delete self.register[entry.key];
|
|
481
|
+
//self.register[entry.key] = undefined;
|
|
482
|
+
entry.value.traverse((o) => {
|
|
483
|
+
|
|
484
|
+
if (o.material) {
|
|
485
|
+
// dispose materials
|
|
486
|
+
if (o.material.length) {
|
|
487
|
+
for (let i = 0; i < o.material.length; ++i) {
|
|
488
|
+
o.material[i].dispose();
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
o.material.dispose()
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if (o.geometry) {
|
|
496
|
+
// dispose geometry
|
|
497
|
+
o.geometry.dispose();
|
|
498
|
+
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
async function _checkLoaderInitialized(loader) {
|
|
511
|
+
const self = this;
|
|
512
|
+
return new Promise((resolve) => {
|
|
513
|
+
const interval = setInterval(() => {
|
|
514
|
+
if ((!loader.hasDracoLoader || loader.dracoLoader) && (!loader.hasKTX2Loader || loader.ktx2Loader)) {
|
|
515
|
+
clearInterval(interval);
|
|
516
|
+
resolve();
|
|
517
|
+
}
|
|
518
|
+
}, 10); // check every 100ms
|
|
519
|
+
});
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
function _simplifyPath(main_path) {
|
|
523
|
+
|
|
524
|
+
var parts = main_path.split('/'),
|
|
525
|
+
new_path = [],
|
|
526
|
+
length = 0;
|
|
527
|
+
for (var i = 0; i < parts.length; i++) {
|
|
528
|
+
var part = parts[i];
|
|
529
|
+
if (part === '.' || part === '' || part === '..') {
|
|
530
|
+
if (part === '..' && length > 0) {
|
|
531
|
+
length--;
|
|
532
|
+
}
|
|
533
|
+
continue;
|
|
534
|
+
}
|
|
535
|
+
new_path[length++] = part;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
if (length === 0) {
|
|
539
|
+
return '/';
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
var result = '';
|
|
543
|
+
for (var i = 0; i < length; i++) {
|
|
544
|
+
result += '/' + new_path[i];
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
return result;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export { TileLoader };</code></pre></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="InstancedOGC3DTile.html">InstancedOGC3DTile</a></div><div class="sidebar-section-children"><a href="InstancedTile.html">InstancedTile</a></div><div class="sidebar-section-children"><a href="InstancedTileLoader.html">InstancedTileLoader</a></div><div class="sidebar-section-children"><a href="OGC3DTile.html">OGC3DTile</a></div><div class="sidebar-section-children"><a href="OcclusionCullingService.html">OcclusionCullingService</a></div><div class="sidebar-section-children"><a href="TileLoader.html">TileLoader</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#getOGC3DTilesCopyrightInfo">getOGC3DTilesCopyrightInfo</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"list":[{"title":"InstancedOGC3DTile","link":"<a href=\"InstancedOGC3DTile.html\">InstancedOGC3DTile</a>"},{"title":"InstancedOGC3DTile#setCanvasSize","link":"<a href=\"InstancedOGC3DTile.html#setCanvasSize\">setCanvasSize</a>","description":"Call this to specify the canvas width/height when it changes (used to compute tiles geometric error that controls tile refinement).\rIt's unnecessary to call this when the {@link OGC3DTile} is instantiated with the renderer."},{"title":"InstancedOGC3DTile#setGeometricErrorMultiplier","link":"<a href=\"InstancedOGC3DTile.html#setGeometricErrorMultiplier\">setGeometricErrorMultiplier</a>","description":"Set the Geometric Error Multiplier for the tileset.\rthe {@param geometricErrorMultiplier} can be a number between 1 and infinity.\rA {@param geometricErrorMultiplier} of 1 (default) corresponds to a max ScreenSpace error (MSE) of 16. \rA lower {@param geometricErrorMultiplier} loads less detail (higher MSE) and a higher {@param geometricErrorMultiplier} loads more detail (lower MSE)"},{"title":"InstancedOGC3DTile#update","link":"<a href=\"InstancedOGC3DTile.html#update\">update</a>","description":"To be called in the render loop."},{"title":"InstancedTile","link":"<a href=\"InstancedTile.html\">InstancedTile</a>"},{"title":"InstancedTile#isReady","link":"<a href=\"InstancedTile.html#isReady\">isReady</a>","description":"Node is ready if it is outside frustum, if it was drawn at least once or if all it's children are ready"},{"title":"InstancedTileLoader","link":"<a href=\"InstancedTileLoader.html\">InstancedTileLoader</a>","description":"Creates a tile loader with a maximum number of cached items and callbacks.\rThe only required property is a renderer that will be used to visualize the tiles.\rThe maxCachedItems property is the size of the cache in number of objects, mesh tile and tileset.json files.\rThe mesh and point callbacks will be called for every incoming mesh or points."},{"title":"InstancedTileLoader#get","link":"<a href=\"InstancedTileLoader.html#get\">get</a>","description":"Schedules a tile content to be downloaded"},{"title":"InstancedTileLoader#update","link":"<a href=\"InstancedTileLoader.html#update\">update</a>","description":"To be called in the render loop or at regular intervals.\rlaunches tile downloading and loading in an orderly fashion."},{"title":"OGC3DTile","link":"<a href=\"OGC3DTile.html\">OGC3DTile</a>"},{"title":"OGC3DTile#_isReady","link":"<a href=\"OGC3DTile.html#_isReady\">_isReady</a>","description":"Node is ready if it is outside frustum, if it was drawn at least once or if all it's children are ready"},{"title":"OGC3DTile#dispose","link":"<a href=\"OGC3DTile.html#dispose\">dispose</a>","description":"Disposes of all the resources used by the tileset."},{"title":"OGC3DTile#setCanvasSize","link":"<a href=\"OGC3DTile.html#setCanvasSize\">setCanvasSize</a>","description":"Call this to specify the canvas width/height when it changes (used to compute tiles geometric error that controls tile refinement).\rIt's unnecessary to call this when the {@link OGC3DTile} is instantiated with the renderer."},{"title":"OGC3DTile#setDistanceBias","link":"<a href=\"OGC3DTile.html#setDistanceBias\">setDistanceBias</a>","description":"Set the Distance Bias for the tileset.\rthe {@param distanceBias} can be a number between 0 and infinity.\rA {@param distanceBias} is applied as an exponent to camera-to-tile distance. \rthe {@link geometricErrorMultiplier} should be used to balance out the amount of detail loaded"},{"title":"OGC3DTile#setGeometricErrorMultiplier","link":"<a href=\"OGC3DTile.html#setGeometricErrorMultiplier\">setGeometricErrorMultiplier</a>","description":"Set the Geometric Error Multiplier for the tileset.\rthe {@param geometricErrorMultiplier} can be a number between 1 and infinity.\rA {@param geometricErrorMultiplier} of 1 (default) corresponds to a max ScreenSpace error (MSE) of 16. \rA lower {@param geometricErrorMultiplier} loads less detail (higher MSE) and a higher {@param geometricErrorMultiplier} loads more detail (lower MSE)"},{"title":"OGC3DTile#update","link":"<a href=\"OGC3DTile.html#update\">update</a>","description":"To be called in the render loop."},{"title":"OGC3DTile#updateMatrices","link":"<a href=\"OGC3DTile.html#updateMatrices\">updateMatrices</a>","description":"Manually updates all the matrices of the tileset. \rTo be called after transforming a {@link OGC3DTile tileset} instantiated with the \"static\" option"},{"title":"OcclusionCullingService","link":"<a href=\"OcclusionCullingService.html\">OcclusionCullingService</a>","description":"Creates an Occlusion Culling service to be passed to {@link OGC3DTile} Tilesets"},{"title":"OcclusionCullingService#hasID","link":"<a href=\"OcclusionCullingService.html#hasID\">hasID</a>","description":"check if the given tile ID was visible in the last rendered frame."},{"title":"OcclusionCullingService#setSide","link":"<a href=\"OcclusionCullingService.html#setSide\">setSide</a>"},{"title":"OcclusionCullingService#update","link":"<a href=\"OcclusionCullingService.html#update\">update</a>","description":"Update function to be called on every frame in the render loop."},{"title":"TileLoader","link":"<a href=\"TileLoader.html\">TileLoader</a>","description":"Creates a tile loader with a maximum number of cached items and callbacks.\rThe only required property is a renderer that will be used to visualize the tiles.\rThe maxCachedItems property is the size of the cache in number of objects, mesh tile and tileset.json files.\rThe mesh and point callbacks will be called for every incoming mesh or points."},{"title":"TileLoader#clear","link":"<a href=\"TileLoader.html#clear\">clear</a>","description":"Invalidates all the unused cached tiles."},{"title":"TileLoader#get","link":"<a href=\"TileLoader.html#get\">get</a>","description":"Schedules a tile content to be downloaded"},{"title":"TileLoader#invalidate","link":"<a href=\"TileLoader.html#invalidate\">invalidate</a>","description":"unregisters a tile content for a specific tile, removing it from the cache if no other tile is using the same content."},{"title":"TileLoader#update","link":"<a href=\"TileLoader.html#update\">update</a>","description":"To be called in the render loop or at regular intervals.\rlaunches tile downloading and loading in an orderly fashion."},{"title":"getOGC3DTilesCopyrightInfo","link":"<a href=\"global.html#getOGC3DTilesCopyrightInfo\">getOGC3DTilesCopyrightInfo</a>"}]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Global</title><!--[if lt IE 9]>
|
|
2
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
3
|
+
<![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="InstancedOGC3DTile.html">InstancedOGC3DTile</a></div><div class="sidebar-section-children"><a href="InstancedTile.html">InstancedTile</a></div><div class="sidebar-section-children"><a href="InstancedTileLoader.html">InstancedTileLoader</a></div><div class="sidebar-section-children"><a href="OGC3DTile.html">OGC3DTile</a></div><div class="sidebar-section-children"><a href="OcclusionCullingService.html">OcclusionCullingService</a></div><div class="sidebar-section-children"><a href="TileLoader.html">TileLoader</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#getOGC3DTilesCopyrightInfo">getOGC3DTilesCopyrightInfo</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section><article><div class="container-overview"></div><h2 id="methods" class="subsection-title has-anchor">Methods</h2><h3 class="name has-anchor" id="getOGC3DTilesCopyrightInfo"><span class="type-signature"></span>getOGC3DTilesCopyrightInfo<span class="signature">()</span></h3><dl class="details"><div class="details-item-container"><dt class="tag-source bold">Source</dt><dd class="tag-source"><ul><li><a href="OGC3DTile.js.html">OGC3DTile.js</a>, <a href="OGC3DTile.js.html#line22">line 22</a></li></ul></dd></div></dl><div class="method-member-container mt-20"><strong>Returns:</strong><div class="param-desc">a list of vendors that are required by copyright to be displayed in the app.</div></div></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="InstancedOGC3DTile.html">InstancedOGC3DTile</a></div><div class="sidebar-section-children"><a href="InstancedTile.html">InstancedTile</a></div><div class="sidebar-section-children"><a href="InstancedTileLoader.html">InstancedTileLoader</a></div><div class="sidebar-section-children"><a href="OGC3DTile.html">OGC3DTile</a></div><div class="sidebar-section-children"><a href="OcclusionCullingService.html">OcclusionCullingService</a></div><div class="sidebar-section-children"><a href="TileLoader.html">TileLoader</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#getOGC3DTilesCopyrightInfo">getOGC3DTilesCopyrightInfo</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>
|