@plasius/gpu-shared 0.1.14 → 0.1.15

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +15 -0
  3. package/dist/{chunk-4ZJ24VRS.js → chunk-6SOHFUOE.js} +4 -3
  4. package/dist/{chunk-4ZJ24VRS.js.map → chunk-6SOHFUOE.js.map} +1 -1
  5. package/dist/{chunk-3ARPGHCQ.js → chunk-CH3ZS5TQ.js} +8 -8
  6. package/dist/chunk-CH3ZS5TQ.js.map +1 -0
  7. package/dist/chunk-DGUM43GV.js +11 -0
  8. package/dist/{chunk-W5GA3VA6.js → chunk-QVNRTWHB.js} +8 -5
  9. package/dist/chunk-QVNRTWHB.js.map +1 -0
  10. package/dist/dist-B5R2GZQR.js +1433 -0
  11. package/dist/dist-B5R2GZQR.js.map +1 -0
  12. package/dist/gltf-loader-B6VOWGBV.js +9 -0
  13. package/dist/index.cjs +1483 -20
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +30 -6
  16. package/dist/index.js.map +1 -1
  17. package/dist/{product-studio-runtime-HDAUDWYO.js → product-studio-runtime-BYVBUWIN.js} +4 -3
  18. package/dist/{showcase-inline-assets-WT4PSNKI.js → showcase-inline-assets-QRQKXGVX.js} +2 -1
  19. package/dist/showcase-inline-assets-QRQKXGVX.js.map +1 -0
  20. package/dist/{showcase-runtime-SNCUFSSC.js → showcase-runtime-M6TEUYOG.js} +4 -3
  21. package/dist/{showcase-runtime-SNCUFSSC.js.map → showcase-runtime-M6TEUYOG.js.map} +1 -1
  22. package/package.json +3 -4
  23. package/src/gltf-loader.js +7 -3
  24. package/src/index.d.ts +1 -0
  25. package/src/index.js +35 -1
  26. package/src/product-studio-runtime.js +1 -0
  27. package/dist/chunk-3ARPGHCQ.js.map +0 -1
  28. package/dist/chunk-W5GA3VA6.js.map +0 -1
  29. package/dist/gltf-loader-YDPLZS5Q.js +0 -8
  30. /package/dist/{gltf-loader-YDPLZS5Q.js.map → chunk-DGUM43GV.js.map} +0 -0
  31. /package/dist/{product-studio-runtime-HDAUDWYO.js.map → gltf-loader-B6VOWGBV.js.map} +0 -0
  32. /package/dist/{showcase-inline-assets-WT4PSNKI.js.map → product-studio-runtime-BYVBUWIN.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasius/gpu-shared",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Shared browser-safe demo runtime and asset helpers for the Plasius gpu-* package family.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -56,10 +56,8 @@
56
56
  ],
57
57
  "author": "Plasius LTD <development@plasius.co.uk>",
58
58
  "license": "Apache-2.0",
59
- "dependencies": {
60
- },
61
59
  "peerDependencies": {
62
- "@plasius/gpu-renderer": "^0.1.14",
60
+ "@plasius/gpu-renderer": "^0.1.15",
63
61
  "@plasius/translations": "^1.0.17"
64
62
  },
65
63
  "peerDependenciesMeta": {
@@ -72,6 +70,7 @@
72
70
  },
73
71
  "devDependencies": {
74
72
  "@eslint/js": "^10.0.1",
73
+ "@plasius/gpu-lighting": "^0.1.19",
75
74
  "@plasius/translations": "^1.0.17",
76
75
  "c8": "^11.0.0",
77
76
  "eslint": "^10.3.0",
@@ -145,6 +145,12 @@ function appendValues(target, values) {
145
145
  }
146
146
  }
147
147
 
148
+ function appendIndicesWithOffset(target, values, vertexOffset) {
149
+ for (let index = 0; index < values.length; index += 1) {
150
+ target.push(values[index] + vertexOffset);
151
+ }
152
+ }
153
+
148
154
  function resolveBrowserRequestBaseUrl() {
149
155
  if (
150
156
  typeof document !== "undefined" &&
@@ -413,9 +419,7 @@ async function buildGltfModel(document, baseUrl) {
413
419
  for (const primitive of scene.primitives) {
414
420
  const vertexOffset = aggregatePositions.length / 3;
415
421
  appendValues(aggregatePositions, primitive.positions);
416
- for (const index of primitive.indices) {
417
- aggregateIndices.push(index + vertexOffset);
418
- }
422
+ appendIndicesWithOffset(aggregateIndices, primitive.indices, vertexOffset);
419
423
  }
420
424
 
421
425
  const color = scene.primitives[0]?.material?.color ?? { r: 0.56, g: 0.33, b: 0.22, a: 1 };
package/src/index.d.ts CHANGED
@@ -208,6 +208,7 @@ export interface MountGpuProductStudioResult {
208
208
  rendererStats: Record<string, unknown>;
209
209
  }>;
210
210
  readonly model: GltfModel;
211
+ readonly productModel: GltfModel;
211
212
  readonly canvas: HTMLCanvasElement;
212
213
  readonly renderer: unknown;
213
214
  readonly meshes: readonly ProductStudioMesh[];
package/src/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ import {
2
+ GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,
3
+ GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,
4
+ } from "./feature-flags.js";
5
+
1
6
  export { resolveShowcaseAssetUrl } from "./asset-url.js";
2
7
  export {
3
8
  createGpuSharedTranslator,
@@ -9,7 +14,7 @@ export { gpuSharedEnGbTranslations } from "./translations/en-GB.js";
9
14
  export {
10
15
  GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,
11
16
  GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,
12
- } from "./feature-flags.js";
17
+ };
13
18
  export {
14
19
  createProductStudioMeshes,
15
20
  mountGpuProductStudio,
@@ -31,6 +36,29 @@ export async function loadGltfModel(url) {
31
36
  return module.loadGltfModel(url);
32
37
  }
33
38
 
39
+ function isProductStudioFeatureEnabled(featureFlags) {
40
+ if (typeof featureFlags?.get === "function") {
41
+ return featureFlags.get(GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE) === true;
42
+ }
43
+
44
+ const direct = featureFlags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];
45
+ if (typeof direct === "boolean") {
46
+ return direct;
47
+ }
48
+
49
+ const flagsValue = featureFlags?.flags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];
50
+ if (typeof flagsValue === "boolean") {
51
+ return flagsValue;
52
+ }
53
+
54
+ const enabledValue = featureFlags?.enabled?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];
55
+ if (typeof enabledValue === "boolean") {
56
+ return enabledValue;
57
+ }
58
+
59
+ return false;
60
+ }
61
+
34
62
  export async function mountGpuShowcase(options = {}) {
35
63
  const demoMode = options.demoMode ?? options.mode;
36
64
  if (
@@ -39,6 +67,12 @@ export async function mountGpuShowcase(options = {}) {
39
67
  demoMode === "studio" ||
40
68
  demoMode === "eames"
41
69
  ) {
70
+ if (!isProductStudioFeatureEnabled(options.__featureFlags)) {
71
+ throw new Error(
72
+ `${GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE} must be enabled before Product Studio can mount.`
73
+ );
74
+ }
75
+
42
76
  const productRuntimeLoader =
43
77
  typeof options.__productRuntimeLoader === "function"
44
78
  ? options.__productRuntimeLoader
@@ -452,6 +452,7 @@ export async function mountGpuProductStudio(options = {}, featureFlags = null) {
452
452
  return Object.freeze({
453
453
  state,
454
454
  model,
455
+ productModel: model,
455
456
  canvas,
456
457
  renderer,
457
458
  meshes,
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/translations/en-GB.js","../src/i18n.js","../src/feature-flags.js"],"sourcesContent":["export const gpuSharedEnGbTranslations = Object.freeze({\n \"gpuShared.showcase.title\": \"Flag by the Sea\",\n \"gpuShared.showcase.subtitle\":\n \"Shared 3D validation scene using GLTF ships, cloth, fluid continuity, adaptive performance, and telemetry.\",\n \"gpuShared.showcase.status.booting\": \"Booting 3D scene...\",\n \"gpuShared.showcase.status.live\": \"3D scene live - {fps} FPS\",\n \"gpuShared.showcase.details.booting\":\n \"Preparing a moonlit harbor scene, GLTF hull data, cloth and fluid continuity plans, and adaptive quality metadata.\",\n \"gpuShared.showcase.details.physics\":\n \"Stable world snapshots are emitted from {snapshotStageId} after the authoritative solver; the heavier hull now carries momentum through mass-aware collision impulses while cloth and fluid remain downstream.\",\n \"gpuShared.showcase.details.realistic\":\n \"Moonlit GLTF ships now mix a brigantine and a cutter against modeled harbor assets; cloth, fluid, and ship-local lighting stay continuous while the governor pressure is {pressureLevel}.\",\n \"gpuShared.showcase.details.legacy\":\n \"Moonlit GLTF ships use the legacy brigantine and placeholder harbor blocks while cloth, fluid, and ship-local lighting stay continuous while the governor pressure is {pressureLevel}.\",\n \"gpuShared.showcase.action.pause\": \"Pause\",\n \"gpuShared.showcase.action.resume\": \"Resume\",\n \"gpuShared.showcase.control.stressMode\": \"Stress mode\",\n \"gpuShared.showcase.control.focus\": \"Focus\",\n \"gpuShared.showcase.focus.integrated\": \"integrated\",\n \"gpuShared.showcase.focus.lighting\": \"lighting\",\n \"gpuShared.showcase.focus.cloth\": \"cloth\",\n \"gpuShared.showcase.focus.fluid\": \"fluid\",\n \"gpuShared.showcase.focus.physics\": \"physics\",\n \"gpuShared.showcase.focus.performance\": \"performance\",\n \"gpuShared.showcase.focus.debug\": \"debug\",\n \"gpuShared.showcase.legend.title\": \"Scene\",\n \"gpuShared.showcase.legend.shipMetadata\":\n \"GLTF ships carry hull mass and damping metadata.\",\n \"gpuShared.showcase.legend.lighting\":\n \"Lanterns and torches warm the moonlit harbor.\",\n \"gpuShared.showcase.legend.collisions\":\n \"Mass-aware collisions stay authoritative near the camera.\",\n \"gpuShared.showcase.section.sceneState\": \"Scene State\",\n \"gpuShared.showcase.section.qualityBudgets\": \"Quality + Budgets\",\n \"gpuShared.showcase.section.debugTelemetry\": \"Debug Telemetry\",\n \"gpuShared.showcase.section.notes\": \"Notes\",\n \"gpuShared.showcase.note.assetLoading\":\n \"Ships are loaded from a GLTF asset and carry mass, damping, restitution, and hull extents from node extras.\",\n \"gpuShared.showcase.note.moonlight\":\n \"Moonlight sets the cold ambient read while deck lanterns and harbor torches provide warm local contrast.\",\n \"gpuShared.showcase.note.continuity\":\n \"Cloth and fluid continuity stay coherent across near, mid, far, and horizon bands even in the darker night palette.\",\n \"gpuShared.showcase.note.performance\":\n \"Performance pressure reduces visual detail before mass-weighted authoritative collision motion is touched.\",\n \"gpuShared.showcase.note.physicsSnapshots\":\n \"Stable world snapshots are taken after the authoritative rigid-body commit and before visual follow-up work.\",\n \"gpuShared.showcase.note.physicsCollisions\":\n \"The ships collide with mass-weighted impulses and positional correction, so the heavier hull keeps more of its line.\",\n \"gpuShared.showcase.note.physicsLighting\":\n \"Moonlight keeps the overall read legible while lanterns and torches make collision moments easy to track against the water.\",\n \"gpuShared.debug.adapter.showcase\": \"3D showcase\",\n \"gpuShared.debug.allocation.mainColorBuffer\": \"Main color buffer\",\n \"gpuShared.debug.allocation.shadowImpressionAtlas\": \"Shadow impression atlas\",\n});\n\n","import { gpuSharedEnGbTranslations } from \"./translations/en-GB.js\";\n\nexport const gpuSharedTranslationKeys = Object.freeze({\n showcaseTitle: \"gpuShared.showcase.title\",\n showcaseSubtitle: \"gpuShared.showcase.subtitle\",\n statusBooting: \"gpuShared.showcase.status.booting\",\n statusLive: \"gpuShared.showcase.status.live\",\n detailsBooting: \"gpuShared.showcase.details.booting\",\n detailsPhysics: \"gpuShared.showcase.details.physics\",\n detailsRealistic: \"gpuShared.showcase.details.realistic\",\n detailsLegacy: \"gpuShared.showcase.details.legacy\",\n pause: \"gpuShared.showcase.action.pause\",\n resume: \"gpuShared.showcase.action.resume\",\n stressMode: \"gpuShared.showcase.control.stressMode\",\n focus: \"gpuShared.showcase.control.focus\",\n focusIntegrated: \"gpuShared.showcase.focus.integrated\",\n focusLighting: \"gpuShared.showcase.focus.lighting\",\n focusCloth: \"gpuShared.showcase.focus.cloth\",\n focusFluid: \"gpuShared.showcase.focus.fluid\",\n focusPhysics: \"gpuShared.showcase.focus.physics\",\n focusPerformance: \"gpuShared.showcase.focus.performance\",\n focusDebug: \"gpuShared.showcase.focus.debug\",\n legendTitle: \"gpuShared.showcase.legend.title\",\n legendShipMetadata: \"gpuShared.showcase.legend.shipMetadata\",\n legendLighting: \"gpuShared.showcase.legend.lighting\",\n legendCollisions: \"gpuShared.showcase.legend.collisions\",\n sceneState: \"gpuShared.showcase.section.sceneState\",\n qualityBudgets: \"gpuShared.showcase.section.qualityBudgets\",\n debugTelemetry: \"gpuShared.showcase.section.debugTelemetry\",\n notes: \"gpuShared.showcase.section.notes\",\n noteAssetLoading: \"gpuShared.showcase.note.assetLoading\",\n noteMoonlight: \"gpuShared.showcase.note.moonlight\",\n noteContinuity: \"gpuShared.showcase.note.continuity\",\n notePerformance: \"gpuShared.showcase.note.performance\",\n notePhysicsSnapshots: \"gpuShared.showcase.note.physicsSnapshots\",\n notePhysicsCollisions: \"gpuShared.showcase.note.physicsCollisions\",\n notePhysicsLighting: \"gpuShared.showcase.note.physicsLighting\",\n debugAdapterShowcase: \"gpuShared.debug.adapter.showcase\",\n debugMainColorBuffer: \"gpuShared.debug.allocation.mainColorBuffer\",\n debugShadowImpressionAtlas: \"gpuShared.debug.allocation.shadowImpressionAtlas\",\n});\n\nexport const gpuSharedTranslations = Object.freeze({\n \"en-GB\": gpuSharedEnGbTranslations,\n});\n\nfunction formatTranslation(template, args = {}) {\n return template.replace(/\\{([A-Za-z0-9_]+)\\}/g, (match, name) => {\n if (!Object.prototype.hasOwnProperty.call(args, name)) {\n return match;\n }\n\n const value = args[name];\n return value == null ? \"\" : String(value);\n });\n}\n\nexport function translateGpuSharedText(key, args, translate) {\n const translated = translate?.(key, args);\n if (translated && translated !== key) {\n return translated;\n }\n\n const fallback = gpuSharedEnGbTranslations[key];\n return fallback ? formatTranslation(fallback, args) : key;\n}\n\nexport function createGpuSharedTranslator(translate) {\n return (key, args) => translateGpuSharedText(key, args, translate);\n}\n\n","export const GPU_SHOWCASE_REALISTIC_MODELS_FEATURE = \"gpu_showcase_realistic_models_v1\";\nexport const GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE = \"gpu_showcase_product_studio_wavefront_v1\";\n"],"mappings":";AAAO,IAAM,4BAA4B,OAAO,OAAO;AAAA,EACrD,4BAA4B;AAAA,EAC5B,+BACE;AAAA,EACF,qCAAqC;AAAA,EACrC,kCAAkC;AAAA,EAClC,sCACE;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BAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,4BAA4B;AAC9B,CAAC;AAEM,IAAM,wBAAwB,OAAO,OAAO;AAAA,EACjD,SAAS;AACX,CAAC;AAED,SAAS,kBAAkB,UAAU,OAAO,CAAC,GAAG;AAC9C,SAAO,SAAS,QAAQ,wBAAwB,CAAC,OAAO,SAAS;AAC/D,QAAI,CAAC,OAAO,UAAU,eAAe,KAAK,MAAM,IAAI,GAAG;AACrD,aAAO;AAAA,IACT;AAEA,UAAM,QAAQ,KAAK,IAAI;AACvB,WAAO,SAAS,OAAO,KAAK,OAAO,KAAK;AAAA,EAC1C,CAAC;AACH;AAEO,SAAS,uBAAuB,KAAK,MAAM,WAAW;AAC3D,QAAM,aAAa,YAAY,KAAK,IAAI;AACxC,MAAI,cAAc,eAAe,KAAK;AACpC,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,0BAA0B,GAAG;AAC9C,SAAO,WAAW,kBAAkB,UAAU,IAAI,IAAI;AACxD;AAEO,SAAS,0BAA0B,WAAW;AACnD,SAAO,CAAC,KAAK,SAAS,uBAAuB,KAAK,MAAM,SAAS;AACnE;;;ACrEO,IAAM,wCAAwC;AAC9C,IAAM,sCAAsC;","names":[]}
@@ -1 +0,0 @@
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, baseUrl);\n }\n}\n"],"mappings":";;;;;AAEA,IAAM,uBAAuB,OAAO,OAAO;AAAA,EACzC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,eAAe;AACjB,CAAC;AAED,SAAS,6BAA6B,WAAW;AAC/C,QAAM,YAAY,2BAA2B,SAAS;AACtD,SAAO,YAAY,IAAI,IAAI,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,UAAAA,WAAU,QAAQ,IAAI,MAAM,2BAA2B;AAC/D,WAAO,eAAeA,WAAU,OAAO;AAAA,EACzC;AACF;","names":["document"]}
@@ -1,8 +0,0 @@
1
- import {
2
- loadGltfModel
3
- } from "./chunk-W5GA3VA6.js";
4
- import "./chunk-2GM64LB6.js";
5
- export {
6
- loadGltfModel
7
- };
8
- //# sourceMappingURL=gltf-loader-YDPLZS5Q.js.map