entangled-worlds-orbiters-shared 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "entangled-worlds-orbiters-shared",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Shared library for entangled worlds orbiters - contains core world rendering, moons system, and UI components",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,10 +1,10 @@
1
1
  import * as THREE from 'three';
2
2
  import { loadTexture } from '../loaders/bodyTextureLoader.js';
3
- import { getPublicBase } from '../config/env.js';
3
+ import { resolvePublicUrl } from '../config/env.js';
4
4
 
5
- // Resolve public herbarium base (strip trailing slash)
6
- const HERBARIUM_BASE = getPublicBase();
7
- function moonTexPath(file) { return `${HERBARIUM_BASE}/default/textures/moons/${file}`; }
5
+ function moonTexPath(file) {
6
+ return resolvePublicUrl(`default/textures/moons/${file}`);
7
+ }
8
8
  export const DEFAULT_MOON_TEX_KTX2 = moonTexPath('moon-equirectangular.ktx2');
9
9
  export const DEFAULT_MOON_TEX_PNG = moonTexPath('moon-equirectangular.png');
10
10
 
@@ -90,16 +90,9 @@ export async function generateMoons({
90
90
  try { sharedTexture = await buildUvGridTexture(); usedUvGrid = true; } catch(_) {}
91
91
  } else if (useTexture) {
92
92
  // Use textureKey if provided, otherwise fall back to default textures
93
- let primaryTexture = textureKey || textureKTX2;
93
+ let primaryTexture = textureKey ? resolvePublicUrl(textureKey) : textureKTX2;
94
94
  const fallbackTexture = texturePNG;
95
95
 
96
- // Resolve textureKey to absolute URL if it's relative
97
- if (textureKey && textureKey.startsWith('/')) {
98
- primaryTexture = `${HERBARIUM_BASE}${textureKey}`;
99
- } else if (textureKey) {
100
- primaryTexture = textureKey; // already absolute
101
- }
102
-
103
96
  try {
104
97
  sharedTexture = await loadTexture(primaryTexture);
105
98
  } catch (eKTX) {