@loaders.gl/terrain 3.2.12 → 3.3.0-alpha.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/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/index.js +10 -24
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/decode-quantized-mesh.js +18 -65
- package/dist/es5/lib/decode-quantized-mesh.js.map +1 -1
- package/dist/es5/lib/delatin/index.js +46 -104
- package/dist/es5/lib/delatin/index.js.map +1 -1
- package/dist/es5/lib/helpers/skirt.js +12 -20
- package/dist/es5/lib/helpers/skirt.js.map +1 -1
- package/dist/es5/lib/parse-quantized-mesh.js +22 -39
- package/dist/es5/lib/parse-quantized-mesh.js.map +1 -1
- package/dist/es5/lib/parse-terrain.js +23 -57
- package/dist/es5/lib/parse-terrain.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/lib/utils/version.js.map +1 -1
- package/dist/es5/quantized-mesh-loader.js +0 -2
- package/dist/es5/quantized-mesh-loader.js.map +1 -1
- package/dist/es5/terrain-loader.js +1 -2
- package/dist/es5/terrain-loader.js.map +1 -1
- package/dist/es5/workers/quantized-mesh-worker.js +0 -2
- package/dist/es5/workers/quantized-mesh-worker.js.map +1 -1
- package/dist/es5/workers/terrain-worker.js +0 -2
- package/dist/es5/workers/terrain-worker.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/index.js +7 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/decode-quantized-mesh.js +6 -40
- package/dist/esm/lib/decode-quantized-mesh.js.map +1 -1
- package/dist/esm/lib/delatin/index.js +18 -98
- package/dist/esm/lib/delatin/index.js.map +1 -1
- package/dist/esm/lib/helpers/skirt.js +16 -19
- package/dist/esm/lib/helpers/skirt.js.map +1 -1
- package/dist/esm/lib/parse-quantized-mesh.js +2 -6
- package/dist/esm/lib/parse-quantized-mesh.js.map +1 -1
- package/dist/esm/lib/parse-terrain.js +6 -19
- package/dist/esm/lib/parse-terrain.js.map +1 -1
- package/dist/esm/lib/utils/version.js +2 -1
- package/dist/esm/lib/utils/version.js.map +1 -1
- package/dist/esm/quantized-mesh-loader.js +1 -0
- package/dist/esm/quantized-mesh-loader.js.map +1 -1
- package/dist/esm/terrain-loader.js +2 -0
- package/dist/esm/terrain-loader.js.map +1 -1
- package/dist/esm/workers/quantized-mesh-worker.js.map +1 -1
- package/dist/esm/workers/terrain-worker.js.map +1 -1
- package/dist/lib/decode-quantized-mesh.d.ts +1 -1
- package/dist/lib/decode-quantized-mesh.d.ts.map +1 -1
- package/dist/lib/helpers/skirt.d.ts +1 -1
- package/dist/lib/helpers/skirt.d.ts.map +1 -1
- package/dist/lib/parse-quantized-mesh.js +5 -1
- package/dist/quantized-mesh-worker.js +1 -1
- package/dist/terrain-worker.js +1 -1
- package/package.json +4 -4
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports._typecheckTerrainWorkerLoader = exports.TerrainLoader = void 0;
|
|
7
|
-
|
|
8
7
|
var _version = require("./lib/utils/version");
|
|
9
|
-
|
|
10
8
|
var TerrainLoader = {
|
|
11
9
|
name: 'Terrain',
|
|
12
10
|
id: 'terrain',
|
|
@@ -30,6 +28,7 @@ var TerrainLoader = {
|
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
};
|
|
31
|
+
|
|
33
32
|
exports.TerrainLoader = TerrainLoader;
|
|
34
33
|
var _typecheckTerrainWorkerLoader = TerrainLoader;
|
|
35
34
|
exports._typecheckTerrainWorkerLoader = _typecheckTerrainWorkerLoader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"terrain-loader.js","names":["TerrainLoader","name","id","module","version","VERSION","worker","extensions","mimeTypes","options","terrain","tesselator","bounds","meshMaxError","elevationDecoder","rScaler","gScaler","bScaler","offset","skirtHeight","_typecheckTerrainWorkerLoader"],"sources":["../../src/terrain-loader.ts"],"sourcesContent":["import type {Loader} from '@loaders.gl/loader-utils';\nimport {VERSION} from './lib/utils/version';\n\n/**\n * Worker loader for color-encoded images\n */\nexport const TerrainLoader = {\n name: 'Terrain',\n id: 'terrain',\n module: 'terrain',\n version: VERSION,\n worker: true,\n extensions: ['png', 'pngraw', 'jpg', 'jpeg', 'gif', 'webp', 'bmp'],\n mimeTypes: ['image/png', 'image/jpeg', 'image/gif', 'image/webp', 'image/bmp'],\n options: {\n terrain: {\n tesselator: 'auto',\n bounds: null,\n meshMaxError: 10,\n elevationDecoder: {\n rScaler: 1,\n gScaler: 0,\n bScaler: 0,\n offset: 0\n },\n skirtHeight: null\n }\n }\n};\n\n/**\n * Loader for color-encoded images\n */\nexport const _typecheckTerrainWorkerLoader: Loader = TerrainLoader;\n"],"mappings":";;;;;;AACA;AAKO,IAAMA,aAAa,GAAG;EAC3BC,IAAI,EAAE,SAAS;EACfC,EAAE,EAAE,SAAS;EACbC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAEC,gBAAO;EAChBC,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;EAClEC,SAAS,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;EAC9EC,OAAO,EAAE;IACPC,OAAO,EAAE;MACPC,UAAU,EAAE,MAAM;MAClBC,MAAM,EAAE,IAAI;MACZC,YAAY,EAAE,EAAE;MAChBC,gBAAgB,EAAE;QAChBC,OAAO,EAAE,CAAC;QACVC,OAAO,EAAE,CAAC;QACVC,OAAO,EAAE,CAAC;QACVC,MAAM,EAAE;MACV,CAAC;MACDC,WAAW,EAAE;IACf;EACF;AACF,CAAC;;AAAC;AAKK,IAAMC,6BAAqC,GAAGpB,aAAa;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"quantized-mesh-worker.js","names":["createLoaderWorker","QuantizedMeshLoader"],"sources":["../../../src/workers/quantized-mesh-worker.ts"],"sourcesContent":["import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport {QuantizedMeshLoader} from '../index';\n\ncreateLoaderWorker(QuantizedMeshLoader);\n"],"mappings":";;AAAA;AACA;AAEA,IAAAA,+BAAkB,EAACC,0BAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"terrain-worker.js","names":["createLoaderWorker","TerrainLoader"],"sources":["../../../src/workers/terrain-worker.ts"],"sourcesContent":["import {createLoaderWorker} from '@loaders.gl/loader-utils';\nimport {TerrainLoader} from '../index';\n\ncreateLoaderWorker(TerrainLoader);\n"],"mappings":";;AAAA;AACA;AAEA,IAAAA,+BAAkB,EAACC,oBAAa,CAAC"}
|
package/dist/esm/bundle.js
CHANGED
package/dist/esm/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":";AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAS,CAAC;AACxCC,UAAU,CAACC,OAAO,GAAGD,UAAU,CAACC,OAAO,IAAI,CAAC,CAAC;AAC7CC,MAAM,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACL,UAAU,CAACC,OAAO,EAAEH,aAAa,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,13 +2,18 @@ import parseQuantizedMesh from './lib/parse-quantized-mesh';
|
|
|
2
2
|
import loadTerrain from './lib/parse-terrain';
|
|
3
3
|
import { TerrainLoader as TerrainWorkerLoader } from './terrain-loader';
|
|
4
4
|
import { QuantizedMeshLoader as QuantizedMeshWorkerLoader } from './quantized-mesh-loader';
|
|
5
|
+
|
|
5
6
|
export { TerrainWorkerLoader };
|
|
6
|
-
export const TerrainLoader = {
|
|
7
|
+
export const TerrainLoader = {
|
|
8
|
+
...TerrainWorkerLoader,
|
|
7
9
|
parse: loadTerrain
|
|
8
10
|
};
|
|
9
11
|
export const _typecheckTerrainLoader = TerrainLoader;
|
|
12
|
+
|
|
10
13
|
export { QuantizedMeshWorkerLoader };
|
|
11
|
-
|
|
14
|
+
|
|
15
|
+
export const QuantizedMeshLoader = {
|
|
16
|
+
...QuantizedMeshWorkerLoader,
|
|
12
17
|
parseSync: parseQuantizedMesh,
|
|
13
18
|
parse: async (arrayBuffer, options) => parseQuantizedMesh(arrayBuffer, options)
|
|
14
19
|
};
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["parseQuantizedMesh","loadTerrain","TerrainLoader","TerrainWorkerLoader","QuantizedMeshLoader","QuantizedMeshWorkerLoader","parse","_typecheckTerrainLoader","parseSync","arrayBuffer","options","_typecheckQuantizedMeshLoader"],"sources":["../../src/index.ts"],"sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport parseQuantizedMesh from './lib/parse-quantized-mesh';\nimport loadTerrain from './lib/parse-terrain';\n\nimport {TerrainLoader as TerrainWorkerLoader} from './terrain-loader';\nimport {QuantizedMeshLoader as QuantizedMeshWorkerLoader} from './quantized-mesh-loader';\n\n// TerrainLoader\n\nexport {TerrainWorkerLoader};\n\nexport const TerrainLoader = {\n ...TerrainWorkerLoader,\n parse: loadTerrain\n};\n\nexport const _typecheckTerrainLoader: LoaderWithParser = TerrainLoader; // eslint-disable-line\n\n// QuantizedMeshLoader\n\nexport {QuantizedMeshWorkerLoader};\n\n/**\n * Loader for quantized meshes\n */\nexport const QuantizedMeshLoader = {\n ...QuantizedMeshWorkerLoader,\n parseSync: parseQuantizedMesh,\n parse: async (arrayBuffer, options) => parseQuantizedMesh(arrayBuffer, options)\n};\n\nexport const _typecheckQuantizedMeshLoader: LoaderWithParser = QuantizedMeshLoader;\n"],"mappings":"AACA,OAAOA,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,WAAW,MAAM,qBAAqB;AAE7C,SAAQC,aAAa,IAAIC,mBAAmB,QAAO,kBAAkB;AACrE,SAAQC,mBAAmB,IAAIC,yBAAyB,QAAO,yBAAyB;;AAIxF,SAAQF,mBAAmB;AAE3B,OAAO,MAAMD,aAAa,GAAG;EAC3B,GAAGC,mBAAmB;EACtBG,KAAK,EAAEL;AACT,CAAC;AAED,OAAO,MAAMM,uBAAyC,GAAGL,aAAa;;AAItE,SAAQG,yBAAyB;;AAKjC,OAAO,MAAMD,mBAAmB,GAAG;EACjC,GAAGC,yBAAyB;EAC5BG,SAAS,EAAER,kBAAkB;EAC7BM,KAAK,EAAE,OAAOG,WAAW,EAAEC,OAAO,KAAKV,kBAAkB,CAACS,WAAW,EAAEC,OAAO;AAChF,CAAC;AAED,OAAO,MAAMC,6BAA+C,GAAGP,mBAAmB"}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
const QUANTIZED_MESH_HEADER = new Map([['centerX', Float64Array.BYTES_PER_ELEMENT], ['centerY', Float64Array.BYTES_PER_ELEMENT], ['centerZ', Float64Array.BYTES_PER_ELEMENT], ['minHeight', Float32Array.BYTES_PER_ELEMENT], ['maxHeight', Float32Array.BYTES_PER_ELEMENT], ['boundingSphereCenterX', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereCenterY', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereCenterZ', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereRadius', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointX', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointY', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointZ', Float64Array.BYTES_PER_ELEMENT]]);
|
|
2
1
|
|
|
2
|
+
|
|
3
|
+
const QUANTIZED_MESH_HEADER = new Map([['centerX', Float64Array.BYTES_PER_ELEMENT], ['centerY', Float64Array.BYTES_PER_ELEMENT], ['centerZ', Float64Array.BYTES_PER_ELEMENT], ['minHeight', Float32Array.BYTES_PER_ELEMENT], ['maxHeight', Float32Array.BYTES_PER_ELEMENT], ['boundingSphereCenterX', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereCenterY', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereCenterZ', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereRadius', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointX', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointY', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointZ', Float64Array.BYTES_PER_ELEMENT]]);
|
|
3
4
|
function decodeZigZag(value) {
|
|
4
5
|
return value >> 1 ^ -(value & 1);
|
|
5
6
|
}
|
|
6
|
-
|
|
7
7
|
function decodeHeader(dataView) {
|
|
8
8
|
let position = 0;
|
|
9
9
|
const header = {};
|
|
10
|
-
|
|
11
10
|
for (const [key, bytesCount] of QUANTIZED_MESH_HEADER) {
|
|
12
11
|
const getter = bytesCount === 8 ? dataView.getFloat64 : dataView.getFloat32;
|
|
13
12
|
header[key] = getter.call(dataView, position, true);
|
|
14
13
|
position += bytesCount;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
return {
|
|
18
16
|
header,
|
|
19
17
|
headerEndPosition: position
|
|
20
18
|
};
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
function decodeVertexData(dataView, headerEndPosition) {
|
|
24
21
|
let position = headerEndPosition;
|
|
25
22
|
const elementsPerVertex = 3;
|
|
@@ -34,7 +31,6 @@ function decodeVertexData(dataView, headerEndPosition) {
|
|
|
34
31
|
let u = 0;
|
|
35
32
|
let v = 0;
|
|
36
33
|
let height = 0;
|
|
37
|
-
|
|
38
34
|
for (let i = 0; i < vertexCount; i++) {
|
|
39
35
|
u += decodeZigZag(dataView.getUint16(uArrayStartPosition + bytesPerArrayElement * i, true));
|
|
40
36
|
v += decodeZigZag(dataView.getUint16(vArrayStartPosition + bytesPerArrayElement * i, true));
|
|
@@ -43,51 +39,41 @@ function decodeVertexData(dataView, headerEndPosition) {
|
|
|
43
39
|
vertexData[i + vertexCount] = v;
|
|
44
40
|
vertexData[i + vertexCount * 2] = height;
|
|
45
41
|
}
|
|
46
|
-
|
|
47
42
|
position += elementArrayLength * 3;
|
|
48
43
|
return {
|
|
49
44
|
vertexData,
|
|
50
45
|
vertexDataEndPosition: position
|
|
51
46
|
};
|
|
52
47
|
}
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
function decodeIndex(buffer, position, indicesCount, bytesPerIndex) {
|
|
49
|
+
let encoded = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
55
50
|
let indices;
|
|
56
|
-
|
|
57
51
|
if (bytesPerIndex === 2) {
|
|
58
52
|
indices = new Uint16Array(buffer, position, indicesCount);
|
|
59
53
|
} else {
|
|
60
54
|
indices = new Uint32Array(buffer, position, indicesCount);
|
|
61
55
|
}
|
|
62
|
-
|
|
63
56
|
if (!encoded) {
|
|
64
57
|
return indices;
|
|
65
58
|
}
|
|
66
|
-
|
|
67
59
|
let highest = 0;
|
|
68
|
-
|
|
69
60
|
for (let i = 0; i < indices.length; ++i) {
|
|
70
61
|
const code = indices[i];
|
|
71
62
|
indices[i] = highest - code;
|
|
72
|
-
|
|
73
63
|
if (code === 0) {
|
|
74
64
|
++highest;
|
|
75
65
|
}
|
|
76
66
|
}
|
|
77
|
-
|
|
78
67
|
return indices;
|
|
79
68
|
}
|
|
80
|
-
|
|
81
69
|
function decodeTriangleIndices(dataView, vertexData, vertexDataEndPosition) {
|
|
82
70
|
let position = vertexDataEndPosition;
|
|
83
71
|
const elementsPerVertex = 3;
|
|
84
72
|
const vertexCount = vertexData.length / elementsPerVertex;
|
|
85
73
|
const bytesPerIndex = vertexCount > 65536 ? Uint32Array.BYTES_PER_ELEMENT : Uint16Array.BYTES_PER_ELEMENT;
|
|
86
|
-
|
|
87
74
|
if (position % bytesPerIndex !== 0) {
|
|
88
75
|
position += bytesPerIndex - position % bytesPerIndex;
|
|
89
76
|
}
|
|
90
|
-
|
|
91
77
|
const triangleCount = dataView.getUint32(position, true);
|
|
92
78
|
position += Uint32Array.BYTES_PER_ELEMENT;
|
|
93
79
|
const triangleIndicesCount = triangleCount * 3;
|
|
@@ -98,7 +84,6 @@ function decodeTriangleIndices(dataView, vertexData, vertexDataEndPosition) {
|
|
|
98
84
|
triangleIndices
|
|
99
85
|
};
|
|
100
86
|
}
|
|
101
|
-
|
|
102
87
|
function decodeEdgeIndices(dataView, vertexData, triangleIndicesEndPosition) {
|
|
103
88
|
let position = triangleIndicesEndPosition;
|
|
104
89
|
const elementsPerVertex = 3;
|
|
@@ -128,60 +113,49 @@ function decodeEdgeIndices(dataView, vertexData, triangleIndicesEndPosition) {
|
|
|
128
113
|
northIndices
|
|
129
114
|
};
|
|
130
115
|
}
|
|
131
|
-
|
|
132
116
|
function decodeVertexNormalsExtension(extensionDataView) {
|
|
133
117
|
return new Uint8Array(extensionDataView.buffer, extensionDataView.byteOffset, extensionDataView.byteLength);
|
|
134
118
|
}
|
|
135
|
-
|
|
136
119
|
function decodeWaterMaskExtension(extensionDataView) {
|
|
137
120
|
return extensionDataView.buffer.slice(extensionDataView.byteOffset, extensionDataView.byteOffset + extensionDataView.byteLength);
|
|
138
121
|
}
|
|
139
|
-
|
|
140
122
|
function decodeExtensions(dataView, indicesEndPosition) {
|
|
141
123
|
const extensions = {};
|
|
142
|
-
|
|
143
124
|
if (dataView.byteLength <= indicesEndPosition) {
|
|
144
125
|
return {
|
|
145
126
|
extensions,
|
|
146
127
|
extensionsEndPosition: indicesEndPosition
|
|
147
128
|
};
|
|
148
129
|
}
|
|
149
|
-
|
|
150
130
|
let position = indicesEndPosition;
|
|
151
|
-
|
|
152
131
|
while (position < dataView.byteLength) {
|
|
153
132
|
const extensionId = dataView.getUint8(position, true);
|
|
154
133
|
position += Uint8Array.BYTES_PER_ELEMENT;
|
|
155
134
|
const extensionLength = dataView.getUint32(position, true);
|
|
156
135
|
position += Uint32Array.BYTES_PER_ELEMENT;
|
|
157
136
|
const extensionView = new DataView(dataView.buffer, position, extensionLength);
|
|
158
|
-
|
|
159
137
|
switch (extensionId) {
|
|
160
138
|
case 1:
|
|
161
139
|
{
|
|
162
140
|
extensions.vertexNormals = decodeVertexNormalsExtension(extensionView);
|
|
163
141
|
break;
|
|
164
142
|
}
|
|
165
|
-
|
|
166
143
|
case 2:
|
|
167
144
|
{
|
|
168
145
|
extensions.waterMask = decodeWaterMaskExtension(extensionView);
|
|
169
146
|
break;
|
|
170
147
|
}
|
|
171
|
-
|
|
172
148
|
default:
|
|
173
|
-
{
|
|
149
|
+
{
|
|
150
|
+
}
|
|
174
151
|
}
|
|
175
|
-
|
|
176
152
|
position += extensionLength;
|
|
177
153
|
}
|
|
178
|
-
|
|
179
154
|
return {
|
|
180
155
|
extensions,
|
|
181
156
|
extensionsEndPosition: position
|
|
182
157
|
};
|
|
183
158
|
}
|
|
184
|
-
|
|
185
159
|
export const DECODING_STEPS = {
|
|
186
160
|
header: 0,
|
|
187
161
|
vertices: 1,
|
|
@@ -199,30 +173,25 @@ export default function decode(data, userOptions) {
|
|
|
199
173
|
header,
|
|
200
174
|
headerEndPosition
|
|
201
175
|
} = decodeHeader(view);
|
|
202
|
-
|
|
203
176
|
if (options.maxDecodingStep < DECODING_STEPS.vertices) {
|
|
204
177
|
return {
|
|
205
178
|
header
|
|
206
179
|
};
|
|
207
180
|
}
|
|
208
|
-
|
|
209
181
|
const {
|
|
210
182
|
vertexData,
|
|
211
183
|
vertexDataEndPosition
|
|
212
184
|
} = decodeVertexData(view, headerEndPosition);
|
|
213
|
-
|
|
214
185
|
if (options.maxDecodingStep < DECODING_STEPS.triangleIndices) {
|
|
215
186
|
return {
|
|
216
187
|
header,
|
|
217
188
|
vertexData
|
|
218
189
|
};
|
|
219
190
|
}
|
|
220
|
-
|
|
221
191
|
const {
|
|
222
192
|
triangleIndices,
|
|
223
193
|
triangleIndicesEndPosition
|
|
224
194
|
} = decodeTriangleIndices(view, vertexData, vertexDataEndPosition);
|
|
225
|
-
|
|
226
195
|
if (options.maxDecodingStep < DECODING_STEPS.edgeIndices) {
|
|
227
196
|
return {
|
|
228
197
|
header,
|
|
@@ -230,7 +199,6 @@ export default function decode(data, userOptions) {
|
|
|
230
199
|
triangleIndices
|
|
231
200
|
};
|
|
232
201
|
}
|
|
233
|
-
|
|
234
202
|
const {
|
|
235
203
|
westIndices,
|
|
236
204
|
southIndices,
|
|
@@ -238,7 +206,6 @@ export default function decode(data, userOptions) {
|
|
|
238
206
|
northIndices,
|
|
239
207
|
edgeIndicesEndPosition
|
|
240
208
|
} = decodeEdgeIndices(view, vertexData, triangleIndicesEndPosition);
|
|
241
|
-
|
|
242
209
|
if (options.maxDecodingStep < DECODING_STEPS.extensions) {
|
|
243
210
|
return {
|
|
244
211
|
header,
|
|
@@ -250,7 +217,6 @@ export default function decode(data, userOptions) {
|
|
|
250
217
|
southIndices
|
|
251
218
|
};
|
|
252
219
|
}
|
|
253
|
-
|
|
254
220
|
const {
|
|
255
221
|
extensions
|
|
256
222
|
} = decodeExtensions(view, edgeIndicesEndPosition);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/decode-quantized-mesh.ts"],"names":["QUANTIZED_MESH_HEADER","Map","Float64Array","BYTES_PER_ELEMENT","Float32Array","decodeZigZag","value","decodeHeader","dataView","position","header","key","bytesCount","getter","getFloat64","getFloat32","call","headerEndPosition","decodeVertexData","elementsPerVertex","vertexCount","getUint32","vertexData","Uint16Array","Uint32Array","bytesPerArrayElement","elementArrayLength","uArrayStartPosition","vArrayStartPosition","heightArrayStartPosition","u","v","height","i","getUint16","vertexDataEndPosition","decodeIndex","buffer","indicesCount","bytesPerIndex","encoded","indices","highest","length","code","decodeTriangleIndices","triangleCount","triangleIndicesCount","triangleIndices","triangleIndicesEndPosition","decodeEdgeIndices","westVertexCount","westIndices","southVertexCount","southIndices","eastVertexCount","eastIndices","northVertexCount","northIndices","edgeIndicesEndPosition","decodeVertexNormalsExtension","extensionDataView","Uint8Array","byteOffset","byteLength","decodeWaterMaskExtension","slice","decodeExtensions","indicesEndPosition","extensions","extensionsEndPosition","extensionId","getUint8","extensionLength","extensionView","DataView","vertexNormals","waterMask","DECODING_STEPS","vertices","edgeIndices","DEFAULT_OPTIONS","maxDecodingStep","decode","data","userOptions","options","Object","assign","view"],"mappings":"AAoBA,MAAMA,qBAAqB,GAAG,IAAIC,GAAJ,CAAQ,CACpC,CAAC,SAAD,EAAYC,YAAY,CAACC,iBAAzB,CADoC,EAEpC,CAAC,SAAD,EAAYD,YAAY,CAACC,iBAAzB,CAFoC,EAGpC,CAAC,SAAD,EAAYD,YAAY,CAACC,iBAAzB,CAHoC,EAKpC,CAAC,WAAD,EAAcC,YAAY,CAACD,iBAA3B,CALoC,EAMpC,CAAC,WAAD,EAAcC,YAAY,CAACD,iBAA3B,CANoC,EAQpC,CAAC,uBAAD,EAA0BD,YAAY,CAACC,iBAAvC,CARoC,EASpC,CAAC,uBAAD,EAA0BD,YAAY,CAACC,iBAAvC,CAToC,EAUpC,CAAC,uBAAD,EAA0BD,YAAY,CAACC,iBAAvC,CAVoC,EAWpC,CAAC,sBAAD,EAAyBD,YAAY,CAACC,iBAAtC,CAXoC,EAapC,CAAC,wBAAD,EAA2BD,YAAY,CAACC,iBAAxC,CAboC,EAcpC,CAAC,wBAAD,EAA2BD,YAAY,CAACC,iBAAxC,CAdoC,EAepC,CAAC,wBAAD,EAA2BD,YAAY,CAACC,iBAAxC,CAfoC,CAAR,CAA9B;;AAkBA,SAASE,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K;AAKLM,MAAAA,YALK;AAMLF,MAAAA,WANK;AAOLF,MAAAA;AAPK,KAAP;AASD;;AAED,QAAM;AAACe,IAAAA;AAAD,MAAeF,gBAAgB,CAACsB,IAAD,EAAO9B,sBAAP,CAArC;AAEA,SAAO;AACLjD,IAAAA,MADK;AAELY,IAAAA,UAFK;AAGL0B,IAAAA,eAHK;AAILI,IAAAA,WAJK;AAKLM,IAAAA,YALK;AAMLF,IAAAA,WANK;AAOLF,IAAAA,YAPK;AAQLe,IAAAA;AARK,GAAP;AAUD","sourcesContent":["// Copyright (C) 2018-2019 HERE Europe B.V.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nconst QUANTIZED_MESH_HEADER = new Map([\n ['centerX', Float64Array.BYTES_PER_ELEMENT],\n ['centerY', Float64Array.BYTES_PER_ELEMENT],\n ['centerZ', Float64Array.BYTES_PER_ELEMENT],\n\n ['minHeight', Float32Array.BYTES_PER_ELEMENT],\n ['maxHeight', Float32Array.BYTES_PER_ELEMENT],\n\n ['boundingSphereCenterX', Float64Array.BYTES_PER_ELEMENT],\n ['boundingSphereCenterY', Float64Array.BYTES_PER_ELEMENT],\n ['boundingSphereCenterZ', Float64Array.BYTES_PER_ELEMENT],\n ['boundingSphereRadius', Float64Array.BYTES_PER_ELEMENT],\n\n ['horizonOcclusionPointX', Float64Array.BYTES_PER_ELEMENT],\n ['horizonOcclusionPointY', Float64Array.BYTES_PER_ELEMENT],\n ['horizonOcclusionPointZ', Float64Array.BYTES_PER_ELEMENT]\n]);\n\nfunction decodeZigZag(value) {\n return (value >> 1) ^ -(value & 1);\n}\n\nfunction decodeHeader(dataView) {\n let position = 0;\n const header = {};\n\n for (const [key, bytesCount] of QUANTIZED_MESH_HEADER) {\n const getter = bytesCount === 8 ? dataView.getFloat64 : dataView.getFloat32;\n\n header[key] = getter.call(dataView, position, true);\n position += bytesCount;\n }\n\n return {header, headerEndPosition: position};\n}\n\nfunction decodeVertexData(dataView, headerEndPosition) {\n let position = headerEndPosition;\n const elementsPerVertex = 3;\n const vertexCount = dataView.getUint32(position, true);\n const vertexData = new Uint16Array(vertexCount * elementsPerVertex);\n\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const bytesPerArrayElement = Uint16Array.BYTES_PER_ELEMENT;\n const elementArrayLength = vertexCount * bytesPerArrayElement;\n const uArrayStartPosition = position;\n const vArrayStartPosition = uArrayStartPosition + elementArrayLength;\n const heightArrayStartPosition = vArrayStartPosition + elementArrayLength;\n\n let u = 0;\n let v = 0;\n let height = 0;\n\n for (let i = 0; i < vertexCount; i++) {\n u += decodeZigZag(dataView.getUint16(uArrayStartPosition + bytesPerArrayElement * i, true));\n v += decodeZigZag(dataView.getUint16(vArrayStartPosition + bytesPerArrayElement * i, true));\n height += decodeZigZag(\n dataView.getUint16(heightArrayStartPosition + bytesPerArrayElement * i, true)\n );\n\n vertexData[i] = u;\n vertexData[i + vertexCount] = v;\n vertexData[i + vertexCount * 2] = height;\n }\n\n position += elementArrayLength * 3;\n\n return {vertexData, vertexDataEndPosition: position};\n}\n\nfunction decodeIndex(buffer, position, indicesCount, bytesPerIndex, encoded = true) {\n let indices;\n\n if (bytesPerIndex === 2) {\n indices = new Uint16Array(buffer, position, indicesCount);\n } else {\n indices = new Uint32Array(buffer, position, indicesCount);\n }\n\n if (!encoded) {\n return indices;\n }\n\n let highest = 0;\n\n for (let i = 0; i < indices.length; ++i) {\n const code = indices[i];\n\n indices[i] = highest - code;\n\n if (code === 0) {\n ++highest;\n }\n }\n\n return indices;\n}\n\nfunction decodeTriangleIndices(dataView, vertexData, vertexDataEndPosition) {\n let position = vertexDataEndPosition;\n const elementsPerVertex = 3;\n const vertexCount = vertexData.length / elementsPerVertex;\n const bytesPerIndex =\n vertexCount > 65536 ? Uint32Array.BYTES_PER_ELEMENT : Uint16Array.BYTES_PER_ELEMENT;\n\n if (position % bytesPerIndex !== 0) {\n position += bytesPerIndex - (position % bytesPerIndex);\n }\n\n const triangleCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const triangleIndicesCount = triangleCount * 3;\n const triangleIndices = decodeIndex(\n dataView.buffer,\n position,\n triangleIndicesCount,\n bytesPerIndex\n );\n position += triangleIndicesCount * bytesPerIndex;\n\n return {\n triangleIndicesEndPosition: position,\n triangleIndices\n };\n}\n\nfunction decodeEdgeIndices(dataView, vertexData, triangleIndicesEndPosition) {\n let position = triangleIndicesEndPosition;\n const elementsPerVertex = 3;\n const vertexCount = vertexData.length / elementsPerVertex;\n const bytesPerIndex =\n vertexCount > 65536 ? Uint32Array.BYTES_PER_ELEMENT : Uint16Array.BYTES_PER_ELEMENT;\n\n const westVertexCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const westIndices = decodeIndex(dataView.buffer, position, westVertexCount, bytesPerIndex, false);\n position += westVertexCount * bytesPerIndex;\n\n const southVertexCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const southIndices = decodeIndex(\n dataView.buffer,\n position,\n southVertexCount,\n bytesPerIndex,\n false\n );\n position += southVertexCount * bytesPerIndex;\n\n const eastVertexCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const eastIndices = decodeIndex(dataView.buffer, position, eastVertexCount, bytesPerIndex, false);\n position += eastVertexCount * bytesPerIndex;\n\n const northVertexCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const northIndices = decodeIndex(\n dataView.buffer,\n position,\n northVertexCount,\n bytesPerIndex,\n false\n );\n position += northVertexCount * bytesPerIndex;\n\n return {\n edgeIndicesEndPosition: position,\n westIndices,\n southIndices,\n eastIndices,\n northIndices\n };\n}\n\nfunction decodeVertexNormalsExtension(extensionDataView) {\n return new Uint8Array(\n extensionDataView.buffer,\n extensionDataView.byteOffset,\n extensionDataView.byteLength\n );\n}\n\nfunction decodeWaterMaskExtension(extensionDataView) {\n return extensionDataView.buffer.slice(\n extensionDataView.byteOffset,\n extensionDataView.byteOffset + extensionDataView.byteLength\n );\n}\n\ntype Extensions = {\n vertexNormals?: any;\n waterMask?: any;\n};\n\nfunction decodeExtensions(dataView, indicesEndPosition) {\n const extensions: Extensions = {};\n\n if (dataView.byteLength <= indicesEndPosition) {\n return {extensions, extensionsEndPosition: indicesEndPosition};\n }\n\n let position = indicesEndPosition;\n\n while (position < dataView.byteLength) {\n const extensionId = dataView.getUint8(position, true);\n position += Uint8Array.BYTES_PER_ELEMENT;\n\n const extensionLength = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const extensionView = new DataView(dataView.buffer, position, extensionLength);\n\n switch (extensionId) {\n case 1: {\n extensions.vertexNormals = decodeVertexNormalsExtension(extensionView);\n\n break;\n }\n case 2: {\n extensions.waterMask = decodeWaterMaskExtension(extensionView);\n\n break;\n }\n default: {\n // console.warn(`Unknown extension with id ${extensionId}`)\n }\n }\n\n position += extensionLength;\n }\n\n return {extensions, extensionsEndPosition: position};\n}\n\nexport const DECODING_STEPS = {\n header: 0,\n vertices: 1,\n triangleIndices: 2,\n edgeIndices: 3,\n extensions: 4\n};\n\nconst DEFAULT_OPTIONS = {\n maxDecodingStep: DECODING_STEPS.extensions\n};\n\nexport default function decode(data, userOptions) {\n const options = Object.assign({}, DEFAULT_OPTIONS, userOptions);\n const view = new DataView(data);\n const {header, headerEndPosition} = decodeHeader(view);\n\n if (options.maxDecodingStep < DECODING_STEPS.vertices) {\n return {header};\n }\n\n const {vertexData, vertexDataEndPosition} = decodeVertexData(view, headerEndPosition);\n\n if (options.maxDecodingStep < DECODING_STEPS.triangleIndices) {\n return {header, vertexData};\n }\n\n const {triangleIndices, triangleIndicesEndPosition} = decodeTriangleIndices(\n view,\n vertexData,\n vertexDataEndPosition\n );\n\n if (options.maxDecodingStep < DECODING_STEPS.edgeIndices) {\n return {header, vertexData, triangleIndices};\n }\n\n const {westIndices, southIndices, eastIndices, northIndices, edgeIndicesEndPosition} =\n decodeEdgeIndices(view, vertexData, triangleIndicesEndPosition);\n\n if (options.maxDecodingStep < DECODING_STEPS.extensions) {\n return {\n header,\n vertexData,\n triangleIndices,\n westIndices,\n northIndices,\n eastIndices,\n southIndices\n };\n }\n\n const {extensions} = decodeExtensions(view, edgeIndicesEndPosition);\n\n return {\n header,\n vertexData,\n triangleIndices,\n westIndices,\n northIndices,\n eastIndices,\n southIndices,\n extensions\n };\n}\n"],"file":"decode-quantized-mesh.js"}
|
|
1
|
+
{"version":3,"file":"decode-quantized-mesh.js","names":["QUANTIZED_MESH_HEADER","Map","Float64Array","BYTES_PER_ELEMENT","Float32Array","decodeZigZag","value","decodeHeader","dataView","position","header","key","bytesCount","getter","getFloat64","getFloat32","call","headerEndPosition","decodeVertexData","elementsPerVertex","vertexCount","getUint32","vertexData","Uint16Array","Uint32Array","bytesPerArrayElement","elementArrayLength","uArrayStartPosition","vArrayStartPosition","heightArrayStartPosition","u","v","height","i","getUint16","vertexDataEndPosition","decodeIndex","buffer","indicesCount","bytesPerIndex","encoded","indices","highest","length","code","decodeTriangleIndices","triangleCount","triangleIndicesCount","triangleIndices","triangleIndicesEndPosition","decodeEdgeIndices","westVertexCount","westIndices","southVertexCount","southIndices","eastVertexCount","eastIndices","northVertexCount","northIndices","edgeIndicesEndPosition","decodeVertexNormalsExtension","extensionDataView","Uint8Array","byteOffset","byteLength","decodeWaterMaskExtension","slice","decodeExtensions","indicesEndPosition","extensions","extensionsEndPosition","extensionId","getUint8","extensionLength","extensionView","DataView","vertexNormals","waterMask","DECODING_STEPS","vertices","edgeIndices","DEFAULT_OPTIONS","maxDecodingStep","decode","data","userOptions","options","Object","assign","view"],"sources":["../../../src/lib/decode-quantized-mesh.ts"],"sourcesContent":["// Copyright (C) 2018-2019 HERE Europe B.V.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nconst QUANTIZED_MESH_HEADER = new Map([\n ['centerX', Float64Array.BYTES_PER_ELEMENT],\n ['centerY', Float64Array.BYTES_PER_ELEMENT],\n ['centerZ', Float64Array.BYTES_PER_ELEMENT],\n\n ['minHeight', Float32Array.BYTES_PER_ELEMENT],\n ['maxHeight', Float32Array.BYTES_PER_ELEMENT],\n\n ['boundingSphereCenterX', Float64Array.BYTES_PER_ELEMENT],\n ['boundingSphereCenterY', Float64Array.BYTES_PER_ELEMENT],\n ['boundingSphereCenterZ', Float64Array.BYTES_PER_ELEMENT],\n ['boundingSphereRadius', Float64Array.BYTES_PER_ELEMENT],\n\n ['horizonOcclusionPointX', Float64Array.BYTES_PER_ELEMENT],\n ['horizonOcclusionPointY', Float64Array.BYTES_PER_ELEMENT],\n ['horizonOcclusionPointZ', Float64Array.BYTES_PER_ELEMENT]\n]);\n\nfunction decodeZigZag(value) {\n return (value >> 1) ^ -(value & 1);\n}\n\nfunction decodeHeader(dataView) {\n let position = 0;\n const header = {};\n\n for (const [key, bytesCount] of QUANTIZED_MESH_HEADER) {\n const getter = bytesCount === 8 ? dataView.getFloat64 : dataView.getFloat32;\n\n header[key] = getter.call(dataView, position, true);\n position += bytesCount;\n }\n\n return {header, headerEndPosition: position};\n}\n\nfunction decodeVertexData(dataView, headerEndPosition) {\n let position = headerEndPosition;\n const elementsPerVertex = 3;\n const vertexCount = dataView.getUint32(position, true);\n const vertexData = new Uint16Array(vertexCount * elementsPerVertex);\n\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const bytesPerArrayElement = Uint16Array.BYTES_PER_ELEMENT;\n const elementArrayLength = vertexCount * bytesPerArrayElement;\n const uArrayStartPosition = position;\n const vArrayStartPosition = uArrayStartPosition + elementArrayLength;\n const heightArrayStartPosition = vArrayStartPosition + elementArrayLength;\n\n let u = 0;\n let v = 0;\n let height = 0;\n\n for (let i = 0; i < vertexCount; i++) {\n u += decodeZigZag(dataView.getUint16(uArrayStartPosition + bytesPerArrayElement * i, true));\n v += decodeZigZag(dataView.getUint16(vArrayStartPosition + bytesPerArrayElement * i, true));\n height += decodeZigZag(\n dataView.getUint16(heightArrayStartPosition + bytesPerArrayElement * i, true)\n );\n\n vertexData[i] = u;\n vertexData[i + vertexCount] = v;\n vertexData[i + vertexCount * 2] = height;\n }\n\n position += elementArrayLength * 3;\n\n return {vertexData, vertexDataEndPosition: position};\n}\n\nfunction decodeIndex(buffer, position, indicesCount, bytesPerIndex, encoded = true) {\n let indices;\n\n if (bytesPerIndex === 2) {\n indices = new Uint16Array(buffer, position, indicesCount);\n } else {\n indices = new Uint32Array(buffer, position, indicesCount);\n }\n\n if (!encoded) {\n return indices;\n }\n\n let highest = 0;\n\n for (let i = 0; i < indices.length; ++i) {\n const code = indices[i];\n\n indices[i] = highest - code;\n\n if (code === 0) {\n ++highest;\n }\n }\n\n return indices;\n}\n\nfunction decodeTriangleIndices(dataView, vertexData, vertexDataEndPosition) {\n let position = vertexDataEndPosition;\n const elementsPerVertex = 3;\n const vertexCount = vertexData.length / elementsPerVertex;\n const bytesPerIndex =\n vertexCount > 65536 ? Uint32Array.BYTES_PER_ELEMENT : Uint16Array.BYTES_PER_ELEMENT;\n\n if (position % bytesPerIndex !== 0) {\n position += bytesPerIndex - (position % bytesPerIndex);\n }\n\n const triangleCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const triangleIndicesCount = triangleCount * 3;\n const triangleIndices = decodeIndex(\n dataView.buffer,\n position,\n triangleIndicesCount,\n bytesPerIndex\n );\n position += triangleIndicesCount * bytesPerIndex;\n\n return {\n triangleIndicesEndPosition: position,\n triangleIndices\n };\n}\n\nfunction decodeEdgeIndices(dataView, vertexData, triangleIndicesEndPosition) {\n let position = triangleIndicesEndPosition;\n const elementsPerVertex = 3;\n const vertexCount = vertexData.length / elementsPerVertex;\n const bytesPerIndex =\n vertexCount > 65536 ? Uint32Array.BYTES_PER_ELEMENT : Uint16Array.BYTES_PER_ELEMENT;\n\n const westVertexCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const westIndices = decodeIndex(dataView.buffer, position, westVertexCount, bytesPerIndex, false);\n position += westVertexCount * bytesPerIndex;\n\n const southVertexCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const southIndices = decodeIndex(\n dataView.buffer,\n position,\n southVertexCount,\n bytesPerIndex,\n false\n );\n position += southVertexCount * bytesPerIndex;\n\n const eastVertexCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const eastIndices = decodeIndex(dataView.buffer, position, eastVertexCount, bytesPerIndex, false);\n position += eastVertexCount * bytesPerIndex;\n\n const northVertexCount = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const northIndices = decodeIndex(\n dataView.buffer,\n position,\n northVertexCount,\n bytesPerIndex,\n false\n );\n position += northVertexCount * bytesPerIndex;\n\n return {\n edgeIndicesEndPosition: position,\n westIndices,\n southIndices,\n eastIndices,\n northIndices\n };\n}\n\nfunction decodeVertexNormalsExtension(extensionDataView) {\n return new Uint8Array(\n extensionDataView.buffer,\n extensionDataView.byteOffset,\n extensionDataView.byteLength\n );\n}\n\nfunction decodeWaterMaskExtension(extensionDataView) {\n return extensionDataView.buffer.slice(\n extensionDataView.byteOffset,\n extensionDataView.byteOffset + extensionDataView.byteLength\n );\n}\n\ntype Extensions = {\n vertexNormals?: any;\n waterMask?: any;\n};\n\nfunction decodeExtensions(dataView, indicesEndPosition) {\n const extensions: Extensions = {};\n\n if (dataView.byteLength <= indicesEndPosition) {\n return {extensions, extensionsEndPosition: indicesEndPosition};\n }\n\n let position = indicesEndPosition;\n\n while (position < dataView.byteLength) {\n const extensionId = dataView.getUint8(position, true);\n position += Uint8Array.BYTES_PER_ELEMENT;\n\n const extensionLength = dataView.getUint32(position, true);\n position += Uint32Array.BYTES_PER_ELEMENT;\n\n const extensionView = new DataView(dataView.buffer, position, extensionLength);\n\n switch (extensionId) {\n case 1: {\n extensions.vertexNormals = decodeVertexNormalsExtension(extensionView);\n\n break;\n }\n case 2: {\n extensions.waterMask = decodeWaterMaskExtension(extensionView);\n\n break;\n }\n default: {\n // console.warn(`Unknown extension with id ${extensionId}`)\n }\n }\n\n position += extensionLength;\n }\n\n return {extensions, extensionsEndPosition: position};\n}\n\nexport const DECODING_STEPS = {\n header: 0,\n vertices: 1,\n triangleIndices: 2,\n edgeIndices: 3,\n extensions: 4\n};\n\nconst DEFAULT_OPTIONS = {\n maxDecodingStep: DECODING_STEPS.extensions\n};\n\nexport default function decode(data, userOptions) {\n const options = Object.assign({}, DEFAULT_OPTIONS, userOptions);\n const view = new DataView(data);\n const {header, headerEndPosition} = decodeHeader(view);\n\n if (options.maxDecodingStep < DECODING_STEPS.vertices) {\n return {header};\n }\n\n const {vertexData, vertexDataEndPosition} = decodeVertexData(view, headerEndPosition);\n\n if (options.maxDecodingStep < DECODING_STEPS.triangleIndices) {\n return {header, vertexData};\n }\n\n const {triangleIndices, triangleIndicesEndPosition} = decodeTriangleIndices(\n view,\n vertexData,\n vertexDataEndPosition\n );\n\n if (options.maxDecodingStep < DECODING_STEPS.edgeIndices) {\n return {header, vertexData, triangleIndices};\n }\n\n const {westIndices, southIndices, eastIndices, northIndices, edgeIndicesEndPosition} =\n decodeEdgeIndices(view, vertexData, triangleIndicesEndPosition);\n\n if (options.maxDecodingStep < DECODING_STEPS.extensions) {\n return {\n header,\n vertexData,\n triangleIndices,\n westIndices,\n northIndices,\n eastIndices,\n southIndices\n };\n }\n\n const {extensions} = decodeExtensions(view, edgeIndicesEndPosition);\n\n return {\n header,\n vertexData,\n triangleIndices,\n westIndices,\n northIndices,\n eastIndices,\n southIndices,\n extensions\n };\n}\n"],"mappings":";;AAoBA,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAAC,CACpC,CAAC,SAAS,EAAEC,YAAY,CAACC,iBAAiB,CAAC,EAC3C,CAAC,SAAS,EAAED,YAAY,CAACC,iBAAiB,CAAC,EAC3C,CAAC,SAAS,EAAED,YAAY,CAACC,iBAAiB,CAAC,EAE3C,CAAC,WAAW,EAAEC,YAAY,CAACD,iBAAiB,CAAC,EAC7C,CAAC,WAAW,EAAEC,YA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