@johnmorrisdotca/wakusei-planets 0.0.0-stage → 0.3.0
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 +31 -0
- package/LICENSE +21 -0
- package/NOTICE.md +48 -0
- package/README.md +214 -2
- package/dist/bodies/all.d.ts +16 -0
- package/dist/bodies/all.js +16 -0
- package/dist/bodies/earth.d.ts +1 -0
- package/dist/bodies/earth.js +23 -0
- package/dist/bodies/jupiter.d.ts +1 -0
- package/dist/bodies/jupiter.js +22 -0
- package/dist/bodies/mars.d.ts +1 -0
- package/dist/bodies/mars.js +25 -0
- package/dist/bodies/mercury.d.ts +1 -0
- package/dist/bodies/mercury.js +9 -0
- package/dist/bodies/moons-earth.d.ts +1 -0
- package/dist/bodies/moons-earth.js +37 -0
- package/dist/bodies/moons-jupiter.d.ts +1 -0
- package/dist/bodies/moons-jupiter.js +29 -0
- package/dist/bodies/moons-mars.d.ts +1 -0
- package/dist/bodies/moons-mars.js +4 -0
- package/dist/bodies/moons-neptune.d.ts +1 -0
- package/dist/bodies/moons-neptune.js +11 -0
- package/dist/bodies/moons-pluto.d.ts +1 -0
- package/dist/bodies/moons-pluto.js +5 -0
- package/dist/bodies/moons-saturn.d.ts +1 -0
- package/dist/bodies/moons-saturn.js +34 -0
- package/dist/bodies/moons-uranus.d.ts +1 -0
- package/dist/bodies/moons-uranus.js +7 -0
- package/dist/bodies/neptune.d.ts +1 -0
- package/dist/bodies/neptune.js +19 -0
- package/dist/bodies/pluto.d.ts +1 -0
- package/dist/bodies/pluto.js +22 -0
- package/dist/bodies/saturn.d.ts +1 -0
- package/dist/bodies/saturn.js +14 -0
- package/dist/bodies/sun.d.ts +1 -0
- package/dist/bodies/sun.js +20 -0
- package/dist/bodies/uranus.d.ts +1 -0
- package/dist/bodies/uranus.js +15 -0
- package/dist/bodies/venus.d.ts +1 -0
- package/dist/bodies/venus.js +10 -0
- package/dist/data/orbits.d.ts +20 -0
- package/dist/data/orbits.js +27 -0
- package/dist/element.d.ts +88 -0
- package/dist/element.js +603 -0
- package/dist/ephemeris.d.ts +189 -0
- package/dist/ephemeris.js +340 -0
- package/dist/facts.d.ts +213 -0
- package/dist/facts.js +198 -0
- package/dist/gate.d.ts +37 -0
- package/dist/gate.js +54 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/line.d.ts +82 -0
- package/dist/line.js +280 -0
- package/dist/live.d.ts +42 -0
- package/dist/live.js +62 -0
- package/dist/pose.d.ts +62 -0
- package/dist/pose.js +69 -0
- package/dist/scene/body.d.ts +68 -0
- package/dist/scene/body.js +337 -0
- package/dist/scene/glsl.d.ts +13 -0
- package/dist/scene/glsl.js +186 -0
- package/dist/scene/look.d.ts +106 -0
- package/dist/scene/look.js +35 -0
- package/dist/scene/recipes.d.ts +49 -0
- package/dist/scene/recipes.js +76 -0
- package/dist/scene/rings.d.ts +34 -0
- package/dist/scene/rings.js +64 -0
- package/dist/scene/shared.d.ts +24 -0
- package/dist/scene/shared.js +55 -0
- package/dist/scene/store.d.ts +19 -0
- package/dist/scene/store.js +8 -0
- package/dist/textures/callisto-1024.webp +0 -0
- package/dist/textures/callisto-512.webp +0 -0
- package/dist/textures/enceladus-1024.webp +0 -0
- package/dist/textures/enceladus-512.webp +0 -0
- package/dist/textures/europa-1024.webp +0 -0
- package/dist/textures/europa-512.webp +0 -0
- package/dist/textures/ganymede-1024.webp +0 -0
- package/dist/textures/ganymede-512.webp +0 -0
- package/dist/textures/io-1024.webp +0 -0
- package/dist/textures/io-512.webp +0 -0
- package/dist/textures/jupiter-1024.webp +0 -0
- package/dist/textures/jupiter-512.webp +0 -0
- package/dist/textures/mars-1024.webp +0 -0
- package/dist/textures/mars-512.webp +0 -0
- package/dist/textures/mercury-1024.webp +0 -0
- package/dist/textures/mercury-512.webp +0 -0
- package/dist/textures/mimas-1024.webp +0 -0
- package/dist/textures/mimas-512.webp +0 -0
- package/dist/textures/moon-1024.webp +0 -0
- package/dist/textures/moon-512.webp +0 -0
- package/dist/textures/neptune-1024.webp +0 -0
- package/dist/textures/neptune-512.webp +0 -0
- package/dist/textures/pluto-1024.webp +0 -0
- package/dist/textures/pluto-512.webp +0 -0
- package/dist/textures/rhea-1024.webp +0 -0
- package/dist/textures/rhea-512.webp +0 -0
- package/dist/textures/saturn-1024.webp +0 -0
- package/dist/textures/saturn-512.webp +0 -0
- package/dist/textures/saturn-ring-2048.webp +0 -0
- package/dist/textures/sun-1024.webp +0 -0
- package/dist/textures/sun-512.webp +0 -0
- package/dist/textures/titan-1024.webp +0 -0
- package/dist/textures/titan-512.webp +0 -0
- package/dist/textures/uranus-1024.webp +0 -0
- package/dist/textures/uranus-512.webp +0 -0
- package/dist/textures/venus-1024.webp +0 -0
- package/dist/textures/venus-512.webp +0 -0
- package/dist/vec.d.ts +19 -0
- package/dist/vec.js +32 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +236 -4
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { cloud, ice, rock } from "../scene/recipes.js";
|
|
3
|
+
registerLook({ id: "mimas", surface: rock({ dark: "#7f7d79", light: "#bebcb7", craters: 1.7, contrast: 1, seed: 6, extra: "float hs = bowl(p, -110.0, 0.0, 33.0, 0.7); h += hs; col *= 1.0 + 0.9 * hs;" }), relief: 1, ambient: 0.02, painted: { map: "mimas", widths: [512, 1024, 2048], far: 2048 } });
|
|
4
|
+
registerLook({
|
|
5
|
+
id: "enceladus",
|
|
6
|
+
surface: ice({ base: "#f4f7fa", stain: "#c3cfd9", craters: 0.35, extra: "float tiger = oval(p, 0.0, -80.0, 170.0, 14.0, 0.5) * (1.0 - smoothstep(0.0, 0.04, abs(fbm(p * vec3(4.0, 4.0, 14.0)) - 0.5))); col = mix(col, vec3(0.45, 0.72, 0.85), tiger * 0.85);" }),
|
|
7
|
+
ambient: 0.03,
|
|
8
|
+
relief: 0.3,
|
|
9
|
+
painted: { map: "enceladus", widths: [512, 1024, 2048], far: 2048 },
|
|
10
|
+
});
|
|
11
|
+
registerLook({ id: "tethys", surface: rock({ dark: "#8f8d88", light: "#d0cec9", craters: 1.2, contrast: 0.9, seed: 14, patches: 2.2, extra: "float od = bowl(p, 232.0, 5.0, 24.0, 0.6); h += od; col *= 1.0 + 0.7 * od;" }), relief: 0.8, ambient: 0.02 });
|
|
12
|
+
registerLook({ id: "dione", surface: rock({ dark: "#8c8a85", light: "#cdcbc5", craters: 1, contrast: 0.9, seed: 18, patches: 2.6 }), relief: 0.8, ambient: 0.02 });
|
|
13
|
+
registerLook({ id: "rhea", surface: rock({ dark: "#8a8883", light: "#cac8c2", craters: 1.5, contrast: 0.9, seed: 24, patches: 2 }), relief: 0.85, ambient: 0.02, painted: { map: "rhea", widths: [512, 1024, 2048], far: 2048 } });
|
|
14
|
+
registerLook({
|
|
15
|
+
id: "titan",
|
|
16
|
+
surface: cloud({ light: "#ecbe6c", dark: "#b8802f", swirl: 0.7 }),
|
|
17
|
+
atmosphere: { colour: [0.92, 0.66, 0.3], strength: 0.65, power: 2.3 },
|
|
18
|
+
limb: 0.3,
|
|
19
|
+
ambient: 0.06,
|
|
20
|
+
painted: { map: "titan", widths: [512, 1024, 2048], far: 2048 },
|
|
21
|
+
});
|
|
22
|
+
registerLook({
|
|
23
|
+
id: "iapetus",
|
|
24
|
+
surface: rock({
|
|
25
|
+
dark: "#7e7a73",
|
|
26
|
+
light: "#d9d6d0",
|
|
27
|
+
craters: 1,
|
|
28
|
+
contrast: 0.8,
|
|
29
|
+
seed: 30,
|
|
30
|
+
extra: "float lead = smoothstep(-0.15, 0.35, cos(lon(p) + 1.5708)) * (1.0 - smoothstep(0.75, 0.95, abs(lat(p)) / 1.5708 * 1.2)); col = mix(col, vec3(0.20, 0.15, 0.12), lead * 0.9);",
|
|
31
|
+
}),
|
|
32
|
+
relief: 0.7,
|
|
33
|
+
ambient: 0.02,
|
|
34
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { rock } from "../scene/recipes.js";
|
|
3
|
+
registerLook({ id: "miranda", surface: rock({ dark: "#6f6d69", light: "#b3b1ac", craters: 0.8, contrast: 0.8, seed: 9, patches: 4.5, extra: "col = mix(col, col * 1.25, oval(p, 30.0, -55.0, 40.0, 25.0, 0.4) * 0.5);" }), relief: 0.9, ambient: 0.02 });
|
|
4
|
+
registerLook({ id: "ariel", surface: rock({ dark: "#8a8883", light: "#c6c3bc", craters: 0.8, contrast: 0.7, seed: 13, patches: 3, extra: "float v = 1.0 - smoothstep(0.0, 0.02, abs(fbm(p * 6.0 + 2.0) - 0.5)); col = mix(col, vec3(0.9), v * 0.35);" }), relief: 0.7, ambient: 0.02 });
|
|
5
|
+
registerLook({ id: "umbriel", surface: rock({ dark: "#4f4c49", light: "#7f7c77", craters: 1.2, contrast: 0.9, seed: 16, extra: "col = mix(col, vec3(0.85), (oval(p, 270.0, 8.0, 8.0, 8.0, 0.5) - oval(p, 270.0, 8.0, 4.0, 4.0, 0.5)) * 0.8);" }), relief: 0.8, ambient: 0.02 });
|
|
6
|
+
registerLook({ id: "titania", surface: rock({ dark: "#7d7972", light: "#bdb8af", craters: 0.9, contrast: 0.8, seed: 19 }), relief: 0.8, ambient: 0.02 });
|
|
7
|
+
registerLook({ id: "oberon", surface: rock({ dark: "#625b55", light: "#9c948b", craters: 1.4, contrast: 0.9, seed: 22 }), relief: 0.85, ambient: 0.02 });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { gas } from "../scene/recipes.js";
|
|
3
|
+
registerLook({
|
|
4
|
+
id: "neptune",
|
|
5
|
+
surface: gas({
|
|
6
|
+
stops: [[-90, "#2b45b4"], [-60, "#3153c6"], [-35, "#2a47b6"], [-15, "#3a60d4"], [0, "#2e4ebf"], [20, "#3c61d3"], [45, "#3050c0"], [90, "#3a5ccf"]],
|
|
7
|
+
turbulence: 0.022,
|
|
8
|
+
streaks: 0.1,
|
|
9
|
+
extra: `
|
|
10
|
+
float spot = oval(p, -30.0, -24.0, 11.0, 6.5, 0.5);
|
|
11
|
+
col = mix(col, vec3(0.10, 0.17, 0.46), spot * 0.9);
|
|
12
|
+
float cirrus = smoothstep(0.6, 0.8, fbm(vec3(p.xy * 3.0, p.z * 30.0) + 8.0)) * smoothstep(0.5, 0.0, abs(degrees(la) + 38.0) / 10.0);
|
|
13
|
+
col = mix(col, vec3(0.86, 0.9, 1.0), clamp(cirrus + oval(p, -8.0, -28.0, 7.0, 2.0, 0.6) * 0.8, 0.0, 1.0) * 0.55);`,
|
|
14
|
+
}),
|
|
15
|
+
atmosphere: { colour: [0.35, 0.5, 0.95], strength: 0.42, power: 2.8 },
|
|
16
|
+
limb: 0.3,
|
|
17
|
+
ambient: 0.05,
|
|
18
|
+
painted: { map: "neptune", widths: [512, 1024, 2048], far: 2048, relief: 0 },
|
|
19
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { rock } from "../scene/recipes.js";
|
|
3
|
+
registerLook({
|
|
4
|
+
id: "pluto",
|
|
5
|
+
surface: rock({
|
|
6
|
+
dark: "#5f4033",
|
|
7
|
+
light: "#c9a784",
|
|
8
|
+
craters: 0.35,
|
|
9
|
+
contrast: 0.6,
|
|
10
|
+
seed: 5,
|
|
11
|
+
patches: 2.6,
|
|
12
|
+
extra: `
|
|
13
|
+
col = mix(col, vec3(0.20, 0.10, 0.09), oval(p, 105.0, -6.0, 55.0, 14.0, 0.6) * 0.88);
|
|
14
|
+
float heart = clamp(oval(p, 178.0, 20.0, 23.0, 27.0, 0.35) + oval(p, 226.0, 24.0, 21.0, 20.0, 0.5) * 0.75 + oval(p, 205.0, -10.0, 13.0, 30.0, 0.5) * 0.6, 0.0, 1.0);
|
|
15
|
+
col = mix(col, vec3(0.95, 0.90, 0.82), heart * 0.92);
|
|
16
|
+
h *= 1.0 - heart;`,
|
|
17
|
+
}),
|
|
18
|
+
atmosphere: { colour: [0.6, 0.7, 0.9], strength: 0.12, power: 5 },
|
|
19
|
+
relief: 0.4,
|
|
20
|
+
ambient: 0.025,
|
|
21
|
+
painted: { map: "pluto", widths: [512, 1024, 2048], far: 2048 },
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { gas } from "../scene/recipes.js";
|
|
3
|
+
registerLook({
|
|
4
|
+
id: "saturn",
|
|
5
|
+
surface: gas({
|
|
6
|
+
stops: [[-90, "#9c9484"], [-72, "#b4a684"], [-60, "#c1ae86"], [-45, "#e1cf9f"], [-30, "#cdb581"], [-15, "#e6d3a0"], [-5, "#f0e0b0"], [5, "#ead9a8"], [15, "#d7c18c"], [30, "#e4d2a2"], [45, "#cdb88a"], [60, "#d9c698"], [75, "#a9a083"], [90, "#7d8794"]],
|
|
7
|
+
turbulence: 0.016,
|
|
8
|
+
streaks: 0.09,
|
|
9
|
+
plateau: 0.3,
|
|
10
|
+
}),
|
|
11
|
+
atmosphere: { colour: [0.9, 0.82, 0.62], strength: 0.12, power: 3.5 },
|
|
12
|
+
limb: 0.4,
|
|
13
|
+
painted: { map: "saturn", widths: [512, 1024, 2048], far: 2048, relief: 0, rings: { map: "saturn-ring", width: 2048, from: 74794, to: 137035 } },
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
registerLook({
|
|
3
|
+
id: "sun",
|
|
4
|
+
emissive: true,
|
|
5
|
+
limb: 0.5,
|
|
6
|
+
surface: `
|
|
7
|
+
vec4 surface(vec3 p) {
|
|
8
|
+
float g = fbm(p * 24.0);
|
|
9
|
+
float g2 = fbm(p * 70.0 + 4.0);
|
|
10
|
+
float cell = smoothstep(0.32, 0.72, mix(g, g2, 0.55));
|
|
11
|
+
vec3 col = mix(vec3(1.0, 0.52, 0.10), vec3(1.0, 0.9, 0.52), cell);
|
|
12
|
+
float act = smoothstep(radians(40.0), radians(10.0), abs(lat(p)));
|
|
13
|
+
float spot = smoothstep(0.64, 0.72, fbm(p * 5.0 + 3.0)) * act;
|
|
14
|
+
float pen = smoothstep(0.57, 0.64, fbm(p * 5.0 + 3.0)) * act;
|
|
15
|
+
col = mix(col, vec3(0.62, 0.22, 0.05), pen * 0.55);
|
|
16
|
+
col = mix(col, vec3(0.16, 0.04, 0.01), spot * 0.92);
|
|
17
|
+
return vec4(col * 1.12, 0.0);
|
|
18
|
+
}`,
|
|
19
|
+
painted: { map: "sun", widths: [512, 1024, 2048], far: 2048, relief: 0 },
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { gas } from "../scene/recipes.js";
|
|
3
|
+
registerLook({
|
|
4
|
+
id: "uranus",
|
|
5
|
+
surface: gas({
|
|
6
|
+
stops: [[-90, "#b4e8ee"], [-55, "#9fdce3"], [-25, "#97d5dd"], [0, "#9ad8df"], [25, "#a0dce3"], [55, "#a8e0e7"], [90, "#bdeef3"]],
|
|
7
|
+
turbulence: 0.01,
|
|
8
|
+
streaks: 0.035,
|
|
9
|
+
plateau: 0.4,
|
|
10
|
+
}),
|
|
11
|
+
atmosphere: { colour: [0.55, 0.88, 0.92], strength: 0.4, power: 2.8 },
|
|
12
|
+
limb: 0.3,
|
|
13
|
+
ambient: 0.05,
|
|
14
|
+
painted: { map: "uranus", widths: [512, 1024, 2048], far: 2048, relief: 0 },
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { cloud } from "../scene/recipes.js";
|
|
3
|
+
registerLook({
|
|
4
|
+
id: "venus",
|
|
5
|
+
surface: cloud({ light: "#f6ebc6", dark: "#bf9552", swirl: 1 }),
|
|
6
|
+
atmosphere: { colour: [1, 0.9, 0.62], strength: 0.55, power: 2.6 },
|
|
7
|
+
limb: 0.35,
|
|
8
|
+
ambient: 0.07,
|
|
9
|
+
painted: { map: "venus", widths: [512, 1024, 2048], far: 2048 },
|
|
10
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface OrbitElements {
|
|
2
|
+
/** The planet it goes round. */
|
|
3
|
+
parent: string;
|
|
4
|
+
/** The reference plane: the ecliptic, the planet's equator, or the Laplace plane whose pole is `pole` (right ascension, declination, degrees). */
|
|
5
|
+
frame: "ecliptic" | "equatorial" | "laplace";
|
|
6
|
+
pole?: [number, number];
|
|
7
|
+
/** The epoch of the elements, in milliseconds since 1970. */
|
|
8
|
+
epoch: number;
|
|
9
|
+
/** Semi-major axis in km, eccentricity, argument of periapsis, mean anomaly, inclination and node, degrees. */
|
|
10
|
+
a: number;
|
|
11
|
+
e: number;
|
|
12
|
+
w: number;
|
|
13
|
+
m: number;
|
|
14
|
+
i: number;
|
|
15
|
+
node: number;
|
|
16
|
+
sid: number;
|
|
17
|
+
dw: number;
|
|
18
|
+
dn: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const ORBITS: Record<string, OrbitElements>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const ORBITS = {
|
|
2
|
+
moon: { parent: "earth", frame: "ecliptic", epoch: 946728000000, a: 384400, e: 0.0554, w: 318.15, m: 135.27, i: 5.16, node: 125.08, sid: 13.1763585, dw: 0.16435, dn: -0.05299 },
|
|
3
|
+
phobos: { parent: "mars", frame: "laplace", pole: [317.7, 52.9], epoch: 946728000000, a: 9375, e: 0.015, w: 216.3, m: 189.7, i: 1.1, node: 169.2, sid: 1128.8443146, dw: -0.74464, dn: -0.42853 },
|
|
4
|
+
deimos: { parent: "mars", frame: "laplace", pole: [316.6, 53.5], epoch: 946728000000, a: 23457, e: 0, w: 0, m: 205, i: 1.8, node: 54.3, sid: 285.1619090, dw: 0.00000, dn: -0.01754 },
|
|
5
|
+
io: { parent: "jupiter", frame: "laplace", pole: [268.1, 64.5], epoch: 946728000000, a: 421800, e: 0.004, w: 49.1, m: 330.9, i: 0, node: 0, sid: 203.4889554, dw: -0.73948, dn: 0.00000 },
|
|
6
|
+
europa: { parent: "jupiter", frame: "laplace", pole: [268.1, 64.5], epoch: 946728000000, a: 671100, e: 0.009, w: 45, m: 345.4, i: 0.5, node: 184, sid: 101.3747246, dw: -0.73952, dn: -0.03263 },
|
|
7
|
+
ganymede: { parent: "jupiter", frame: "laplace", pole: [268.2, 64.6], epoch: 946728000000, a: 1.0704e+06, e: 0.001, w: 198.3, m: 324.8, i: 0.2, node: 58.5, sid: 50.3176092, dw: 0.00000, dn: -0.00715 },
|
|
8
|
+
callisto: { parent: "jupiter", frame: "laplace", pole: [268.7, 64.8], epoch: 946728000000, a: 1.8827e+06, e: 0.007, w: 43.8, m: 87.4, i: 0.3, node: 309.1, sid: 21.5710710, dw: 0.00355, dn: -0.00171 },
|
|
9
|
+
mimas: { parent: "saturn", frame: "laplace", pole: [40.6, 83.5], epoch: 946728000000, a: 186000, e: 0.02, w: 160.4, m: 275.3, i: 1.6, node: 66.2, sid: 381.9945591, dw: 1.99924, dn: -0.99962 },
|
|
10
|
+
enceladus: { parent: "saturn", frame: "laplace", pole: [40.6, 83.5], epoch: 946728000000, a: 238400, e: 0.005, w: 119.5, m: 57, i: 0, node: 0, sid: 262.7319157, dw: 0.33801, dn: 0.00000 },
|
|
11
|
+
tethys: { parent: "saturn", frame: "laplace", pole: [40.6, 83.5], epoch: 946728000000, a: 295000, e: 0.001, w: 335.3, m: 0, i: 1.1, node: 273, sid: 190.6979651, dw: 0.00000, dn: -0.19784 },
|
|
12
|
+
dione: { parent: "saturn", frame: "laplace", pole: [40.6, 83.5], epoch: 946728000000, a: 377700, e: 0.002, w: 116, m: 212, i: 0, node: 0, sid: 131.5349582, dw: 0.00000, dn: 0.00000 },
|
|
13
|
+
rhea: { parent: "saturn", frame: "laplace", pole: [40.6, 83.5], epoch: 946728000000, a: 527200, e: 0.001, w: 44.3, m: 31.5, i: 0.3, node: 133.7, sid: 79.6900941, dw: 0.00000, dn: -0.02755 },
|
|
14
|
+
titan: { parent: "saturn", frame: "laplace", pole: [36.4, 84.0], epoch: 946728000000, a: 1.2219e+06, e: 0.029, w: 78.3, m: 11.7, i: 0.3, node: 78.6, sid: 22.5770144, dw: 0.00284, dn: -0.00143 },
|
|
15
|
+
iapetus: { parent: "saturn", frame: "laplace", pole: [288.7, 78.9], epoch: 946728000000, a: 3.5617e+06, e: 0.028, w: 254.5, m: 74.8, i: 7.6, node: 86.5, sid: 4.5384921, dw: 0.00054, dn: -0.00031 },
|
|
16
|
+
miranda: { parent: "uranus", frame: "equatorial", epoch: 946728000000, a: 129846, e: 0.001, w: 154.8, m: 73, i: 4.4, node: 100.9, sid: 254.6907312, dw: 0.00000, dn: -0.05541 },
|
|
17
|
+
ariel: { parent: "uranus", frame: "equatorial", epoch: 946728000000, a: 190929, e: 0.001, w: 9.6, m: 193.5, i: 0, node: 0, sid: 142.8356608, dw: 0.00000, dn: 0.00000 },
|
|
18
|
+
umbriel: { parent: "uranus", frame: "equatorial", epoch: 946728000000, a: 265986, e: 0.004, w: 183.4, m: 253, i: 0.1, node: 174.8, sid: 86.8688975, dw: 0.01537, dn: -0.00758 },
|
|
19
|
+
titania: { parent: "uranus", frame: "equatorial", epoch: 946728000000, a: 436298, e: 0.002, w: 184, m: 68.1, i: 0.1, node: 29.5, sid: 41.3514243, dw: 0.00000, dn: -0.00060 },
|
|
20
|
+
oberon: { parent: "uranus", frame: "equatorial", epoch: 946728000000, a: 583511, e: 0.002, w: 132.2, m: 143.6, i: 0.1, node: 76.8, sid: 26.7394892, dw: 0.00000, dn: -0.00511 },
|
|
21
|
+
triton: { parent: "neptune", frame: "equatorial", epoch: 946728000000, a: 354800, e: 0, w: 0, m: 63, i: 157.3, node: 177.7, sid: -61.2572645, dw: 0.00000, dn: 0.00329 },
|
|
22
|
+
nereid: { parent: "neptune", frame: "ecliptic", epoch: 1577836800000, a: 5.5139e+06, e: 0.751, w: 296.8, m: 318.5, i: 5.1, node: 319.5, sid: 0.9996218, dw: 0.00012, dn: -0.00010 },
|
|
23
|
+
proteus: { parent: "neptune", frame: "equatorial", epoch: 946728000000, a: 117700, e: 0.001, w: 357.2, m: 297.4, i: 0.6, node: 355.5, sid: 320.7655605, dw: 0.00000, dn: -0.07524 },
|
|
24
|
+
charon: { parent: "pluto", frame: "equatorial", epoch: 946728000000, a: 19600, e: 0, w: 0, m: 304.1, i: 0, node: 0, sid: 56.3624607, dw: 0.00000, dn: 0.00000 },
|
|
25
|
+
nix: { parent: "pluto", frame: "equatorial", epoch: 946728000000, a: 49300, e: 0.015, w: 31.4, m: 338.2, i: 0, node: 0, sid: 14.4842403, dw: 0.00000, dn: 0.00000 },
|
|
26
|
+
hydra: { parent: "pluto", frame: "equatorial", epoch: 946728000000, a: 65200, e: 0.009, w: 139.3, m: 335, i: 0.3, node: 114.3, sid: 9.4236471, dw: 0.00000, dn: -0.07040 },
|
|
27
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { SharedRenderer } from "@johnmorrisdotca/kazoku-ui/renderer";
|
|
2
|
+
import { type BodyId, type Look } from "./facts.ts";
|
|
3
|
+
import { type ThreeParts } from "./scene/body.ts";
|
|
4
|
+
import { setThreeLoader } from "./scene/shared.ts";
|
|
5
|
+
export { setThreeLoader };
|
|
6
|
+
/**
|
|
7
|
+
* What the element is doing: `line` (an SVG), `loading` (waiting for three.js or a picture), `still` (a picture of the 3D look, nothing running), `live` (drawing), `lost` (the GPU took the context; it comes back by itself) or `unavailable` (no WebGL: the line drawing is shown).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts no-run
|
|
11
|
+
* import type { WakuseiState } from "@johnmorrisdotca/wakusei-planets/element";
|
|
12
|
+
*
|
|
13
|
+
* const done = (state: WakuseiState): boolean => state === "live" || state === "line";
|
|
14
|
+
* console.log(done("still"));
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type WakuseiState = "line" | "loading" | "still" | "live" | "lost" | "unavailable";
|
|
18
|
+
/**
|
|
19
|
+
* The default home of the surface pictures: the files of this exact version on jsDelivr. Set `texture-base` on an element to serve them yourself.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts no-run
|
|
23
|
+
* import { TEXTURE_BASE } from "@johnmorrisdotca/wakusei-planets/element";
|
|
24
|
+
*
|
|
25
|
+
* console.log(TEXTURE_BASE);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.3.0/dist/textures/";
|
|
29
|
+
/**
|
|
30
|
+
* Where the sharpest surface pictures are: the files of this exact version in the repository, on jsDelivr's GitHub address. The npm package holds only the two smaller widths, so a page that
|
|
31
|
+
* never zooms in never fetches them. Set `texture-far-base` on an element to serve them yourself.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts no-run
|
|
35
|
+
* import { TEXTURE_FAR_BASE } from "@johnmorrisdotca/wakusei-planets/element";
|
|
36
|
+
*
|
|
37
|
+
* console.log(TEXTURE_FAR_BASE);
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.3.0/textures/";
|
|
41
|
+
/**
|
|
42
|
+
* The `<wakusei-body>` custom element: a body of the solar system, drawn in a look.
|
|
43
|
+
*
|
|
44
|
+
* Attributes: `body` (a name, such as `jupiter`), `look` (`line`, `realistic` or `painted`), `size` (pixels across), `time` (`now` or an ISO date: the body as the Earth sees it then; leave it out for a portrait),
|
|
45
|
+
* `tilt`, `pitch`, `phase` and `meridian` (a portrait's pose, degrees), `turn` (a portrait turns this many degrees a second), `rate` (simulated seconds for each real second), `moons` (draw the planet's moons on their orbits),
|
|
46
|
+
* `range` (planet radii the moons picture reaches), `scale-to` (draw to scale with another body), `live` (`always`, `hover` or `off`: when it takes the page's one WebGL context), `texture-base` (where the surface pictures are) and `lang` (`en` or `ja`).
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts no-run
|
|
50
|
+
* import { WakuseiBody } from "@johnmorrisdotca/wakusei-planets/element";
|
|
51
|
+
* import "@johnmorrisdotca/wakusei-planets/saturn";
|
|
52
|
+
*
|
|
53
|
+
* const saturn = document.createElement("wakusei-body") as WakuseiBody;
|
|
54
|
+
* saturn.setAttribute("body", "saturn");
|
|
55
|
+
* saturn.setAttribute("look", "realistic");
|
|
56
|
+
* document.body.append(saturn);
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare class WakuseiBody extends HTMLElement {
|
|
60
|
+
#private;
|
|
61
|
+
static observedAttributes: string[];
|
|
62
|
+
get body(): BodyId;
|
|
63
|
+
get look(): Look;
|
|
64
|
+
/** What the element is doing now. */
|
|
65
|
+
get state(): WakuseiState;
|
|
66
|
+
/** Numbers for a test or a status line: the state, the texture width in use and the renderer's own counts. */
|
|
67
|
+
get stats(): {
|
|
68
|
+
state: WakuseiState;
|
|
69
|
+
textureWidth: number;
|
|
70
|
+
anchors: number;
|
|
71
|
+
renderer: SharedRenderer<ThreeParts>["stats"] | undefined;
|
|
72
|
+
};
|
|
73
|
+
connectedCallback(): void;
|
|
74
|
+
disconnectedCallback(): void;
|
|
75
|
+
attributeChangedCallback(name: string): void;
|
|
76
|
+
/** Put the picture on the page's one WebGL context and draw it, moving if it is asked to. Resolves true when it is live. A `line` look has nothing to take and resolves false. */
|
|
77
|
+
goLive(): Promise<boolean>;
|
|
78
|
+
/** Give the WebGL context back: the picture stays as a still. */
|
|
79
|
+
rest(): void;
|
|
80
|
+
/** The shared controllers' camera: `yaw` turns the body about its pole, `tilt` tips its top away from you as it grows (a drag up moves the surface up), `zoom` and the pan move the picture. */
|
|
81
|
+
setView(view: {
|
|
82
|
+
yaw?: number;
|
|
83
|
+
tilt?: number;
|
|
84
|
+
zoom?: number;
|
|
85
|
+
panX?: number;
|
|
86
|
+
panY?: number;
|
|
87
|
+
}): void;
|
|
88
|
+
}
|