@plasius/gpu-shared 0.1.11 → 0.1.14
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/CHANGELOG.md +58 -3
- package/README.md +110 -4
- package/assets/brigantine.gltf +549 -24
- package/assets/cutter.gltf +538 -0
- package/assets/harbor-dock.gltf +680 -0
- package/assets/lighthouse.gltf +604 -0
- package/dist/chunk-2GM64LB6.js +9 -0
- package/dist/chunk-2GM64LB6.js.map +1 -0
- package/dist/chunk-3ARPGHCQ.js +119 -0
- package/dist/chunk-3ARPGHCQ.js.map +1 -0
- package/dist/chunk-4ZJ24VRS.js +402 -0
- package/dist/chunk-4ZJ24VRS.js.map +1 -0
- package/dist/chunk-W5GA3VA6.js +442 -0
- package/dist/chunk-W5GA3VA6.js.map +1 -0
- package/dist/gltf-loader-YDPLZS5Q.js +8 -0
- package/dist/index.cjs +2432 -6424
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +45 -6
- package/dist/index.js.map +1 -1
- package/dist/product-studio-runtime-HDAUDWYO.js +11 -0
- package/dist/showcase-inline-assets-WT4PSNKI.js +7 -0
- package/dist/showcase-inline-assets-WT4PSNKI.js.map +1 -0
- package/dist/showcase-runtime-SNCUFSSC.js +3785 -0
- package/dist/showcase-runtime-SNCUFSSC.js.map +1 -0
- package/package.json +20 -8
- package/src/asset-url.js +62 -11
- package/src/feature-flags.js +2 -0
- package/src/gltf-loader.js +330 -32
- package/src/i18n.js +71 -0
- package/src/index.d.ts +187 -2
- package/src/index.js +42 -1
- package/src/product-studio-runtime.js +465 -0
- package/src/showcase-inline-assets.js +3 -0
- package/src/showcase-runtime.js +1779 -252
- package/src/translations/en-GB.js +55 -0
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-OTCJ3VOK.js +0 -35
- package/dist/chunk-OTCJ3VOK.js.map +0 -1
- package/dist/chunk-QBMXJ3V2.js +0 -142
- package/dist/chunk-QBMXJ3V2.js.map +0 -1
- package/dist/gltf-loader-LKALCZAV.js +0 -8
- package/dist/showcase-runtime-2ZNPKD7D.js +0 -8593
- package/dist/showcase-runtime-2ZNPKD7D.js.map +0 -1
- /package/dist/{chunk-DGUM43GV.js.map → gltf-loader-YDPLZS5Q.js.map} +0 -0
- /package/dist/{gltf-loader-LKALCZAV.js.map → product-studio-runtime-HDAUDWYO.js.map} +0 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INLINE_SHOWCASE_ASSET_URLS
|
|
3
|
+
} from "./chunk-2GM64LB6.js";
|
|
4
|
+
|
|
5
|
+
// src/asset-url.js
|
|
6
|
+
var SHOWCASE_ASSET_FILES = Object.freeze({
|
|
7
|
+
brigantine: "brigantine.gltf",
|
|
8
|
+
cutter: "cutter.gltf",
|
|
9
|
+
lighthouse: "lighthouse.gltf",
|
|
10
|
+
"harbor-dock": "harbor-dock.gltf"
|
|
11
|
+
});
|
|
12
|
+
function createInlineShowcaseAssetUrl(assetName) {
|
|
13
|
+
const inlineUrl = INLINE_SHOWCASE_ASSET_URLS[assetName];
|
|
14
|
+
return inlineUrl ? new URL(inlineUrl) : null;
|
|
15
|
+
}
|
|
16
|
+
function getBrowserBaseUrl() {
|
|
17
|
+
if (typeof document !== "undefined" && typeof document.baseURI === "string" && document.baseURI.length > 0) {
|
|
18
|
+
return document.baseURI;
|
|
19
|
+
}
|
|
20
|
+
if (typeof window !== "undefined" && typeof window.location?.href === "string" && window.location.href.length > 0) {
|
|
21
|
+
return window.location.href;
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
function normalizeAssetName(assetName) {
|
|
26
|
+
return typeof assetName === "string" && assetName in SHOWCASE_ASSET_FILES ? assetName : "brigantine";
|
|
27
|
+
}
|
|
28
|
+
function parseResolveArgs(baseUrlOrAssetName, assetName) {
|
|
29
|
+
if (typeof baseUrlOrAssetName === "string" && baseUrlOrAssetName in SHOWCASE_ASSET_FILES && typeof assetName === "undefined") {
|
|
30
|
+
return {
|
|
31
|
+
baseUrl: import.meta.url,
|
|
32
|
+
assetName: baseUrlOrAssetName
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
baseUrl: baseUrlOrAssetName ?? import.meta.url,
|
|
37
|
+
assetName: normalizeAssetName(assetName)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function resolveShowcaseAssetUrl(baseUrlOrAssetName, assetName) {
|
|
41
|
+
const resolved = parseResolveArgs(baseUrlOrAssetName, assetName);
|
|
42
|
+
const fileName = SHOWCASE_ASSET_FILES[resolved.assetName];
|
|
43
|
+
try {
|
|
44
|
+
return new URL(`../assets/${fileName}`, resolved.baseUrl);
|
|
45
|
+
} catch {
|
|
46
|
+
const browserBaseUrl = getBrowserBaseUrl();
|
|
47
|
+
if (browserBaseUrl) {
|
|
48
|
+
try {
|
|
49
|
+
const normalizedBaseUrl = new URL(resolved.baseUrl, browserBaseUrl);
|
|
50
|
+
return new URL(`../assets/${fileName}`, normalizedBaseUrl);
|
|
51
|
+
} catch {
|
|
52
|
+
const inlineAsset = createInlineShowcaseAssetUrl(resolved.assetName);
|
|
53
|
+
if (inlineAsset) {
|
|
54
|
+
return inlineAsset;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
return new URL(`../assets/${fileName}`, import.meta.url);
|
|
60
|
+
} catch {
|
|
61
|
+
return new URL(`assets/${fileName}`, "file:///");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function shouldUseInlineShowcaseFallback(url) {
|
|
66
|
+
const href = url instanceof URL ? url.href : String(url ?? "");
|
|
67
|
+
return href.includes("/assets/");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// src/gltf-loader.js
|
|
71
|
+
function decodeDataUri(uri) {
|
|
72
|
+
const match = /^data:.*?;base64,(.+)$/i.exec(uri);
|
|
73
|
+
if (!match) {
|
|
74
|
+
throw new Error(`Unsupported glTF buffer URI: ${uri.slice(0, 48)}`);
|
|
75
|
+
}
|
|
76
|
+
const binary = atob(match[1]);
|
|
77
|
+
const bytes = new Uint8Array(binary.length);
|
|
78
|
+
for (let index = 0; index < binary.length; index += 1) {
|
|
79
|
+
bytes[index] = binary.charCodeAt(index);
|
|
80
|
+
}
|
|
81
|
+
return bytes.buffer;
|
|
82
|
+
}
|
|
83
|
+
function getComponentArray(componentType, buffer, byteOffset, count) {
|
|
84
|
+
switch (componentType) {
|
|
85
|
+
case 5121:
|
|
86
|
+
return new Uint8Array(buffer, byteOffset, count);
|
|
87
|
+
case 5123:
|
|
88
|
+
return new Uint16Array(buffer, byteOffset, count);
|
|
89
|
+
case 5125:
|
|
90
|
+
return new Uint32Array(buffer, byteOffset, count);
|
|
91
|
+
case 5126:
|
|
92
|
+
return new Float32Array(buffer, byteOffset, count);
|
|
93
|
+
default:
|
|
94
|
+
throw new Error(`Unsupported glTF componentType: ${componentType}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function getNormalizationScale(componentType) {
|
|
98
|
+
switch (componentType) {
|
|
99
|
+
case 5121:
|
|
100
|
+
return 255;
|
|
101
|
+
case 5123:
|
|
102
|
+
return 65535;
|
|
103
|
+
default:
|
|
104
|
+
return 1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function getTypeSize(type) {
|
|
108
|
+
switch (type) {
|
|
109
|
+
case "SCALAR":
|
|
110
|
+
return 1;
|
|
111
|
+
case "VEC2":
|
|
112
|
+
return 2;
|
|
113
|
+
case "VEC3":
|
|
114
|
+
return 3;
|
|
115
|
+
case "VEC4":
|
|
116
|
+
return 4;
|
|
117
|
+
default:
|
|
118
|
+
throw new Error(`Unsupported glTF accessor type: ${type}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function readAccessor(document2, accessorIndex, buffers) {
|
|
122
|
+
const accessor = document2.accessors?.[accessorIndex];
|
|
123
|
+
if (!accessor) {
|
|
124
|
+
throw new Error(`glTF accessor ${accessorIndex} is missing.`);
|
|
125
|
+
}
|
|
126
|
+
const bufferView = document2.bufferViews?.[accessor.bufferView];
|
|
127
|
+
if (!bufferView) {
|
|
128
|
+
throw new Error(`glTF bufferView ${accessor.bufferView} is missing.`);
|
|
129
|
+
}
|
|
130
|
+
const buffer = buffers[bufferView.buffer];
|
|
131
|
+
const componentCount = getTypeSize(accessor.type);
|
|
132
|
+
const byteOffset = (bufferView.byteOffset ?? 0) + (accessor.byteOffset ?? 0);
|
|
133
|
+
const valueCount = accessor.count * componentCount;
|
|
134
|
+
const values = Array.from(
|
|
135
|
+
getComponentArray(accessor.componentType, buffer, byteOffset, valueCount)
|
|
136
|
+
);
|
|
137
|
+
if (accessor.normalized) {
|
|
138
|
+
const scale = getNormalizationScale(accessor.componentType);
|
|
139
|
+
return values.map((value) => value / scale);
|
|
140
|
+
}
|
|
141
|
+
return values;
|
|
142
|
+
}
|
|
143
|
+
function getMaterialInfo(document2, primitive) {
|
|
144
|
+
const material = document2.materials?.[primitive.material] ?? null;
|
|
145
|
+
const factor = material?.pbrMetallicRoughness?.baseColorFactor ?? [0.56, 0.33, 0.22, 1];
|
|
146
|
+
const emissive = material?.emissiveFactor ?? [0, 0, 0];
|
|
147
|
+
return Object.freeze({
|
|
148
|
+
name: material?.name ?? "default-material",
|
|
149
|
+
color: Object.freeze({
|
|
150
|
+
r: factor[0],
|
|
151
|
+
g: factor[1],
|
|
152
|
+
b: factor[2],
|
|
153
|
+
a: factor[3] ?? 1
|
|
154
|
+
}),
|
|
155
|
+
roughness: typeof material?.pbrMetallicRoughness?.roughnessFactor === "number" ? material.pbrMetallicRoughness.roughnessFactor : 0.92,
|
|
156
|
+
metallic: typeof material?.pbrMetallicRoughness?.metallicFactor === "number" ? material.pbrMetallicRoughness.metallicFactor : 0.08,
|
|
157
|
+
emissive: Object.freeze({
|
|
158
|
+
r: emissive[0] ?? 0,
|
|
159
|
+
g: emissive[1] ?? 0,
|
|
160
|
+
b: emissive[2] ?? 0
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function computeBounds(positions) {
|
|
165
|
+
const min = [
|
|
166
|
+
Number.POSITIVE_INFINITY,
|
|
167
|
+
Number.POSITIVE_INFINITY,
|
|
168
|
+
Number.POSITIVE_INFINITY
|
|
169
|
+
];
|
|
170
|
+
const max = [
|
|
171
|
+
Number.NEGATIVE_INFINITY,
|
|
172
|
+
Number.NEGATIVE_INFINITY,
|
|
173
|
+
Number.NEGATIVE_INFINITY
|
|
174
|
+
];
|
|
175
|
+
for (let index = 0; index < positions.length; index += 3) {
|
|
176
|
+
min[0] = Math.min(min[0], positions[index]);
|
|
177
|
+
min[1] = Math.min(min[1], positions[index + 1]);
|
|
178
|
+
min[2] = Math.min(min[2], positions[index + 2]);
|
|
179
|
+
max[0] = Math.max(max[0], positions[index]);
|
|
180
|
+
max[1] = Math.max(max[1], positions[index + 1]);
|
|
181
|
+
max[2] = Math.max(max[2], positions[index + 2]);
|
|
182
|
+
}
|
|
183
|
+
return Object.freeze({
|
|
184
|
+
min: Object.freeze([min[0], min[1], min[2]]),
|
|
185
|
+
max: Object.freeze([max[0], max[1], max[2]])
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
function appendValues(target, values) {
|
|
189
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
190
|
+
target.push(values[index]);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function resolveBrowserRequestBaseUrl() {
|
|
194
|
+
if (typeof document !== "undefined" && typeof document.baseURI === "string" && document.baseURI.length > 0) {
|
|
195
|
+
return document.baseURI;
|
|
196
|
+
}
|
|
197
|
+
if (typeof window !== "undefined" && typeof window.location?.href === "string" && window.location.href.length > 0) {
|
|
198
|
+
return window.location.href;
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
function resolveFetchBaseUrl(requestUrl, responseUrl) {
|
|
203
|
+
if (typeof responseUrl === "string" && responseUrl.length > 0) {
|
|
204
|
+
try {
|
|
205
|
+
return new URL(responseUrl);
|
|
206
|
+
} catch {
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
return new URL(requestUrl);
|
|
211
|
+
} catch {
|
|
212
|
+
const browserBaseUrl = resolveBrowserRequestBaseUrl();
|
|
213
|
+
if (browserBaseUrl) {
|
|
214
|
+
return new URL(requestUrl, browserBaseUrl);
|
|
215
|
+
}
|
|
216
|
+
throw new Error(
|
|
217
|
+
`Unable to resolve a stable base URL for glTF asset loading: ${String(requestUrl)}`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function createIdentityMatrix() {
|
|
222
|
+
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
223
|
+
}
|
|
224
|
+
function multiplyMatrices(a, b) {
|
|
225
|
+
const out = new Array(16).fill(0);
|
|
226
|
+
for (let column = 0; column < 4; column += 1) {
|
|
227
|
+
for (let row = 0; row < 4; row += 1) {
|
|
228
|
+
out[column * 4 + row] = a[0 * 4 + row] * b[column * 4 + 0] + a[1 * 4 + row] * b[column * 4 + 1] + a[2 * 4 + row] * b[column * 4 + 2] + a[3 * 4 + row] * b[column * 4 + 3];
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return out;
|
|
232
|
+
}
|
|
233
|
+
function composeNodeMatrix(node) {
|
|
234
|
+
if (Array.isArray(node.matrix) && node.matrix.length === 16) {
|
|
235
|
+
return [...node.matrix];
|
|
236
|
+
}
|
|
237
|
+
const translation = Array.isArray(node.translation) ? node.translation : [0, 0, 0];
|
|
238
|
+
const rotation = Array.isArray(node.rotation) ? node.rotation : [0, 0, 0, 1];
|
|
239
|
+
const scale = Array.isArray(node.scale) ? node.scale : [1, 1, 1];
|
|
240
|
+
const [x, y, z, w] = rotation;
|
|
241
|
+
const x2 = x + x;
|
|
242
|
+
const y2 = y + y;
|
|
243
|
+
const z2 = z + z;
|
|
244
|
+
const xx = x * x2;
|
|
245
|
+
const xy = x * y2;
|
|
246
|
+
const xz = x * z2;
|
|
247
|
+
const yy = y * y2;
|
|
248
|
+
const yz = y * z2;
|
|
249
|
+
const zz = z * z2;
|
|
250
|
+
const wx = w * x2;
|
|
251
|
+
const wy = w * y2;
|
|
252
|
+
const wz = w * z2;
|
|
253
|
+
return [
|
|
254
|
+
(1 - (yy + zz)) * scale[0],
|
|
255
|
+
(xy + wz) * scale[0],
|
|
256
|
+
(xz - wy) * scale[0],
|
|
257
|
+
0,
|
|
258
|
+
(xy - wz) * scale[1],
|
|
259
|
+
(1 - (xx + zz)) * scale[1],
|
|
260
|
+
(yz + wx) * scale[1],
|
|
261
|
+
0,
|
|
262
|
+
(xz + wy) * scale[2],
|
|
263
|
+
(yz - wx) * scale[2],
|
|
264
|
+
(1 - (xx + yy)) * scale[2],
|
|
265
|
+
0,
|
|
266
|
+
translation[0],
|
|
267
|
+
translation[1],
|
|
268
|
+
translation[2],
|
|
269
|
+
1
|
|
270
|
+
];
|
|
271
|
+
}
|
|
272
|
+
function transformPosition(position, matrix) {
|
|
273
|
+
return [
|
|
274
|
+
matrix[0] * position[0] + matrix[4] * position[1] + matrix[8] * position[2] + matrix[12],
|
|
275
|
+
matrix[1] * position[0] + matrix[5] * position[1] + matrix[9] * position[2] + matrix[13],
|
|
276
|
+
matrix[2] * position[0] + matrix[6] * position[1] + matrix[10] * position[2] + matrix[14]
|
|
277
|
+
];
|
|
278
|
+
}
|
|
279
|
+
function transformNormal(normal, matrix) {
|
|
280
|
+
const transformed = [
|
|
281
|
+
matrix[0] * normal[0] + matrix[4] * normal[1] + matrix[8] * normal[2],
|
|
282
|
+
matrix[1] * normal[0] + matrix[5] * normal[1] + matrix[9] * normal[2],
|
|
283
|
+
matrix[2] * normal[0] + matrix[6] * normal[1] + matrix[10] * normal[2]
|
|
284
|
+
];
|
|
285
|
+
const length = Math.hypot(transformed[0], transformed[1], transformed[2]) || 1;
|
|
286
|
+
return [transformed[0] / length, transformed[1] / length, transformed[2] / length];
|
|
287
|
+
}
|
|
288
|
+
function collectScenePrimitives(document2, buffers) {
|
|
289
|
+
const scene = document2.scenes?.[document2.scene ?? 0];
|
|
290
|
+
if (!scene || !Array.isArray(scene.nodes) || scene.nodes.length === 0) {
|
|
291
|
+
throw new Error("glTF demo asset must expose a default scene with at least one node.");
|
|
292
|
+
}
|
|
293
|
+
const results = [];
|
|
294
|
+
let modelName = null;
|
|
295
|
+
let physics = null;
|
|
296
|
+
function visit(nodeIndex, parentMatrix) {
|
|
297
|
+
const node = document2.nodes?.[nodeIndex];
|
|
298
|
+
if (!node) {
|
|
299
|
+
throw new Error(`glTF node ${nodeIndex} is missing.`);
|
|
300
|
+
}
|
|
301
|
+
const localMatrix = composeNodeMatrix(node);
|
|
302
|
+
const worldMatrix = multiplyMatrices(parentMatrix, localMatrix);
|
|
303
|
+
if (!modelName && typeof node.name === "string" && node.name.length > 0) {
|
|
304
|
+
modelName = node.name;
|
|
305
|
+
}
|
|
306
|
+
if (!physics && node.extras?.physics && typeof node.extras.physics === "object") {
|
|
307
|
+
physics = Object.freeze({ ...node.extras.physics });
|
|
308
|
+
}
|
|
309
|
+
if (typeof node.mesh === "number") {
|
|
310
|
+
const mesh = document2.meshes?.[node.mesh];
|
|
311
|
+
if (!mesh || !Array.isArray(mesh.primitives)) {
|
|
312
|
+
throw new Error(`glTF mesh ${node.mesh} is missing primitives.`);
|
|
313
|
+
}
|
|
314
|
+
mesh.primitives.forEach((primitive, primitiveIndex) => {
|
|
315
|
+
const positions = readAccessor(document2, primitive.attributes.POSITION, buffers);
|
|
316
|
+
const normals = typeof primitive.attributes.NORMAL === "number" ? readAccessor(document2, primitive.attributes.NORMAL, buffers) : null;
|
|
317
|
+
const colors = typeof primitive.attributes.COLOR_0 === "number" ? readAccessor(document2, primitive.attributes.COLOR_0, buffers) : null;
|
|
318
|
+
const transformedPositions = [];
|
|
319
|
+
const transformedNormals = [];
|
|
320
|
+
for (let index = 0; index < positions.length; index += 3) {
|
|
321
|
+
const point = transformPosition(
|
|
322
|
+
[positions[index], positions[index + 1], positions[index + 2]],
|
|
323
|
+
worldMatrix
|
|
324
|
+
);
|
|
325
|
+
transformedPositions.push(point[0], point[1], point[2]);
|
|
326
|
+
if (normals) {
|
|
327
|
+
const normal = transformNormal(
|
|
328
|
+
[normals[index], normals[index + 1], normals[index + 2]],
|
|
329
|
+
worldMatrix
|
|
330
|
+
);
|
|
331
|
+
transformedNormals.push(normal[0], normal[1], normal[2]);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
const indices = typeof primitive.indices === "number" ? readAccessor(document2, primitive.indices, buffers).map((value) => Number(value)) : Array.from({ length: transformedPositions.length / 3 }, (_, index) => index);
|
|
335
|
+
const material = getMaterialInfo(document2, primitive);
|
|
336
|
+
const primitiveName = `${node.name ?? mesh.name ?? "mesh"}-${primitiveIndex}`;
|
|
337
|
+
results.push(
|
|
338
|
+
Object.freeze({
|
|
339
|
+
name: primitiveName,
|
|
340
|
+
positions: Object.freeze(transformedPositions),
|
|
341
|
+
indices: Object.freeze(indices),
|
|
342
|
+
normals: transformedNormals.length > 0 ? Object.freeze(transformedNormals) : null,
|
|
343
|
+
colors: colors ? Object.freeze(colors) : null,
|
|
344
|
+
material,
|
|
345
|
+
bounds: computeBounds(transformedPositions)
|
|
346
|
+
})
|
|
347
|
+
);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
if (Array.isArray(node.children)) {
|
|
351
|
+
for (const childIndex of node.children) {
|
|
352
|
+
visit(childIndex, worldMatrix);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
for (const rootNodeIndex of scene.nodes) {
|
|
357
|
+
visit(rootNodeIndex, createIdentityMatrix());
|
|
358
|
+
}
|
|
359
|
+
if (results.length === 0) {
|
|
360
|
+
throw new Error("glTF demo asset must contain at least one mesh primitive.");
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
name: modelName ?? "gltf-model",
|
|
364
|
+
physics: physics ?? Object.freeze({}),
|
|
365
|
+
primitives: results
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
async function loadGltfDocument(url) {
|
|
369
|
+
const response = await fetch(url);
|
|
370
|
+
if (!response.ok) {
|
|
371
|
+
throw new Error(`Failed to load glTF asset: ${response.status} ${response.statusText}`);
|
|
372
|
+
}
|
|
373
|
+
return {
|
|
374
|
+
document: await response.json(),
|
|
375
|
+
baseUrl: resolveFetchBaseUrl(url, response.url)
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
async function loadInlineShowcaseDocument() {
|
|
379
|
+
const module = await import("./showcase-inline-assets-WT4PSNKI.js");
|
|
380
|
+
return loadGltfDocument(new URL(module.INLINE_SHOWCASE_ASSET_URLS.brigantine));
|
|
381
|
+
}
|
|
382
|
+
async function buildGltfModel(document2, baseUrl) {
|
|
383
|
+
const buffers = await Promise.all(
|
|
384
|
+
(document2.buffers ?? []).map(async (buffer) => {
|
|
385
|
+
if (typeof buffer.uri !== "string") {
|
|
386
|
+
throw new Error("glTF buffer URI is required for demo asset loading.");
|
|
387
|
+
}
|
|
388
|
+
if (buffer.uri.startsWith("data:")) {
|
|
389
|
+
return decodeDataUri(buffer.uri);
|
|
390
|
+
}
|
|
391
|
+
const nested = await fetch(new URL(buffer.uri, baseUrl));
|
|
392
|
+
if (!nested.ok) {
|
|
393
|
+
throw new Error(`Failed to load glTF buffer: ${nested.status} ${nested.statusText}`);
|
|
394
|
+
}
|
|
395
|
+
return nested.arrayBuffer();
|
|
396
|
+
})
|
|
397
|
+
);
|
|
398
|
+
const scene = collectScenePrimitives(document2, buffers);
|
|
399
|
+
const aggregatePositions = [];
|
|
400
|
+
const aggregateIndices = [];
|
|
401
|
+
for (const primitive of scene.primitives) {
|
|
402
|
+
const vertexOffset = aggregatePositions.length / 3;
|
|
403
|
+
appendValues(aggregatePositions, primitive.positions);
|
|
404
|
+
for (const index of primitive.indices) {
|
|
405
|
+
aggregateIndices.push(index + vertexOffset);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
const color = scene.primitives[0]?.material?.color ?? { r: 0.56, g: 0.33, b: 0.22, a: 1 };
|
|
409
|
+
return Object.freeze({
|
|
410
|
+
name: scene.name,
|
|
411
|
+
positions: Object.freeze(aggregatePositions),
|
|
412
|
+
indices: Object.freeze(aggregateIndices),
|
|
413
|
+
bounds: computeBounds(aggregatePositions),
|
|
414
|
+
color: Object.freeze({ ...color }),
|
|
415
|
+
physics: scene.physics,
|
|
416
|
+
primitives: Object.freeze(scene.primitives)
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
function shouldRetryWithInlineShowcaseFallback(url, error) {
|
|
420
|
+
if (!shouldUseInlineShowcaseFallback(url)) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
return error instanceof TypeError || /^Failed to load glTF asset:/u.test(error.message);
|
|
424
|
+
}
|
|
425
|
+
async function loadGltfModel(url) {
|
|
426
|
+
try {
|
|
427
|
+
const { document: document2, baseUrl } = await loadGltfDocument(url);
|
|
428
|
+
return buildGltfModel(document2, baseUrl);
|
|
429
|
+
} catch (error) {
|
|
430
|
+
if (!shouldRetryWithInlineShowcaseFallback(url, error)) {
|
|
431
|
+
throw error;
|
|
432
|
+
}
|
|
433
|
+
const { document: document2, baseUrl } = await loadInlineShowcaseDocument();
|
|
434
|
+
return buildGltfModel(document2, baseUrl);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export {
|
|
439
|
+
resolveShowcaseAssetUrl,
|
|
440
|
+
loadGltfModel
|
|
441
|
+
};
|
|
442
|
+
//# sourceMappingURL=chunk-W5GA3VA6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/asset-url.js","../src/gltf-loader.js"],"sourcesContent":["import { INLINE_SHOWCASE_ASSET_URLS } from \"./showcase-inline-assets.js\";\n\nconst SHOWCASE_ASSET_FILES = Object.freeze({\n brigantine: \"brigantine.gltf\",\n cutter: \"cutter.gltf\",\n lighthouse: \"lighthouse.gltf\",\n \"harbor-dock\": \"harbor-dock.gltf\",\n});\n\nfunction createInlineShowcaseAssetUrl(assetName) {\n const inlineUrl = INLINE_SHOWCASE_ASSET_URLS[assetName];\n return inlineUrl ? new URL(inlineUrl) : null;\n}\n\nfunction getBrowserBaseUrl() {\n if (\n typeof document !== \"undefined\" &&\n typeof document.baseURI === \"string\" &&\n document.baseURI.length > 0\n ) {\n return document.baseURI;\n }\n if (\n typeof window !== \"undefined\" &&\n typeof window.location?.href === \"string\" &&\n window.location.href.length > 0\n ) {\n return window.location.href;\n }\n return null;\n}\n\nfunction normalizeAssetName(assetName) {\n return typeof assetName === \"string\" && assetName in SHOWCASE_ASSET_FILES\n ? assetName\n : \"brigantine\";\n}\n\nfunction parseResolveArgs(baseUrlOrAssetName, assetName) {\n if (\n typeof baseUrlOrAssetName === \"string\" &&\n baseUrlOrAssetName in SHOWCASE_ASSET_FILES &&\n typeof assetName === \"undefined\"\n ) {\n return {\n baseUrl: import.meta.url,\n assetName: baseUrlOrAssetName,\n };\n }\n\n return {\n baseUrl: baseUrlOrAssetName ?? import.meta.url,\n assetName: normalizeAssetName(assetName),\n };\n}\n\nexport function resolveShowcaseAssetUrl(baseUrlOrAssetName, assetName) {\n const resolved = parseResolveArgs(baseUrlOrAssetName, assetName);\n const fileName = SHOWCASE_ASSET_FILES[resolved.assetName];\n\n try {\n return new URL(`../assets/${fileName}`, resolved.baseUrl);\n } catch {\n const browserBaseUrl = getBrowserBaseUrl();\n if (browserBaseUrl) {\n try {\n const normalizedBaseUrl = new URL(resolved.baseUrl, browserBaseUrl);\n return new URL(`../assets/${fileName}`, normalizedBaseUrl);\n } catch {\n const inlineAsset = createInlineShowcaseAssetUrl(resolved.assetName);\n if (inlineAsset) {\n return inlineAsset;\n }\n }\n }\n\n try {\n return new URL(`../assets/${fileName}`, import.meta.url);\n } catch {\n return new URL(`assets/${fileName}`, \"file:///\");\n }\n }\n}\n\nexport function shouldUseInlineShowcaseFallback(url) {\n const href = url instanceof URL ? url.href : String(url ?? \"\");\n return href.includes(\"/assets/\");\n}\n","import { shouldUseInlineShowcaseFallback } from \"./asset-url.js\";\n\nfunction decodeDataUri(uri) {\n const match = /^data:.*?;base64,(.+)$/i.exec(uri);\n if (!match) {\n throw new Error(`Unsupported glTF buffer URI: ${uri.slice(0, 48)}`);\n }\n\n const binary = atob(match[1]);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n return bytes.buffer;\n}\n\nfunction getComponentArray(componentType, buffer, byteOffset, count) {\n switch (componentType) {\n case 5121:\n return new Uint8Array(buffer, byteOffset, count);\n case 5123:\n return new Uint16Array(buffer, byteOffset, count);\n case 5125:\n return new Uint32Array(buffer, byteOffset, count);\n case 5126:\n return new Float32Array(buffer, byteOffset, count);\n default:\n throw new Error(`Unsupported glTF componentType: ${componentType}`);\n }\n}\n\nfunction getNormalizationScale(componentType) {\n switch (componentType) {\n case 5121:\n return 255;\n case 5123:\n return 65535;\n default:\n return 1;\n }\n}\n\nfunction getTypeSize(type) {\n switch (type) {\n case \"SCALAR\":\n return 1;\n case \"VEC2\":\n return 2;\n case \"VEC3\":\n return 3;\n case \"VEC4\":\n return 4;\n default:\n throw new Error(`Unsupported glTF accessor type: ${type}`);\n }\n}\n\nfunction readAccessor(document, accessorIndex, buffers) {\n const accessor = document.accessors?.[accessorIndex];\n if (!accessor) {\n throw new Error(`glTF accessor ${accessorIndex} is missing.`);\n }\n\n const bufferView = document.bufferViews?.[accessor.bufferView];\n if (!bufferView) {\n throw new Error(`glTF bufferView ${accessor.bufferView} is missing.`);\n }\n\n const buffer = buffers[bufferView.buffer];\n const componentCount = getTypeSize(accessor.type);\n const byteOffset = (bufferView.byteOffset ?? 0) + (accessor.byteOffset ?? 0);\n const valueCount = accessor.count * componentCount;\n const values = Array.from(\n getComponentArray(accessor.componentType, buffer, byteOffset, valueCount)\n );\n\n if (accessor.normalized) {\n const scale = getNormalizationScale(accessor.componentType);\n return values.map((value) => value / scale);\n }\n\n return values;\n}\n\nfunction getMaterialInfo(document, primitive) {\n const material = document.materials?.[primitive.material] ?? null;\n const factor =\n material?.pbrMetallicRoughness?.baseColorFactor ?? [0.56, 0.33, 0.22, 1];\n const emissive = material?.emissiveFactor ?? [0, 0, 0];\n\n return Object.freeze({\n name: material?.name ?? \"default-material\",\n color: Object.freeze({\n r: factor[0],\n g: factor[1],\n b: factor[2],\n a: factor[3] ?? 1,\n }),\n roughness:\n typeof material?.pbrMetallicRoughness?.roughnessFactor === \"number\"\n ? material.pbrMetallicRoughness.roughnessFactor\n : 0.92,\n metallic:\n typeof material?.pbrMetallicRoughness?.metallicFactor === \"number\"\n ? material.pbrMetallicRoughness.metallicFactor\n : 0.08,\n emissive: Object.freeze({\n r: emissive[0] ?? 0,\n g: emissive[1] ?? 0,\n b: emissive[2] ?? 0,\n }),\n });\n}\n\nfunction computeBounds(positions) {\n const min = [\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n ];\n const max = [\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n ];\n\n for (let index = 0; index < positions.length; index += 3) {\n min[0] = Math.min(min[0], positions[index]);\n min[1] = Math.min(min[1], positions[index + 1]);\n min[2] = Math.min(min[2], positions[index + 2]);\n max[0] = Math.max(max[0], positions[index]);\n max[1] = Math.max(max[1], positions[index + 1]);\n max[2] = Math.max(max[2], positions[index + 2]);\n }\n\n return Object.freeze({\n min: Object.freeze([min[0], min[1], min[2]]),\n max: Object.freeze([max[0], max[1], max[2]]),\n });\n}\n\nfunction appendValues(target, values) {\n for (let index = 0; index < values.length; index += 1) {\n target.push(values[index]);\n }\n}\n\nfunction resolveBrowserRequestBaseUrl() {\n if (\n typeof document !== \"undefined\" &&\n typeof document.baseURI === \"string\" &&\n document.baseURI.length > 0\n ) {\n return document.baseURI;\n }\n if (\n typeof window !== \"undefined\" &&\n typeof window.location?.href === \"string\" &&\n window.location.href.length > 0\n ) {\n return window.location.href;\n }\n return null;\n}\n\nfunction resolveFetchBaseUrl(requestUrl, responseUrl) {\n if (typeof responseUrl === \"string\" && responseUrl.length > 0) {\n try {\n return new URL(responseUrl);\n } catch {\n // Keep trying the other candidates when an environment reports a malformed response URL.\n }\n }\n\n try {\n return new URL(requestUrl);\n } catch {\n const browserBaseUrl = resolveBrowserRequestBaseUrl();\n if (browserBaseUrl) {\n return new URL(requestUrl, browserBaseUrl);\n }\n throw new Error(\n `Unable to resolve a stable base URL for glTF asset loading: ${String(requestUrl)}`\n );\n }\n}\n\nfunction createIdentityMatrix() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\nfunction multiplyMatrices(a, b) {\n const out = new Array(16).fill(0);\n for (let column = 0; column < 4; column += 1) {\n for (let row = 0; row < 4; row += 1) {\n out[column * 4 + row] =\n a[0 * 4 + row] * b[column * 4 + 0] +\n a[1 * 4 + row] * b[column * 4 + 1] +\n a[2 * 4 + row] * b[column * 4 + 2] +\n a[3 * 4 + row] * b[column * 4 + 3];\n }\n }\n return out;\n}\n\nfunction composeNodeMatrix(node) {\n if (Array.isArray(node.matrix) && node.matrix.length === 16) {\n return [...node.matrix];\n }\n\n const translation = Array.isArray(node.translation) ? node.translation : [0, 0, 0];\n const rotation = Array.isArray(node.rotation) ? node.rotation : [0, 0, 0, 1];\n const scale = Array.isArray(node.scale) ? node.scale : [1, 1, 1];\n const [x, y, z, w] = rotation;\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const xy = x * y2;\n const xz = x * z2;\n const yy = y * y2;\n const yz = y * z2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n\n return [\n (1 - (yy + zz)) * scale[0],\n (xy + wz) * scale[0],\n (xz - wy) * scale[0],\n 0,\n (xy - wz) * scale[1],\n (1 - (xx + zz)) * scale[1],\n (yz + wx) * scale[1],\n 0,\n (xz + wy) * scale[2],\n (yz - wx) * scale[2],\n (1 - (xx + yy)) * scale[2],\n 0,\n translation[0],\n translation[1],\n translation[2],\n 1,\n ];\n}\n\nfunction transformPosition(position, matrix) {\n return [\n matrix[0] * position[0] + matrix[4] * position[1] + matrix[8] * position[2] + matrix[12],\n matrix[1] * position[0] + matrix[5] * position[1] + matrix[9] * position[2] + matrix[13],\n matrix[2] * position[0] + matrix[6] * position[1] + matrix[10] * position[2] + matrix[14],\n ];\n}\n\nfunction transformNormal(normal, matrix) {\n const transformed = [\n matrix[0] * normal[0] + matrix[4] * normal[1] + matrix[8] * normal[2],\n matrix[1] * normal[0] + matrix[5] * normal[1] + matrix[9] * normal[2],\n matrix[2] * normal[0] + matrix[6] * normal[1] + matrix[10] * normal[2],\n ];\n const length = Math.hypot(transformed[0], transformed[1], transformed[2]) || 1;\n return [transformed[0] / length, transformed[1] / length, transformed[2] / length];\n}\n\nfunction collectScenePrimitives(document, buffers) {\n const scene = document.scenes?.[document.scene ?? 0];\n if (!scene || !Array.isArray(scene.nodes) || scene.nodes.length === 0) {\n throw new Error(\"glTF demo asset must expose a default scene with at least one node.\");\n }\n\n const results = [];\n let modelName = null;\n let physics = null;\n\n function visit(nodeIndex, parentMatrix) {\n const node = document.nodes?.[nodeIndex];\n if (!node) {\n throw new Error(`glTF node ${nodeIndex} is missing.`);\n }\n\n const localMatrix = composeNodeMatrix(node);\n const worldMatrix = multiplyMatrices(parentMatrix, localMatrix);\n\n if (!modelName && typeof node.name === \"string\" && node.name.length > 0) {\n modelName = node.name;\n }\n\n if (!physics && node.extras?.physics && typeof node.extras.physics === \"object\") {\n physics = Object.freeze({ ...node.extras.physics });\n }\n\n if (typeof node.mesh === \"number\") {\n const mesh = document.meshes?.[node.mesh];\n if (!mesh || !Array.isArray(mesh.primitives)) {\n throw new Error(`glTF mesh ${node.mesh} is missing primitives.`);\n }\n\n mesh.primitives.forEach((primitive, primitiveIndex) => {\n const positions = readAccessor(document, primitive.attributes.POSITION, buffers);\n const normals =\n typeof primitive.attributes.NORMAL === \"number\"\n ? readAccessor(document, primitive.attributes.NORMAL, buffers)\n : null;\n const colors =\n typeof primitive.attributes.COLOR_0 === \"number\"\n ? readAccessor(document, primitive.attributes.COLOR_0, buffers)\n : null;\n const transformedPositions = [];\n const transformedNormals = [];\n\n for (let index = 0; index < positions.length; index += 3) {\n const point = transformPosition(\n [positions[index], positions[index + 1], positions[index + 2]],\n worldMatrix\n );\n transformedPositions.push(point[0], point[1], point[2]);\n\n if (normals) {\n const normal = transformNormal(\n [normals[index], normals[index + 1], normals[index + 2]],\n worldMatrix\n );\n transformedNormals.push(normal[0], normal[1], normal[2]);\n }\n }\n\n const indices =\n typeof primitive.indices === \"number\"\n ? readAccessor(document, primitive.indices, buffers).map((value) => Number(value))\n : Array.from({ length: transformedPositions.length / 3 }, (_, index) => index);\n const material = getMaterialInfo(document, primitive);\n const primitiveName =\n `${node.name ?? mesh.name ?? \"mesh\"}-${primitiveIndex}`;\n\n results.push(\n Object.freeze({\n name: primitiveName,\n positions: Object.freeze(transformedPositions),\n indices: Object.freeze(indices),\n normals:\n transformedNormals.length > 0\n ? Object.freeze(transformedNormals)\n : null,\n colors: colors ? Object.freeze(colors) : null,\n material,\n bounds: computeBounds(transformedPositions),\n })\n );\n });\n }\n\n if (Array.isArray(node.children)) {\n for (const childIndex of node.children) {\n visit(childIndex, worldMatrix);\n }\n }\n }\n\n for (const rootNodeIndex of scene.nodes) {\n visit(rootNodeIndex, createIdentityMatrix());\n }\n\n if (results.length === 0) {\n throw new Error(\"glTF demo asset must contain at least one mesh primitive.\");\n }\n\n return {\n name: modelName ?? \"gltf-model\",\n physics: physics ?? Object.freeze({}),\n primitives: results,\n };\n}\n\nasync function loadGltfDocument(url) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to load glTF asset: ${response.status} ${response.statusText}`);\n }\n\n return {\n document: await response.json(),\n baseUrl: resolveFetchBaseUrl(url, response.url),\n };\n}\n\nasync function loadInlineShowcaseDocument() {\n const module = await import(\"./showcase-inline-assets.js\");\n return loadGltfDocument(new URL(module.INLINE_SHOWCASE_ASSET_URLS.brigantine));\n}\n\nasync function buildGltfModel(document, baseUrl) {\n const buffers = await Promise.all(\n (document.buffers ?? []).map(async (buffer) => {\n if (typeof buffer.uri !== \"string\") {\n throw new Error(\"glTF buffer URI is required for demo asset loading.\");\n }\n if (buffer.uri.startsWith(\"data:\")) {\n return decodeDataUri(buffer.uri);\n }\n const nested = await fetch(new URL(buffer.uri, baseUrl));\n if (!nested.ok) {\n throw new Error(`Failed to load glTF buffer: ${nested.status} ${nested.statusText}`);\n }\n return nested.arrayBuffer();\n })\n );\n\n const scene = collectScenePrimitives(document, buffers);\n const aggregatePositions = [];\n const aggregateIndices = [];\n\n for (const primitive of scene.primitives) {\n const vertexOffset = aggregatePositions.length / 3;\n appendValues(aggregatePositions, primitive.positions);\n for (const index of primitive.indices) {\n aggregateIndices.push(index + vertexOffset);\n }\n }\n\n const color = scene.primitives[0]?.material?.color ?? { r: 0.56, g: 0.33, b: 0.22, a: 1 };\n\n return Object.freeze({\n name: scene.name,\n positions: Object.freeze(aggregatePositions),\n indices: Object.freeze(aggregateIndices),\n bounds: computeBounds(aggregatePositions),\n color: Object.freeze({ ...color }),\n physics: scene.physics,\n primitives: Object.freeze(scene.primitives),\n });\n}\n\nfunction shouldRetryWithInlineShowcaseFallback(url, error) {\n if (!shouldUseInlineShowcaseFallback(url)) {\n return false;\n }\n\n return error instanceof TypeError || /^Failed to load glTF asset:/u.test(error.message);\n}\n\nexport async function loadGltfModel(url) {\n try {\n const { document, baseUrl } = await loadGltfDocument(url);\n return buildGltfModel(document, baseUrl);\n } catch (error) {\n if (!shouldRetryWithInlineShowcaseFallback(url, error)) {\n throw error;\n }\n\n const { document, baseUrl } = await loadInlineShowcaseDocument();\n return buildGltfModel(document, baseUr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