@project-skymap/library 0.7.3 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -476,6 +476,7 @@ var init_ConstellationArtworkLayer = __esm({
|
|
|
476
476
|
}
|
|
477
477
|
load(config, getPosition) {
|
|
478
478
|
this.clear();
|
|
479
|
+
console.log(`[Constellation] Loading ${config.constellations.length} constellations from ${config.atlasBasePath}`);
|
|
479
480
|
const basePath = config.atlasBasePath.replace(/\/$/, "");
|
|
480
481
|
config.constellations.forEach((c) => {
|
|
481
482
|
let center = new THREE5__namespace.Vector3();
|
|
@@ -644,10 +645,12 @@ var init_ConstellationArtworkLayer = __esm({
|
|
|
644
645
|
const natAspect = tex.image.width / tex.image.height;
|
|
645
646
|
material.uniforms.uImgAspect.value = natAspect;
|
|
646
647
|
}
|
|
648
|
+
console.log(`[Constellation] Loaded: ${c.id} (${tex.image.width}x${tex.image.height})`);
|
|
649
|
+
},
|
|
650
|
+
(progress) => {
|
|
647
651
|
},
|
|
648
|
-
void 0,
|
|
649
652
|
(err) => {
|
|
650
|
-
console.
|
|
653
|
+
console.error(`[Constellation] Failed to load: ${texPath}`, err);
|
|
651
654
|
}
|
|
652
655
|
);
|
|
653
656
|
if (c.zBias) {
|
|
@@ -668,7 +671,9 @@ var init_ConstellationArtworkLayer = __esm({
|
|
|
668
671
|
}
|
|
669
672
|
update(fov, showArt) {
|
|
670
673
|
this.root.visible = showArt;
|
|
671
|
-
if (!showArt)
|
|
674
|
+
if (!showArt) {
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
672
677
|
for (const item of this.items) {
|
|
673
678
|
const { fade } = item.config;
|
|
674
679
|
let opacity = fade.maxOpacity;
|
|
@@ -987,8 +992,10 @@ function createEngine({
|
|
|
987
992
|
let scale = currentProjection.getScale(fovRad);
|
|
988
993
|
const aspect = camera.aspect;
|
|
989
994
|
if (currentConfig?.fitProjection) {
|
|
990
|
-
if (aspect
|
|
995
|
+
if (aspect >= 1) {
|
|
991
996
|
scale /= aspect;
|
|
997
|
+
} else {
|
|
998
|
+
scale *= aspect * aspect;
|
|
992
999
|
}
|
|
993
1000
|
}
|
|
994
1001
|
globalUniforms.uScale.value = scale;
|