@loaders.gl/tiles 4.2.0-alpha.4 → 4.2.0-alpha.5
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/constants.js +34 -32
- package/dist/dist.dev.js +723 -342
- package/dist/dist.min.js +9 -0
- package/dist/index.cjs +98 -240
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/tileset/format-3d-tiles/tileset-3d-traverser.d.ts +1 -1
- package/dist/tileset/format-3d-tiles/tileset-3d-traverser.d.ts.map +1 -1
- package/dist/tileset/format-3d-tiles/tileset-3d-traverser.js +45 -35
- package/dist/tileset/format-i3s/i3s-pending-tiles-register.js +40 -22
- package/dist/tileset/format-i3s/i3s-tile-manager.d.ts +1 -1
- package/dist/tileset/format-i3s/i3s-tile-manager.d.ts.map +1 -1
- package/dist/tileset/format-i3s/i3s-tile-manager.js +67 -69
- package/dist/tileset/format-i3s/i3s-tileset-traverser.d.ts +2 -2
- package/dist/tileset/format-i3s/i3s-tileset-traverser.d.ts.map +1 -1
- package/dist/tileset/format-i3s/i3s-tileset-traverser.js +78 -57
- package/dist/tileset/helpers/3d-tiles-options.d.ts +1 -1
- package/dist/tileset/helpers/3d-tiles-options.d.ts.map +1 -1
- package/dist/tileset/helpers/3d-tiles-options.js +3 -4
- package/dist/tileset/helpers/bounding-volume.js +269 -128
- package/dist/tileset/helpers/frame-state.d.ts +1 -1
- package/dist/tileset/helpers/frame-state.d.ts.map +1 -1
- package/dist/tileset/helpers/frame-state.js +114 -95
- package/dist/tileset/helpers/i3s-lod.d.ts +2 -2
- package/dist/tileset/helpers/i3s-lod.d.ts.map +1 -1
- package/dist/tileset/helpers/i3s-lod.js +68 -39
- package/dist/tileset/helpers/tiles-3d-lod.js +97 -85
- package/dist/tileset/helpers/transform-utils.js +45 -44
- package/dist/tileset/helpers/zoom.d.ts +1 -1
- package/dist/tileset/helpers/zoom.d.ts.map +1 -1
- package/dist/tileset/helpers/zoom.js +70 -40
- package/dist/tileset/tile-3d.d.ts +5 -5
- package/dist/tileset/tile-3d.d.ts.map +1 -1
- package/dist/tileset/tile-3d.js +595 -399
- package/dist/tileset/tileset-3d.d.ts +5 -5
- package/dist/tileset/tileset-3d.d.ts.map +1 -1
- package/dist/tileset/tileset-3d.js +721 -597
- package/dist/tileset/tileset-cache.d.ts +2 -2
- package/dist/tileset/tileset-cache.d.ts.map +1 -1
- package/dist/tileset/tileset-cache.js +62 -48
- package/dist/tileset/tileset-traverser.d.ts +3 -3
- package/dist/tileset/tileset-traverser.d.ts.map +1 -1
- package/dist/tileset/tileset-traverser.js +281 -220
- package/dist/types.js +0 -1
- package/dist/utils/doubly-linked-list-node.js +14 -9
- package/dist/utils/doubly-linked-list.d.ts +1 -1
- package/dist/utils/doubly-linked-list.d.ts.map +1 -1
- package/dist/utils/doubly-linked-list.js +85 -56
- package/dist/utils/managed-array.js +138 -76
- package/package.json +10 -9
- package/dist/constants.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/tileset/format-3d-tiles/tileset-3d-traverser.js.map +0 -1
- package/dist/tileset/format-i3s/i3s-pending-tiles-register.js.map +0 -1
- package/dist/tileset/format-i3s/i3s-tile-manager.js.map +0 -1
- package/dist/tileset/format-i3s/i3s-tileset-traverser.js.map +0 -1
- package/dist/tileset/helpers/3d-tiles-options.js.map +0 -1
- package/dist/tileset/helpers/bounding-volume.js.map +0 -1
- package/dist/tileset/helpers/frame-state.js.map +0 -1
- package/dist/tileset/helpers/i3s-lod.js.map +0 -1
- package/dist/tileset/helpers/tiles-3d-lod.js.map +0 -1
- package/dist/tileset/helpers/transform-utils.js.map +0 -1
- package/dist/tileset/helpers/zoom.js.map +0 -1
- package/dist/tileset/tile-3d.js.map +0 -1
- package/dist/tileset/tileset-3d.js.map +0 -1
- package/dist/tileset/tileset-cache.js.map +0 -1
- package/dist/tileset/tileset-traverser.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/doubly-linked-list-node.js.map +0 -1
- package/dist/utils/doubly-linked-list.js.map +0 -1
- package/dist/utils/managed-array.js.map +0 -1
|
@@ -1,64 +1,93 @@
|
|
|
1
|
+
// This file is derived from the Cesium code base under Apache 2 license
|
|
2
|
+
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
1
3
|
import { DoublyLinkedListNode } from "./doubly-linked-list-node.js";
|
|
4
|
+
/**
|
|
5
|
+
* Doubly linked list
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
2
8
|
export class DoublyLinkedList {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
get length() {
|
|
9
|
-
return this._length;
|
|
10
|
-
}
|
|
11
|
-
add(item) {
|
|
12
|
-
const node = new DoublyLinkedListNode(item, this.tail, null);
|
|
13
|
-
if (this.tail) {
|
|
14
|
-
this.tail.next = node;
|
|
15
|
-
this.tail = node;
|
|
16
|
-
} else {
|
|
17
|
-
this.head = node;
|
|
18
|
-
this.tail = node;
|
|
9
|
+
constructor() {
|
|
10
|
+
this.head = null;
|
|
11
|
+
this.tail = null;
|
|
12
|
+
this._length = 0;
|
|
19
13
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
remove(node) {
|
|
24
|
-
if (!node) {
|
|
25
|
-
return;
|
|
14
|
+
get length() {
|
|
15
|
+
return this._length;
|
|
26
16
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Adds the item to the end of the list
|
|
19
|
+
* @param {*} [item]
|
|
20
|
+
* @return {DoublyLinkedListNode}
|
|
21
|
+
*/
|
|
22
|
+
add(item) {
|
|
23
|
+
const node = new DoublyLinkedListNode(item, this.tail, null);
|
|
24
|
+
if (this.tail) {
|
|
25
|
+
this.tail.next = node;
|
|
26
|
+
this.tail = node;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.head = node;
|
|
30
|
+
this.tail = node;
|
|
31
|
+
}
|
|
32
|
+
++this._length;
|
|
33
|
+
return node;
|
|
39
34
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Removes the given node from the list
|
|
37
|
+
* @param {DoublyLinkedListNode} node
|
|
38
|
+
*/
|
|
39
|
+
remove(node) {
|
|
40
|
+
if (!node) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (node.previous && node.next) {
|
|
44
|
+
node.previous.next = node.next;
|
|
45
|
+
node.next.previous = node.previous;
|
|
46
|
+
}
|
|
47
|
+
else if (node.previous) {
|
|
48
|
+
// Remove last node
|
|
49
|
+
node.previous.next = null;
|
|
50
|
+
this.tail = node.previous;
|
|
51
|
+
}
|
|
52
|
+
else if (node.next) {
|
|
53
|
+
// Remove first node
|
|
54
|
+
node.next.previous = null;
|
|
55
|
+
this.head = node.next;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// Remove last node in the linked list
|
|
59
|
+
this.head = null;
|
|
60
|
+
this.tail = null;
|
|
61
|
+
}
|
|
62
|
+
node.next = null;
|
|
63
|
+
node.previous = null;
|
|
64
|
+
--this._length;
|
|
47
65
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
node
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Moves nextNode after node
|
|
68
|
+
* @param {DoublyLinkedListNode} node
|
|
69
|
+
* @param {DoublyLinkedListNode} nextNode
|
|
70
|
+
*/
|
|
71
|
+
splice(node, nextNode) {
|
|
72
|
+
if (node === nextNode) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Remove nextNode, then insert after node
|
|
76
|
+
this.remove(nextNode);
|
|
77
|
+
this._insert(node, nextNode);
|
|
78
|
+
}
|
|
79
|
+
_insert(node, nextNode) {
|
|
80
|
+
const oldNodeNext = node.next;
|
|
81
|
+
node.next = nextNode;
|
|
82
|
+
// nextNode is the new tail
|
|
83
|
+
if (this.tail === node) {
|
|
84
|
+
this.tail = nextNode;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
oldNodeNext.previous = nextNode;
|
|
88
|
+
}
|
|
89
|
+
nextNode.next = oldNodeNext;
|
|
90
|
+
nextNode.previous = node;
|
|
91
|
+
++this._length;
|
|
58
92
|
}
|
|
59
|
-
nextNode.next = oldNodeNext;
|
|
60
|
-
nextNode.previous = node;
|
|
61
|
-
++this._length;
|
|
62
|
-
}
|
|
63
93
|
}
|
|
64
|
-
//# sourceMappingURL=doubly-linked-list.js.map
|
|
@@ -1,86 +1,148 @@
|
|
|
1
|
+
// This file is derived from the Cesium code base under Apache 2 license
|
|
2
|
+
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
1
3
|
import { assert } from '@loaders.gl/loader-utils';
|
|
4
|
+
/**
|
|
5
|
+
* A wrapper around arrays so that the internal length of the array can be manually managed.
|
|
6
|
+
*
|
|
7
|
+
* @alias ManagedArray
|
|
8
|
+
* @constructor
|
|
9
|
+
* @private
|
|
10
|
+
*
|
|
11
|
+
* @param {Number} [length=0] The initial length of the array.
|
|
12
|
+
*/
|
|
2
13
|
export class ManagedArray {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
this._length = void 0;
|
|
8
|
-
this._array = new Array(length);
|
|
9
|
-
this._length = length;
|
|
10
|
-
}
|
|
11
|
-
get length() {
|
|
12
|
-
return this._length;
|
|
13
|
-
}
|
|
14
|
-
set length(length) {
|
|
15
|
-
this._length = length;
|
|
16
|
-
if (length > this._array.length) {
|
|
17
|
-
this._array.length = length;
|
|
14
|
+
constructor(length = 0) {
|
|
15
|
+
this._map = new Map();
|
|
16
|
+
this._array = new Array(length);
|
|
17
|
+
this._length = length;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
assert(index >= 0);
|
|
29
|
-
if (index >= this.length) {
|
|
30
|
-
this.length = index + 1;
|
|
19
|
+
/**
|
|
20
|
+
* Gets or sets the length of the array.
|
|
21
|
+
* If the set length is greater than the length of the internal array, the internal array is resized.
|
|
22
|
+
*
|
|
23
|
+
* @memberof ManagedArray.prototype
|
|
24
|
+
* @type Number
|
|
25
|
+
*/
|
|
26
|
+
get length() {
|
|
27
|
+
return this._length;
|
|
31
28
|
}
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
set length(length) {
|
|
30
|
+
this._length = length;
|
|
31
|
+
if (length > this._array.length) {
|
|
32
|
+
this._array.length = length;
|
|
33
|
+
}
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Gets the internal array.
|
|
37
|
+
*
|
|
38
|
+
* @memberof ManagedArray.prototype
|
|
39
|
+
* @type Array
|
|
40
|
+
* @readonly
|
|
41
|
+
*/
|
|
42
|
+
get values() {
|
|
43
|
+
return this._array;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this._map.set(element, index);
|
|
45
|
+
/**
|
|
46
|
+
* Gets the element at an index.
|
|
47
|
+
*
|
|
48
|
+
* @param {Number} index The index to get.
|
|
49
|
+
*/
|
|
50
|
+
get(index) {
|
|
51
|
+
assert(index < this._array.length);
|
|
52
|
+
return this._array[index];
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Sets the element at an index. Resizes the array if index is greater than the length of the array.
|
|
56
|
+
*
|
|
57
|
+
* @param {Number} index The index to set.
|
|
58
|
+
* @param {*} element The element to set at index.
|
|
59
|
+
*/
|
|
60
|
+
set(index, element) {
|
|
61
|
+
assert(index >= 0);
|
|
62
|
+
if (index >= this.length) {
|
|
63
|
+
this.length = index + 1;
|
|
64
|
+
}
|
|
65
|
+
if (this._map.has(this._array[index])) {
|
|
66
|
+
this._map.delete(this._array[index]);
|
|
67
|
+
}
|
|
68
|
+
this._array[index] = element;
|
|
69
|
+
this._map.set(element, index);
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
delete(element) {
|
|
72
|
+
const index = this._map.get(element);
|
|
73
|
+
if (index >= 0) {
|
|
74
|
+
this._array.splice(index, 1);
|
|
75
|
+
this._map.delete(element);
|
|
76
|
+
this.length--;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Returns the last element in the array without modifying the array.
|
|
81
|
+
*
|
|
82
|
+
* @returns {*} The last element in the array.
|
|
83
|
+
*/
|
|
84
|
+
peek() {
|
|
85
|
+
return this._array[this._length - 1];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Push an element into the array.
|
|
89
|
+
*
|
|
90
|
+
* @param {*} element The element to push.
|
|
91
|
+
*/
|
|
92
|
+
push(element) {
|
|
93
|
+
if (!this._map.has(element)) {
|
|
94
|
+
const index = this.length++;
|
|
95
|
+
this._array[index] = element;
|
|
96
|
+
this._map.set(element, index);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Pop an element from the array.
|
|
101
|
+
*
|
|
102
|
+
* @returns {*} The last element in the array.
|
|
103
|
+
*/
|
|
104
|
+
pop() {
|
|
105
|
+
const element = this._array[--this.length];
|
|
106
|
+
this._map.delete(element);
|
|
107
|
+
return element;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Resize the internal array if length > _array.length.
|
|
111
|
+
*
|
|
112
|
+
* @param {Number} length The length.
|
|
113
|
+
*/
|
|
114
|
+
reserve(length) {
|
|
115
|
+
assert(length >= 0);
|
|
116
|
+
if (length > this._array.length) {
|
|
117
|
+
this._array.length = length;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Resize the array.
|
|
122
|
+
*
|
|
123
|
+
* @param {Number} length The length.
|
|
124
|
+
*/
|
|
125
|
+
resize(length) {
|
|
126
|
+
assert(length >= 0);
|
|
127
|
+
this.length = length;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Trim the internal array to the specified length. Defaults to the current length.
|
|
131
|
+
*
|
|
132
|
+
* @param {Number} [length] The length.
|
|
133
|
+
*/
|
|
134
|
+
trim(length) {
|
|
135
|
+
if (length === null || length === undefined) {
|
|
136
|
+
length = this.length;
|
|
137
|
+
}
|
|
138
|
+
this._array.length = length;
|
|
139
|
+
}
|
|
140
|
+
reset() {
|
|
141
|
+
this._array = [];
|
|
142
|
+
this._map = new Map();
|
|
143
|
+
this._length = 0;
|
|
144
|
+
}
|
|
145
|
+
find(target) {
|
|
146
|
+
return this._map.has(target);
|
|
74
147
|
}
|
|
75
|
-
this._array.length = length;
|
|
76
|
-
}
|
|
77
|
-
reset() {
|
|
78
|
-
this._array = [];
|
|
79
|
-
this._map = new Map();
|
|
80
|
-
this._length = 0;
|
|
81
|
-
}
|
|
82
|
-
find(target) {
|
|
83
|
-
return this._map.has(target);
|
|
84
|
-
}
|
|
85
148
|
}
|
|
86
|
-
//# sourceMappingURL=managed-array.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tiles",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.5",
|
|
4
4
|
"description": "Common components for different tiles loaders.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,23 +37,24 @@
|
|
|
37
37
|
"README.md"
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
|
-
"pre-build": "npm run build-bundle && npm run build-bundle
|
|
41
|
-
"build-bundle": "ocular-bundle ./
|
|
40
|
+
"pre-build": "npm run build-bundle && npm run build-bundle-dev",
|
|
41
|
+
"build-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
|
|
42
|
+
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@loaders.gl/loader-utils": "4.2.0-alpha.
|
|
45
|
-
"@loaders.gl/math": "4.2.0-alpha.
|
|
45
|
+
"@loaders.gl/loader-utils": "4.2.0-alpha.5",
|
|
46
|
+
"@loaders.gl/math": "4.2.0-alpha.5",
|
|
46
47
|
"@math.gl/core": "^4.0.0",
|
|
47
48
|
"@math.gl/culling": "^4.0.0",
|
|
48
49
|
"@math.gl/geospatial": "^4.0.0",
|
|
49
50
|
"@math.gl/web-mercator": "^4.0.0",
|
|
50
51
|
"@probe.gl/stats": "^4.0.2"
|
|
51
52
|
},
|
|
52
|
-
"peerDependencies": {
|
|
53
|
-
"@loaders.gl/core": "^4.0.0"
|
|
54
|
-
},
|
|
55
53
|
"devDependencies": {
|
|
56
54
|
"@deck.gl/core": "^8.9.0"
|
|
57
55
|
},
|
|
58
|
-
"
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@loaders.gl/core": "^4.0.0"
|
|
58
|
+
},
|
|
59
|
+
"gitHead": "32d95a81971f104e4dfeb88ab57065f05321a76a"
|
|
59
60
|
}
|
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["TILE_CONTENT_STATE","UNLOADED","LOADING","PROCESSING","READY","EXPIRED","FAILED","TILE_REFINEMENT","TILE_TYPE","TILESET_TYPE","LOD_METRIC_TYPE","TILE3D_OPTIMIZATION_HINT","NOT_COMPUTED","USE_OPTIMIZATION","SKIP_OPTIMIZATION"],"sources":["../src/constants.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type TileContentState =\n | 'unloaded' // Has never been requested\n | 'loading' // Is waiting on a pending request\n | 'processing' // Request received. Contents are being processed for rendering. Depending on the content, it might make its own requests for external data.\n | 'ready' // Ready to render.\n | 'expired' // Is expired and will be unloaded once new content is loaded.\n | 'failed'; // Request failed.\n\nexport const TILE_CONTENT_STATE = {\n UNLOADED: 0, // Has never been requested\n LOADING: 1, // Is waiting on a pending request\n PROCESSING: 2, // Request received. Contents are being processed for rendering. Depending on the content, it might make its own requests for external data.\n READY: 3, // Ready to render.\n EXPIRED: 4, // Is expired and will be unloaded once new content is loaded.\n FAILED: 5 // Request failed.\n};\n\nexport type TileRefinement = 'add' | 'replace';\n\nexport enum TILE_REFINEMENT {\n ADD = 1, // Render tile and, if screen space error exceeded, also refine to its children.\n REPLACE = 2 // Render tile or, if screen space error exceeded, refine to its descendants instead.\n}\n\nexport type TileType = 'empty' | 'scenegraph' | 'pointcloud' | 'mesh';\n\nexport enum TILE_TYPE {\n EMPTY = 'empty',\n SCENEGRAPH = 'scenegraph',\n POINTCLOUD = 'pointcloud',\n MESH = 'mesh'\n}\n\nexport type TilesetType = 'I3S' | 'TILES3D';\n\nexport enum TILESET_TYPE {\n I3S = 'I3S',\n TILES3D = 'TILES3D'\n}\n\nexport type LODMetricType = 'geometricError' | 'maxScreenThreshold';\n\nexport enum LOD_METRIC_TYPE {\n GEOMETRIC_ERROR = 'geometricError',\n MAX_SCREEN_THRESHOLD = 'maxScreenThreshold'\n}\n\n// Cesium 3D Tiles Specific\nexport type Tile3DOptimizationHint = 'NOT_COMPUTED' | 'USE_OPTIMIZATION' | 'SKIP_OPTIMIZATION';\n\nexport const TILE3D_OPTIMIZATION_HINT = {\n NOT_COMPUTED: -1,\n USE_OPTIMIZATION: 1,\n SKIP_OPTIMIZATION: 0\n};\n"],"mappings":"AAYA,OAAO,MAAMA,kBAAkB,GAAG;EAChCC,QAAQ,EAAE,CAAC;EACXC,OAAO,EAAE,CAAC;EACVC,UAAU,EAAE,CAAC;EACbC,KAAK,EAAE,CAAC;EACRC,OAAO,EAAE,CAAC;EACVC,MAAM,EAAE;AACV,CAAC;AAID,WAAYC,eAAe,aAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAO3B,WAAYC,SAAS,aAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AASrB,WAAYC,YAAY,aAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAOxB,WAAYC,eAAe,aAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAQ3B,OAAO,MAAMC,wBAAwB,GAAG;EACtCC,YAAY,EAAE,CAAC,CAAC;EAChBC,gBAAgB,EAAE,CAAC;EACnBC,iBAAiB,EAAE;AACrB,CAAC"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Tileset3D","Tile3D","TilesetTraverser","TilesetCache","createBoundingVolume","calculateTransformProps","getFrameState","getLodStatus","TILE_CONTENT_STATE","TILE_REFINEMENT","TILE_TYPE","TILESET_TYPE","LOD_METRIC_TYPE"],"sources":["../src/index.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type {Tileset3DProps} from './tileset/tileset-3d';\nexport {Tileset3D} from './tileset/tileset-3d';\nexport {Tile3D} from './tileset/tile-3d';\n\nexport {TilesetTraverser} from './tileset/tileset-traverser';\nexport {TilesetCache} from './tileset/tileset-cache';\n\nexport {createBoundingVolume} from './tileset/helpers/bounding-volume';\nexport {calculateTransformProps} from './tileset/helpers/transform-utils';\n\nexport {getFrameState} from './tileset/helpers/frame-state';\nexport {getLodStatus} from './tileset/helpers/i3s-lod';\n\nexport {\n TILE_CONTENT_STATE,\n TILE_REFINEMENT,\n TILE_TYPE,\n TILESET_TYPE,\n LOD_METRIC_TYPE\n} from './constants';\n"],"mappings":"SAKQA,SAAS;AAAA,SACTC,MAAM;AAAA,SAENC,gBAAgB;AAAA,SAChBC,YAAY;AAAA,SAEZC,oBAAoB;AAAA,SACpBC,uBAAuB;AAAA,SAEvBC,aAAa;AAAA,SACbC,YAAY;AAAA,SAGlBC,kBAAkB,EAClBC,eAAe,EACfC,SAAS,EACTC,YAAY,EACZC,eAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tileset-3d-traverser.js","names":["TILE3D_OPTIMIZATION_HINT","TILE_REFINEMENT","TilesetTraverser","Tileset3DTraverser","compareDistanceToCamera","a","b","_distanceToCamera","_centerZDepth","updateTileVisibility","tile","frameState","isVisibleAndInRequestVolume","hasChildren","children","length","hasTilesetContent","firstChild","_visible","meetsScreenSpaceErrorEarly","replace","refine","REPLACE","useOptimization","_optimChildrenWithinParent","USE_OPTIMIZATION","anyChildrenVisible","parent","ADD","shouldRefine"],"sources":["../../../src/tileset/format-3d-tiles/tileset-3d-traverser.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// This file is derived from the Cesium code base under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\nimport {TILE3D_OPTIMIZATION_HINT, TILE_REFINEMENT} from '../../constants';\nimport {TilesetTraverser} from '../tileset-traverser';\n\nexport class Tileset3DTraverser extends TilesetTraverser {\n compareDistanceToCamera(a, b) {\n // Sort by farthest child first since this is going on a stack\n return b._distanceToCamera === 0 && a._distanceToCamera === 0\n ? b._centerZDepth - a._centerZDepth\n : b._distanceToCamera - a._distanceToCamera;\n }\n\n updateTileVisibility(tile, frameState) {\n super.updateTileVisibility(tile, frameState);\n\n // Optimization - if none of the tile's children are visible then this tile isn't visible\n if (!tile.isVisibleAndInRequestVolume) {\n return;\n }\n\n const hasChildren = tile.children.length > 0;\n if (tile.hasTilesetContent && hasChildren) {\n // Use the root tile's visibility instead of this tile's visibility.\n // The root tile may be culled by the children bounds optimization in which\n // case this tile should also be culled.\n const firstChild = tile.children[0];\n this.updateTileVisibility(firstChild, frameState);\n tile._visible = firstChild._visible;\n return;\n }\n\n if (this.meetsScreenSpaceErrorEarly(tile, frameState)) {\n tile._visible = false;\n return;\n }\n\n const replace = tile.refine === TILE_REFINEMENT.REPLACE;\n const useOptimization =\n tile._optimChildrenWithinParent === TILE3D_OPTIMIZATION_HINT.USE_OPTIMIZATION;\n if (replace && useOptimization && hasChildren) {\n if (!this.anyChildrenVisible(tile, frameState)) {\n tile._visible = false;\n return;\n }\n }\n }\n\n meetsScreenSpaceErrorEarly(tile, frameState) {\n const {parent} = tile;\n if (!parent || parent.hasTilesetContent || parent.refine !== TILE_REFINEMENT.ADD) {\n return false;\n }\n\n // Use parent's geometric error with child's box to see if the tile already meet the SSE\n return !this.shouldRefine(tile, frameState, true);\n }\n}\n"],"mappings":"SAOQA,wBAAwB,EAAEC,eAAe;AAAA,SACzCC,gBAAgB;AAExB,OAAO,MAAMC,kBAAkB,SAASD,gBAAgB,CAAC;EACvDE,uBAAuBA,CAACC,CAAC,EAAEC,CAAC,EA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AAI;IACrB,IAAI,CAACiB,MAAM,IAAIA,MAAM,CAACX,iBAAiB,IAAIW,MAAM,CAACN,MAAM,KAAKpB,eAAe,CAAC2B,GAAG,EAAE;MAChF,OAAO,KAAK;IACd;IAGA,OAAO,CAAC,IAAI,CAACC,YAAY,CAACnB,IAAI,EAAEC,UAAU,EAAE,IAAI,CAAC;EACnD;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-pending-tiles-register.js","names":["I3SPendingTilesRegister","constructor","frameNumberMap","Map","register","viewportId","frameNumber","viewportMap","get","oldCount","set","deregister","isZero","_this$frameNumberMap$","count"],"sources":["../../../src/tileset/format-i3s/i3s-pending-tiles-register.ts"],"sourcesContent":["/**\n * Counter to register pending tile headers for the particular frameNumber\n * Until all tiles are loaded we won't call `onTraversalEnd` callback\n */\nexport class I3SPendingTilesRegister {\n private frameNumberMap: Map<string, Map<number, number>> = new Map();\n\n /**\n * Register a new pending tile header for the particular frameNumber\n * @param viewportId\n * @param frameNumber\n */\n register(viewportId: string, frameNumber: number) {\n const viewportMap = this.frameNumberMap.get(viewportId) || new Map();\n const oldCount = viewportMap.get(frameNumber) || 0;\n viewportMap.set(frameNumber, oldCount + 1);\n this.frameNumberMap.set(viewportId, viewportMap);\n }\n\n /**\n * Deregister a pending tile header for the particular frameNumber\n * @param viewportId\n * @param frameNumber\n */\n deregister(viewportId: string, frameNumber: number) {\n const viewportMap = this.frameNumberMap.get(viewportId);\n if (!viewportMap) {\n return;\n }\n const oldCount = viewportMap.get(frameNumber) || 1;\n viewportMap.set(frameNumber, oldCount - 1);\n }\n\n /**\n * Check is there are no pending tile headers registered for the particular frameNumber\n * @param viewportId\n * @param frameNumber\n * @returns\n */\n isZero(viewportId: string, frameNumber: number) {\n const count = this.frameNumberMap.get(viewportId)?.get(frameNumber) || 0;\n return count === 0;\n }\n}\n"],"mappings":"AAIA,OAAO,MAAMA,uBAAuB,CAAC;EAAAC,YAAA;IAAA,KAC3BC,cAAc,GAAqC,IAAIC,GAAG,CAAC,CAAC;EAAA;EAOpEC,QAAQA,CAACC,UAAkB,EAAEC,WAAmB,EAAE;IAChD,MAAMC,WAAW,GAAG,IAAI,CAACL,cAAc,CAACM,GAAG,CAACH,UAAU,CAAC,IAAI,IAAIF,GAAG,CAAC,CAAC;IACpE,MAAMM,QAAQ,GAAGF,WAAW,CAACC,GAAG,CAACF,WAAW,CAAC,IAAI,CAAC;IAClDC,WAAW,CAACG,GAAG,CAACJ,WAAW,EAAEG,QAAQ,GAAG,CAAC,CAAC;IAC1C,IAAI,CAACP,cAAc,CAACQ,GAAG,CAACL,UAAU,EAAEE,WAAW,CAAC;EAClD;EAOAI,UAAUA,CAACN,UAAkB,EAAEC,WAAmB,EAAE;IAClD,MAAMC,WAAW,GAAG,IAAI,CAACL,cAAc,CAACM,GAAG,CAACH,UAAU,CAAC;IACvD,IAAI,CAACE,WAAW,EAAE;MAChB;IACF;IACA,MAAME,QAAQ,GAAGF,WAAW,CAACC,GAAG,CAACF,WAAW,CAAC,IAAI,CAAC;IAClDC,WAAW,CAACG,GAAG,CAACJ,WAAW,EAAEG,QAAQ,GAAG,CAAC,CAAC;EAC5C;EAQAG,MAAMA,CAACP,UAAkB,EAAEC,WAAmB,EAAE;IAAA,IAAAO,qBAAA;IAC9C,MAAMC,KAAK,GAAG,EAAAD,qBAAA,OAAI,CAACX,cAAc,CAACM,GAAG,CAACH,UAAU,CAAC,cAAAQ,qBAAA,uBAAnCA,qBAAA,CAAqCL,GAAG,CAACF,WAAW,CAAC,KAAI,CAAC;IACxE,OAAOQ,KAAK,KAAK,CAAC;EACpB;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-tile-manager.js","names":["I3SPendingTilesRegister","STATUS","REQUESTED","COMPLETED","ERROR","I3STileManager","constructor","_statusMap","pendingTilesRegister","add","request","key","callback","frameState","frameNumber","viewport","id","status","register","then","data","actualFrameNumber","deregister","catch","error","update","newFrameNumber","newViewportId","find","hasPendingTiles","viewportId","isZero"],"sources":["../../../src/tileset/format-i3s/i3s-tile-manager.ts"],"sourcesContent":["import {FrameState} from '../helpers/frame-state';\nimport {I3SPendingTilesRegister} from './i3s-pending-tiles-register';\n\nconst STATUS = {\n REQUESTED: 'REQUESTED',\n COMPLETED: 'COMPLETED',\n ERROR: 'ERROR'\n};\n\n// A helper class to manage tile metadata fetching\nexport class I3STileManager {\n private _statusMap: object;\n private pendingTilesRegister = new I3SPendingTilesRegister();\n\n constructor() {\n this._statusMap = {};\n }\n\n /**\n * Add request to map\n * @param request - node metadata request\n * @param key - unique key\n * @param callback - callback after request completed\n * @param frameState - frameState data\n */\n add(request, key, callback, frameState: FrameState) {\n if (!this._statusMap[key]) {\n const {\n frameNumber,\n viewport: {id}\n } = frameState;\n this._statusMap[key] = {request, callback, key, frameState, status: STATUS.REQUESTED};\n // Register pending request for the frameNumber\n this.pendingTilesRegister.register(id, frameNumber);\n request()\n .then((data) => {\n this._statusMap[key].status = STATUS.COMPLETED;\n const {\n frameNumber: actualFrameNumber,\n viewport: {id}\n } = this._statusMap[key].frameState;\n // Deregister pending request for the frameNumber\n this.pendingTilesRegister.deregister(id, actualFrameNumber);\n this._statusMap[key].callback(data, frameState);\n })\n .catch((error) => {\n this._statusMap[key].status = STATUS.ERROR;\n const {\n frameNumber: actualFrameNumber,\n viewport: {id}\n } = this._statusMap[key].frameState;\n // Deregister pending request for the frameNumber\n this.pendingTilesRegister.deregister(id, actualFrameNumber);\n callback(error);\n });\n }\n }\n\n /**\n * Update request if it is still actual for the new frameState\n * @param key - unique key\n * @param frameState - frameState data\n */\n update(key, frameState: FrameState) {\n if (this._statusMap[key]) {\n // Deregister pending request for the old frameNumber\n const {\n frameNumber,\n viewport: {id}\n } = this._statusMap[key].frameState;\n this.pendingTilesRegister.deregister(id, frameNumber);\n\n // Register pending request for the new frameNumber\n const {\n frameNumber: newFrameNumber,\n viewport: {id: newViewportId}\n } = frameState;\n this.pendingTilesRegister.register(newViewportId, newFrameNumber);\n this._statusMap[key].frameState = frameState;\n }\n }\n\n /**\n * Find request in the map\n * @param key - unique key\n * @returns\n */\n find(key) {\n return this._statusMap[key];\n }\n\n /**\n * Check it there are pending tile headers for the particular frameNumber\n * @param viewportId\n * @param frameNumber\n * @returns\n */\n hasPendingTiles(viewportId: string, frameNumber: number): boolean {\n return !this.pendingTilesRegister.isZero(viewportId, frameNumber);\n }\n}\n"],"mappings":"SACQA,uBAAuB;AAE/B,MAAMC,MAAM,GAAG;EACbC,SAAS,EAAE,WAAW;EACtBC,SAAS,EAAE,WAAW;EACtBC,KAAK,EAAE;AACT,CAAC;AAGD,OAAO,MAAMC,cAAc,CAAC;EAI1BC,WAAWA,CAAA,EAAG;IAAA,KAHNC,UAAU;IAAA,KACVC,oBAAoB,GAAG,IAAIR,uBAAuB,CAAC,CAAC;IAG1D,IAAI,CAACO,UAAU,GAAG,CAAC,CAAC;EACtB;EASAE,GAAGA,CAACC,OAAO,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,UAAsB,EAAE;IAClD,IAAI,CAAC,IAAI,CAACN,UAAU,CAACI,GAAG,CAAC,EAAE;MACzB,MAAM;QACJG,WAAW;QACXC,QAAQ,EAAE;UAACC;QAAE;MACf,CAAC,GAAGH,UAAU;MACd,IAAI,CAACN,UAAU,CAACI,GAAG,CAAC,GAAG;QAACD,OAAO;QAAEE,QAAQ;QAAED,GAAG;QAAEE,UAAU;QAAEI,MAAM,EAAEhB,MAAM,CAACC;MAAS,CAAC;MAErF,IAAI,CAACM,oBAAoB,CAACU,QAAQ,CAACF,EAAE,EAAEF,WAAW,CAAC;MACnDJ,OAAO,CAAC,CAAC,CACNS,IAAI,CAAEC,IAAI,IAAK;QACd,IAAI,CAACb,UAAU,CAACI,GAAG,CAAC,CAACM,MAAM,GAAGhB,MAAM,CAACE,SAAS;QAC9C,MAAM;UACJW,WAAW,EAAEO,iBAAiB;UAC9BN,QAAQ,EAAE;YAACC;UAAE;QACf,CAAC,GAA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U,CAACI,GAAG,CAAC;EAC7B;EAQAkB,eAAeA,CAACC,UAAkB,EAAEhB,WAAmB,EAAW;IAChE,OAAO,CAAC,IAAI,CAACN,oBAAoB,CAACuB,MAAM,CAACD,UAAU,EAAEhB,WAAW,CAAC;EACnE;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-tileset-traverser.js","names":["load","TilesetTraverser","getLodStatus","Tile3D","I3STileManager","I3STilesetTraverser","constructor","options","_tileManager","traversalFinished","frameState","hasPendingTiles","viewport","id","_frameNumber","shouldRefine","tile","_lodJudge","updateChildTiles","children","header","childTiles","tileset","child","extendedId","childTile","find","t","request","_loadTile","cachedRequest","nodePages","nodePagesTile","formTileFromNodePages","add","_onTileLoad","update","updateTile","nodeId","loader","nodeUrl","getTileUrl","url","loadOptions","i3s","isTileHeader","push","frameNumber","Date","getTime","lastUpdate","updateDebounceTime","executeTraversal"],"sources":["../../../src/tileset/format-i3s/i3s-tileset-traverser.ts"],"sourcesContent":["import {load} from '@loaders.gl/core';\nimport {TilesetTraverser} from '../tileset-traverser';\n\nimport {getLodStatus} from '../helpers/i3s-lod';\nimport {Tile3D} from '../tile-3d';\nimport {I3STileManager} from './i3s-tile-manager';\nimport {FrameState} from '../helpers/frame-state';\n\nexport class I3STilesetTraverser extends TilesetTraverser {\n private _tileManager: I3STileManager;\n\n constructor(options) {\n super(options);\n this._tileManager = new I3STileManager();\n }\n\n /**\n * Check if there are no penging tile header requests,\n * that means the traversal is finished and we can call\n * following-up callbacks.\n */\n traversalFinished(frameState: FrameState): boolean {\n return !this._tileManager.hasPendingTiles(frameState.viewport.id, this._frameNumber || 0);\n }\n\n shouldRefine(tile, frameState: FrameState) {\n tile._lodJudge = getLodStatus(tile, frameState);\n return tile._lodJudge === 'DIG';\n }\n\n updateChildTiles(tile, frameState: FrameState): boolean {\n const children = tile.header.children || [];\n // children which are already fetched and constructed as Tile3D instances\n const childTiles = tile.children;\n const tileset = tile.tileset;\n\n for (const child of children) {\n const extendedId = `${child.id}-${frameState.viewport.id}`;\n // if child tile is not fetched\n const childTile = childTiles && childTiles.find((t) => t.id === extendedId);\n if (!childTile) {\n let request = () => this._loadTile(child.id, tileset);\n const cachedRequest = this._tileManager.find(extendedId);\n if (!cachedRequest) {\n // eslint-disable-next-line max-depth\n if (tileset.tileset.nodePages) {\n request = () => tileset.tileset.nodePagesTile.formTileFromNodePages(child.id);\n }\n this._tileManager.add(\n request,\n extendedId,\n (header) => this._onTileLoad(header, tile, extendedId),\n frameState\n );\n } else {\n // update frameNumber since it is still needed in current frame\n this._tileManager.update(extendedId, frameState);\n }\n } else if (childTile) {\n // if child tile is fetched and available\n this.updateTile(childTile, frameState);\n }\n }\n return false;\n }\n\n async _loadTile(nodeId, tileset) {\n const {loader} = tileset;\n const nodeUrl = tileset.getTileUrl(`${tileset.url}/nodes/${nodeId}`);\n // load metadata\n const options = {\n ...tileset.loadOptions,\n i3s: {\n ...tileset.loadOptions.i3s,\n isTileHeader: true\n }\n };\n\n return await load(nodeUrl, loader, options);\n }\n\n /**\n * The callback to init Tile3D instance after loading the tile JSON\n * @param {Object} header - the tile JSON from a dataset\n * @param {Tile3D} tile - the parent Tile3D instance\n * @param {string} extendedId - optional ID to separate copies of a tile for different viewports.\n * const extendedId = `${tile.id}-${frameState.viewport.id}`;\n * @return {void}\n */\n _onTileLoad(header, tile, extendedId) {\n // after child tile is fetched\n const childTile = new Tile3D(tile.tileset, header, tile, extendedId);\n tile.children.push(childTile);\n const frameState = this._tileManager.find(childTile.id).frameState;\n this.updateTile(childTile, frameState);\n\n // after tile fetched, resume traversal if still in current update/traversal frame\n if (\n this._frameNumber === frameState.frameNumber &&\n (this.traversalFinished(frameState) ||\n new Date().getTime() - this.lastUpdate > this.updateDebounceTime)\n ) {\n this.executeTraversal(childTile, frameState);\n }\n }\n}\n"],"mappings":"AAAA,SAAQA,IAAI,QAAO,kBAAkB;AAAC,SAC9BC,gBAAgB;AAAA,SAEhBC,YAAY;AA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ACG,QAAQ,CAAC2B,IAAI,CAACrB,SAAS,CAAC;IAC7B,MAAMf,UAAU,GAAG,IAAI,CAACF,YAAY,CAACkB,IAAI,CAACD,SAAS,CAACZ,EAAE,CAAC,CAACH,UAAU;IAClE,IAAI,CAAC2B,UAAU,CAACZ,SAAS,EAAEf,UAAU,CAAC;IAGtC,IACE,IAAI,CAACI,YAAY,KAAKJ,UAAU,CAACqC,WAAW,KAC3C,IAAI,CAACtC,iBAAiB,CAACC,UAAU,CAAC,IACjC,IAAIsC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,GAAG,IAAI,CAACC,UAAU,GAAG,IAAI,CAACC,kBAAkB,CAAC,EACnE;MACA,IAAI,CAACC,gBAAgB,CAAC3B,SAAS,EAAEf,UAAU,CAAC;IAC9C;EACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"3d-tiles-options.js","names":["get3dTilesOptions","tileset","assetGltfUpAxis","asset","gltfUpAxis"],"sources":["../../../src/tileset/helpers/3d-tiles-options.ts"],"sourcesContent":["import type {Tileset3D} from '../tileset-3d';\n\nexport function get3dTilesOptions(tileset: Tileset3D): {assetGltfUpAxis: 'X' | 'Y' | 'Z'} {\n return {\n assetGltfUpAxis: (tileset.asset && tileset.asset.gltfUpAxis) || 'Y'\n };\n}\n"],"mappings":"AAEA,OAAO,SAASA,iBAAiBA,CAACC,OAAkB,EAAsC;EACxF,OAAO;IACLC,eAAe,EAAGD,OAAO,CAACE,KAAK,IAAIF,OAAO,CAACE,KAAK,CAACC,UAAU,IAAK;EAClE,CAAC;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bounding-volume.js","names":["Quaternion","Vector3","Matrix3","Matrix4","degrees","BoundingSphere","OrientedBoundingBox","Ellipsoid","assert","defined","x","undefined","scratchPoint","scratchScale","scratchNorthWest","scratchSouthEast","scratchCenter","scratchXAxis","scratchYAxis","scratchZAxis","createBoundingVolume","boundingVolumeHeader","transform","result","box","createBox","region","createObbFromRegion","sphere","createSphere","Error","getCartographicBounds","boundingVolume","orientedBoundingBoxToCartographicBounds","west","south","east","north","minHeight","maxHeight","boundingSphereToCartographicBounds","center","origin","length","halfSize","slice","quaternion","fromArray","y","z","transformByQuaternion","scale","toArray","xAxis","transformAsVector","yAxis","zAxis","halfAxes","getScale","uniformScale","Math","max","radius","northWest","WGS84","cartographicToCartesian","southEast","centerInCartesian","addVectors","multiplyByScalar","cartesianToCartographic","subtract","emptyCartographicBounds","getColumn","copy","add","addToCartographicBounds","negate","point","scaleToGeodeticSurface","geodeticSurfaceNormal","len","normalize","clone","cross","axis","dir","Infinity","target","cartesian","min"],"sources":["../../../src/tileset/helpers/bounding-volume.ts"],"sourcesContent":["// This file is derived from the Cesium code base under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\n/* eslint-disable */\nimport {Quaternion, Vector3, Matrix3, Matrix4, degrees} from '@math.gl/core';\nimport {BoundingSphere, OrientedBoundingBox} from '@math.gl/culling';\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {assert} from '@loaders.gl/loader-utils';\n\n// const scratchProjectedBoundingSphere = new BoundingSphere();\n\nfunction defined(x) {\n return x !== undefined && x !== null;\n}\n\n// const scratchMatrix = new Matrix3();\nconst scratchPoint = new Vector3();\nconst scratchScale = new Vector3();\nconst scratchNorthWest = new Vector3();\nconst scratchSouthEast = new Vector3();\nconst scratchCenter = new Vector3();\nconst scratchXAxis = new Vector3();\nconst scratchYAxis = new Vector3();\nconst scratchZAxis = new Vector3();\n// const scratchRectangle = new Rectangle();\n// const scratchOrientedBoundingBox = new OrientedBoundingBox();\n// const scratchTransform = new Matrix4();\n\n/**\n * Create a bounding volume from the tile's bounding volume header.\n * @param {Object} boundingVolumeHeader The tile's bounding volume header.\n * @param {Matrix4} transform The transform to apply to the bounding volume.\n * @param [result] The object onto which to store the result.\n * @returns The modified result parameter or a new TileBoundingVolume instance if none was provided.\n */\nexport function createBoundingVolume(boundingVolumeHeader, transform, result?) {\n assert(boundingVolumeHeader, '3D Tile: boundingVolume must be defined');\n\n // boundingVolume schema:\n // https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/boundingVolume.schema.json\n if (boundingVolumeHeader.box) {\n return createBox(boundingVolumeHeader.box, transform, result);\n }\n if (boundingVolumeHeader.region) {\n return createObbFromRegion(boundingVolumeHeader.region);\n }\n\n if (boundingVolumeHeader.sphere) {\n return createSphere(boundingVolumeHeader.sphere, transform, result);\n }\n\n throw new Error('3D Tile: boundingVolume must contain a sphere, region, or box');\n}\n\n/** [min, max] each in [longitude, latitude, altitude] */\nexport type CartographicBounds = [min: number[], max: number[]];\n\n/**\n * Calculate the cartographic bounding box the tile's bounding volume.\n * @param {Object} boundingVolumeHeader The tile's bounding volume header.\n * @param {BoundingVolume} boundingVolume The bounding volume.\n * @returns {CartographicBounds}\n */\nexport function getCartographicBounds(\n boundingVolumeHeader,\n boundingVolume: OrientedBoundingBox | BoundingSphere\n): CartographicBounds {\n // boundingVolume schema:\n // https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/boundingVolume.schema.json\n if (boundingVolumeHeader.box) {\n return orientedBoundingBoxToCartographicBounds(boundingVolume as OrientedBoundingBox);\n }\n if (boundingVolumeHeader.region) {\n // [west, south, east, north, minimum height, maximum height]\n // Latitudes and longitudes are in the WGS 84 datum as defined in EPSG 4979 and are in radians.\n // Heights are in meters above (or below) the WGS 84 ellipsoid.\n const [west, south, east, north, minHeight, maxHeight] = boundingVolumeHeader.region;\n\n return [\n [degrees(west), degrees(south), minHeight],\n [degrees(east), degrees(north), maxHeight]\n ];\n }\n\n if (boundingVolumeHeader.sphere) {\n return boundingSphereToCartographicBounds(boundingVolume as BoundingSphere);\n }\n\n throw new Error('Unkown boundingVolume type');\n}\n\nfunction createBox(box, transform, result?) {\n // https://math.gl/modules/culling/docs/api-reference/oriented-bounding-box\n // 1. A half-axes based representation.\n // box: An array of 12 numbers that define an oriented bounding box.\n // The first three elements define the x, y, and z values for the center of the box.\n // The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length.\n // The next three elements (indices 6, 7, and 8) define the y axis direction and half-length.\n // The last three elements (indices 9, 10, and 11) define the z axis direction and half-length.\n // 2. A half-size-quaternion based representation.\n // box: An array of 10 numbers that define an oriented bounding box.\n // The first three elements define the x, y, and z values for the center of the box in a right-handed 3-axis (x, y, z) Cartesian coordinate system where the z-axis is up.\n // The next three elements (with indices 3, 4, and 5) define the halfSize.\n // The last four elements (indices 6, 7, 8 and 10) define the quaternion.\n const center = new Vector3(box[0], box[1], box[2]);\n transform.transform(center, center);\n let origin: number[] = [];\n if (box.length === 10) {\n const halfSize = box.slice(3, 6);\n const quaternion = new Quaternion();\n quaternion.fromArray(box, 6);\n const x = new Vector3([1, 0, 0]);\n const y = new Vector3([0, 1, 0]);\n const z = new Vector3([0, 0, 1]);\n x.transformByQuaternion(quaternion);\n x.scale(halfSize[0]);\n y.transformByQuaternion(quaternion);\n y.scale(halfSize[1]);\n z.transformByQuaternion(quaternion);\n z.scale(halfSize[2]);\n origin = [...x.toArray(), ...y.toArray(), ...z.toArray()];\n } else {\n origin = [...box.slice(3, 6), ...box.slice(6, 9), ...box.slice(9, 12)];\n }\n const xAxis = transform.transformAsVector(origin.slice(0, 3));\n const yAxis = transform.transformAsVector(origin.slice(3, 6));\n const zAxis = transform.transformAsVector(origin.slice(6, 9));\n const halfAxes = new Matrix3([\n xAxis[0],\n xAxis[1],\n xAxis[2],\n yAxis[0],\n yAxis[1],\n yAxis[2],\n zAxis[0],\n zAxis[1],\n zAxis[2]\n ]);\n\n if (defined(result)) {\n result.center = center;\n result.halfAxes = halfAxes;\n return result;\n }\n\n return new OrientedBoundingBox(center, halfAxes);\n}\n\n/*\nfunction createBoxFromTransformedRegion(region, transform, initialTransform, result) {\n const rectangle = Rectangle.unpack(region, 0, scratchRectangle);\n const minimumHeight = region[4];\n const maximumHeight = region[5];\n\n const orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n rectangle,\n minimumHeight,\n maximumHeight,\n Ellipsoid.WGS84,\n scratchOrientedBoundingBox\n );\n const center = orientedBoundingBox.center;\n const halfAxes = orientedBoundingBox.halfAxes;\n\n // A region bounding volume is not transformed by the transform in the tileset JSON,\n // but may be transformed by additional transforms applied in Cesium.\n // This is why the transform is calculated as the difference between the initial transform and the current transform.\n transform = Matrix4.multiplyTransformation(\n transform,\n Matrix4.inverseTransformation(initialTransform, scratchTransform),\n scratchTransform\n );\n center = Matrix4.multiplyByPoint(transform, center, center);\n const rotationScale = Matrix4.getRotation(transform, scratchMatrix);\n halfAxes = Matrix3.multiply(rotationScale, halfAxes, halfAxes);\n\n if (defined(result) && result instanceof TileOrientedBoundingBox) {\n result.update(center, halfAxes);\n return result;\n }\n\n return new TileOrientedBoundingBox(center, halfAxes);\n}\n\nfunction createRegion(region, transform, initialTransform, result) {\n if (!Matrix4.equalsEpsilon(transform, initialTransform, CesiumMath.EPSILON8)) {\n return createBoxFromTransformedRegion(region, transform, initialTransform, result);\n }\n\n if (defined(result)) {\n return result;\n }\n\n const rectangleRegion = Rectangle.unpack(region, 0, scratchRectangle);\n\n return new TileBoundingRegion({\n rectangle: rectangleRegion,\n minimumHeight: region[4],\n maximumHeight: region[5]\n });\n}\n*/\n\nfunction createSphere(sphere, transform, result?) {\n // Find the transformed center\n const center = new Vector3(sphere[0], sphere[1], sphere[2]);\n transform.transform(center, center);\n const scale = transform.getScale(scratchScale);\n\n const uniformScale = Math.max(Math.max(scale[0], scale[1]), scale[2]);\n const radius = sphere[3] * uniformScale;\n\n if (defined(result)) {\n result.center = center;\n result.radius = radius;\n return result;\n }\n\n return new BoundingSphere(center, radius);\n}\n\n/**\n * Create OrientedBoundingBox instance from region 3D tiles bounding volume\n * @param region - region 3D tiles bounding volume\n * @returns OrientedBoundingBox instance\n */\nfunction createObbFromRegion(region: number[]): OrientedBoundingBox {\n // [west, south, east, north, minimum height, maximum height]\n // Latitudes and longitudes are in the WGS 84 datum as defined in EPSG 4979 and are in radians.\n // Heights are in meters above (or below) the WGS 84 ellipsoid.\n const [west, south, east, north, minHeight, maxHeight] = region;\n\n const northWest = Ellipsoid.WGS84.cartographicToCartesian(\n [degrees(west), degrees(north), minHeight],\n scratchNorthWest\n );\n const southEast = Ellipsoid.WGS84.cartographicToCartesian(\n [degrees(east), degrees(south), maxHeight],\n scratchSouthEast\n );\n const centerInCartesian = new Vector3().addVectors(northWest, southEast).multiplyByScalar(0.5);\n Ellipsoid.WGS84.cartesianToCartographic(centerInCartesian, scratchCenter);\n\n Ellipsoid.WGS84.cartographicToCartesian(\n [degrees(east), scratchCenter[1], scratchCenter[2]],\n scratchXAxis\n );\n Ellipsoid.WGS84.cartographicToCartesian(\n [scratchCenter[0], degrees(north), scratchCenter[2]],\n scratchYAxis\n );\n Ellipsoid.WGS84.cartographicToCartesian(\n [scratchCenter[0], scratchCenter[1], maxHeight],\n scratchZAxis\n );\n\n return createBox(\n [\n ...centerInCartesian,\n ...scratchXAxis.subtract(centerInCartesian),\n ...scratchYAxis.subtract(centerInCartesian),\n ...scratchZAxis.subtract(centerInCartesian)\n ],\n new Matrix4()\n );\n}\n\n/**\n * Convert a bounding volume defined by OrientedBoundingBox to cartographic bounds\n * @returns {CartographicBounds}\n */\nfunction orientedBoundingBoxToCartographicBounds(\n boundingVolume: OrientedBoundingBox\n): CartographicBounds {\n const result = emptyCartographicBounds();\n\n const {halfAxes} = boundingVolume as OrientedBoundingBox;\n const xAxis = new Vector3(halfAxes.getColumn(0));\n const yAxis = new Vector3(halfAxes.getColumn(1));\n const zAxis = new Vector3(halfAxes.getColumn(2));\n\n // Test all 8 corners of the box\n for (let x = 0; x < 2; x++) {\n for (let y = 0; y < 2; y++) {\n for (let z = 0; z < 2; z++) {\n scratchPoint.copy(boundingVolume.center);\n scratchPoint.add(xAxis);\n scratchPoint.add(yAxis);\n scratchPoint.add(zAxis);\n\n addToCartographicBounds(result, scratchPoint);\n zAxis.negate();\n }\n yAxis.negate();\n }\n xAxis.negate();\n }\n return result;\n}\n\n/**\n * Convert a bounding volume defined by BoundingSphere to cartographic bounds\n * @returns {CartographicBounds}\n */\nfunction boundingSphereToCartographicBounds(boundingVolume: BoundingSphere): CartographicBounds {\n const result = emptyCartographicBounds();\n\n const {center, radius} = boundingVolume as BoundingSphere;\n const point = Ellipsoid.WGS84.scaleToGeodeticSurface(center, scratchPoint);\n\n let zAxis: Vector3;\n if (point) {\n zAxis = Ellipsoid.WGS84.geodeticSurfaceNormal(point) as Vector3;\n } else {\n zAxis = new Vector3(0, 0, 1);\n }\n let xAxis = new Vector3(zAxis[2], -zAxis[1], 0);\n if (xAxis.len() > 0) {\n xAxis.normalize();\n } else {\n xAxis = new Vector3(0, 1, 0);\n }\n const yAxis = xAxis.clone().cross(zAxis);\n\n // Test 6 end points of the 3 axes\n for (const axis of [xAxis, yAxis, zAxis]) {\n scratchScale.copy(axis).scale(radius);\n for (let dir = 0; dir < 2; dir++) {\n scratchPoint.copy(center);\n scratchPoint.add(scratchScale);\n addToCartographicBounds(result, scratchPoint);\n // Flip the axis\n scratchScale.negate();\n }\n }\n return result;\n}\n\n/**\n * Create a new cartographic bounds that contains no points\n * @returns {CartographicBounds}\n */\nfunction emptyCartographicBounds(): CartographicBounds {\n return [\n [Infinity, Infinity, Infinity],\n [-Infinity, -Infinity, -Infinity]\n ];\n}\n\n/**\n * Add a point to the target cartographic bounds\n * @param {CartographicBounds} target\n * @param {Vector3} cartesian coordinates of the point to add\n */\nfunction addToCartographicBounds(target: CartographicBounds, cartesian: Readonly<Vector3>) {\n Ellipsoid.WGS84.cartesianToCartographic(cartesian, scratchPoint);\n target[0][0] = Math.min(target[0][0], scratchPoint[0]);\n target[0][1] = Math.min(target[0][1], scratchPoint[1]);\n target[0][2] = Math.min(target[0][2], scratchPoint[2]);\n\n target[1][0] = Math.max(target[1][0], scratchPoint[0]);\n target[1][1] = Math.max(target[1][1], scratchPoint[1]);\n target[1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AAG5B,IAAI,CAAC8B,GAAG,CAACF,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE5E,YAAY,CAAC,CAAC,CAAC,CAAC;EAEtD4E,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG5B,IAAI,CAACC,GAAG,CAAC2B,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE5E,YAAY,CAAC,CAAC,CAAC,CAAC;EACtD4E,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG5B,IAAI,CAACC,GAAG,CAAC2B,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE5E,YAAY,CAAC,CAAC,CAAC,CAAC;EACtD4E,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG5B,IAAI,CAACC,GAAG,CAAC2B,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE5E,YAAY,CAAC,CAAC,CAAC,CAAC;AACxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame-state.js","names":["Vector3","CullingVolume","Plane","Ellipsoid","scratchVector","scratchPosition","cullingVolume","getFrameState","viewport","frameNumber","cameraDirection","cameraUp","height","metersPerUnit","distanceScales","viewportCenterCartesian","worldToCartesian","center","enuToFixedTransform","WGS84","eastNorthUpToFixedFrame","cameraPositionCartographic","unprojectPosition","cameraPosition","cameraPositionCartesian","cartographicToCartesian","cameraDirectionCartesian","transformAsVector","scale","normalize","cameraUpCartesian","commonSpacePlanesToWGS84","ViewportClass","constructor","longitude","latitude","width","bearing","zoom","topDownViewport","pitch","camera","position","direction","up","sseDenominator","limitSelectedTiles","tiles","frameState","maximumTilesSelected","length","tuples","viewportLongitude","viewportLatitude","index","tile","entries","header","mbs","deltaLon","Math","abs","deltaLat","distance","sqrt","push","tuplesSorted","sort","a","b","selectedTiles","i","unselectedTiles","frustumPlanes","getFrustumPlanes","nearCenterCommon","closestPointOnPlane","near","nearCenterCartesian","cameraCartesian","planes","fromPointNormal","copy","subtract","dir","plane","posCommon","cartesianPos","refPoint","out","arguments","undefined","distanceToRef","normal","dot","add","point","cartographicPos"],"sources":["../../../src/tileset/helpers/frame-state.ts"],"sourcesContent":["import {Tile3D} from '@loaders.gl/tiles';\nimport {Vector3} from '@math.gl/core';\nimport {CullingVolume, Plane} from '@math.gl/culling';\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {GeospatialViewport, Viewport} from '../../types';\n\nexport type FrameState = {\n camera: {\n position: number[];\n direction: number[];\n up: number[];\n };\n viewport: GeospatialViewport;\n topDownViewport: GeospatialViewport; // Use it to calculate projected radius for a tile\n height: number;\n cullingVolume: CullingVolume;\n frameNumber: number; // TODO: This can be the same between updates, what number is unique for between updates?\n sseDenominator: number; // Assumes fovy = 60 degrees\n};\n\nconst scratchVector = new Vector3();\nconst scratchPosition = new Vector3();\nconst cullingVolume = new CullingVolume([\n new Plane(),\n new Plane(),\n new Plane(),\n new Plane(),\n new Plane(),\n new Plane()\n]);\n\n// Extracts a frame state appropriate for tile culling from a deck.gl viewport\n// TODO - this could likely be generalized and merged back into deck.gl for other culling scenarios\nexport function getFrameState(viewport: GeospatialViewport, frameNumber: number): FrameState {\n // Traverse and and request. Update _selectedTiles so that we know what to render.\n // Traverse and and request. Update _selectedTiles so that we know what to render.\n const {cameraDirection, cameraUp, height} = viewport;\n const {metersPerUnit} = viewport.distanceScales;\n\n // TODO - Ellipsoid.eastNorthUpToFixedFrame() breaks on raw array, create a Vector.\n // TODO - Ellipsoid.eastNorthUpToFixedFrame() takes a cartesian, is that intuitive?\n const viewportCenterCartesian = worldToCartesian(viewport, viewport.center);\n const enuToFixedTransform = Ellipsoid.WGS84.eastNorthUpToFixedFrame(viewportCenterCartesian);\n\n const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);\n const cameraPositionCartesian = Ellipsoid.WGS84.cartographicToCartesian(\n cameraPositionCartographic,\n new Vector3()\n );\n\n // These should still be normalized as the transform has scale 1 (goes from meters to meters)\n const cameraDirectionCartesian = new Vector3(\n // @ts-ignore\n enuToFixedTransform.transformAsVector(new Vector3(cameraDirection).scale(metersPerUnit))\n ).normalize();\n const cameraUpCartesian = new Vector3(\n // @ts-ignore\n enuToFixedTransform.transformAsVector(new Vector3(cameraUp).scale(metersPerUnit))\n ).normalize();\n\n commonSpacePlanesToWGS84(viewport);\n\n const ViewportClass = viewport.constructor;\n const {longitude, latitude, width, bearing, zoom} = viewport;\n // @ts-ignore\n const topDownViewport = new ViewportClass({\n longitude,\n latitude,\n height,\n width,\n bearing,\n zoom,\n pitch: 0\n });\n\n // TODO: make a file/class for frameState and document what needs to be attached to this so that traversal can function\n return {\n camera: {\n position: cameraPositionCartesian,\n direction: cameraDirectionCartesian,\n up: cameraUpCartesian\n },\n viewport,\n topDownViewport,\n height,\n cullingVolume,\n frameNumber, // TODO: This can be the same between updates, what number is unique for between updates?\n sseDenominator: 1.15 // Assumes fovy = 60 degrees\n };\n}\n\n/**\n * Limit `tiles` array length with `maximumTilesSelected` number.\n * The criteria for this filtering is distance of a tile center\n * to the `frameState.viewport`'s longitude and latitude\n * @param tiles - tiles array to filter\n * @param frameState - frameState to calculate distances\n * @param maximumTilesSelected - maximal amount of tiles in the output array\n * @returns new tiles array\n */\nexport function limitSelectedTiles(\n tiles: Tile3D[],\n frameState: FrameState,\n maximumTilesSelected: number\n): [Tile3D[], Tile3D[]] {\n if (maximumTilesSelected === 0 || tiles.length <= maximumTilesSelected) {\n return [tiles, []];\n }\n // Accumulate distances in couples array: [tileIndex: number, distanceToViewport: number]\n const tuples: [number, number][] = [];\n const {longitude: viewportLongitude, latitude: viewportLatitude} = frameState.viewport;\n for (const [index, tile] of tiles.entries()) {\n const [longitude, latitude] = tile.header.mbs;\n const deltaLon = Math.abs(viewportLongitude - longitude);\n const deltaLat = Math.abs(viewportLatitude - latitude);\n const distance = Math.sqrt(deltaLat * deltaLat + deltaLon * deltaLon);\n tuples.push([index, distance]);\n }\n const tuplesSorted = tuples.sort((a, b) => a[1] - b[1]);\n const selectedTiles: Tile3D[] = [];\n for (let i = 0; i < maximumTilesSelected; i++) {\n selectedTiles.push(tiles[tuplesSorted[i][0]]);\n }\n const unselectedTiles: Tile3D[] = [];\n for (let i = maximumTilesSelected; i < tuplesSorted.length; i++) {\n unselectedTiles.push(tiles[tuplesSorted[i][0]]);\n }\n\n return [selectedTiles, unselectedTiles];\n}\n\nfunction commonSpacePlanesToWGS84(viewport) {\n // Extract frustum planes based on current view.\n const frustumPlanes = viewport.getFrustumPlanes();\n\n // Get the near/far plane centers\n const nearCenterCommon = closestPointOnPlane(frustumPlanes.near, viewport.cameraPosition);\n const nearCenterCartesian = worldToCartesian(viewport, nearCenterCommon);\n const cameraCartesian = worldToCartesian(viewport, viewport.cameraPosition, scratchPosition);\n\n let i = 0;\n cullingVolume.planes[i++].fromPointNormal(\n nearCenterCartesian,\n scratchVector.copy(nearCenterCartesian).subtract(cameraCartesian)\n );\n\n for (const dir in frustumPlanes) {\n if (dir === 'near') {\n continue; // eslint-disable-line no-continue\n }\n const plane = frustumPlanes[dir];\n const posCommon = closestPointOnPlane(plane, nearCenterCommon, scratchPosition);\n const cartesianPos = worldToCartesian(viewport, posCommon, scratchPosition);\n\n cullingVolume.planes[i++].fromPointNormal(\n cartesianPos,\n // Want the normal to point into the frustum since that's what culling expects\n scratchVector.copy(nearCenterCartesian).subtract(cartesianPos)\n );\n }\n}\n\nfunction closestPointOnPlane(\n plane: {distance: number; normal: Vector3},\n refPoint: [number, number, number] | Vector3,\n out: Vector3 = new Vector3()\n): Vector3 {\n const distanceToRef = plane.normal.dot(refPoint);\n out\n .copy(plane.normal)\n .scale(plane.distance - distanceToRef)\n .add(refPoint);\n return out;\n}\n\nfunction worldToCartesian(\n viewport: Viewport,\n point: number[] | Vector3,\n out: Vector3 = new Vector3()\n): Vector3 {\n const cartographicPos = viewport.unprojectPosition(point);\n return Ellipsoid.WGS84.cartographicToCartesian(cartographicPos, out);\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,GAAG6B,aAAa,CAAC,CACrCG,GAAG,CAACP,QAAQ,CAAC;EAChB,OAAOC,GAAG;AACZ;AAEA,SAASzE,gBAAgBA,CACvBR,QAAkB,EAClBwF,KAAyB,EAEhB;EAAA,IADTP,GAAY,GAAAC,SAAA,CAAAxC,MAAA,QAAAwC,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,IAAI1F,OAAO,CAAC,CAAC;EAE5B,MAAMiG,eAAe,GAAGzF,QAAQ,CAACc,iBAAiB,CAAC0E,KAAK,CAAC;EACzD,OAAO7F,SAAS,CAACgB,KAAK,CAACM,uBAAuB,CAACwE,eAAe,EAAER,GAAG,CAAC;AACtE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-lod.js","names":["Matrix4","Vector3","Ellipsoid","cameraPositionCartesian","toEye","cameraPositionEnu","extraVertexEnu","projectedOriginVector","enuToCartesianMatrix","cartesianToEnuMatrix","getLodStatus","tile","frameState","lodMetricValue","isNaN","screenSize","getProjectedRadius","header","children","topDownViewport","viewport","mbsLat","mbs","mbsLon","mbsZ","mbsR","mbsCenterCartesian","boundingVolume","center","cameraPositionCartographic","unprojectPosition","cameraPosition","WGS84","cartographicToCartesian","copy","subtract","normalize","eastNorthUpToFixedFrame","invert","transform","projection","Math","sqrt","extraZ","extraVertexCartesian","extraVectorCartesian","radiusVector","cross","scale","sphereMbsBorderVertexCartesian","add","sphereMbsBorderVertexCartographic","cartesianToCartographic","projectedOrigin","project","projectedMbsBorderVertex","projectedRadius","magnitude"],"sources":["../../../src/tileset/helpers/i3s-lod.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Matrix4, Vector3} from '@math.gl/core';\nimport {Ellipsoid} from '@math.gl/geospatial';\nimport {Tile3D} from '../tile-3d';\nimport {FrameState} from './frame-state';\n\nconst cameraPositionCartesian = new Vector3();\nconst toEye = new Vector3();\nconst cameraPositionEnu = new Vector3();\nconst extraVertexEnu = new Vector3();\nconst projectedOriginVector = new Vector3();\nconst enuToCartesianMatrix = new Matrix4();\nconst cartesianToEnuMatrix = new Matrix4();\n\n/**\n * For the maxScreenThreshold error metric, maxError means that you should replace the node with it's children\n as soon as the nodes bounding sphere has a screen radius larger than maxError pixels.\n In this sense a value of 0 means you should always load it's children,\n or if it's a leaf node, you should always display it.\n * @param tile \n * @param frameState \n * @returns \n */\nexport function getLodStatus(tile: Tile3D, frameState: FrameState): 'DIG' | 'OUT' | 'DRAW' {\n if (tile.lodMetricValue === 0 || isNaN(tile.lodMetricValue)) {\n return 'DIG';\n }\n const screenSize = 2 * getProjectedRadius(tile, frameState);\n if (screenSize < 2) {\n return 'OUT';\n }\n if (!tile.header.children || screenSize <= tile.lodMetricValue) {\n return 'DRAW';\n } else if (tile.header.children) {\n return 'DIG';\n }\n return 'OUT';\n}\n\n/**\n * Calculate size of MBS radius projected on the screen plane\n * @param tile\n * @param frameState\n * @returns\n */\n// eslint-disable-next-line max-statements\nexport function getProjectedRadius(tile: Tile3D, frameState: FrameState): number {\n const {topDownViewport: viewport} = frameState;\n const mbsLat = tile.header.mbs[1];\n const mbsLon = tile.header.mbs[0];\n const mbsZ = tile.header.mbs[2];\n const mbsR = tile.header.mbs[3];\n const mbsCenterCartesian = [...tile.boundingVolume.center];\n const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);\n Ellipsoid.WGS84.cartographicToCartesian(cameraPositionCartographic, cameraPositionCartesian);\n\n // ---------------------------\n // Calculate mbs border vertex\n // ---------------------------\n toEye.copy(cameraPositionCartesian).subtract(mbsCenterCartesian).normalize();\n // Add extra vector to form plane\n Ellipsoid.WGS84.eastNorthUpToFixedFrame(mbsCenterCartesian, enuToCartesianMatrix);\n cartesianToEnuMatrix.copy(enuToCartesianMatrix).invert();\n cameraPositionEnu.copy(cameraPositionCartesian).transform(cartesianToEnuMatrix);\n // Mean Proportionals in Right Triangles - Altitude rule\n // https://mathbitsnotebook.com/Geometry/RightTriangles/RTmeanRight.html\n const projection = Math.sqrt(\n cameraPositionEnu[0] * cameraPositionEnu[0] + cameraPositionEnu[1] * cameraPositionEnu[1]\n );\n const extraZ = (projection * projection) / cameraPositionEnu[2];\n extraVertexEnu.copy([cameraPositionEnu[0], cameraPositionEnu[1], extraZ]);\n const extraVertexCartesian = extraVertexEnu.transform(enuToCartesianMatrix);\n const extraVectorCartesian = extraVertexCartesian.subtract(mbsCenterCartesian).normalize();\n // We need radius vector orthogonal to toEye vector\n const radiusVector = toEye.cross(extraVectorCartesian).normalize().scale(mbsR);\n const sphereMbsBorderVertexCartesian = radiusVector.add(mbsCenterCartesian);\n const sphereMbsBorderVertexCartographic = Ellipsoid.WGS84.cartesianToCartographic(\n sphereMbsBorderVertexCartesian\n );\n // ---------------------------\n\n // Project center vertex and border vertex and calculate projected radius of MBS\n const projectedOrigin = viewport.project([mbsLon, mbsLat, mbsZ]);\n const projectedMbsBorderVertex = viewport.project(\n sphereMbsBorderVertexCartographic as [number, number, number]\n );\n const projectedRadius = projectedOriginVector\n .copy(projectedOrigin)\n .subtract(projectedMbsBorderVertex)\n .magnitude();\n return projectedRadius;\n}\n"],"mappings":"AAIA,SAAQA,OAAO,EAAEC,OAAO,QAAO,eAAe;AAC9C,SAAQC,SAAS,QAAO,qBAAqB;AAI7C,MAAMC,uBAAuB,GAAG,IAAIF,OAAO,CAAC,CAAC;AAC7C,MAAMG,KAAK,GAAG,IAAIH,OAAO,CAAC,CAAC;AAC3B,MAAMI,iBAAiB,GAAG,IAAIJ,OAAO,CAAC,CAAC;AACvC,MAAMK,cAAc,GAAG,IAAIL,OAAO,CAAC,CAAC;AACpC,MAAMM,qBAAqB,GAAG,IAAIN,OAAO,CAAC,CAAC;AAC3C,MAAMO,oBAAoB,GAAG,IAAIR,OAAO,CAAC,CAAC;AAC1C,MAAMS,oBAAoB,GAAG,IAAIT,OAAO,CAAC,CAAC;AAW1C,OAAO,SAASU,YAAYA,CAACC,IAAY,EAAEC,UAAsB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