mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 18:22:25 +00:00
feat(satellites): current ISS model with moving parts and a command panel
The ISS model is now NASA/JSC IGOAL's current-configuration station (Nauka, Prichal, Bishop, roll-out arrays), reduced from 96 MB to 3 MB with its joints kept as nodes. NASA's file is a mirror image of the station and marks 15 materials as blended; both are corrected. Its parts move by computation, never telemetry: arrays and radiators by the Sun (feathered in the Earth's shadow), the Ku-band dishes toward the TDRS nominal slots, and the robotic arms as an illustrative sway. Selecting the ISS shows a collapsed command panel: zoom to the station, Automatic (default, with a lit/shadow status line) and Manual controls for the Sun's position, arrays, radiators, dishes and Canadarm2. Also: docked objects are found by comparing both orbits at one instant, the tracked card keeps clear of the model, the model file loads only near its range, and both ISS panels follow a language change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
9aeabbacfb
commit
a75993a66b
35 files changed
+2636
-119
No files matched your search
+1
-1
@@ -33,7 +33,7 @@ How to read this:
|
||||
| **Planespotters.net** (`api.planespotters.net/pub/photos/hex/{hex}`) | One thumbnail photo of the tracked aircraft, by ICAO hex, in the CONTEXT panel's CONTACTS view under the tracked flight's name | [Planespotters photo API terms](https://www.planespotters.net/photo/api); each photo remains the copyright of its photographer. Thumbnails may be hotlinked on the condition that the photographer is named next to the photo and the photo links to its Planespotters page with a followable link | "Photo © {photographer}" beside every photo that names one, linked to its Planespotters page; "Planespotters.net" in Data attribution |
|
||||
| **AISStream.io** | Live vessels (AIS) | Free, beta, no formal ToS; AIS is a public broadcast | "AISStream.io" (courtesy) |
|
||||
| **CelesTrak** | Satellite TLEs (SGP4) and SATCAT records (object type, operational status, owner) that file each satellite under a class | US-government-origin data, no license; citation requested | "CelesTrak (celestrak.org), Dr. T.S. Kelso" |
|
||||
| **NASA 3D Resources** (`public/models/iss.glb`) | The ISS drawn as a 3D model when the camera is near it (satellites layer) | NASA media, not subject to copyright in the United States; NASA's Images and Media Usage Guidelines (https://www.nasa.gov/nasa-brand-center/images-and-media) ask that use not imply endorsement and that the insignia not be used | "ISS model: NASA 3D Resources" |
|
||||
| **NASA 3D Resources** (`public/models/iss.glb`) | The ISS drawn as a 3D model when the camera is near it (satellites layer): NASA/JSC IGOAL's "International Space Station (ISS) (D)" (https://science.nasa.gov/3d-resources/international-space-station-iss-d-igoal/), reduced and re-rigged as `public/models/README.md` records. Its moving parts are computed by the app, not read from telemetry: arrays and radiators from the Sun's position, the Ku-band dishes toward the TDRS fleet's nominal slots (41°W, 171°W, 85°E), the robotic arms as an illustrative sway | NASA media, not subject to copyright in the United States; NASA's Images and Media Usage Guidelines (https://www.nasa.gov/nasa-brand-center/images-and-media) ask that use not imply endorsement and that the insignia not be used | "ISS model: NASA 3D Resources" |
|
||||
| **NASA ISS live stream on YouTube** (`youtube-nocookie.com/embed/ROboUHfPUrU`) | NASA's official live video from the ISS ("Live High-Definition Views from the International Space Station"), embedded with YouTube's player while the ISS is selected; the app stores nothing from it | NASA video, not subject to copyright in the United States (same guidelines); played through YouTube's embedded player under YouTube's Terms of Service | "ISS live video: NASA, via YouTube" |
|
||||
| **The Space Devs — Launch Library 2 v2.3** | Recent launch, payload, stage, and recovery metadata for Space Missions (30d) | [The Space Devs terms of use](https://github.com/TheSpaceDevs/Tutorials/blob/main/faqs/faq_TSD.md#terms-of-use): data may be used and shared in any form; avoid forwarding it without added value; attribution is encouraged (not mandatory). [Official API limits](https://ll.thespacedevs.com/docs/): 15 unauthenticated calls/hour; optional token | "Launch Library 2 — The Space Devs" (courtesy attribution) |
|
||||
| **Esri World Imagery** (ArcGIS Online tile service) | The keyless satellite basemap — the default landing when no Google/ion credential is configured, and the "Esri Satellite" map stack | [Esri Master Agreement](https://www.esri.com/en-us/legal/terms/full-master-agreement): the public World Imagery service is usable in public-facing apps with attribution; no key is required for this classic endpoint, but Esri governs and can change access — an app at scale should review current ArcGIS Location Platform terms | "Powered by Esri — Source: Esri, Maxar, Earthstar Geographics, and the GIS User Community" (provider carries the service's own credit line) |
|
||||
|
||||
@@ -1389,6 +1389,25 @@ tracks the ISS. While the ISS is selected, a panel beside the tracked card plays
|
||||
NASA's official ISS live stream (YouTube, muted to start); closing it holds
|
||||
until the next selection, and untracking, the Cockpit or turning the layer off
|
||||
removes the player.
|
||||
The model is NASA/JSC IGOAL's current-configuration station, reduced to 3 MB
|
||||
with its joints kept as nodes (`public/models/README.md`), fetched only once
|
||||
the camera nears its range. `issArticulation.js` turns them every frame, from
|
||||
computation, never telemetry: the two alpha joints and eight beta joints face
|
||||
the arrays to the Sun (feathered along the flight direction in the Earth's
|
||||
shadow, taken as a cylinder), the two radiator joints keep the radiators
|
||||
edge-on to it, the two Ku-band dishes aim at the highest TDRS nominal slots
|
||||
(41°W, 171°W, 85°E) above the station's horizon plane, and Canadarm2, Dextre's
|
||||
arms and the Japanese arm sway a few degrees about NASA's filed pose, which is
|
||||
illustrative only (no public source gives their real pose; the European arm has
|
||||
no joints in the file). Joints turn at most 12°/s of wall time. Docked objects
|
||||
are found by comparing both orbits at one instant, since dots are moved at
|
||||
different moments. Selecting the ISS also shows the command panel
|
||||
(`issCommand.js`), collapsed, bottom left: **Zoom to the ISS** (offered beyond
|
||||
1 km, eases the follow camera to 260 m), **Automatic** (the default, with a
|
||||
lit/shadow status line) and **Manual**, whose controls replace the Sun with a
|
||||
chosen position or a 40 s orbit, fold the arrays and radiators as a labelled
|
||||
demonstration, aim the dishes and pose Canadarm2 by joint. Automatic, a new
|
||||
selection, the Cockpit or turning the layer off hand every joint back.
|
||||
The mission factory separates paths, replay, camera, panel, overlays and placement.
|
||||
Launch Library pad coordinates retain unknown values: missing fields use the
|
||||
reported location coordinates when available, and launches without a known pad
|
||||
|
||||
@@ -14,7 +14,7 @@ under the license listed below.
|
||||
| `mq9.glb` | “MQ-9” by [IProZenoN](https://sketchfab.com/IProZenoN) | [Sketchfab model](https://sketchfab.com/3d-models/mq-9-fabe963feb354c5584b51f9c470c3f7e) | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | Optimized for God's Eye View: geometry/material simplification, textures resized to 256 px WebP, orientation/scale vertex-baked to real-world meters (Y-up, nose −X), origin centered. |
|
||||
| `b789.glb` | “Boeing 787-9” by [Nobilis 2](https://sketchfab.com/nobilishornet2) | [Sketchfab model](https://sketchfab.com/3d-models/boeing-787-9-b6711e2e698e4e469675c1154a50b7a3) | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | Optimized for God's Eye View: geometry/material simplification, textures resized to 256 px WebP, orientation/scale vertex-baked to real-world meters (Y-up, nose −X), origin centered. |
|
||||
| `atr72.glb` | “ATR 72 - 600” by [Oyan3D](https://sketchfab.com/oyan3D) | [Sketchfab model](https://sketchfab.com/3d-models/atr-72-600-1e1a7186f7444d288675262fcee44744) | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | Optimized for God's Eye View: geometry/material simplification, textures removed with dominant material colors baked into PBR factors (flat “abstracted” style), orientation/scale vertex-baked to real-world meters (Y-up, nose −X), origin centered. |
|
||||
| `iss.glb` | “International Space Station (ISS) (A)”, NASA | [NASA 3D Resources](https://github.com/nasa/NASA-3D-Resources/tree/master/3D%20Models/International%20Space%20Station%20(ISS)%20(A)) | NASA media: not subject to copyright in the United States ([NASA Images and Media Usage Guidelines](https://www.nasa.gov/nasa-brand-center/images-and-media)) | None: shipped as published (Draco-compressed, 40 KB). The app scales it to the real 109 m truss at runtime. Its use does not imply endorsement by NASA. |
|
||||
| `iss.glb` | “International Space Station (ISS) (D) (IGOAL)”, NASA Johnson Space Center, Integrated Graphics, Operations and Analysis Laboratory | [NASA 3D Resources](https://science.nasa.gov/3d-resources/international-space-station-iss-d-igoal/) | NASA media: not subject to copyright in the United States ([NASA Images and Media Usage Guidelines](https://www.nasa.gov/nasa-brand-center/images-and-media)) | Reduced for God's Eye View from the 96 MB original (2.7 M triangles) to 3 MB (314 k triangles): handrails left out; geometry simplified within 15 cm (structure) or 40 cm (small details) of the original surface, normals rebuilt; normal maps dropped; textures resized to 512 px WebP; Draco-compressed. Every part is baked into one frame in meters (glTF +Y zenith, +X port, +Z forward) and the scene root moves the bounding-box centre to the origin. NASA's file is a mirror image of the station (port and starboard swapped), which is undone; 15 materials NASA marks as blended are made opaque, because blended they draw see-through. Parts that move stay separate nodes at the joints NASA names (two alpha joints, eight array beta joints, two radiator joints, Canadarm2's seven joints, two joints on each Dextre arm, three on the Japanese arm); the two Ku-band dishes and three of the four power-module radiators, welded into the truss in NASA's file, are cut out by position. Its use does not imply endorsement by NASA. |
|
||||
|
||||
CC BY 4.0 permits sharing and adaptation, including commercial use, provided
|
||||
appropriate credit is retained, the license is linked, and modifications are
|
||||
|
||||
Binary file not shown.
@@ -1792,6 +1792,8 @@
|
||||
"src/layers/satellites/interaction.js",
|
||||
"src/layers/satellites/issModel.js",
|
||||
"src/layers/satellites/issLive.js",
|
||||
"src/layers/satellites/issArticulation.js",
|
||||
"src/layers/satellites/issCommand.js",
|
||||
"src/layers/satellites/labels.js",
|
||||
"src/layers/satellites/lifecycle.js",
|
||||
"src/layers/satellites/orbits.js",
|
||||
@@ -2908,6 +2910,8 @@
|
||||
"src/layers/satellites/interaction.js",
|
||||
"src/layers/satellites/issModel.js",
|
||||
"src/layers/satellites/issLive.js",
|
||||
"src/layers/satellites/issArticulation.js",
|
||||
"src/layers/satellites/issCommand.js",
|
||||
"src/layers/satellites/labels.js",
|
||||
"src/layers/satellites/lifecycle.js",
|
||||
"src/layers/satellites/orbits.js",
|
||||
@@ -3947,6 +3951,8 @@
|
||||
"src/layers/satellites/interaction.js",
|
||||
"src/layers/satellites/issModel.js",
|
||||
"src/layers/satellites/issLive.js",
|
||||
"src/layers/satellites/issArticulation.js",
|
||||
"src/layers/satellites/issCommand.js",
|
||||
"src/layers/satellites/labels.js",
|
||||
"src/layers/satellites/lifecycle.js",
|
||||
"src/layers/satellites/orbits.js",
|
||||
|
||||
@@ -158,7 +158,7 @@ export const DATA_CREDITS = [
|
||||
key: 'nasa-iss-model',
|
||||
html:
|
||||
'ISS model: ' +
|
||||
'<a href="https://github.com/nasa/NASA-3D-Resources" target="_blank" rel="noopener">NASA 3D Resources</a>',
|
||||
'<a href="https://science.nasa.gov/3d-resources/international-space-station-iss-d-igoal/" target="_blank" rel="noopener">NASA 3D Resources</a> (JSC IGOAL)',
|
||||
},
|
||||
{
|
||||
key: 'nasa-iss-live',
|
||||
|
||||
@@ -3835,5 +3835,46 @@
|
||||
"ISS LIVE · NASA": "محطة الفضاء الدولية مباشر · NASA",
|
||||
"Open on YouTube": "فتح على YouTube",
|
||||
"Close ISS live video": "إغلاق البث المباشر لمحطة الفضاء الدولية",
|
||||
"Live views from the International Space Station (NASA)": "مشاهد مباشرة من محطة الفضاء الدولية (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "مشاهد مباشرة من محطة الفضاء الدولية (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "يُشغَّل الفيديو من YouTube، الذي يرى عنوان IP الخاص بك.",
|
||||
"ISS command panel": "لوحة التحكم بمحطة الفضاء الدولية",
|
||||
"ISS · COMMAND PANEL": "المحطة الدولية · لوحة التحكم",
|
||||
"Expand command panel": "توسيع لوحة التحكم",
|
||||
"Collapse command panel": "طي لوحة التحكم",
|
||||
"Automatic": "تلقائي",
|
||||
"Manual": "يدوي",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "الألواح والمشعّات تتبع الشمس، والأطباق تتجه نحو أقمار الترحيل، والأذرع تتحرك للتوضيح فقط. محسوبة، وليست قياسات حية.",
|
||||
"Overhead": "فوق المحطة",
|
||||
"Ahead": "أمام",
|
||||
"Behind": "خلف",
|
||||
"Below": "تحت",
|
||||
"Port side": "الجانب الأيسر",
|
||||
"Starboard side": "الجانب الأيمن",
|
||||
"Night (shadow)": "ليل (ظل)",
|
||||
"Sun position": "موضع الشمس",
|
||||
"Follow the Sun": "اتبع الشمس",
|
||||
"Fast orbit (40 s)": "مدار سريع (40 ث)",
|
||||
"Solar arrays": "الألواح الشمسية",
|
||||
"Demonstration: the real arrays stay extended.": "للتوضيح: الألواح الحقيقية تبقى مفرودة.",
|
||||
"Retract": "طيّ",
|
||||
"Extend": "فرد",
|
||||
"Radiators": "المشعّات",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "للتوضيح: المشعّات الحقيقية قابلة للطي لكنها تبقى مفرودة.",
|
||||
"Dishes": "الأطباق",
|
||||
"Relay satellites": "أقمار الترحيل",
|
||||
"Up": "أعلى",
|
||||
"Forward": "أمام",
|
||||
"Sideways": "جانبًا",
|
||||
"Shoulder roll": "دوران الكتف",
|
||||
"Shoulder yaw": "انعراج الكتف",
|
||||
"Shoulder pitch": "ميل الكتف",
|
||||
"Elbow": "المرفق",
|
||||
"Wrist pitch": "ميل المعصم",
|
||||
"Wrist yaw": "انعراج المعصم",
|
||||
"Wrist roll": "دوران المعصم",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (درجات)",
|
||||
"Resume sway": "استئناف الحركة التلقائية",
|
||||
"Zoom to the ISS": "تقريب إلى المحطة الدولية",
|
||||
"Now: in sunlight": "الآن: في ضوء الشمس",
|
||||
"Now: in the Earth's shadow": "الآن: في ظل الأرض"
|
||||
}
|
||||
@@ -3511,5 +3511,46 @@
|
||||
"ISS LIVE · NASA": "ISS LIVE · NASA",
|
||||
"Open on YouTube": "Auf YouTube öffnen",
|
||||
"Close ISS live video": "ISS-Livevideo schließen",
|
||||
"Live views from the International Space Station (NASA)": "Livebilder von der Internationalen Raumstation (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "Livebilder von der Internationalen Raumstation (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "Das Video wird von YouTube abgespielt, das Ihre IP-Adresse sieht.",
|
||||
"ISS command panel": "ISS-Steuerpult",
|
||||
"ISS · COMMAND PANEL": "ISS · STEUERPULT",
|
||||
"Expand command panel": "Steuerpult ausklappen",
|
||||
"Collapse command panel": "Steuerpult einklappen",
|
||||
"Automatic": "Automatisch",
|
||||
"Manual": "Manuell",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "Solarflügel und Radiatoren folgen der Sonne, die Antennen richten sich auf Relaissatelliten aus und die Arme bewegen sich zur Veranschaulichung. Berechnet, keine Live-Telemetrie.",
|
||||
"Overhead": "Über der Station",
|
||||
"Ahead": "Voraus",
|
||||
"Behind": "Dahinter",
|
||||
"Below": "Darunter",
|
||||
"Port side": "Backbord",
|
||||
"Starboard side": "Steuerbord",
|
||||
"Night (shadow)": "Nacht (Schatten)",
|
||||
"Sun position": "Sonnenstand",
|
||||
"Follow the Sun": "Der Sonne folgen",
|
||||
"Fast orbit (40 s)": "Schneller Umlauf (40 s)",
|
||||
"Solar arrays": "Solarflügel",
|
||||
"Demonstration: the real arrays stay extended.": "Demonstration: Die echten Solarflügel bleiben ausgefahren.",
|
||||
"Retract": "Einfahren",
|
||||
"Extend": "Ausfahren",
|
||||
"Radiators": "Radiatoren",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "Demonstration: Die echten Radiatoren lassen sich falten, bleiben aber ausgefahren.",
|
||||
"Dishes": "Antennen",
|
||||
"Relay satellites": "Relaissatelliten",
|
||||
"Up": "Nach oben",
|
||||
"Forward": "Nach vorn",
|
||||
"Sideways": "Zur Seite",
|
||||
"Shoulder roll": "Schulter-Rollen",
|
||||
"Shoulder yaw": "Schulter-Gieren",
|
||||
"Shoulder pitch": "Schulter-Nicken",
|
||||
"Elbow": "Ellbogen",
|
||||
"Wrist pitch": "Handgelenk-Nicken",
|
||||
"Wrist yaw": "Handgelenk-Gieren",
|
||||
"Wrist roll": "Handgelenk-Rollen",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (Grad)",
|
||||
"Resume sway": "Bewegung fortsetzen",
|
||||
"Zoom to the ISS": "Auf die ISS zoomen",
|
||||
"Now: in sunlight": "Jetzt: im Sonnenlicht",
|
||||
"Now: in the Earth's shadow": "Jetzt: im Erdschatten"
|
||||
}
|
||||
@@ -3592,5 +3592,46 @@
|
||||
"ISS LIVE · NASA": "ISS EN DIRECTO · NASA",
|
||||
"Open on YouTube": "Abrir en YouTube",
|
||||
"Close ISS live video": "Cerrar vídeo en directo de la ISS",
|
||||
"Live views from the International Space Station (NASA)": "Imágenes en directo de la Estación Espacial Internacional (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "Imágenes en directo de la Estación Espacial Internacional (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "El vídeo se reproduce desde YouTube, que ve tu dirección IP.",
|
||||
"ISS command panel": "Panel de mando de la ISS",
|
||||
"ISS · COMMAND PANEL": "ISS · PANEL DE MANDO",
|
||||
"Expand command panel": "Expandir panel de mando",
|
||||
"Collapse command panel": "Contraer panel de mando",
|
||||
"Automatic": "Automático",
|
||||
"Manual": "Manual",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "Los paneles y radiadores siguen al Sol, las antenas apuntan a los satélites de retransmisión y los brazos se mueven a modo de ilustración. Calculado, no es telemetría en vivo.",
|
||||
"Overhead": "Arriba",
|
||||
"Ahead": "Delante",
|
||||
"Behind": "Detrás",
|
||||
"Below": "Abajo",
|
||||
"Port side": "Babor",
|
||||
"Starboard side": "Estribor",
|
||||
"Night (shadow)": "Noche (sombra)",
|
||||
"Sun position": "Posición del Sol",
|
||||
"Follow the Sun": "Seguir al Sol",
|
||||
"Fast orbit (40 s)": "Órbita rápida (40 s)",
|
||||
"Solar arrays": "Paneles solares",
|
||||
"Demonstration: the real arrays stay extended.": "Demostración: los paneles reales permanecen desplegados.",
|
||||
"Retract": "Recoger",
|
||||
"Extend": "Desplegar",
|
||||
"Radiators": "Radiadores",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "Demostración: los radiadores reales pueden plegarse, pero permanecen desplegados.",
|
||||
"Dishes": "Antenas",
|
||||
"Relay satellites": "Satélites de retransmisión",
|
||||
"Up": "Arriba",
|
||||
"Forward": "Adelante",
|
||||
"Sideways": "De lado",
|
||||
"Shoulder roll": "Alabeo del hombro",
|
||||
"Shoulder yaw": "Guiñada del hombro",
|
||||
"Shoulder pitch": "Cabeceo del hombro",
|
||||
"Elbow": "Codo",
|
||||
"Wrist pitch": "Cabeceo de la muñeca",
|
||||
"Wrist yaw": "Guiñada de la muñeca",
|
||||
"Wrist roll": "Alabeo de la muñeca",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (grados)",
|
||||
"Resume sway": "Reanudar movimiento",
|
||||
"Zoom to the ISS": "Acercar a la ISS",
|
||||
"Now: in sunlight": "Ahora: a la luz del Sol",
|
||||
"Now: in the Earth's shadow": "Ahora: a la sombra de la Tierra"
|
||||
}
|
||||
@@ -3592,5 +3592,46 @@
|
||||
"ISS LIVE · NASA": "ISS EN DIRECT · NASA",
|
||||
"Open on YouTube": "Ouvrir sur YouTube",
|
||||
"Close ISS live video": "Fermer la vidéo en direct de l’ISS",
|
||||
"Live views from the International Space Station (NASA)": "Images en direct de la Station spatiale internationale (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "Images en direct de la Station spatiale internationale (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "La vidéo est lue depuis YouTube, qui voit votre adresse IP.",
|
||||
"ISS command panel": "Panneau de commande de l'ISS",
|
||||
"ISS · COMMAND PANEL": "ISS · PANNEAU DE COMMANDE",
|
||||
"Expand command panel": "Développer le panneau de commande",
|
||||
"Collapse command panel": "Réduire le panneau de commande",
|
||||
"Automatic": "Automatique",
|
||||
"Manual": "Manuel",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "Les panneaux et les radiateurs suivent le Soleil, les antennes visent les satellites relais et les bras bougent à titre d'illustration. Calculé, pas de télémétrie en direct.",
|
||||
"Overhead": "Au-dessus",
|
||||
"Ahead": "Devant",
|
||||
"Behind": "Derrière",
|
||||
"Below": "En dessous",
|
||||
"Port side": "Bâbord",
|
||||
"Starboard side": "Tribord",
|
||||
"Night (shadow)": "Nuit (ombre)",
|
||||
"Sun position": "Position du Soleil",
|
||||
"Follow the Sun": "Suivre le Soleil",
|
||||
"Fast orbit (40 s)": "Orbite rapide (40 s)",
|
||||
"Solar arrays": "Panneaux solaires",
|
||||
"Demonstration: the real arrays stay extended.": "Démonstration : les vrais panneaux restent déployés.",
|
||||
"Retract": "Rétracter",
|
||||
"Extend": "Déployer",
|
||||
"Radiators": "Radiateurs",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "Démonstration : les vrais radiateurs peuvent se replier mais restent déployés.",
|
||||
"Dishes": "Antennes",
|
||||
"Relay satellites": "Satellites relais",
|
||||
"Up": "Vers le haut",
|
||||
"Forward": "Vers l'avant",
|
||||
"Sideways": "Sur le côté",
|
||||
"Shoulder roll": "Roulis d'épaule",
|
||||
"Shoulder yaw": "Lacet d'épaule",
|
||||
"Shoulder pitch": "Tangage d'épaule",
|
||||
"Elbow": "Coude",
|
||||
"Wrist pitch": "Tangage du poignet",
|
||||
"Wrist yaw": "Lacet du poignet",
|
||||
"Wrist roll": "Roulis du poignet",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (degrés)",
|
||||
"Resume sway": "Reprendre le mouvement",
|
||||
"Zoom to the ISS": "Zoomer sur l'ISS",
|
||||
"Now: in sunlight": "En ce moment : au soleil",
|
||||
"Now: in the Earth's shadow": "En ce moment : dans l'ombre de la Terre"
|
||||
}
|
||||
@@ -3592,5 +3592,46 @@
|
||||
"ISS LIVE · NASA": "ISS בשידור חי · NASA",
|
||||
"Open on YouTube": "פתיחה ב-YouTube",
|
||||
"Close ISS live video": "סגירת השידור החי מתחנת החלל",
|
||||
"Live views from the International Space Station (NASA)": "צילומים חיים מתחנת החלל הבינלאומית (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "צילומים חיים מתחנת החלל הבינלאומית (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "הווידאו זורם מ-YouTube, שרואה את כתובת ה-IP שלך.",
|
||||
"ISS command panel": "לוח הפיקוד של תחנת החלל",
|
||||
"ISS · COMMAND PANEL": "תחנת החלל · לוח פיקוד",
|
||||
"Expand command panel": "הרחבת לוח הפיקוד",
|
||||
"Collapse command panel": "כיווץ לוח הפיקוד",
|
||||
"Automatic": "אוטומטי",
|
||||
"Manual": "ידני",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "הלוחות והרדיאטורים עוקבים אחר השמש, הצלחות מכוונות ללווייני ממסר והזרועות נעות להמחשה בלבד. מחושב, לא טלמטריה חיה.",
|
||||
"Overhead": "מעל",
|
||||
"Ahead": "מלפנים",
|
||||
"Behind": "מאחור",
|
||||
"Below": "מתחת",
|
||||
"Port side": "צד שמאל",
|
||||
"Starboard side": "צד ימין",
|
||||
"Night (shadow)": "לילה (צל)",
|
||||
"Sun position": "מיקום השמש",
|
||||
"Follow the Sun": "מעקב אחר השמש",
|
||||
"Fast orbit (40 s)": "הקפה מהירה (40 שנ')",
|
||||
"Solar arrays": "לוחות סולאריים",
|
||||
"Demonstration: the real arrays stay extended.": "הדגמה: הלוחות האמיתיים נשארים פרושים.",
|
||||
"Retract": "קיפול",
|
||||
"Extend": "פריסה",
|
||||
"Radiators": "רדיאטורים",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "הדגמה: הרדיאטורים האמיתיים יכולים להתקפל אך נשארים פרושים.",
|
||||
"Dishes": "צלחות",
|
||||
"Relay satellites": "לווייני ממסר",
|
||||
"Up": "למעלה",
|
||||
"Forward": "קדימה",
|
||||
"Sideways": "הצידה",
|
||||
"Shoulder roll": "גלגול כתף",
|
||||
"Shoulder yaw": "סבסוב כתף",
|
||||
"Shoulder pitch": "עלרוד כתף",
|
||||
"Elbow": "מרפק",
|
||||
"Wrist pitch": "עלרוד שורש כף היד",
|
||||
"Wrist yaw": "סבסוב שורש כף היד",
|
||||
"Wrist roll": "גלגול שורש כף היד",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (מעלות)",
|
||||
"Resume sway": "חידוש התנועה",
|
||||
"Zoom to the ISS": "התקרבות לתחנת החלל",
|
||||
"Now: in sunlight": "כעת: באור השמש",
|
||||
"Now: in the Earth's shadow": "כעת: בצל כדור הארץ"
|
||||
}
|
||||
@@ -3592,5 +3592,46 @@
|
||||
"ISS LIVE · NASA": "ISS IN DIRETTA · NASA",
|
||||
"Open on YouTube": "Apri su YouTube",
|
||||
"Close ISS live video": "Chiudi il video in diretta della ISS",
|
||||
"Live views from the International Space Station (NASA)": "Immagini in diretta dalla Stazione Spaziale Internazionale (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "Immagini in diretta dalla Stazione Spaziale Internazionale (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "Il video viene riprodotto da YouTube, che vede il tuo indirizzo IP.",
|
||||
"ISS command panel": "Pannello di comando della ISS",
|
||||
"ISS · COMMAND PANEL": "ISS · PANNELLO DI COMANDO",
|
||||
"Expand command panel": "Espandi pannello di comando",
|
||||
"Collapse command panel": "Comprimi pannello di comando",
|
||||
"Automatic": "Automatico",
|
||||
"Manual": "Manuale",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "Pannelli e radiatori seguono il Sole, le antenne puntano ai satelliti di collegamento e i bracci si muovono a scopo illustrativo. Calcolato, non telemetria in diretta.",
|
||||
"Overhead": "Sopra",
|
||||
"Ahead": "Davanti",
|
||||
"Behind": "Dietro",
|
||||
"Below": "Sotto",
|
||||
"Port side": "Babordo",
|
||||
"Starboard side": "Tribordo",
|
||||
"Night (shadow)": "Notte (ombra)",
|
||||
"Sun position": "Posizione del Sole",
|
||||
"Follow the Sun": "Segui il Sole",
|
||||
"Fast orbit (40 s)": "Orbita veloce (40 s)",
|
||||
"Solar arrays": "Pannelli solari",
|
||||
"Demonstration: the real arrays stay extended.": "Dimostrazione: i pannelli reali restano dispiegati.",
|
||||
"Retract": "Ritira",
|
||||
"Extend": "Dispiega",
|
||||
"Radiators": "Radiatori",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "Dimostrazione: i radiatori reali possono ripiegarsi ma restano dispiegati.",
|
||||
"Dishes": "Antenne",
|
||||
"Relay satellites": "Satelliti di collegamento",
|
||||
"Up": "In alto",
|
||||
"Forward": "In avanti",
|
||||
"Sideways": "Di lato",
|
||||
"Shoulder roll": "Rollio spalla",
|
||||
"Shoulder yaw": "Imbardata spalla",
|
||||
"Shoulder pitch": "Beccheggio spalla",
|
||||
"Elbow": "Gomito",
|
||||
"Wrist pitch": "Beccheggio polso",
|
||||
"Wrist yaw": "Imbardata polso",
|
||||
"Wrist roll": "Rollio polso",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (gradi)",
|
||||
"Resume sway": "Riprendi movimento",
|
||||
"Zoom to the ISS": "Zoom sulla ISS",
|
||||
"Now: in sunlight": "Ora: alla luce del Sole",
|
||||
"Now: in the Earth's shadow": "Ora: nell'ombra della Terra"
|
||||
}
|
||||
@@ -3430,5 +3430,46 @@
|
||||
"ISS LIVE · NASA": "ISS ライブ · NASA",
|
||||
"Open on YouTube": "YouTubeで開く",
|
||||
"Close ISS live video": "ISSのライブ映像を閉じる",
|
||||
"Live views from the International Space Station (NASA)": "国際宇宙ステーションからのライブ映像(NASA)"
|
||||
"Live views from the International Space Station (NASA)": "国際宇宙ステーションからのライブ映像(NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "動画は YouTube から再生され、YouTube にはあなたの IP アドレスが見えます。",
|
||||
"ISS command panel": "ISSコマンドパネル",
|
||||
"ISS · COMMAND PANEL": "ISS · コマンドパネル",
|
||||
"Expand command panel": "コマンドパネルを開く",
|
||||
"Collapse command panel": "コマンドパネルを閉じる",
|
||||
"Automatic": "自動",
|
||||
"Manual": "手動",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "太陽電池パネルとラジエーターは太陽を追い、アンテナは中継衛星を向き、アームは説明用にゆっくり動きます。計算による表示で、実際のテレメトリではありません。",
|
||||
"Overhead": "真上",
|
||||
"Ahead": "前方",
|
||||
"Behind": "後方",
|
||||
"Below": "真下",
|
||||
"Port side": "左舷",
|
||||
"Starboard side": "右舷",
|
||||
"Night (shadow)": "夜(影)",
|
||||
"Sun position": "太陽の位置",
|
||||
"Follow the Sun": "太陽を追う",
|
||||
"Fast orbit (40 s)": "高速周回(40秒)",
|
||||
"Solar arrays": "太陽電池パネル",
|
||||
"Demonstration: the real arrays stay extended.": "デモ表示:実際のパネルは展開したままです。",
|
||||
"Retract": "収納",
|
||||
"Extend": "展開",
|
||||
"Radiators": "ラジエーター",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "デモ表示:実際のラジエーターは折りたためますが、展開したままです。",
|
||||
"Dishes": "アンテナ",
|
||||
"Relay satellites": "中継衛星",
|
||||
"Up": "上",
|
||||
"Forward": "前",
|
||||
"Sideways": "横",
|
||||
"Shoulder roll": "肩ロール",
|
||||
"Shoulder yaw": "肩ヨー",
|
||||
"Shoulder pitch": "肩ピッチ",
|
||||
"Elbow": "肘",
|
||||
"Wrist pitch": "手首ピッチ",
|
||||
"Wrist yaw": "手首ヨー",
|
||||
"Wrist roll": "手首ロール",
|
||||
"Canadarm2 (degrees)": "Canadarm2(度)",
|
||||
"Resume sway": "自動の動きに戻す",
|
||||
"Zoom to the ISS": "ISSにズーム",
|
||||
"Now: in sunlight": "現在:日なた",
|
||||
"Now: in the Earth's shadow": "現在:地球の影の中"
|
||||
}
|
||||
@@ -3592,5 +3592,46 @@
|
||||
"ISS LIVE · NASA": "ISS AO VIVO · NASA",
|
||||
"Open on YouTube": "Abrir no YouTube",
|
||||
"Close ISS live video": "Fechar vídeo ao vivo da ISS",
|
||||
"Live views from the International Space Station (NASA)": "Imagens ao vivo da Estação Espacial Internacional (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "Imagens ao vivo da Estação Espacial Internacional (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "O vídeo é reproduzido a partir do YouTube, que vê o seu endereço IP.",
|
||||
"ISS command panel": "Painel de comando da ISS",
|
||||
"ISS · COMMAND PANEL": "ISS · PAINEL DE COMANDO",
|
||||
"Expand command panel": "Expandir painel de comando",
|
||||
"Collapse command panel": "Minimizar painel de comando",
|
||||
"Automatic": "Automático",
|
||||
"Manual": "Manual",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "Painéis e radiadores seguem o Sol, as antenas apontam para os satélites de retransmissão e os braços se movem de forma ilustrativa. Calculado, não é telemetria ao vivo.",
|
||||
"Overhead": "Em cima",
|
||||
"Ahead": "À frente",
|
||||
"Behind": "Atrás",
|
||||
"Below": "Embaixo",
|
||||
"Port side": "Bombordo",
|
||||
"Starboard side": "Estibordo",
|
||||
"Night (shadow)": "Noite (sombra)",
|
||||
"Sun position": "Posição do Sol",
|
||||
"Follow the Sun": "Seguir o Sol",
|
||||
"Fast orbit (40 s)": "Órbita acelerada (40 s)",
|
||||
"Solar arrays": "Painéis solares",
|
||||
"Demonstration: the real arrays stay extended.": "Demonstração: os painéis reais ficam abertos.",
|
||||
"Retract": "Recolher",
|
||||
"Extend": "Expandir",
|
||||
"Radiators": "Radiadores",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "Demonstração: os radiadores reais podem dobrar, mas ficam abertos.",
|
||||
"Dishes": "Antenas",
|
||||
"Relay satellites": "Satélites de retransmissão",
|
||||
"Up": "Para cima",
|
||||
"Forward": "Para frente",
|
||||
"Sideways": "Para o lado",
|
||||
"Shoulder roll": "Ombro (giro)",
|
||||
"Shoulder yaw": "Ombro (guinada)",
|
||||
"Shoulder pitch": "Ombro (arfagem)",
|
||||
"Elbow": "Cotovelo",
|
||||
"Wrist pitch": "Pulso (arfagem)",
|
||||
"Wrist yaw": "Pulso (guinada)",
|
||||
"Wrist roll": "Pulso (giro)",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (graus)",
|
||||
"Resume sway": "Retomar movimento",
|
||||
"Zoom to the ISS": "Aproximar da ISS",
|
||||
"Now: in sunlight": "Agora: na luz do Sol",
|
||||
"Now: in the Earth's shadow": "Agora: na sombra da Terra"
|
||||
}
|
||||
@@ -3673,5 +3673,46 @@
|
||||
"ISS LIVE · NASA": "МКС В ЭФИРЕ · NASA",
|
||||
"Open on YouTube": "Открыть на YouTube",
|
||||
"Close ISS live video": "Закрыть трансляцию с МКС",
|
||||
"Live views from the International Space Station (NASA)": "Прямая трансляция с Международной космической станции (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "Прямая трансляция с Международной космической станции (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "Видео воспроизводится с YouTube, который видит ваш IP-адрес.",
|
||||
"ISS command panel": "Панель управления МКС",
|
||||
"ISS · COMMAND PANEL": "МКС · ПАНЕЛЬ УПРАВЛЕНИЯ",
|
||||
"Expand command panel": "Развернуть панель управления",
|
||||
"Collapse command panel": "Свернуть панель управления",
|
||||
"Automatic": "Автоматически",
|
||||
"Manual": "Вручную",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "Панели и радиаторы следят за Солнцем, антенны наводятся на спутники-ретрансляторы, а манипуляторы движутся для иллюстрации. Расчёт, а не телеметрия в реальном времени.",
|
||||
"Overhead": "Сверху",
|
||||
"Ahead": "Спереди",
|
||||
"Behind": "Сзади",
|
||||
"Below": "Снизу",
|
||||
"Port side": "Левый борт",
|
||||
"Starboard side": "Правый борт",
|
||||
"Night (shadow)": "Ночь (тень)",
|
||||
"Sun position": "Положение Солнца",
|
||||
"Follow the Sun": "Следить за Солнцем",
|
||||
"Fast orbit (40 s)": "Быстрый виток (40 с)",
|
||||
"Solar arrays": "Солнечные батареи",
|
||||
"Demonstration: the real arrays stay extended.": "Демонстрация: настоящие батареи остаются раскрытыми.",
|
||||
"Retract": "Сложить",
|
||||
"Extend": "Раскрыть",
|
||||
"Radiators": "Радиаторы",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "Демонстрация: настоящие радиаторы складываются, но остаются раскрытыми.",
|
||||
"Dishes": "Антенны",
|
||||
"Relay satellites": "Спутники-ретрансляторы",
|
||||
"Up": "Вверх",
|
||||
"Forward": "Вперёд",
|
||||
"Sideways": "В сторону",
|
||||
"Shoulder roll": "Плечо: крен",
|
||||
"Shoulder yaw": "Плечо: рыскание",
|
||||
"Shoulder pitch": "Плечо: тангаж",
|
||||
"Elbow": "Локоть",
|
||||
"Wrist pitch": "Запястье: тангаж",
|
||||
"Wrist yaw": "Запястье: рыскание",
|
||||
"Wrist roll": "Запястье: крен",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (градусы)",
|
||||
"Resume sway": "Возобновить движение",
|
||||
"Zoom to the ISS": "Приблизить к МКС",
|
||||
"Now: in sunlight": "Сейчас: на свету",
|
||||
"Now: in the Earth's shadow": "Сейчас: в тени Земли"
|
||||
}
|
||||
@@ -3511,5 +3511,46 @@
|
||||
"ISS LIVE · NASA": "ISS LIVE · NASA",
|
||||
"Open on YouTube": "Öppna på YouTube",
|
||||
"Close ISS live video": "Stäng livevideon från ISS",
|
||||
"Live views from the International Space Station (NASA)": "Livebilder från Internationella rymdstationen (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "Livebilder från Internationella rymdstationen (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "Videon spelas upp från YouTube, som ser din IP-adress.",
|
||||
"ISS command panel": "Kommandopanel för ISS",
|
||||
"ISS · COMMAND PANEL": "ISS · KOMMANDOPANEL",
|
||||
"Expand command panel": "Expandera kommandopanelen",
|
||||
"Collapse command panel": "Fäll ihop kommandopanelen",
|
||||
"Automatic": "Automatiskt",
|
||||
"Manual": "Manuellt",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "Paneler och radiatorer följer solen, antennerna riktas mot relästationer i rymden och armarna rör sig som illustration. Beräknat, inte telemetri i realtid.",
|
||||
"Overhead": "Ovanför",
|
||||
"Ahead": "Framför",
|
||||
"Behind": "Bakom",
|
||||
"Below": "Nedanför",
|
||||
"Port side": "Babord",
|
||||
"Starboard side": "Styrbord",
|
||||
"Night (shadow)": "Natt (skugga)",
|
||||
"Sun position": "Solens läge",
|
||||
"Follow the Sun": "Följ solen",
|
||||
"Fast orbit (40 s)": "Snabbt varv (40 s)",
|
||||
"Solar arrays": "Solpaneler",
|
||||
"Demonstration: the real arrays stay extended.": "Demonstration: de verkliga panelerna förblir utfällda.",
|
||||
"Retract": "Fäll in",
|
||||
"Extend": "Fäll ut",
|
||||
"Radiators": "Radiatorer",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "Demonstration: de verkliga radiatorerna kan vikas men förblir utfällda.",
|
||||
"Dishes": "Antenner",
|
||||
"Relay satellites": "Reläsatelliter",
|
||||
"Up": "Uppåt",
|
||||
"Forward": "Framåt",
|
||||
"Sideways": "Åt sidan",
|
||||
"Shoulder roll": "Axel, roll",
|
||||
"Shoulder yaw": "Axel, gir",
|
||||
"Shoulder pitch": "Axel, tipp",
|
||||
"Elbow": "Armbåge",
|
||||
"Wrist pitch": "Handled, tipp",
|
||||
"Wrist yaw": "Handled, gir",
|
||||
"Wrist roll": "Handled, roll",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (grader)",
|
||||
"Resume sway": "Återuppta rörelsen",
|
||||
"Zoom to the ISS": "Zooma in på ISS",
|
||||
"Now: in sunlight": "Nu: i solljus",
|
||||
"Now: in the Earth's shadow": "Nu: i jordens skugga"
|
||||
}
|
||||
@@ -3673,5 +3673,46 @@
|
||||
"ISS LIVE · NASA": "МКС НАЖИВО · NASA",
|
||||
"Open on YouTube": "Відкрити на YouTube",
|
||||
"Close ISS live video": "Закрити трансляцію з МКС",
|
||||
"Live views from the International Space Station (NASA)": "Пряма трансляція з Міжнародної космічної станції (NASA)"
|
||||
"Live views from the International Space Station (NASA)": "Пряма трансляція з Міжнародної космічної станції (NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "Відео відтворюється з YouTube, який бачить вашу IP-адресу.",
|
||||
"ISS command panel": "Панель керування МКС",
|
||||
"ISS · COMMAND PANEL": "МКС · ПАНЕЛЬ КЕРУВАННЯ",
|
||||
"Expand command panel": "Розгорнути панель керування",
|
||||
"Collapse command panel": "Згорнути панель керування",
|
||||
"Automatic": "Автоматично",
|
||||
"Manual": "Вручну",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "Панелі й радіатори стежать за Сонцем, антени наводяться на супутники-ретранслятори, а маніпулятори рухаються для ілюстрації. Розрахунок, а не телеметрія в реальному часі.",
|
||||
"Overhead": "Згори",
|
||||
"Ahead": "Спереду",
|
||||
"Behind": "Позаду",
|
||||
"Below": "Знизу",
|
||||
"Port side": "Лівий борт",
|
||||
"Starboard side": "Правий борт",
|
||||
"Night (shadow)": "Ніч (тінь)",
|
||||
"Sun position": "Положення Сонця",
|
||||
"Follow the Sun": "Стежити за Сонцем",
|
||||
"Fast orbit (40 s)": "Швидкий виток (40 с)",
|
||||
"Solar arrays": "Сонячні батареї",
|
||||
"Demonstration: the real arrays stay extended.": "Демонстрація: справжні батареї залишаються розкритими.",
|
||||
"Retract": "Скласти",
|
||||
"Extend": "Розкрити",
|
||||
"Radiators": "Радіатори",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "Демонстрація: справжні радіатори складаються, але залишаються розкритими.",
|
||||
"Dishes": "Антени",
|
||||
"Relay satellites": "Супутники-ретранслятори",
|
||||
"Up": "Вгору",
|
||||
"Forward": "Вперед",
|
||||
"Sideways": "Убік",
|
||||
"Shoulder roll": "Плече: крен",
|
||||
"Shoulder yaw": "Плече: рискання",
|
||||
"Shoulder pitch": "Плече: тангаж",
|
||||
"Elbow": "Лікоть",
|
||||
"Wrist pitch": "Зап'ястя: тангаж",
|
||||
"Wrist yaw": "Зап'ястя: рискання",
|
||||
"Wrist roll": "Зап'ястя: крен",
|
||||
"Canadarm2 (degrees)": "Canadarm2 (градуси)",
|
||||
"Resume sway": "Відновити рух",
|
||||
"Zoom to the ISS": "Наблизити до МКС",
|
||||
"Now: in sunlight": "Зараз: на світлі",
|
||||
"Now: in the Earth's shadow": "Зараз: у тіні Землі"
|
||||
}
|
||||
@@ -3430,5 +3430,46 @@
|
||||
"ISS LIVE · NASA": "国际空间站直播 · NASA",
|
||||
"Open on YouTube": "在 YouTube 上打开",
|
||||
"Close ISS live video": "关闭国际空间站直播视频",
|
||||
"Live views from the International Space Station (NASA)": "国际空间站实时画面(NASA)"
|
||||
"Live views from the International Space Station (NASA)": "国际空间站实时画面(NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "视频从 YouTube 播放,YouTube 会看到你的 IP 地址。",
|
||||
"ISS command panel": "国际空间站控制面板",
|
||||
"ISS · COMMAND PANEL": "国际空间站 · 控制面板",
|
||||
"Expand command panel": "展开控制面板",
|
||||
"Collapse command panel": "收起控制面板",
|
||||
"Automatic": "自动",
|
||||
"Manual": "手动",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "太阳能板和散热器跟随太阳,天线指向中继卫星,机械臂仅作演示性摆动。均为计算结果,并非实时遥测。",
|
||||
"Overhead": "正上方",
|
||||
"Ahead": "前方",
|
||||
"Behind": "后方",
|
||||
"Below": "正下方",
|
||||
"Port side": "左舷",
|
||||
"Starboard side": "右舷",
|
||||
"Night (shadow)": "夜间(阴影)",
|
||||
"Sun position": "太阳位置",
|
||||
"Follow the Sun": "跟随太阳",
|
||||
"Fast orbit (40 s)": "快速绕行(40 秒)",
|
||||
"Solar arrays": "太阳能板",
|
||||
"Demonstration: the real arrays stay extended.": "演示:真实的太阳能板保持展开。",
|
||||
"Retract": "收起",
|
||||
"Extend": "展开",
|
||||
"Radiators": "散热器",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "演示:真实的散热器可以折叠,但保持展开。",
|
||||
"Dishes": "天线",
|
||||
"Relay satellites": "中继卫星",
|
||||
"Up": "向上",
|
||||
"Forward": "向前",
|
||||
"Sideways": "向侧面",
|
||||
"Shoulder roll": "肩部滚转",
|
||||
"Shoulder yaw": "肩部偏航",
|
||||
"Shoulder pitch": "肩部俯仰",
|
||||
"Elbow": "肘部",
|
||||
"Wrist pitch": "腕部俯仰",
|
||||
"Wrist yaw": "腕部偏航",
|
||||
"Wrist roll": "腕部滚转",
|
||||
"Canadarm2 (degrees)": "Canadarm2(度)",
|
||||
"Resume sway": "恢复摆动",
|
||||
"Zoom to the ISS": "拉近到国际空间站",
|
||||
"Now: in sunlight": "当前:处于日照中",
|
||||
"Now: in the Earth's shadow": "当前:处于地球阴影中"
|
||||
}
|
||||
@@ -3430,5 +3430,46 @@
|
||||
"ISS LIVE · NASA": "國際太空站直播 · NASA",
|
||||
"Open on YouTube": "在 YouTube 上開啟",
|
||||
"Close ISS live video": "關閉國際太空站直播影片",
|
||||
"Live views from the International Space Station (NASA)": "國際太空站即時畫面(NASA)"
|
||||
"Live views from the International Space Station (NASA)": "國際太空站即時畫面(NASA)",
|
||||
"Video plays from YouTube, which sees your IP address.": "影片從 YouTube 播放,YouTube 會看到你的 IP 位址。",
|
||||
"ISS command panel": "國際太空站控制面板",
|
||||
"ISS · COMMAND PANEL": "國際太空站 · 控制面板",
|
||||
"Expand command panel": "展開控制面板",
|
||||
"Collapse command panel": "收合控制面板",
|
||||
"Automatic": "自動",
|
||||
"Manual": "手動",
|
||||
"Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.": "太陽能板與散熱器跟隨太陽,天線指向中繼衛星,機械臂僅作示意性擺動。皆為計算結果,並非即時遙測。",
|
||||
"Overhead": "正上方",
|
||||
"Ahead": "前方",
|
||||
"Behind": "後方",
|
||||
"Below": "正下方",
|
||||
"Port side": "左舷",
|
||||
"Starboard side": "右舷",
|
||||
"Night (shadow)": "夜間(陰影)",
|
||||
"Sun position": "太陽位置",
|
||||
"Follow the Sun": "跟隨太陽",
|
||||
"Fast orbit (40 s)": "快速繞行(40 秒)",
|
||||
"Solar arrays": "太陽能板",
|
||||
"Demonstration: the real arrays stay extended.": "示範:真實的太陽能板保持展開。",
|
||||
"Retract": "收起",
|
||||
"Extend": "展開",
|
||||
"Radiators": "散熱器",
|
||||
"Demonstration: the real radiators can fold but stay extended.": "示範:真實的散熱器可以摺疊,但保持展開。",
|
||||
"Dishes": "天線",
|
||||
"Relay satellites": "中繼衛星",
|
||||
"Up": "向上",
|
||||
"Forward": "向前",
|
||||
"Sideways": "向側面",
|
||||
"Shoulder roll": "肩部滾轉",
|
||||
"Shoulder yaw": "肩部偏航",
|
||||
"Shoulder pitch": "肩部俯仰",
|
||||
"Elbow": "肘部",
|
||||
"Wrist pitch": "腕部俯仰",
|
||||
"Wrist yaw": "腕部偏航",
|
||||
"Wrist roll": "腕部滾轉",
|
||||
"Canadarm2 (degrees)": "Canadarm2(度)",
|
||||
"Resume sway": "恢復擺動",
|
||||
"Zoom to the ISS": "拉近到國際太空站",
|
||||
"Now: in sunlight": "目前:處於日照中",
|
||||
"Now: in the Earth's shadow": "目前:處於地球陰影中"
|
||||
}
|
||||
@@ -405,7 +405,8 @@
|
||||
"iNaturalist",
|
||||
"ICAO: {id}",
|
||||
"MMSI: {id}",
|
||||
"NORAD: {id}"
|
||||
"NORAD: {id}",
|
||||
"Manual"
|
||||
],
|
||||
"fr": [
|
||||
"1 min/s",
|
||||
@@ -1050,7 +1051,8 @@
|
||||
"iNaturalist",
|
||||
"ICAO: {id}",
|
||||
"MMSI: {id}",
|
||||
"NORAD: {id}"
|
||||
"NORAD: {id}",
|
||||
"Manual"
|
||||
],
|
||||
"ru": [
|
||||
"1900–1945",
|
||||
|
||||
Vendored
+7
@@ -254,6 +254,13 @@ export function createControls({ state: layerState, services, parts, source }) {
|
||||
// that card instead. Only members of the tracked cluster are affected —
|
||||
// unrelated nearby satellites are never suppressed.
|
||||
if (!isTracked && layerState._dockedCompanions.has(noradId)) continue;
|
||||
// Up close the ISS is its 3D model: no mark on it, nor on what is
|
||||
// docked to it.
|
||||
if (
|
||||
parts.issModel?._issStandsInFor?.(noradId) ||
|
||||
(noradId === ISS_NORAD && parts.issModel?._issVisualPosition?.())
|
||||
)
|
||||
continue;
|
||||
// The Cockpit camera rides a held subject; a bracket on it would sit
|
||||
// on the lens.
|
||||
if (isTracked && parts.cockpit?._cockpitHeld()) continue;
|
||||
|
||||
@@ -7,6 +7,7 @@ import { createRendering } from './rendering.js';
|
||||
import { createTracking } from './tracking.js';
|
||||
import { createTesting } from './testing.js';
|
||||
import { createInteraction } from './interaction.js';
|
||||
import { createIssCommand } from './issCommand.js';
|
||||
import { createIssLive } from './issLive.js';
|
||||
import { createIssModel } from './issModel.js';
|
||||
import { createLifecycle } from './lifecycle.js';
|
||||
@@ -33,6 +34,7 @@ export function createSatellitesLayer({
|
||||
parts.rendering = createRendering(context);
|
||||
parts.issModel = createIssModel({ ...context, resolveAsset });
|
||||
parts.issLive = createIssLive(context);
|
||||
parts.issCommand = createIssCommand(context);
|
||||
parts.tracking = createTracking(context);
|
||||
parts.testing = createTesting(context);
|
||||
parts.interaction = createInteraction(context);
|
||||
|
||||
@@ -0,0 +1,761 @@
|
||||
import * as Cesium from 'cesium';
|
||||
|
||||
/**
|
||||
* The ISS model's moving parts. NASA's file names its joints; the build keeps
|
||||
* each one as a node of its own, with the parts it carries beneath it, all in
|
||||
* the model's rest frame (glTF axes, meters: X port, Y zenith, Z forward), so
|
||||
* a joint turns by rotating its node about `pivot`.
|
||||
*
|
||||
* The angles are computed from where the Sun is, not read from telemetry: the
|
||||
* two alpha joints turn the outboard truss about the truss axis, each array's
|
||||
* beta joint turns it about its mast, and the two radiator joints keep the
|
||||
* radiators edge-on to the Sun. In the Earth's shadow the arrays feather:
|
||||
* masts along the flight direction, edge into it.
|
||||
*/
|
||||
|
||||
/** Alpha joints (SARJ): rotate about the truss, glTF X. */
|
||||
export const ISS_ALPHA_JOINTS = Object.freeze([
|
||||
Object.freeze({ node: 'PORT_ALPHA_ROT', pivot: [19.533, 0, 0] }),
|
||||
Object.freeze({ node: 'STBD_ALPHA_ROT', pivot: [-19.533, 0, 0] }),
|
||||
]);
|
||||
|
||||
/**
|
||||
* Beta joints (BGA): rotate about the mast, glTF Z at rest. `face` is the
|
||||
* sign of the cell side's normal along X at rest (the roll-out arrays sit on
|
||||
* that side).
|
||||
*/
|
||||
export const ISS_BETA_JOINTS = Object.freeze([
|
||||
Object.freeze({
|
||||
node: 'PORT_BETA_ROT_2A',
|
||||
pivot: [36.7319, 0.7256, -3.0077],
|
||||
face: -1,
|
||||
}),
|
||||
Object.freeze({
|
||||
node: 'PORT_BETA_ROT_4A',
|
||||
pivot: [36.7319, -0.7258, 2.2332],
|
||||
face: -1,
|
||||
}),
|
||||
Object.freeze({
|
||||
node: 'PORT_BETA_ROT_2B',
|
||||
pivot: [53.223, -0.7196, 2.2335],
|
||||
face: -1,
|
||||
}),
|
||||
Object.freeze({
|
||||
node: 'PORT_BETA_ROT_4B',
|
||||
pivot: [53.2219, 0.7294, -3.0076],
|
||||
face: -1,
|
||||
}),
|
||||
Object.freeze({
|
||||
node: 'STBD_BETA_ROT_1A',
|
||||
pivot: [-36.6608, 0.7257, 3.0224],
|
||||
face: 1,
|
||||
}),
|
||||
Object.freeze({
|
||||
node: 'STBD_BETA_ROT_3A',
|
||||
pivot: [-36.6608, -0.7257, -2.2408],
|
||||
face: 1,
|
||||
}),
|
||||
Object.freeze({
|
||||
node: 'STBD_BETA_ROT_1B',
|
||||
pivot: [-53.2219, -0.7294, -2.2408],
|
||||
face: 1,
|
||||
}),
|
||||
Object.freeze({
|
||||
node: 'STBD_BETA_ROT_3B',
|
||||
pivot: [-53.2232, 0.722, 3.0223],
|
||||
face: 1,
|
||||
}),
|
||||
]);
|
||||
|
||||
/** Radiator joints (TRRJ): rotate about glTF Z; the panels face Y at rest. */
|
||||
export const ISS_RADIATOR_JOINTS = Object.freeze([
|
||||
Object.freeze({ node: 'PORT_TRRJ_GAMMA_ROT', pivot: [16.1287, 0, -7.4432] }),
|
||||
Object.freeze({ node: 'STBD_TRRJ_GAMMA_ROT', pivot: [-16.1287, 0, -7.4432] }),
|
||||
]);
|
||||
|
||||
/** How fast a joint may turn on screen, radians per second of wall time. */
|
||||
export const ISS_JOINT_RATE = (12 * Math.PI) / 180;
|
||||
|
||||
/** Below this the Sun is too close to a joint's axis to steer by it. */
|
||||
const MIN_STEER = 0.05;
|
||||
const EARTH_RADIUS_M = 6_371_000;
|
||||
|
||||
/** The signed difference b - a, wrapped to (-π, π]. */
|
||||
function wrap(delta) {
|
||||
let d = delta % (2 * Math.PI);
|
||||
if (d > Math.PI) d -= 2 * Math.PI;
|
||||
if (d <= -Math.PI) d += 2 * Math.PI;
|
||||
return d;
|
||||
}
|
||||
|
||||
/** Of `angle` and `angle + π`, the one nearer to `previous`. */
|
||||
function nearestHalfTurn(angle, previous) {
|
||||
const flipped = angle + Math.PI;
|
||||
return Math.abs(wrap(angle - previous)) <= Math.abs(wrap(flipped - previous))
|
||||
? angle
|
||||
: flipped;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a point is in the Earth's shadow, taken as a cylinder.
|
||||
* @param {number[]} positionEcef Meters.
|
||||
* @param {number[]} sunEcef Unit vector toward the Sun.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function issInShadow(positionEcef, sunEcef) {
|
||||
const along =
|
||||
positionEcef[0] * sunEcef[0] +
|
||||
positionEcef[1] * sunEcef[1] +
|
||||
positionEcef[2] * sunEcef[2];
|
||||
if (along >= 0) return false;
|
||||
const off = Math.hypot(
|
||||
positionEcef[0] - along * sunEcef[0],
|
||||
positionEcef[1] - along * sunEcef[1],
|
||||
positionEcef[2] - along * sunEcef[2],
|
||||
);
|
||||
return off < EARTH_RADIUS_M;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Sun's direction on the model's glTF axes, from the flight axes the
|
||||
* model is oriented by (x along-track, y orbit normal, z zenith).
|
||||
* @param {number[]} sunEcef Unit vector toward the Sun, Earth-fixed.
|
||||
* @param {{x:number[], y:number[], z:number[]}} axes
|
||||
* @returns {number[]} [port, zenith, forward].
|
||||
*/
|
||||
export function issSunInModelFrame(sunEcef, axes) {
|
||||
const dot = (a) => a[0] * sunEcef[0] + a[1] * sunEcef[1] + a[2] * sunEcef[2];
|
||||
return [dot(axes.y), dot(axes.z), dot(axes.x)];
|
||||
}
|
||||
|
||||
/**
|
||||
* The joint angles that point the arrays at the Sun.
|
||||
* @param {number[]} sun Unit vector toward the Sun on the model's glTF axes.
|
||||
* @param {boolean} sunlit False in the Earth's shadow: the arrays feather.
|
||||
* @param {{alpha:number, gamma:number}} [previous] The last targets, so a
|
||||
* joint with two equivalent answers keeps the nearer one.
|
||||
* @returns {{alpha:number, beta:number[], gamma:number}} Radians: `alpha`
|
||||
* about +X for both alpha joints, `beta` about +Z per ISS_BETA_JOINTS entry,
|
||||
* `gamma` about +Z for both radiator joints.
|
||||
*/
|
||||
export function issJointTargets(
|
||||
sun,
|
||||
sunlit,
|
||||
previous = { alpha: 0, gamma: 0 },
|
||||
) {
|
||||
const [sx, sy, sz] = sun;
|
||||
// Radiators: the panel normal, Y at rest, perpendicular to the Sun.
|
||||
const gamma =
|
||||
Math.hypot(sx, sy) < MIN_STEER
|
||||
? previous.gamma
|
||||
: nearestHalfTurn(Math.atan2(sy, sx), previous.gamma);
|
||||
if (!sunlit) {
|
||||
return {
|
||||
alpha: nearestHalfTurn(0, previous.alpha),
|
||||
beta: ISS_BETA_JOINTS.map(() => 0),
|
||||
gamma,
|
||||
};
|
||||
}
|
||||
// Alpha: the masts, ±Z at rest, perpendicular to the Sun.
|
||||
const alpha =
|
||||
Math.hypot(sy, sz) < MIN_STEER
|
||||
? previous.alpha
|
||||
: nearestHalfTurn(Math.atan2(sz, sy), previous.alpha);
|
||||
// The Sun as the arrays see it before the alpha turn.
|
||||
const c = Math.cos(alpha);
|
||||
const s = Math.sin(alpha);
|
||||
const lx = sx;
|
||||
const ly = c * sy + s * sz;
|
||||
// Beta: the cell side's normal, ±X at rest, onto the Sun.
|
||||
const beta = ISS_BETA_JOINTS.map(({ face }) =>
|
||||
Math.atan2(face * ly, face * lx),
|
||||
);
|
||||
return { alpha, beta, gamma };
|
||||
}
|
||||
|
||||
/**
|
||||
* Step `current` toward `target` the short way round, by at most `maxStep`.
|
||||
* @returns {number}
|
||||
*/
|
||||
export function issStepAngle(current, target, maxStep) {
|
||||
const delta = wrap(target - current);
|
||||
if (Math.abs(delta) <= maxStep) return current + delta;
|
||||
return current + Math.sign(delta) * maxStep;
|
||||
}
|
||||
|
||||
/**
|
||||
* A node's matrix for a turn of `angle` about `axis` ('x' or 'z') through
|
||||
* `pivot`, column-major.
|
||||
* @param {'x'|'z'} axis
|
||||
* @param {number[]} pivot
|
||||
* @param {number} angle Radians.
|
||||
* @param {Cesium.Matrix4} result
|
||||
* @returns {Cesium.Matrix4}
|
||||
*/
|
||||
export function issJointMatrix(axis, pivot, angle, result) {
|
||||
const c = Math.cos(angle);
|
||||
const s = Math.sin(angle);
|
||||
const [px, py, pz] = pivot;
|
||||
// Row-major arguments.
|
||||
if (axis === 'x')
|
||||
return set(result, [
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
c,
|
||||
-s,
|
||||
py - (c * py - s * pz),
|
||||
0,
|
||||
s,
|
||||
c,
|
||||
pz - (s * py + c * pz),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
]);
|
||||
return set(result, [
|
||||
c,
|
||||
-s,
|
||||
0,
|
||||
px - (c * px - s * py),
|
||||
s,
|
||||
c,
|
||||
0,
|
||||
py - (s * px + c * py),
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
]);
|
||||
}
|
||||
|
||||
function set(result, rowMajor) {
|
||||
return Cesium.Matrix4.fromRowMajorArray(rowMajor, result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Canadarm2's seven joints as NASA's file names them, base to tip: each
|
||||
* node's pivot and its local Z axis on the model's axes. Where the real arm
|
||||
* is at any moment is not public, so its motion here is ILLUSTRATIVE: a slow
|
||||
* sway of `sway` radians about the pose in NASA's file, over `period`
|
||||
* seconds. Joints with no sway stay as filed.
|
||||
*/
|
||||
export const ISS_ARM_JOINTS = Object.freeze(
|
||||
[
|
||||
['SHR', [0.6732, -9.3793, 8.3367], [-0.0942, -0.0136, 0.9955], 0, 0],
|
||||
['SHY', [0.6004, -9.3899, 9.105], [-0.2949, 0.9554, -0.0148], 8, 97],
|
||||
['SHP_PRIME', [0.7848, -9.9873, 9.1143], [-0.2949, 0.9554, -0.0148], 6, 71],
|
||||
[
|
||||
'ELP_PRIME',
|
||||
[-2.9987, -11.8039, 2.5061],
|
||||
[-0.2949, 0.9554, -0.0148],
|
||||
12,
|
||||
53,
|
||||
],
|
||||
['WRP', [-3.8898, -12.6132, 10.249], [-0.2949, 0.9554, -0.0148], 10, 41],
|
||||
['WRY', [-3.9961, -12.6341, 11.0132], [-0.2949, 0.9554, -0.0148], 0, 0],
|
||||
['WRR', [-4.2995, -12.7285, 10.9684], [0.2874, -0.5533, -0.7818], 0, 0],
|
||||
].map(([node, pivot, axis, swayDeg, period]) =>
|
||||
Object.freeze({
|
||||
node,
|
||||
pivot,
|
||||
axis,
|
||||
sway: (swayDeg * Math.PI) / 180,
|
||||
period,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* The station's smaller arms, swayed the same illustrative way: Dextre's two
|
||||
* arms (shoulder and elbow pitch each) and the Japanese arm on Kibo
|
||||
* (shoulder, elbow and wrist pitch). The European arm on Nauka has no joints
|
||||
* in NASA's file, so it stays as filed.
|
||||
*/
|
||||
export const ISS_SMALL_ARM_JOINTS = Object.freeze(
|
||||
[
|
||||
[
|
||||
'SPDM_Arm1_SHP',
|
||||
[4.3019, -8.7313, 2.9551],
|
||||
[-0.5183, -0.8218, -0.2366],
|
||||
5,
|
||||
61,
|
||||
],
|
||||
[
|
||||
'SPDM_Arm1_ELP',
|
||||
[4.763, -7.9839, 3.1897],
|
||||
[0.2256, 0.4303, -0.874],
|
||||
7,
|
||||
43,
|
||||
],
|
||||
[
|
||||
'SPDM_Arm2_SHP',
|
||||
[1.8182, -9.8753, 5.2105],
|
||||
[-0.27, -0.522, -0.8091],
|
||||
5,
|
||||
67,
|
||||
],
|
||||
[
|
||||
'SPDM_Arm2_ELP',
|
||||
[1.8575, -9.4898, 6.0546],
|
||||
[-0.3202, -0.5495, -0.7717],
|
||||
7,
|
||||
47,
|
||||
],
|
||||
['JEM_SP_ROT', [14.2188, -3.6716, 13.394], [-0.001, 0, -1], 5, 83],
|
||||
['JEM_EP_ROT', [14.2223, 0.6479, 13.394], [-0.0011, 0, -1], 8, 59],
|
||||
['JEM_WP_ROT', [16.4495, -3.0694, 13.3917], [-0.001, 0, -1], 8, 37],
|
||||
].map(([node, pivot, axis, swayDeg, period]) =>
|
||||
Object.freeze({
|
||||
node,
|
||||
pivot,
|
||||
axis,
|
||||
sway: (swayDeg * Math.PI) / 180,
|
||||
period,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
/** Every joint that sways. */
|
||||
const ISS_SWAY_JOINTS = [...ISS_ARM_JOINTS, ...ISS_SMALL_ARM_JOINTS];
|
||||
|
||||
/**
|
||||
* The arm's illustrative joint angles at a wall-clock time.
|
||||
* @param {number} seconds
|
||||
* @returns {number[]} Radians, one per ISS_ARM_JOINTS entry.
|
||||
*/
|
||||
export function issArmAngles(seconds, joints = ISS_ARM_JOINTS) {
|
||||
return joints.map(({ sway, period }) =>
|
||||
sway ? sway * Math.sin((2 * Math.PI * seconds) / period) : 0,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The two Ku-band dishes on the Z1 truss. NASA's file has them welded into
|
||||
* the truss; the build cuts out everything above each gimbal. At rest a dish
|
||||
* looks along +Y (zenith).
|
||||
*/
|
||||
export const ISS_DISH_JOINTS = Object.freeze([
|
||||
Object.freeze({ node: 'SGANT_ROT_1', pivot: [-1.105, 4.5, -4.885] }),
|
||||
Object.freeze({ node: 'SGANT_ROT_2', pivot: [4.56, 4.64, -5.235] }),
|
||||
]);
|
||||
|
||||
/**
|
||||
* The relay satellites the dishes talk to (NASA's TDRS) sit over the equator
|
||||
* at fixed longitudes, so each is a fixed point in the Earth-fixed frame.
|
||||
* These are the fleet's nominal slots (Atlantic, Pacific, Indian Ocean), not
|
||||
* a live roster: which satellite the station uses at a given moment is not
|
||||
* public in real time.
|
||||
*/
|
||||
export const ISS_RELAY_LONGITUDES_DEG = Object.freeze([-41, -171, 85]);
|
||||
const GEOSTATIONARY_RADIUS_M = 42_164_000;
|
||||
/** A dish does not look below this much above the station's horizon plane. */
|
||||
const DISH_MIN_UP = 0.15;
|
||||
|
||||
/**
|
||||
* Where the relay satellites are from the station, on the model's axes, the
|
||||
* highest above the station first.
|
||||
* @param {number[]} positionEcef Meters.
|
||||
* @param {{x:number[], y:number[], z:number[]}} axes Flight axes.
|
||||
* @returns {number[][]} Unit vectors [port, zenith, forward].
|
||||
*/
|
||||
export function issRelayDirections(positionEcef, axes) {
|
||||
return ISS_RELAY_LONGITUDES_DEG.map((longitude) => {
|
||||
const lon = (longitude * Math.PI) / 180;
|
||||
const to = [
|
||||
GEOSTATIONARY_RADIUS_M * Math.cos(lon) - positionEcef[0],
|
||||
GEOSTATIONARY_RADIUS_M * Math.sin(lon) - positionEcef[1],
|
||||
-positionEcef[2],
|
||||
];
|
||||
const length = Math.hypot(to[0], to[1], to[2]);
|
||||
return issSunInModelFrame(
|
||||
to.map((c) => c / length),
|
||||
axes,
|
||||
);
|
||||
}).sort((a, b) => b[1] - a[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn the unit vector `current` toward `target` by at most `maxStep` radians.
|
||||
* @returns {number[]}
|
||||
*/
|
||||
export function issStepDirection(current, target, maxStep) {
|
||||
const cos = Math.min(
|
||||
1,
|
||||
Math.max(
|
||||
-1,
|
||||
current[0] * target[0] + current[1] * target[1] + current[2] * target[2],
|
||||
),
|
||||
);
|
||||
const angle = Math.acos(cos);
|
||||
if (angle <= maxStep || angle < 1e-6) return target;
|
||||
const sin = Math.sin(angle);
|
||||
// Opposite vectors have no single arc between them: nudge off the line.
|
||||
if (sin < 1e-6)
|
||||
return issStepDirection(
|
||||
[current[2], current[0], current[1]],
|
||||
target,
|
||||
maxStep,
|
||||
);
|
||||
const t = maxStep / angle;
|
||||
const a = Math.sin((1 - t) * angle) / sin;
|
||||
const b = Math.sin(t * angle) / sin;
|
||||
return [0, 1, 2].map((i) => a * current[i] + b * target[i]);
|
||||
}
|
||||
|
||||
/**
|
||||
* A node's matrix for a turn of `angle` about the unit vector `axis` through
|
||||
* `pivot`.
|
||||
* @param {number[]} pivot
|
||||
* @param {number[]} axis Unit vector.
|
||||
* @param {number} angle Radians.
|
||||
* @param {Cesium.Matrix4} result
|
||||
* @returns {Cesium.Matrix4}
|
||||
*/
|
||||
export function issAxisMatrix(pivot, axis, angle, result) {
|
||||
const [x, y, z] = axis;
|
||||
const c = Math.cos(angle);
|
||||
const s = Math.sin(angle);
|
||||
const t = 1 - c;
|
||||
const r = [
|
||||
[t * x * x + c, t * x * y - s * z, t * x * z + s * y],
|
||||
[t * x * y + s * z, t * y * y + c, t * y * z - s * x],
|
||||
[t * x * z - s * y, t * y * z + s * x, t * z * z + c],
|
||||
];
|
||||
const rows = r.map((row, i) => [
|
||||
...row,
|
||||
pivot[i] - (row[0] * pivot[0] + row[1] * pivot[1] + row[2] * pivot[2]),
|
||||
]);
|
||||
return set(result, [...rows[0], ...rows[1], ...rows[2], 0, 0, 0, 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* A dish node's matrix that turns its rest boresight (+Y) onto `direction`.
|
||||
* @param {number[]} pivot
|
||||
* @param {number[]} direction Unit vector on the model's axes.
|
||||
* @param {Cesium.Matrix4} result
|
||||
* @returns {Cesium.Matrix4}
|
||||
*/
|
||||
export function issAimMatrix(pivot, direction, result) {
|
||||
// Y × direction
|
||||
const kx = direction[2];
|
||||
const kz = -direction[0];
|
||||
const length = Math.hypot(kx, kz);
|
||||
if (length < 1e-9)
|
||||
return issAxisMatrix(
|
||||
pivot,
|
||||
[1, 0, 0],
|
||||
direction[1] > 0 ? 0 : Math.PI,
|
||||
result,
|
||||
);
|
||||
const angle = Math.acos(Math.min(1, Math.max(-1, direction[1])));
|
||||
return issAxisMatrix(pivot, [kx / length, 0, kz / length], angle, result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drives the loaded model's joints. Stateless about the model: `update` looks
|
||||
* the nodes up once per model and only writes a node whose angle moved.
|
||||
*/
|
||||
export function createIssArticulation() {
|
||||
let boundModel = null;
|
||||
let nodes = null;
|
||||
let angles = null;
|
||||
let targets = { alpha: 0, gamma: 0 };
|
||||
let lastMs = 0;
|
||||
let override = null;
|
||||
let dishOverride = null;
|
||||
/** Whether the last update had the station in sunlight; null before one. */
|
||||
let lastSunlit = null;
|
||||
/** Command panel state: the arm is being posed by hand, so the sway is off. */
|
||||
let armManual = false;
|
||||
let armNodes = null;
|
||||
/** Command panel state: how far the arrays are rolled out, 0.05 to 1. */
|
||||
let deploy = 1;
|
||||
let deployTarget = 1;
|
||||
let radiatorDeploy = 1;
|
||||
let radiatorTarget = 1;
|
||||
/** The truss face the radiators fold back to, on the model's Z axis. */
|
||||
const RADIATOR_ROOT_Z = -1.9;
|
||||
/** The power modules' radiators, cut out by the build, and their root. */
|
||||
const SMALL_RADIATOR_NODES = [
|
||||
'PVR_FOLD_P4',
|
||||
'PVR_FOLD_P6',
|
||||
'PVR_FOLD_S4',
|
||||
'PVR_FOLD_S6',
|
||||
];
|
||||
const SMALL_RADIATOR_ROOT_Y = -1.6;
|
||||
/** Where each dish looks now, on the model's axes. */
|
||||
let dishes = null;
|
||||
const scratchJulian = new Cesium.JulianDate();
|
||||
const scratchSun = new Cesium.Cartesian3();
|
||||
const scratchToFixed = new Cesium.Matrix3();
|
||||
const scratchMatrix = new Cesium.Matrix4();
|
||||
|
||||
function bind(model) {
|
||||
boundModel = model;
|
||||
const get = (joint) => model.getNode(joint.node) ?? null;
|
||||
nodes = {
|
||||
alpha: ISS_ALPHA_JOINTS.map(get),
|
||||
beta: ISS_BETA_JOINTS.map(get),
|
||||
gamma: ISS_RADIATOR_JOINTS.map(get),
|
||||
dish: ISS_DISH_JOINTS.map(get),
|
||||
};
|
||||
angles = null;
|
||||
dishes = null;
|
||||
armNodes = null;
|
||||
}
|
||||
|
||||
function sunEcef(date) {
|
||||
const julian = Cesium.JulianDate.fromDate(date, scratchJulian);
|
||||
const inertial =
|
||||
Cesium.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(
|
||||
julian,
|
||||
scratchSun,
|
||||
);
|
||||
const toFixed =
|
||||
Cesium.Transforms.computeIcrfToFixedMatrix(julian, scratchToFixed) ??
|
||||
Cesium.Transforms.computeTemeToPseudoFixedMatrix(julian, scratchToFixed);
|
||||
Cesium.Matrix3.multiplyByVector(toFixed, inertial, scratchSun);
|
||||
Cesium.Cartesian3.normalize(scratchSun, scratchSun);
|
||||
return [scratchSun.x, scratchSun.y, scratchSun.z];
|
||||
}
|
||||
|
||||
function write(node, axis, pivot, angle) {
|
||||
if (!node) return;
|
||||
node.matrix = issJointMatrix(axis, pivot, angle, scratchMatrix);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Cesium.Model} model A ready model.
|
||||
* @param {Date} date The instant the model is placed at.
|
||||
* @param {Cesium.Cartesian3} position Earth-fixed station position.
|
||||
* @param {{x:number[], y:number[], z:number[]}} axes Its flight axes.
|
||||
* @param {number} [nowMs] Wall clock, for the turn rate.
|
||||
*/
|
||||
function update(model, date, position, axes, nowMs = Date.now()) {
|
||||
if (!model.ready) return;
|
||||
if (model !== boundModel) bind(model);
|
||||
const forced = override?.(nowMs) ?? null;
|
||||
if (forced) {
|
||||
lastSunlit = Boolean(forced.sunlit);
|
||||
targets = issJointTargets(forced.sun, forced.sunlit, targets);
|
||||
} else {
|
||||
const sun = sunEcef(date);
|
||||
const sunlit = !issInShadow([position.x, position.y, position.z], sun);
|
||||
lastSunlit = sunlit;
|
||||
targets = issJointTargets(issSunInModelFrame(sun, axes), sunlit, targets);
|
||||
}
|
||||
// A first frame, or one after a pause, goes straight to the pose.
|
||||
const elapsed = (nowMs - lastMs) / 1000;
|
||||
lastMs = nowMs;
|
||||
const maxStep =
|
||||
!angles || !(elapsed >= 0) || elapsed > 2
|
||||
? Number.POSITIVE_INFINITY
|
||||
: ISS_JOINT_RATE * elapsed;
|
||||
const next = {
|
||||
alpha: issStepAngle(angles?.alpha ?? 0, targets.alpha, maxStep),
|
||||
beta: targets.beta.map((target, i) =>
|
||||
issStepAngle(angles?.beta[i] ?? 0, target, maxStep),
|
||||
),
|
||||
gamma: issStepAngle(angles?.gamma ?? 0, targets.gamma, maxStep),
|
||||
};
|
||||
if (!angles || next.alpha !== angles.alpha)
|
||||
ISS_ALPHA_JOINTS.forEach((joint, i) =>
|
||||
write(nodes.alpha[i], 'x', joint.pivot, next.alpha),
|
||||
);
|
||||
// Command panel: squash the arrays along their masts (see setDeploy).
|
||||
const deployStep = Number.isFinite(maxStep) ? elapsed / 8 : 1;
|
||||
const nextDeploy =
|
||||
deploy +
|
||||
Math.sign(deployTarget - deploy) *
|
||||
Math.min(Math.abs(deployTarget - deploy), deployStep);
|
||||
ISS_BETA_JOINTS.forEach((joint, i) => {
|
||||
if (
|
||||
!angles ||
|
||||
next.beta[i] !== angles.beta[i] ||
|
||||
nextDeploy !== deploy ||
|
||||
nextDeploy !== 1
|
||||
) {
|
||||
const node = nodes.beta[i];
|
||||
if (!node) return;
|
||||
const m = issJointMatrix('z', joint.pivot, next.beta[i], scratchMatrix);
|
||||
m[10] = nextDeploy;
|
||||
m[14] = joint.pivot[2] * (1 - nextDeploy);
|
||||
node.matrix = m;
|
||||
}
|
||||
});
|
||||
deploy = nextDeploy;
|
||||
// Command panel: fold the radiators toward the truss.
|
||||
const nextRadiator =
|
||||
radiatorDeploy +
|
||||
Math.sign(radiatorTarget - radiatorDeploy) *
|
||||
Math.min(Math.abs(radiatorTarget - radiatorDeploy), deployStep);
|
||||
if (
|
||||
!angles ||
|
||||
next.gamma !== angles.gamma ||
|
||||
nextRadiator !== radiatorDeploy
|
||||
)
|
||||
ISS_RADIATOR_JOINTS.forEach((joint, i) => {
|
||||
const node = nodes.gamma[i];
|
||||
if (!node) return;
|
||||
const m = issJointMatrix('z', joint.pivot, next.gamma, scratchMatrix);
|
||||
m[10] = nextRadiator;
|
||||
m[14] = RADIATOR_ROOT_Z * (1 - nextRadiator);
|
||||
node.matrix = m;
|
||||
});
|
||||
// The four small radiators fold up to the truss, along Y.
|
||||
if (nextRadiator !== radiatorDeploy)
|
||||
for (const name of SMALL_RADIATOR_NODES) {
|
||||
const node = model.getNode(name);
|
||||
if (!node) continue;
|
||||
node.matrix = Cesium.Matrix4.fromRowMajorArray(
|
||||
[
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
nextRadiator,
|
||||
0,
|
||||
SMALL_RADIATOR_ROOT_Y * (1 - nextRadiator),
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
],
|
||||
scratchMatrix,
|
||||
);
|
||||
}
|
||||
radiatorDeploy = nextRadiator;
|
||||
angles = next;
|
||||
|
||||
// Dishes: the highest relay satellite for the first, the next for the
|
||||
// second; one below the station's horizon plane keeps its last aim.
|
||||
const relays = dishOverride
|
||||
? [dishOverride, dishOverride]
|
||||
: issRelayDirections([position.x, position.y, position.z], axes);
|
||||
const nextDishes = ISS_DISH_JOINTS.map((joint, i) => {
|
||||
const current = dishes?.[i] ?? [0, 1, 0];
|
||||
const wanted = relays[i];
|
||||
const target = wanted && wanted[1] >= DISH_MIN_UP ? wanted : current;
|
||||
const stepped = issStepDirection(current, target, maxStep);
|
||||
const moved =
|
||||
!dishes || stepped.some((c, k) => Math.abs(c - current[k]) > 1e-9);
|
||||
if (moved)
|
||||
if (nodes.dish[i])
|
||||
nodes.dish[i].matrix = issAimMatrix(
|
||||
joint.pivot,
|
||||
stepped,
|
||||
scratchMatrix,
|
||||
);
|
||||
return stepped;
|
||||
});
|
||||
dishes = nextDishes;
|
||||
|
||||
// Arm: an illustrative sway (see ISS_ARM_JOINTS).
|
||||
if (!armManual) {
|
||||
const arm = issArmAngles(nowMs / 1000, ISS_SWAY_JOINTS);
|
||||
ISS_SWAY_JOINTS.forEach((joint, i) => {
|
||||
if (!joint.sway) return;
|
||||
const node = (armNodes ??= ISS_SWAY_JOINTS.map(
|
||||
(entry) => model.getNode(entry.node) ?? null,
|
||||
))[i];
|
||||
if (node)
|
||||
node.matrix = issAxisMatrix(
|
||||
joint.pivot,
|
||||
joint.axis,
|
||||
arm[i],
|
||||
scratchMatrix,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Command panel: turn any named node about an axis through a pivot.
|
||||
* @param {string} name
|
||||
* @param {number[]} pivot
|
||||
* @param {number[]} axis Unit vector.
|
||||
* @param {number} angle Radians.
|
||||
*/
|
||||
function setJoint(name, pivot, axis, angle) {
|
||||
armManual = true;
|
||||
const node = boundModel?.getNode(name);
|
||||
if (node) node.matrix = issAxisMatrix(pivot, axis, angle, scratchMatrix);
|
||||
}
|
||||
|
||||
function reset() {
|
||||
boundModel = null;
|
||||
nodes = null;
|
||||
angles = null;
|
||||
dishes = null;
|
||||
armNodes = null;
|
||||
targets = { alpha: 0, gamma: 0 };
|
||||
}
|
||||
|
||||
/**
|
||||
* Command panel: a function giving the Sun on the model's axes (and whether the
|
||||
* station is lit) in place of the real one, or null for the real one.
|
||||
* @param {((nowMs:number)=>{sun:number[], sunlit:boolean}|null)|null} fn
|
||||
*/
|
||||
function setOverride(fn) {
|
||||
override = fn;
|
||||
}
|
||||
|
||||
/** Whether the station is in sunlight, as of the last update. */
|
||||
function isSunlit() {
|
||||
return lastSunlit;
|
||||
}
|
||||
|
||||
/** Command panel: aim both dishes along a unit vector, or null for the relays. */
|
||||
function setDishOverride(direction) {
|
||||
dishOverride = direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Command panel: squash the arrays toward their bases, or let them
|
||||
* out again. The real arrays do not retract in service.
|
||||
* @param {boolean} out
|
||||
*/
|
||||
function setDeploy(out) {
|
||||
deployTarget = out ? 1 : 0.05;
|
||||
}
|
||||
|
||||
/**
|
||||
* Command panel: fold the radiators toward the truss, or let them
|
||||
* out. The real ones are accordion panels that can do this, but stay out
|
||||
* in service.
|
||||
* @param {boolean} out
|
||||
*/
|
||||
function setRadiatorDeploy(out) {
|
||||
radiatorTarget = out ? 1 : 0.08;
|
||||
}
|
||||
|
||||
/** Command panel: hand the arm back to its sway. */
|
||||
function resumeArm() {
|
||||
armManual = false;
|
||||
}
|
||||
|
||||
return {
|
||||
update,
|
||||
reset,
|
||||
setOverride,
|
||||
setDishOverride,
|
||||
setJoint,
|
||||
resumeArm,
|
||||
setDeploy,
|
||||
setRadiatorDeploy,
|
||||
isSunlit,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
ISS_ALPHA_JOINTS,
|
||||
ISS_BETA_JOINTS,
|
||||
ISS_RADIATOR_JOINTS,
|
||||
issInShadow,
|
||||
issJointMatrix,
|
||||
issJointTargets,
|
||||
issStepAngle,
|
||||
issSunInModelFrame,
|
||||
} from './issArticulation.js';
|
||||
|
||||
const rotX = (a, [x, y, z]) => [
|
||||
x,
|
||||
Math.cos(a) * y - Math.sin(a) * z,
|
||||
Math.sin(a) * y + Math.cos(a) * z,
|
||||
];
|
||||
const rotZ = (a, [x, y, z]) => [
|
||||
Math.cos(a) * x - Math.sin(a) * y,
|
||||
Math.sin(a) * x + Math.cos(a) * y,
|
||||
z,
|
||||
];
|
||||
const dot = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
||||
const unit = (v) => v.map((c) => c / Math.hypot(...v));
|
||||
|
||||
const SUNS = [
|
||||
[0, 1, 0],
|
||||
[0, -1, 0],
|
||||
[0, 0, 1],
|
||||
[0.5, 0.5, 0.7],
|
||||
[-0.6, 0.2, -0.77],
|
||||
[0.3, -0.9, 0.3],
|
||||
[0.9, 0.1, -0.4],
|
||||
].map(unit);
|
||||
|
||||
test('in sunlight every array faces the Sun, masts across it', () => {
|
||||
for (const sun of SUNS) {
|
||||
const { alpha, beta } = issJointTargets(sun, true);
|
||||
assert.ok(Math.abs(dot(rotX(alpha, [0, 0, 1]), sun)) < 1e-9);
|
||||
ISS_BETA_JOINTS.forEach(({ face }, i) => {
|
||||
// The beta joint hangs from the alpha joint: beta turns first.
|
||||
const normal = rotX(alpha, rotZ(beta[i], [face, 0, 0]));
|
||||
assert.ok(dot(normal, sun) > 1 - 1e-9, `${sun} array ${i}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
test('the radiators stay edge-on to the Sun', () => {
|
||||
for (const sun of SUNS) {
|
||||
const { gamma } = issJointTargets(sun, true);
|
||||
assert.ok(Math.abs(dot(rotZ(gamma, [0, 1, 0]), sun)) < 1e-9);
|
||||
}
|
||||
});
|
||||
|
||||
test('in the shadow the arrays feather along the flight direction', () => {
|
||||
const { alpha, beta } = issJointTargets(unit([0.2, -0.9, 0.3]), false, {
|
||||
alpha: 3,
|
||||
gamma: 0,
|
||||
});
|
||||
assert.ok(Math.abs(Math.sin(alpha)) < 1e-9); // masts back along ±Z
|
||||
assert.ok(Math.abs(alpha - Math.PI) < 1e-9); // the nearer half turn
|
||||
assert.deepEqual(
|
||||
beta,
|
||||
ISS_BETA_JOINTS.map(() => 0),
|
||||
);
|
||||
});
|
||||
|
||||
test('a joint keeps the answer nearer its last one, and holds near its axis', () => {
|
||||
const first = issJointTargets(unit([0, 1, 0.01]), true);
|
||||
const next = issJointTargets(unit([0, 1, -0.01]), true, first);
|
||||
assert.ok(Math.abs(next.alpha - first.alpha) < 0.05);
|
||||
// Sun along the truss: nothing to steer the alpha joint by.
|
||||
const held = issJointTargets([1, 0, 0], true, { alpha: 1.2, gamma: 0.4 });
|
||||
assert.equal(held.alpha, 1.2);
|
||||
});
|
||||
|
||||
test('angles step the short way round, capped', () => {
|
||||
assert.equal(issStepAngle(0, 1, 0.25), 0.25);
|
||||
assert.ok(issStepAngle(3, -3, 0.1) > 3); // through π, not back through 0
|
||||
assert.equal(issStepAngle(0.2, 0.3, 1), 0.3);
|
||||
});
|
||||
|
||||
test('a joint matrix leaves its pivot in place', () => {
|
||||
for (const axis of ['x', 'z']) {
|
||||
const pivot = [3, -2, 5];
|
||||
const m = issJointMatrix(axis, pivot, 0.7, undefined);
|
||||
const moved = [0, 1, 2].map(
|
||||
(r) =>
|
||||
m[r] * pivot[0] + m[4 + r] * pivot[1] + m[8 + r] * pivot[2] + m[12 + r],
|
||||
);
|
||||
moved.forEach((v, i) => assert.ok(Math.abs(v - pivot[i]) < 1e-12));
|
||||
}
|
||||
});
|
||||
|
||||
test('the shadow is the cylinder behind the Earth', () => {
|
||||
const sun = [1, 0, 0];
|
||||
assert.equal(issInShadow([6_790_000, 0, 0], sun), false);
|
||||
assert.equal(issInShadow([-6_790_000, 0, 0], sun), true);
|
||||
assert.equal(issInShadow([-1_000_000, 6_700_000, 0], sun), false);
|
||||
});
|
||||
|
||||
test('the Sun lands on the model axes: port, zenith, forward', () => {
|
||||
const axes = { x: [1, 0, 0], y: [0, 1, 0], z: [0, 0, 1] };
|
||||
assert.deepEqual(issSunInModelFrame([0.1, 0.2, 0.3], axes), [0.2, 0.3, 0.1]);
|
||||
});
|
||||
|
||||
test('the model file has every joint node, beta joints under their alpha', () => {
|
||||
const buf = fs.readFileSync(
|
||||
new URL('../../../public/models/iss.glb', import.meta.url),
|
||||
);
|
||||
const json = JSON.parse(
|
||||
buf.subarray(20, 20 + buf.readUInt32LE(12)).toString('utf8'),
|
||||
);
|
||||
const byName = new Map(json.nodes.map((n) => [n.name, n]));
|
||||
for (const { node } of [
|
||||
...ISS_ALPHA_JOINTS,
|
||||
...ISS_BETA_JOINTS,
|
||||
...ISS_RADIATOR_JOINTS,
|
||||
]) {
|
||||
const n = byName.get(node);
|
||||
assert.ok(n, node);
|
||||
// Joints rest at identity: the pivots above are in the model's own frame.
|
||||
assert.equal(n.rotation, undefined);
|
||||
assert.equal(n.translation, undefined);
|
||||
assert.equal(n.matrix, undefined);
|
||||
}
|
||||
for (const side of ['PORT', 'STBD']) {
|
||||
const kids = byName
|
||||
.get(`${side}_ALPHA_ROT`)
|
||||
.children.map((i) => json.nodes[i].name);
|
||||
for (const { node } of ISS_BETA_JOINTS)
|
||||
if (node.startsWith(side)) assert.ok(kids.includes(node), node);
|
||||
}
|
||||
});
|
||||
|
||||
test('a dish aims its rest boresight (+Y) at the direction, pivot in place', async () => {
|
||||
const { issAimMatrix, ISS_DISH_JOINTS } =
|
||||
await import('./issArticulation.js');
|
||||
for (const direction of SUNS) {
|
||||
const m = issAimMatrix(ISS_DISH_JOINTS[0].pivot, direction, undefined);
|
||||
// Column 1 is where +Y goes.
|
||||
[m[4], m[5], m[6]].forEach((v, i) =>
|
||||
assert.ok(Math.abs(v - direction[i]) < 1e-9),
|
||||
);
|
||||
const p = ISS_DISH_JOINTS[0].pivot;
|
||||
[0, 1, 2].forEach((r) =>
|
||||
assert.ok(
|
||||
Math.abs(
|
||||
m[r] * p[0] + m[4 + r] * p[1] + m[8 + r] * p[2] + m[12 + r] - p[r],
|
||||
) < 1e-9,
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('relay directions are unit vectors, highest above the station first', async () => {
|
||||
const { issRelayDirections } = await import('./issArticulation.js');
|
||||
// Over the equator at 41°W, flying east: the Atlantic relay is overhead.
|
||||
const lon = (-41 * Math.PI) / 180;
|
||||
const r = 6_790_000;
|
||||
const position = [r * Math.cos(lon), r * Math.sin(lon), 0];
|
||||
const zenith = [Math.cos(lon), Math.sin(lon), 0];
|
||||
const east = [-Math.sin(lon), Math.cos(lon), 0];
|
||||
const axes = { x: east, y: [0, 0, 1], z: zenith };
|
||||
const relays = issRelayDirections(position, axes);
|
||||
assert.equal(relays.length, 3);
|
||||
relays.forEach((d) => assert.ok(Math.abs(Math.hypot(...d) - 1) < 1e-9));
|
||||
assert.ok(relays[0][1] > 0.999);
|
||||
assert.ok(relays[0][1] >= relays[1][1] && relays[1][1] >= relays[2][1]);
|
||||
});
|
||||
|
||||
test('a direction steps along the arc, capped, and lands on the target', async () => {
|
||||
const { issStepDirection } = await import('./issArticulation.js');
|
||||
const stepped = issStepDirection([0, 1, 0], [1, 0, 0], 0.1);
|
||||
assert.ok(Math.abs(Math.hypot(...stepped) - 1) < 1e-9);
|
||||
assert.ok(Math.abs(Math.acos(stepped[1]) - 0.1) < 1e-9);
|
||||
assert.deepEqual(issStepDirection([0, 1, 0], [1, 0, 0], 2), [1, 0, 0]);
|
||||
});
|
||||
|
||||
test('the model file has both dish nodes', async () => {
|
||||
const { ISS_DISH_JOINTS } = await import('./issArticulation.js');
|
||||
const buf = fs.readFileSync(
|
||||
new URL('../../../public/models/iss.glb', import.meta.url),
|
||||
);
|
||||
const json = JSON.parse(
|
||||
buf.subarray(20, 20 + buf.readUInt32LE(12)).toString('utf8'),
|
||||
);
|
||||
for (const { node } of ISS_DISH_JOINTS) {
|
||||
const n = json.nodes.find((candidate) => candidate.name === node);
|
||||
assert.ok(n?.children?.length, node);
|
||||
}
|
||||
});
|
||||
|
||||
test('the arm sways gently about the filed pose, and only where it is set to', async () => {
|
||||
const { ISS_ARM_JOINTS, issArmAngles } = await import('./issArticulation.js');
|
||||
assert.equal(ISS_ARM_JOINTS.length, 7);
|
||||
for (let seconds = 0; seconds < 400; seconds += 7) {
|
||||
issArmAngles(seconds).forEach((angle, i) => {
|
||||
assert.ok(Math.abs(angle) <= ISS_ARM_JOINTS[i].sway + 1e-12);
|
||||
// Illustrative, so kept small.
|
||||
assert.ok(Math.abs(angle) <= (12 * Math.PI) / 180 + 1e-12);
|
||||
});
|
||||
}
|
||||
assert.deepEqual(issArmAngles(0), [0, 0, 0, 0, 0, 0, 0]);
|
||||
});
|
||||
|
||||
test('the smaller arms sway too, and their joints are in the model file', async () => {
|
||||
const { ISS_SMALL_ARM_JOINTS, ISS_ARM_JOINTS, issArmAngles } =
|
||||
await import('./issArticulation.js');
|
||||
const buf = fs.readFileSync(
|
||||
new URL('../../../public/models/iss.glb', import.meta.url),
|
||||
);
|
||||
const json = JSON.parse(
|
||||
buf.subarray(20, 20 + buf.readUInt32LE(12)).toString('utf8'),
|
||||
);
|
||||
const names = new Set(json.nodes.map((n) => n.name));
|
||||
for (const { node, sway, axis } of [
|
||||
...ISS_ARM_JOINTS,
|
||||
...ISS_SMALL_ARM_JOINTS,
|
||||
]) {
|
||||
assert.ok(names.has(node), node);
|
||||
assert.ok(sway <= (12 * Math.PI) / 180 + 1e-12);
|
||||
assert.ok(Math.abs(Math.hypot(...axis) - 1) < 1e-3);
|
||||
}
|
||||
assert.equal(
|
||||
issArmAngles(10, ISS_SMALL_ARM_JOINTS).length,
|
||||
ISS_SMALL_ARM_JOINTS.length,
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,481 @@
|
||||
import { onLocaleChange, t } from '../../i18n/index.js';
|
||||
import { ISS_ARM_JOINTS } from './issArticulation.js';
|
||||
import { makePanelDraggable } from './issLive.js';
|
||||
import * as Cesium from 'cesium';
|
||||
import { ISS_NORAD } from './policy.js';
|
||||
|
||||
/**
|
||||
* Whether the command panel shows: the ISS selected (tracked), the layer on
|
||||
* and the Cockpit not riding it.
|
||||
* @param {{enabled: boolean, trackedNorad: number|null, cockpitHeld: boolean}} input
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function issCommandShouldShow({ enabled, trackedNorad, cockpitHeld }) {
|
||||
return Boolean(enabled) && trackedNorad === ISS_NORAD && !cockpitHeld;
|
||||
}
|
||||
|
||||
const unit = (v) => {
|
||||
const n = Math.hypot(...v);
|
||||
return v.map((c) => c / n);
|
||||
};
|
||||
|
||||
/**
|
||||
* The Sun positions Manual offers, on the model's axes (port, zenith,
|
||||
* forward), and whether the station is lit there.
|
||||
* @returns {Array<{label: string, sun: number[], sunlit: boolean}>}
|
||||
*/
|
||||
export function issCommandSunPoses() {
|
||||
return [
|
||||
{ label: t('Overhead'), sun: [0, 1, 0], sunlit: true },
|
||||
{ label: t('Ahead'), sun: unit([0, 0.05, 1]), sunlit: true },
|
||||
{ label: t('Behind'), sun: unit([0, 0.05, -1]), sunlit: true },
|
||||
{ label: t('Below'), sun: unit([0, -1, 0.05]), sunlit: true },
|
||||
{ label: t('Port side'), sun: unit([0.8, 0.5, 0.3]), sunlit: true },
|
||||
{ label: t('Starboard side'), sun: unit([-0.8, 0.5, 0.3]), sunlit: true },
|
||||
{ label: t('Night (shadow)'), sun: [0, -1, 0], sunlit: false },
|
||||
];
|
||||
}
|
||||
|
||||
/** Where "Zoom to the ISS" stops: the whole 109 m station fills the view. */
|
||||
export const ISS_COMMAND_ZOOM_RANGE_M = 260;
|
||||
|
||||
/**
|
||||
* The Automatic mode's status line.
|
||||
* @param {boolean|null} sunlit Null while the model has not been placed yet.
|
||||
* @returns {string}
|
||||
*/
|
||||
export function issCommandStatusText(sunlit) {
|
||||
if (sunlit === null) return '';
|
||||
return sunlit ? t('Now: in sunlight') : t("Now: in the Earth's shadow");
|
||||
}
|
||||
|
||||
/** Beyond this the camera counts as far, and the zoom button is offered. */
|
||||
export const ISS_COMMAND_FAR_M = 1000;
|
||||
|
||||
/**
|
||||
* Whether "Zoom to the ISS" is offered: only from far away, so it goes once
|
||||
* the camera is in close (by the button or by hand) and returns on zooming
|
||||
* back out.
|
||||
* @param {number} distance Meters from the camera to the station.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function issCommandOffersZoom(distance) {
|
||||
return distance > ISS_COMMAND_FAR_M;
|
||||
}
|
||||
|
||||
/**
|
||||
* One step of the zoom: how far to move in from `distance`, easing out as
|
||||
* the target range nears, never past it.
|
||||
* @param {number} distance Meters from the camera to the station.
|
||||
* @returns {number} Meters to move in; 0 once close enough.
|
||||
*/
|
||||
export function issCommandZoomStep(distance) {
|
||||
const left = distance - ISS_COMMAND_ZOOM_RANGE_M;
|
||||
if (!(left > ISS_COMMAND_ZOOM_RANGE_M * 0.02)) return 0;
|
||||
return left * 0.14;
|
||||
}
|
||||
|
||||
/** How long one lap of the "fast orbit" takes, and its share in shadow. */
|
||||
const FAST_ORBIT_MS = 40_000;
|
||||
|
||||
/**
|
||||
* The Sun over one accelerated orbit: it circles the truss, a third of the
|
||||
* lap in the Earth's shadow.
|
||||
* @param {number} elapsedMs
|
||||
* @returns {{sun: number[], sunlit: boolean}}
|
||||
*/
|
||||
export function issCommandFastOrbit(elapsedMs) {
|
||||
const angle = (elapsedMs / FAST_ORBIT_MS) * 2 * Math.PI;
|
||||
return {
|
||||
sun: unit([0.35, Math.cos(angle), Math.sin(angle)]),
|
||||
sunlit: Math.cos(angle) > -0.5,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The ISS command panel: shown collapsed while the ISS is selected. Automatic
|
||||
* (the default) leaves the model to its own rules: arrays and radiators by the
|
||||
* Sun, dishes at the relay satellites, arms swaying. Manual opens the
|
||||
* controls and hands the joints to the viewer; going back to Automatic
|
||||
* returns every joint to its rule.
|
||||
*/
|
||||
export function createIssCommand({ state: layerState, parts }) {
|
||||
let panel = null;
|
||||
let renderTimer = null;
|
||||
let renderUntil = 0;
|
||||
|
||||
const joints = () => parts.issModel?._issArticulation ?? null;
|
||||
|
||||
/** Keep frames coming while a joint is on its way to a new pose. */
|
||||
function _renderFor(ms) {
|
||||
renderUntil = Math.max(renderUntil, Date.now() + ms);
|
||||
if (renderTimer) return;
|
||||
renderTimer = setInterval(() => {
|
||||
layerState._viewer?.scene?.requestRender?.();
|
||||
if (Date.now() > renderUntil) _stopRendering();
|
||||
}, 33);
|
||||
}
|
||||
|
||||
function _stopRendering() {
|
||||
if (renderTimer) clearInterval(renderTimer);
|
||||
renderTimer = null;
|
||||
renderUntil = 0;
|
||||
}
|
||||
|
||||
let zoomTimer = null;
|
||||
let zoomButton = null;
|
||||
/** Stops listening for language changes; set while the panel is open. */
|
||||
let stopLocale = null;
|
||||
let statusLine = null;
|
||||
/** The lit/shadow state the status line last showed. */
|
||||
let shownSunlit;
|
||||
|
||||
/** Say whether the station is in sunlight right now, when that changes. */
|
||||
function _syncStatus() {
|
||||
if (!statusLine) return;
|
||||
const sunlit = joints()?.isSunlit() ?? null;
|
||||
if (sunlit === shownSunlit) return;
|
||||
shownSunlit = sunlit;
|
||||
statusLine.textContent = issCommandStatusText(sunlit);
|
||||
}
|
||||
|
||||
/** Meters from the camera to the station, or null when unknown. */
|
||||
function _stationDistance() {
|
||||
const viewer = layerState._viewer;
|
||||
const target =
|
||||
parts.issModel?._issVisualPosition?.() ??
|
||||
layerState._trackedFrameCartesian ??
|
||||
layerState._points.get(ISS_NORAD)?.position;
|
||||
if (!viewer || !target) return null;
|
||||
return Cesium.Cartesian3.distance(viewer.camera.positionWC, target);
|
||||
}
|
||||
|
||||
function _syncZoomButton() {
|
||||
if (!zoomButton) return;
|
||||
const distance = _stationDistance();
|
||||
const offered = distance !== null && issCommandOffersZoom(distance);
|
||||
if (zoomButton.hidden === offered) zoomButton.hidden = !offered;
|
||||
}
|
||||
|
||||
function _stopZoom() {
|
||||
if (zoomTimer) clearInterval(zoomTimer);
|
||||
zoomTimer = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bring the follow camera in to the station. The camera already tracks the
|
||||
* ISS, so this only shortens its range, a step per frame.
|
||||
*/
|
||||
function _zoomToStation() {
|
||||
_stopZoom();
|
||||
let steps = 0;
|
||||
zoomTimer = setInterval(() => {
|
||||
const viewer = layerState._viewer;
|
||||
const target =
|
||||
parts.issModel?._issVisualPosition?.() ??
|
||||
layerState._trackedFrameCartesian ??
|
||||
layerState._points.get(ISS_NORAD)?.position;
|
||||
steps += 1;
|
||||
if (
|
||||
!viewer ||
|
||||
!target ||
|
||||
layerState._trackedNorad !== ISS_NORAD ||
|
||||
steps > 400
|
||||
) {
|
||||
_stopZoom();
|
||||
return;
|
||||
}
|
||||
const step = issCommandZoomStep(
|
||||
Cesium.Cartesian3.distance(viewer.camera.positionWC, target),
|
||||
);
|
||||
if (!step) {
|
||||
_stopZoom();
|
||||
return;
|
||||
}
|
||||
viewer.camera.zoomIn(step);
|
||||
viewer.scene.requestRender?.();
|
||||
}, 16);
|
||||
}
|
||||
|
||||
/** Every joint back to its own rule. */
|
||||
function _automatic() {
|
||||
const articulation = joints();
|
||||
if (!articulation) return;
|
||||
articulation.setOverride(null);
|
||||
articulation.setDishOverride(null);
|
||||
articulation.setDeploy(true);
|
||||
articulation.setRadiatorDeploy(true);
|
||||
articulation.resumeArm();
|
||||
_renderFor(20_000);
|
||||
}
|
||||
|
||||
function _build(documentRef) {
|
||||
const el = (tag, className, text) => {
|
||||
const node = documentRef.createElement(tag);
|
||||
if (className) node.className = className;
|
||||
if (text !== undefined) node.textContent = text;
|
||||
return node;
|
||||
};
|
||||
const root = el('section', 'qci-panel iss-command-panel');
|
||||
root.setAttribute('role', 'region');
|
||||
root.setAttribute('aria-label', t('ISS command panel'));
|
||||
|
||||
const header = el('header', 'qci-header');
|
||||
const title = el('strong', 'iss-command-title', t('ISS · COMMAND PANEL'));
|
||||
const toggle = el('button', 'iss-command-toggle');
|
||||
toggle.type = 'button';
|
||||
header.append(title, toggle);
|
||||
|
||||
const body = el('div', 'iss-command-body');
|
||||
body.hidden = true;
|
||||
const setCollapsed = (collapsed) => {
|
||||
body.hidden = collapsed;
|
||||
toggle.textContent = collapsed ? '▸' : '▾';
|
||||
toggle.setAttribute('aria-expanded', String(!collapsed));
|
||||
toggle.setAttribute(
|
||||
'aria-label',
|
||||
collapsed ? t('Expand command panel') : t('Collapse command panel'),
|
||||
);
|
||||
};
|
||||
toggle.addEventListener('click', () => setCollapsed(!body.hidden));
|
||||
setCollapsed(true);
|
||||
|
||||
// Mode
|
||||
const modes = el('div', 'iss-command-modes');
|
||||
modes.setAttribute('role', 'radiogroup');
|
||||
const autoButton = el('button', 'iss-command-mode', t('Automatic'));
|
||||
const manualButton = el('button', 'iss-command-mode', t('Manual'));
|
||||
const status = el('p', 'iss-command-status');
|
||||
statusLine = status;
|
||||
const autoNote = el(
|
||||
'p',
|
||||
'qci-note',
|
||||
t(
|
||||
'Arrays and radiators follow the Sun, the dishes aim at relay satellites and the arms sway for illustration. Computed, not live telemetry.',
|
||||
),
|
||||
);
|
||||
const manual = el('div', 'iss-command-manual');
|
||||
manual.hidden = true;
|
||||
const setMode = (isManual) => {
|
||||
for (const [button, on] of [
|
||||
[autoButton, !isManual],
|
||||
[manualButton, isManual],
|
||||
]) {
|
||||
button.type = 'button';
|
||||
button.setAttribute('role', 'radio');
|
||||
button.setAttribute('aria-checked', String(on));
|
||||
button.classList.toggle('is-active', on);
|
||||
}
|
||||
manual.hidden = !isManual;
|
||||
autoNote.hidden = isManual;
|
||||
status.hidden = isManual;
|
||||
};
|
||||
const resetControls = () => {
|
||||
manual
|
||||
.querySelectorAll('input[type="range"]')
|
||||
.forEach((slider) => (slider.value = '0'));
|
||||
// Back to what Automatic does: each row's own default lit.
|
||||
manual
|
||||
.querySelectorAll('.iss-command-button')
|
||||
.forEach((button) =>
|
||||
button.classList.toggle('is-active', button.dataset.default === '1'),
|
||||
);
|
||||
};
|
||||
autoButton.addEventListener('click', () => {
|
||||
setMode(false);
|
||||
resetControls();
|
||||
_automatic();
|
||||
});
|
||||
manualButton.addEventListener('click', () => setMode(true));
|
||||
modes.append(autoButton, manualButton);
|
||||
setMode(false);
|
||||
|
||||
// Manual controls
|
||||
const group = (label, note) => {
|
||||
const box = el('div', 'iss-command-group');
|
||||
box.append(el('div', 'iss-command-label', label));
|
||||
const row = el('div', 'iss-command-row');
|
||||
box.append(row);
|
||||
if (note) box.append(el('p', 'qci-note', note));
|
||||
manual.append(box);
|
||||
return row;
|
||||
};
|
||||
/** A row of buttons where the last one pressed stays lit. */
|
||||
const choices = (row, entries) => {
|
||||
for (const [label, action, isDefault] of entries) {
|
||||
const button = el('button', 'iss-command-button', label);
|
||||
button.type = 'button';
|
||||
// What Automatic is doing starts lit, so the row shows what holds.
|
||||
if (isDefault) {
|
||||
button.dataset.default = '1';
|
||||
button.classList.add('is-active');
|
||||
}
|
||||
button.addEventListener('click', () => {
|
||||
row
|
||||
.querySelectorAll('.is-active')
|
||||
.forEach((other) => other.classList.remove('is-active'));
|
||||
button.classList.add('is-active');
|
||||
const articulation = joints();
|
||||
if (!articulation) return;
|
||||
action(articulation);
|
||||
_renderFor(20_000);
|
||||
});
|
||||
row.append(button);
|
||||
}
|
||||
};
|
||||
|
||||
choices(group(t('Sun position')), [
|
||||
[t('Follow the Sun'), (a) => a.setOverride(null), true],
|
||||
...issCommandSunPoses().map(({ label, sun, sunlit }) => [
|
||||
label,
|
||||
(a) => {
|
||||
const fixed = { sun, sunlit };
|
||||
a.setOverride(() => fixed);
|
||||
},
|
||||
]),
|
||||
[
|
||||
t('Fast orbit (40 s)'),
|
||||
(a) => {
|
||||
const start = Date.now();
|
||||
a.setOverride((nowMs) => issCommandFastOrbit(nowMs - start));
|
||||
_renderFor(10 * 60_000);
|
||||
},
|
||||
],
|
||||
]);
|
||||
choices(
|
||||
group(
|
||||
t('Solar arrays'),
|
||||
t('Demonstration: the real arrays stay extended.'),
|
||||
),
|
||||
[
|
||||
[t('Retract'), (a) => a.setDeploy(false)],
|
||||
[t('Extend'), (a) => a.setDeploy(true), true],
|
||||
],
|
||||
);
|
||||
choices(
|
||||
group(
|
||||
t('Radiators'),
|
||||
t('Demonstration: the real radiators can fold but stay extended.'),
|
||||
),
|
||||
[
|
||||
[t('Retract'), (a) => a.setRadiatorDeploy(false)],
|
||||
[t('Extend'), (a) => a.setRadiatorDeploy(true), true],
|
||||
],
|
||||
);
|
||||
choices(group(t('Dishes')), [
|
||||
[t('Relay satellites'), (a) => a.setDishOverride(null), true],
|
||||
[t('Up'), (a) => a.setDishOverride([0, 1, 0])],
|
||||
[t('Forward'), (a) => a.setDishOverride(unit([0, 0.35, 0.94]))],
|
||||
[t('Sideways'), (a) => a.setDishOverride(unit([0.94, 0.35, 0]))],
|
||||
]);
|
||||
|
||||
const armLabels = [
|
||||
t('Shoulder roll'),
|
||||
t('Shoulder yaw'),
|
||||
t('Shoulder pitch'),
|
||||
t('Elbow'),
|
||||
t('Wrist pitch'),
|
||||
t('Wrist yaw'),
|
||||
t('Wrist roll'),
|
||||
];
|
||||
const arm = group(t('Canadarm2 (degrees)'));
|
||||
arm.classList.add('iss-command-sliders');
|
||||
ISS_ARM_JOINTS.forEach((joint, i) => {
|
||||
const row = el('label', 'iss-command-slider');
|
||||
const slider = el('input');
|
||||
slider.type = 'range';
|
||||
slider.min = '-120';
|
||||
slider.max = '120';
|
||||
slider.value = '0';
|
||||
slider.addEventListener('input', () => {
|
||||
joints()?.setJoint(
|
||||
joint.node,
|
||||
joint.pivot,
|
||||
joint.axis,
|
||||
(Number(slider.value) * Math.PI) / 180,
|
||||
);
|
||||
_renderFor(2000);
|
||||
});
|
||||
row.append(el('span', '', armLabels[i]), slider);
|
||||
arm.append(row);
|
||||
});
|
||||
const resume = el('button', 'iss-command-button', t('Resume sway'));
|
||||
resume.type = 'button';
|
||||
resume.addEventListener('click', () => {
|
||||
arm
|
||||
.querySelectorAll('input[type="range"]')
|
||||
.forEach((slider) => (slider.value = '0'));
|
||||
joints()?.resumeArm();
|
||||
_renderFor(20_000);
|
||||
});
|
||||
arm.append(resume);
|
||||
|
||||
const zoom = el('button', 'iss-command-button iss-command-zoom');
|
||||
zoom.type = 'button';
|
||||
zoom.textContent = t('Zoom to the ISS');
|
||||
zoom.addEventListener('click', _zoomToStation);
|
||||
zoomButton = zoom;
|
||||
body.append(zoom, modes, status, autoNote, manual);
|
||||
root.append(header, body);
|
||||
makePanelDraggable(root, header);
|
||||
return root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show or hide the panel for the current selection. Cheap when nothing
|
||||
* changed, so the tracking and Cockpit paths can call it freely.
|
||||
* @returns {void}
|
||||
*/
|
||||
function _syncIssCommand() {
|
||||
const show = issCommandShouldShow({
|
||||
enabled: layerState._enabled,
|
||||
trackedNorad: layerState._trackedNorad,
|
||||
cockpitHeld: Boolean(parts.cockpit?._cockpitHeld()),
|
||||
});
|
||||
if (!show) {
|
||||
_removePanel();
|
||||
return;
|
||||
}
|
||||
if (panel) {
|
||||
_syncZoomButton();
|
||||
_syncStatus();
|
||||
return;
|
||||
}
|
||||
const documentRef = globalThis.document;
|
||||
if (!documentRef?.body) return;
|
||||
panel = _build(documentRef);
|
||||
documentRef.body.append(panel);
|
||||
stopLocale = onLocaleChange(_onLocaleChange);
|
||||
_syncZoomButton();
|
||||
_syncStatus();
|
||||
}
|
||||
|
||||
/** Closing the panel hands the joints back, so no manual pose lingers. */
|
||||
function _removePanel() {
|
||||
if (!panel) return;
|
||||
panel.remove();
|
||||
panel = null;
|
||||
zoomButton = null;
|
||||
stopLocale?.();
|
||||
stopLocale = null;
|
||||
statusLine = null;
|
||||
shownSunlit = undefined;
|
||||
_stopZoom();
|
||||
_automatic();
|
||||
_stopRendering();
|
||||
}
|
||||
|
||||
// A language change rebuilds the panel in the new language. It comes back
|
||||
// collapsed and on Automatic, as on a fresh selection.
|
||||
function _onLocaleChange() {
|
||||
if (!panel) return;
|
||||
_removePanel();
|
||||
_syncIssCommand();
|
||||
}
|
||||
|
||||
function _destroyIssCommand() {
|
||||
_removePanel();
|
||||
}
|
||||
|
||||
return { _syncIssCommand, _destroyIssCommand };
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
ISS_COMMAND_ZOOM_RANGE_M,
|
||||
issCommandFastOrbit,
|
||||
issCommandShouldShow,
|
||||
issCommandZoomStep,
|
||||
} from './issCommand.js';
|
||||
import { ISS_NORAD } from './policy.js';
|
||||
|
||||
test('the panel shows only while the ISS is selected, layer on, Cockpit off', () => {
|
||||
const base = { enabled: true, trackedNorad: ISS_NORAD, cockpitHeld: false };
|
||||
assert.equal(issCommandShouldShow(base), true);
|
||||
assert.equal(issCommandShouldShow({ ...base, enabled: false }), false);
|
||||
assert.equal(issCommandShouldShow({ ...base, trackedNorad: 20580 }), false);
|
||||
assert.equal(issCommandShouldShow({ ...base, trackedNorad: null }), false);
|
||||
assert.equal(issCommandShouldShow({ ...base, cockpitHeld: true }), false);
|
||||
});
|
||||
|
||||
test('the zoom eases in to its range and stops there, never past it', () => {
|
||||
let distance = 726_000;
|
||||
let steps = 0;
|
||||
for (; steps < 400; steps++) {
|
||||
const step = issCommandZoomStep(distance);
|
||||
if (!step) break;
|
||||
assert.ok(step > 0 && step < distance - ISS_COMMAND_ZOOM_RANGE_M);
|
||||
distance -= step;
|
||||
}
|
||||
assert.ok(steps < 120); // under two seconds at 60 frames a second
|
||||
assert.ok(distance >= ISS_COMMAND_ZOOM_RANGE_M);
|
||||
assert.ok(distance <= ISS_COMMAND_ZOOM_RANGE_M * 1.02 + 1e-6);
|
||||
// Already closer: nothing to do, and it never pushes the camera back out.
|
||||
assert.equal(issCommandZoomStep(180), 0);
|
||||
});
|
||||
|
||||
test('the fast orbit turns the Sun once per lap, part of it in shadow', () => {
|
||||
const start = issCommandFastOrbit(0);
|
||||
assert.ok(Math.abs(Math.hypot(...start.sun) - 1) < 1e-9);
|
||||
assert.equal(start.sunlit, true);
|
||||
assert.equal(issCommandFastOrbit(20_000).sunlit, false); // half a lap: below
|
||||
const lap = issCommandFastOrbit(40_000);
|
||||
lap.sun.forEach((v, i) => assert.ok(Math.abs(v - start.sun[i]) < 1e-9));
|
||||
});
|
||||
|
||||
test('the zoom is offered only from far away', async () => {
|
||||
const { ISS_COMMAND_FAR_M, issCommandOffersZoom } =
|
||||
await import('./issCommand.js');
|
||||
assert.equal(issCommandOffersZoom(726_000), true);
|
||||
assert.equal(issCommandOffersZoom(ISS_COMMAND_FAR_M + 1), true);
|
||||
// Where the zoom itself stops, and anywhere closer, it is gone.
|
||||
assert.equal(issCommandOffersZoom(ISS_COMMAND_ZOOM_RANGE_M * 1.02), false);
|
||||
assert.equal(issCommandOffersZoom(150), false);
|
||||
});
|
||||
|
||||
test('the status line says lit or in shadow, and nothing before the model is placed', async () => {
|
||||
const { issCommandStatusText } = await import('./issCommand.js');
|
||||
assert.equal(issCommandStatusText(null), '');
|
||||
assert.notEqual(issCommandStatusText(true), issCommandStatusText(false));
|
||||
assert.ok(issCommandStatusText(true).length > 0);
|
||||
assert.ok(issCommandStatusText(false).length > 0);
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
import { t } from '../../i18n/index.js';
|
||||
import { onLocaleChange, t } from '../../i18n/index.js';
|
||||
import { ISS_LIVE_VIDEO_ID, ISS_NORAD } from './policy.js';
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,37 @@ export function issLiveShouldShow({
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drag a floating panel by its header, kept inside the window (as the Québec
|
||||
* player).
|
||||
* @param {HTMLElement} root
|
||||
* @param {HTMLElement} header
|
||||
*/
|
||||
export function makePanelDraggable(root, header) {
|
||||
header.addEventListener('pointerdown', (event) => {
|
||||
if (event.target.closest('button')) return;
|
||||
const rect = root.getBoundingClientRect();
|
||||
const offsetX = event.clientX - rect.left;
|
||||
const offsetY = event.clientY - rect.top;
|
||||
header.setPointerCapture?.(event.pointerId);
|
||||
const view = root.ownerDocument.defaultView;
|
||||
const move = (moveEvent) => {
|
||||
root.style.left = `${Math.max(0, Math.min(view.innerWidth - root.offsetWidth, moveEvent.clientX - offsetX))}px`;
|
||||
root.style.top = `${Math.max(0, Math.min(view.innerHeight - root.offsetHeight, moveEvent.clientY - offsetY))}px`;
|
||||
root.style.right = 'auto';
|
||||
root.style.bottom = 'auto';
|
||||
};
|
||||
const stop = () => {
|
||||
header.removeEventListener('pointermove', move);
|
||||
header.removeEventListener('pointerup', stop);
|
||||
header.removeEventListener('pointercancel', stop);
|
||||
};
|
||||
header.addEventListener('pointermove', move);
|
||||
header.addEventListener('pointerup', stop, { once: true });
|
||||
header.addEventListener('pointercancel', stop, { once: true });
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* NASA's live view from the ISS, in a panel beside the existing tracked card
|
||||
* while the ISS is selected. The player is created on show and removed on
|
||||
@@ -49,51 +80,86 @@ export function createIssLive({ state: layerState, parts }) {
|
||||
let panel = null;
|
||||
let dismissed = false;
|
||||
let lastTracked = null;
|
||||
/** Rewrites the open panel's text in the current language. */
|
||||
let reword = null;
|
||||
/** Stops listening for language changes; set while the panel is open. */
|
||||
let stopLocale = null;
|
||||
|
||||
/**
|
||||
* The project's floating video window (the Québec CCTV player,
|
||||
* src/ui/quebecCctvOverlay.js): its `qci-` classes, a header that drags it,
|
||||
* × and Escape to close, the source's credit, the privacy note and a link
|
||||
* to the provider's page.
|
||||
*/
|
||||
function _build(documentRef) {
|
||||
const root = documentRef.createElement('section');
|
||||
root.className = 'iss-live-panel';
|
||||
root.className = 'qci-panel iss-live-panel';
|
||||
root.setAttribute('role', 'region');
|
||||
root.setAttribute('aria-label', t('ISS live video'));
|
||||
// Worded again on a language change, without restarting the player.
|
||||
const word = [];
|
||||
const worded = (apply) => {
|
||||
word.push(apply);
|
||||
apply();
|
||||
};
|
||||
worded(() => root.setAttribute('aria-label', t('ISS live video')));
|
||||
|
||||
const header = documentRef.createElement('header');
|
||||
header.className = 'iss-live-header';
|
||||
const title = documentRef.createElement('span');
|
||||
header.className = 'qci-header';
|
||||
const title = documentRef.createElement('strong');
|
||||
title.className = 'iss-live-title';
|
||||
const dotMark = documentRef.createElement('span');
|
||||
dotMark.className = 'iss-live-dot';
|
||||
dotMark.setAttribute('aria-hidden', 'true');
|
||||
title.append(dotMark, documentRef.createTextNode(t('ISS LIVE · NASA')));
|
||||
const link = documentRef.createElement('a');
|
||||
link.className = 'iss-live-link';
|
||||
link.href = issLiveWatchUrl(ISS_LIVE_VIDEO_ID);
|
||||
link.target = '_blank';
|
||||
link.rel = 'noopener noreferrer';
|
||||
link.textContent = t('Open on YouTube');
|
||||
const titleText = documentRef.createTextNode('');
|
||||
worded(() => (titleText.data = t('ISS LIVE · NASA')));
|
||||
title.append(dotMark, titleText);
|
||||
const close = documentRef.createElement('button');
|
||||
close.type = 'button';
|
||||
close.className = 'iss-live-close';
|
||||
close.textContent = '×';
|
||||
close.title = t('Close ISS live video');
|
||||
close.setAttribute('aria-label', t('Close ISS live video'));
|
||||
worded(() => close.setAttribute('aria-label', t('Close ISS live video')));
|
||||
close.addEventListener('click', () => {
|
||||
dismissed = true;
|
||||
_syncIssLive();
|
||||
});
|
||||
header.append(title, link, close);
|
||||
header.append(title, close);
|
||||
|
||||
const frame = documentRef.createElement('div');
|
||||
frame.className = 'iss-live-frame';
|
||||
const iframe = documentRef.createElement('iframe');
|
||||
iframe.className = 'qci-live';
|
||||
iframe.src = issLiveEmbedUrl(ISS_LIVE_VIDEO_ID);
|
||||
iframe.title = t('Live views from the International Space Station (NASA)');
|
||||
worded(
|
||||
() =>
|
||||
(iframe.title = t(
|
||||
'Live views from the International Space Station (NASA)',
|
||||
)),
|
||||
);
|
||||
iframe.allow = 'autoplay; encrypted-media; picture-in-picture; fullscreen';
|
||||
iframe.allowFullscreen = true;
|
||||
iframe.referrerPolicy = 'strict-origin-when-cross-origin';
|
||||
iframe.loading = 'eager';
|
||||
frame.append(iframe);
|
||||
|
||||
root.append(header, frame);
|
||||
const credit = documentRef.createElement('p');
|
||||
credit.className = 'qci-credit';
|
||||
credit.textContent = 'NASA · YouTube'; // i18n-ignore: provider names
|
||||
const note = documentRef.createElement('p');
|
||||
note.className = 'qci-note';
|
||||
worded(
|
||||
() =>
|
||||
(note.textContent = t(
|
||||
'Video plays from YouTube, which sees your IP address.',
|
||||
)),
|
||||
);
|
||||
const link = documentRef.createElement('a');
|
||||
link.href = issLiveWatchUrl(ISS_LIVE_VIDEO_ID);
|
||||
link.target = '_blank';
|
||||
link.rel = 'noopener noreferrer';
|
||||
worded(() => (link.textContent = t('Open on YouTube')));
|
||||
reword = () => word.forEach((apply) => apply());
|
||||
|
||||
root.append(header, iframe, credit, note, link);
|
||||
root.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Escape') close.click();
|
||||
});
|
||||
makePanelDraggable(root, header);
|
||||
return root;
|
||||
}
|
||||
|
||||
@@ -124,12 +190,16 @@ export function createIssLive({ state: layerState, parts }) {
|
||||
if (!documentRef?.body) return;
|
||||
panel = _build(documentRef);
|
||||
documentRef.body.append(panel);
|
||||
stopLocale = onLocaleChange(() => reword?.());
|
||||
}
|
||||
|
||||
function _removePanel() {
|
||||
if (!panel) return;
|
||||
panel.remove(); // the player goes with it, so the stream stops
|
||||
panel = null;
|
||||
reword = null;
|
||||
stopLocale?.();
|
||||
stopLocale = null;
|
||||
}
|
||||
|
||||
/** Drop the panel and forget the selection (layer destroy). */
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { eciToGeodetic, gstime, propagate } from 'satellite.js';
|
||||
import { createIssArticulation } from './issArticulation.js';
|
||||
import {
|
||||
ISS_COMPANION_COARSE_M,
|
||||
ISS_COMPANION_RADIUS_M,
|
||||
ISS_COMPANION_SCAN_MS,
|
||||
ISS_CARD_CLEAR_M,
|
||||
ISS_MODEL_LOCAL_AXES,
|
||||
ISS_MODEL_MAX_DISTANCE_M,
|
||||
ISS_MODEL_MIN_PX,
|
||||
ISS_MODEL_NATIVE_SPAN,
|
||||
ISS_MODEL_URL,
|
||||
ISS_NORAD,
|
||||
ISS_ORBIT_HIDE_M,
|
||||
ISS_SPAN_M,
|
||||
} from './policy.js';
|
||||
|
||||
@@ -98,6 +105,8 @@ export function createIssModel({ state: layerState, parts, resolveAsset }) {
|
||||
let loading = false;
|
||||
let failed = false;
|
||||
let generation = 0;
|
||||
/** Turns the solar arrays and radiators by where the Sun is. */
|
||||
const articulation = createIssArticulation();
|
||||
const nearCondition = new Cesium.DistanceDisplayCondition(
|
||||
0,
|
||||
ISS_MODEL_MAX_DISTANCE_M,
|
||||
@@ -106,7 +115,15 @@ export function createIssModel({ state: layerState, parts, resolveAsset }) {
|
||||
ISS_MODEL_MAX_DISTANCE_M,
|
||||
Number.MAX_VALUE,
|
||||
);
|
||||
/** @type {Set<number>} Docked objects whose dots the model stands in for. */
|
||||
const handedCompanions = new Set();
|
||||
let lastCompanionScanMs = Number.NEGATIVE_INFINITY;
|
||||
/** Whether the ISS's orbit ring is hidden for the close-up. */
|
||||
let orbitHidden = false;
|
||||
const scratchPosition = new Cesium.Cartesian3();
|
||||
/** The station centre the model last rendered at (for the tracked card). */
|
||||
const visualPosition = new Cesium.Cartesian3();
|
||||
let visualValid = false;
|
||||
const scratchRotation = new Cesium.Matrix3();
|
||||
const scratchColumn = new Cesium.Cartesian3();
|
||||
|
||||
@@ -153,6 +170,17 @@ export function createIssModel({ state: layerState, parts, resolveAsset }) {
|
||||
}
|
||||
}
|
||||
|
||||
/** An object's inertial position at `date`, km, or null. */
|
||||
function _temeKm(satrec, date) {
|
||||
if (!satrec) return null;
|
||||
try {
|
||||
const position = propagate(satrec, date)?.position;
|
||||
return position && typeof position !== 'boolean' ? position : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Leave the near range to the model: the dots draw only beyond it. */
|
||||
function _handOverDots() {
|
||||
const point = layerState._points.get(ISS_NORAD);
|
||||
@@ -166,31 +194,119 @@ export function createIssModel({ state: layerState, parts, resolveAsset }) {
|
||||
dot.distanceDisplayCondition = farCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Objects docked to the ISS (Nauka, a Soyuz, a Dragon…) have dots of their
|
||||
* own at the station's position. Near the model they are part of it, and
|
||||
* their dots, moved only a few times a second, jump across the model at
|
||||
* 7.6 km/s. While the model shows, their dots draw only beyond its range
|
||||
* too. Rescanned once a second: a vehicle that undocks gets its dot back,
|
||||
* and a catalog rebuild's new dots are picked up.
|
||||
* @param {number} nowMs
|
||||
*/
|
||||
function _handOverCompanions(nowMs) {
|
||||
if (nowMs - lastCompanionScanMs < ISS_COMPANION_SCAN_MS) return;
|
||||
lastCompanionScanMs = nowMs;
|
||||
const issPosition = layerState._points.get(ISS_NORAD)?.position;
|
||||
// The dots are placed at different moments (far apart with the clock sped
|
||||
// up), so their spacing only rules out what is nowhere near. Whether an
|
||||
// object is docked is read from both orbits at one instant.
|
||||
const date = new Date(layerState.now());
|
||||
const issTeme = _temeKm(layerState._catalog.get(ISS_NORAD)?.satrec, date);
|
||||
if (!issPosition || !issTeme) return;
|
||||
for (const [noradId, point] of layerState._points) {
|
||||
if (noradId === ISS_NORAD || !point?.position) continue;
|
||||
const entry = layerState._catalog.get(noradId);
|
||||
if (entry?.group === 'dense') continue;
|
||||
let docked = false;
|
||||
if (
|
||||
Cesium.Cartesian3.distance(point.position, issPosition) <=
|
||||
ISS_COMPANION_COARSE_M
|
||||
) {
|
||||
const teme = _temeKm(entry?.satrec, date);
|
||||
docked =
|
||||
Boolean(teme) &&
|
||||
Math.hypot(
|
||||
teme.x - issTeme.x,
|
||||
teme.y - issTeme.y,
|
||||
teme.z - issTeme.z,
|
||||
) *
|
||||
1000 <=
|
||||
ISS_COMPANION_RADIUS_M;
|
||||
}
|
||||
if (docked) {
|
||||
point.distanceDisplayCondition = farCondition; // no-op when equal
|
||||
handedCompanions.add(noradId);
|
||||
} else if (handedCompanions.has(noradId)) {
|
||||
point.distanceDisplayCondition = undefined;
|
||||
handedCompanions.delete(noradId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Give docked objects their dots back at every distance. */
|
||||
function _releaseCompanions() {
|
||||
for (const noradId of handedCompanions) {
|
||||
const point = layerState._points.get(noradId);
|
||||
if (point) point.distanceDisplayCondition = undefined;
|
||||
}
|
||||
handedCompanions.clear();
|
||||
lastCompanionScanMs = Number.NEGATIVE_INFINITY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Up close the orbit ring (polyline chords, turned once a second) runs off
|
||||
* the model and jumps across it, so it is hidden there.
|
||||
* @param {boolean} near Camera within ISS_ORBIT_HIDE_M of the station.
|
||||
*/
|
||||
function _syncOrbitCloseUp(near) {
|
||||
const path = layerState._orbitPaths.get(ISS_NORAD);
|
||||
if (near) {
|
||||
if (path) path.primitive.show = false;
|
||||
orbitHidden = true;
|
||||
} else if (orbitHidden) {
|
||||
orbitHidden = false;
|
||||
// Back to the ring's own rules, unless the Cockpit holds it hidden.
|
||||
if (layerState._cockpitHiddenPath !== ISS_NORAD)
|
||||
parts.controls._syncIssOrbit?.();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Per-frame update from the layer's preRender tick.
|
||||
* @returns {void}
|
||||
*/
|
||||
function _updateIssModel() {
|
||||
visualValid = false;
|
||||
const show = _shouldShow();
|
||||
if (!show) {
|
||||
if (model) model.show = false;
|
||||
if (handedCompanions.size) _releaseCompanions();
|
||||
_syncOrbitCloseUp(false);
|
||||
return;
|
||||
}
|
||||
const point = layerState._points.get(ISS_NORAD);
|
||||
const camera = layerState._viewer?.camera;
|
||||
const cameraDistance =
|
||||
point?.position && camera
|
||||
? Cesium.Cartesian3.distance(camera.positionWC, point.position)
|
||||
: Number.POSITIVE_INFINITY;
|
||||
if (!model) {
|
||||
if (!loading && !failed && resolveAsset) _load();
|
||||
// The file is fetched only once the camera nears the model's range, so
|
||||
// a globe-wide view of the layer never downloads it.
|
||||
if (
|
||||
!loading &&
|
||||
!failed &&
|
||||
resolveAsset &&
|
||||
cameraDistance <= ISS_MODEL_MAX_DISTANCE_M * 1.5
|
||||
)
|
||||
_load();
|
||||
return;
|
||||
}
|
||||
_handOverDots();
|
||||
|
||||
const point = layerState._points.get(ISS_NORAD);
|
||||
const camera = layerState._viewer?.camera;
|
||||
_handOverCompanions(Date.now());
|
||||
_syncOrbitCloseUp(cameraDistance < ISS_ORBIT_HIDE_M);
|
||||
// Out of range the model would not draw anyway: skip the SGP4 sample.
|
||||
if (
|
||||
point?.position &&
|
||||
camera &&
|
||||
Cesium.Cartesian3.distance(camera.positionWC, point.position) >
|
||||
ISS_MODEL_MAX_DISTANCE_M * 1.5
|
||||
) {
|
||||
if (cameraDistance > ISS_MODEL_MAX_DISTANCE_M * 1.5) {
|
||||
model.show = false;
|
||||
return;
|
||||
}
|
||||
@@ -236,6 +352,7 @@ export function createIssModel({ state: layerState, parts, resolveAsset }) {
|
||||
scratchPosition,
|
||||
);
|
||||
}
|
||||
Cesium.Cartesian3.clone(scratchPosition, visualPosition);
|
||||
const axes = issFlightAxes(
|
||||
scratchPosition,
|
||||
temeToEcefAxes(posVel.velocity, gmst),
|
||||
@@ -244,7 +361,7 @@ export function createIssModel({ state: layerState, parts, resolveAsset }) {
|
||||
model.show = false;
|
||||
return;
|
||||
}
|
||||
['x', 'y', 'z'].forEach((key, column) => {
|
||||
ISS_MODEL_LOCAL_AXES.forEach((key, column) => {
|
||||
scratchColumn.x = axes[key][0];
|
||||
scratchColumn.y = axes[key][1];
|
||||
scratchColumn.z = axes[key][2];
|
||||
@@ -260,14 +377,58 @@ export function createIssModel({ state: layerState, parts, resolveAsset }) {
|
||||
scratchPosition,
|
||||
model.modelMatrix,
|
||||
);
|
||||
articulation.update(model, date, scratchPosition, axes);
|
||||
model.show = true;
|
||||
visualValid = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Where the tracked card should anchor: the station centre the model is
|
||||
* rendering at this frame, or null while the model is not drawn (the card
|
||||
* then keeps the dot's position). Up close the dot's cache can be a frame
|
||||
* ahead of the rendered model, ~130 m of orbit, which shook the card.
|
||||
* @returns {Cesium.Cartesian3|null}
|
||||
*/
|
||||
function _issVisualPosition() {
|
||||
if (!visualValid || !model?.show) return null;
|
||||
const camera = layerState._viewer?.camera;
|
||||
if (
|
||||
camera &&
|
||||
Cesium.Cartesian3.distance(camera.positionWC, visualPosition) >
|
||||
ISS_MODEL_MAX_DISTANCE_M
|
||||
)
|
||||
return null;
|
||||
return visualPosition;
|
||||
}
|
||||
|
||||
/**
|
||||
* How far the tracked card must stay from its anchor to clear the model, in
|
||||
* pixels, or null while the dot shows.
|
||||
*/
|
||||
function _issCardClearPx() {
|
||||
const position = _issVisualPosition();
|
||||
const viewer = layerState._viewer;
|
||||
const camera = viewer?.camera;
|
||||
const height = viewer?.scene?.canvas?.clientHeight;
|
||||
const fovy = camera?.frustum?.fovy;
|
||||
if (!position || !height || !fovy) return null;
|
||||
const distance = Cesium.Cartesian3.distance(camera.positionWC, position);
|
||||
if (!(distance > 0)) return null;
|
||||
const pixelsPerMeter = height / (2 * Math.tan(fovy / 2)) / distance;
|
||||
return Math.min(
|
||||
height * 0.45,
|
||||
Math.max(ISS_MODEL_MIN_PX * 0.35, ISS_CARD_CLEAR_M * pixelsPerMeter),
|
||||
);
|
||||
}
|
||||
|
||||
/** Drop the model (destroy or a fresh init); the next need reloads it. */
|
||||
function _destroyIssModel() {
|
||||
generation += 1;
|
||||
loading = false;
|
||||
failed = false;
|
||||
visualValid = false;
|
||||
articulation.reset();
|
||||
_releaseCompanions();
|
||||
_syncOrbitCloseUp(false);
|
||||
if (model) {
|
||||
const scene = layerState._viewer?.scene;
|
||||
if (scene && scene.primitives.contains(model))
|
||||
@@ -277,5 +438,18 @@ export function createIssModel({ state: layerState, parts, resolveAsset }) {
|
||||
}
|
||||
}
|
||||
|
||||
return { _updateIssModel, _destroyIssModel };
|
||||
/** Whether the model is standing in for this docked object's dot. */
|
||||
function _issStandsInFor(noradId) {
|
||||
return handedCompanions.has(noradId) && _issVisualPosition() !== null;
|
||||
}
|
||||
|
||||
return {
|
||||
_updateIssModel,
|
||||
_destroyIssModel,
|
||||
_issVisualPosition,
|
||||
_issCardClearPx,
|
||||
_issStandsInFor,
|
||||
/** The joint driver, for the command panel. */
|
||||
_issArticulation: articulation,
|
||||
};
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import {
|
||||
temeToEcefAxes,
|
||||
} from './issModel.js';
|
||||
import {
|
||||
ISS_MODEL_CENTER_NATIVE,
|
||||
ISS_MODEL_LOCAL_AXES,
|
||||
ISS_MODEL_NATIVE_SPAN,
|
||||
ISS_MODEL_URL,
|
||||
ISS_NORAD,
|
||||
@@ -61,22 +63,53 @@ test('the model is the ISS by NORAD number, at its real 109 m span', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('the native span matches the shipped asset', () => {
|
||||
test('the native span and centre match the shipped asset', () => {
|
||||
const glb = readFileSync(
|
||||
new URL(`../../../public${ISS_MODEL_URL}`, import.meta.url),
|
||||
);
|
||||
const jsonLength = glb.readUInt32LE(12);
|
||||
const gltf = JSON.parse(glb.subarray(20, 20 + jsonLength).toString('utf8'));
|
||||
let minX = Infinity;
|
||||
let maxX = -Infinity;
|
||||
for (const node of gltf.nodes.filter((n) => n.mesh !== undefined)) {
|
||||
for (const primitive of gltf.meshes[node.mesh].primitives) {
|
||||
const root = gltf.nodes[gltf.scenes[0].nodes[0]];
|
||||
const min = [Infinity, Infinity, Infinity];
|
||||
const max = [-Infinity, -Infinity, -Infinity];
|
||||
// Every node below the root rests untransformed (joint nodes included), so
|
||||
// each mesh's bounds are already in the root's frame.
|
||||
const visit = (index) => {
|
||||
const node = gltf.nodes[index];
|
||||
assert.equal(node.rotation ?? null, null);
|
||||
assert.equal(node.scale ?? null, null);
|
||||
assert.equal(node.translation ?? null, null);
|
||||
for (const primitive of gltf.meshes[node.mesh]?.primitives ?? []) {
|
||||
const accessor = gltf.accessors[primitive.attributes.POSITION];
|
||||
minX = Math.min(minX, accessor.min[0] * (node.scale?.[0] ?? 1));
|
||||
maxX = Math.max(maxX, accessor.max[0] * (node.scale?.[0] ?? 1));
|
||||
for (let i = 0; i < 3; i++) {
|
||||
min[i] = Math.min(min[i], accessor.min[i]);
|
||||
max[i] = Math.max(max[i], accessor.max[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
assert.ok(Math.abs(maxX - minX - ISS_MODEL_NATIVE_SPAN) < 0.01);
|
||||
(node.children ?? []).forEach(visit);
|
||||
};
|
||||
root.children.forEach(visit);
|
||||
// The truss is the longest axis, glTF X.
|
||||
assert.ok(Math.abs(max[0] - min[0] - ISS_MODEL_NATIVE_SPAN) < 0.01);
|
||||
assert.ok(max[0] - min[0] > max[1] - min[1]);
|
||||
assert.ok(max[0] - min[0] > max[2] - min[2]);
|
||||
ISS_MODEL_CENTER_NATIVE.forEach((value, i) =>
|
||||
assert.ok(Math.abs((min[i] + max[i]) / 2 - value) < 0.01),
|
||||
);
|
||||
// The scene root moves that centre to the origin: minimumPixelSize scales
|
||||
// the model about its origin, so the far-range model stays centred.
|
||||
assert.deepEqual(
|
||||
root.translation.map((value, i) => value + ISS_MODEL_CENTER_NATIVE[i]),
|
||||
[0, 0, 0],
|
||||
);
|
||||
// NASA's own textures ship with it.
|
||||
assert.ok(gltf.textures.length > 0);
|
||||
});
|
||||
|
||||
test('the model axes are a proper rotation of the flight axes', () => {
|
||||
// A cyclic order of x, y, z keeps the frame right-handed (no mirroring).
|
||||
const order = ISS_MODEL_LOCAL_AXES.join('');
|
||||
assert.ok(['xyz', 'yzx', 'zxy'].includes(order));
|
||||
});
|
||||
|
||||
test('flight axes: orthonormal, z away from the Earth, x along the motion', () => {
|
||||
|
||||
@@ -134,6 +134,7 @@ export function createLifecycle({
|
||||
parts.issModel?._updateIssModel(); // off: hides the model
|
||||
parts.tracking._clearTracking();
|
||||
parts.issLive?._syncIssLive(); // off: closes the live video
|
||||
parts.issCommand?._syncIssCommand(); // off: closes the command panel
|
||||
parts.labels._syncIssOverlay();
|
||||
// Remove click handler + keydown listener + preRender propagation while disabled
|
||||
if (layerState._clickHandler) {
|
||||
@@ -177,6 +178,7 @@ export function createLifecycle({
|
||||
layerState._overlayHost.setVisible(ISS_OVERLAY_SOURCE_ID, false);
|
||||
parts.issModel?._destroyIssModel();
|
||||
parts.issLive?._destroyIssLive();
|
||||
parts.issCommand?._destroyIssCommand();
|
||||
if (layerState._pointCollection) {
|
||||
viewer.scene.primitives.remove(layerState._pointCollection);
|
||||
layerState._pointCollection = null;
|
||||
|
||||
@@ -21,7 +21,10 @@ export const ISS_NORAD = 25544;
|
||||
|
||||
/**
|
||||
* The ISS drawn as a 3D model up close (issModel.js): NASA's "International
|
||||
* Space Station (ISS) (A)" from NASA 3D Resources, shipped unmodified.
|
||||
* Space Station (ISS) (D) (IGOAL)" from NASA 3D Resources, the station's
|
||||
* current configuration (Nauka, Prichal, Bishop, the roll-out solar arrays),
|
||||
* with NASA's own textures. The shipped file is that model reduced for the
|
||||
* web and put in one frame, in meters (public/models/README.md says how).
|
||||
*/
|
||||
export const ISS_MODEL_URL = '/models/iss.glb';
|
||||
|
||||
@@ -29,10 +32,28 @@ export const ISS_MODEL_URL = '/models/iss.glb';
|
||||
export const ISS_SPAN_M = 109;
|
||||
|
||||
/**
|
||||
* The asset's truss length in its own units: the mesh's X extent (37.772)
|
||||
* times the root node's scale (0.678121), read from the file's accessors.
|
||||
* The asset's span along its truss (glTF X, solar array to solar array) in
|
||||
* its own units, read from the file's accessors. The file is in meters.
|
||||
*/
|
||||
export const ISS_MODEL_NATIVE_SPAN = 25.614;
|
||||
export const ISS_MODEL_NATIVE_SPAN = 109;
|
||||
|
||||
/**
|
||||
* The station's bounding-box centre in the file's coordinates, whose origin is
|
||||
* NASA's (the middle of the S0 truss). The scene root is translated by minus
|
||||
* this, so the model's origin is the station's centre. That is what
|
||||
* minimumPixelSize scales about, so the enlarged far-range model stays
|
||||
* centred on the orbital position (and on the tracked card's leader).
|
||||
*/
|
||||
export const ISS_MODEL_CENTER_NATIVE = Object.freeze([0, -7.38, 0.001]);
|
||||
|
||||
/**
|
||||
* Which flight axis each of the model's local axes (Cesium's, after its glTF
|
||||
* axis correction: local X = glTF Z, Y = glTF X, Z = glTF Y) points along.
|
||||
* The file has the U.S. segment at +Z (forward), Kibo at +X (port) and the Z1
|
||||
* truss at +Y (zenith; the Cupola faces -Y), so: local X → along-track, local
|
||||
* Y → orbit normal, local Z → zenith.
|
||||
*/
|
||||
export const ISS_MODEL_LOCAL_AXES = Object.freeze(['x', 'y', 'z']);
|
||||
|
||||
/**
|
||||
* Within this camera distance the model replaces the dot; farther out the dot
|
||||
@@ -47,6 +68,38 @@ export const ISS_MODEL_MAX_DISTANCE_M = 1_500_000;
|
||||
*/
|
||||
export const ISS_MODEL_MIN_PX = 72;
|
||||
|
||||
/**
|
||||
* Objects within this distance of the ISS are docked to it (their element
|
||||
* sets put them within a few hundred meters); while the model shows, their
|
||||
* dots give way to it inside its range (issModel.js).
|
||||
*/
|
||||
export const ISS_COMPANION_RADIUS_M = 5_000;
|
||||
|
||||
/**
|
||||
* Dots are moved at different moments, so with the clock sped up a docked
|
||||
* object's dot can trail the ISS's by a long way. Only objects whose dots are
|
||||
* within this distance are checked orbit against orbit (issModel.js).
|
||||
*/
|
||||
export const ISS_COMPANION_COARSE_M = 3_000_000;
|
||||
|
||||
/** How often the docked set is rescanned, ms. */
|
||||
export const ISS_COMPANION_SCAN_MS = 1_000;
|
||||
|
||||
/**
|
||||
* Within this camera distance of the ISS its orbit ring is hidden. The ring is
|
||||
* drawn as ~230 km chords and turned with the Earth once a second, so up close
|
||||
* it runs metres to kilometres off the model and jumps; at the tracked view
|
||||
* (~726 km) and beyond it stays.
|
||||
*/
|
||||
export const ISS_ORBIT_HIDE_M = 50_000;
|
||||
|
||||
/**
|
||||
* The tracked card keeps clear of the model: its gap from the anchor is this
|
||||
* many meters of the station as drawn on screen (about its reach from its
|
||||
* centre in an oblique view), so up close the card sits beside the station, not on it.
|
||||
*/
|
||||
export const ISS_CARD_CLEAR_M = 40;
|
||||
|
||||
/**
|
||||
* NASA's official live stream from the ISS on YouTube ("Live High-Definition
|
||||
* Views from the International Space Station", channel @NASA), shown in a
|
||||
|
||||
@@ -236,6 +236,7 @@ export function createRendering({
|
||||
|
||||
// NASA's live video beside the card while the ISS is selected.
|
||||
parts.issLive?._syncIssLive();
|
||||
parts.issCommand?._syncIssCommand();
|
||||
|
||||
_updatePointFocus(now);
|
||||
|
||||
|
||||
@@ -389,11 +389,21 @@ export function createTracking({ state: layerState, services, parts, source }) {
|
||||
: t('DOCKED · {name}', { name: companions[0] }),
|
||||
);
|
||||
}
|
||||
// While the ISS model shows, the card keeps clear of it: the gap follows
|
||||
// the station's size on screen, in steps so the card is not republished
|
||||
// every frame.
|
||||
const clearPx =
|
||||
layerState._trackedNorad === ISS_NORAD
|
||||
? parts.issModel?._issCardClearPx?.()
|
||||
: null;
|
||||
// The overlay's gap is twice the anchor radius, so half the clearance.
|
||||
const anchorRadiusPx = clearPx ? Math.round(clearPx / 8) * 4 : null;
|
||||
const current = layerState._trackedEntity.gevLabelModel;
|
||||
// Compare the WHOLE detail array: comparing only `details[0]` swallowed any
|
||||
// change confined to the companions line, so the card would never republish.
|
||||
const unchanged =
|
||||
current?.title === title &&
|
||||
(current?.anchorRadiusPx ?? null) === anchorRadiusPx &&
|
||||
current?.details?.length === details.length &&
|
||||
details.every((line, index) => current.details[index] === line);
|
||||
if (unchanged) return;
|
||||
@@ -401,6 +411,7 @@ export function createTracking({ state: layerState, services, parts, source }) {
|
||||
title,
|
||||
details,
|
||||
accent: '#ffd84d',
|
||||
...(anchorRadiusPx ? { anchorRadiusPx, anchorRadiusScale: null } : {}),
|
||||
};
|
||||
refreshTrackedReadout(layerState._trackedEntity);
|
||||
}
|
||||
@@ -468,6 +479,10 @@ export function createTracking({ state: layerState, services, parts, source }) {
|
||||
layerState._trackedEntity.gevSelectionOrigin = origin;
|
||||
layerState._trackedEntity.gevTrackedId = `satellites:${noradId}`;
|
||||
layerState._trackedEntity.gevDisplayPosition = _trackedDisplayCached;
|
||||
// Up close the ISS is a 3D model: the card welds to where it is drawn.
|
||||
if (noradId === ISS_NORAD)
|
||||
layerState._trackedEntity.gevVisualPosition = () =>
|
||||
parts.issModel?._issVisualPosition?.() ?? null;
|
||||
_updateTrackedSatelliteLabelModel(initialPos?.altitude ?? null);
|
||||
|
||||
_emitAwarenessEvent('gev:awareness-subject-selected', {
|
||||
|
||||
+119
-53
@@ -1,38 +1,20 @@
|
||||
/* NASA's ISS live video while the ISS is selected (src/layers/satellites/issLive.js).
|
||||
Bottom right, above the timeline and under the right rail: 300 px wide keeps
|
||||
it clear of the rail's last item at 720 px tall, and the rail (z-index 110)
|
||||
stays on top where a shorter window makes them meet. */
|
||||
.iss-live-panel {
|
||||
position: fixed;
|
||||
The project's floating video window: the Québec CCTV player's `qci-` look
|
||||
(quebecCctvOverlay.css), draggable by its header. Only its starting place
|
||||
and the iframe's details are set here: bottom right, above the timeline,
|
||||
300 px wide so it clears the right rail. */
|
||||
.qci-panel.iss-live-panel {
|
||||
top: auto;
|
||||
right: 16px;
|
||||
bottom: 96px;
|
||||
z-index: 40;
|
||||
width: min(300px, calc(100vw - 32px));
|
||||
background: rgba(6, 14, 22, 0.92);
|
||||
border: 1px solid rgba(0, 220, 255, 0.35);
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
|
||||
color: #d8f6ff;
|
||||
font-family: var(--font-mono);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.iss-live-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 6px 8px 6px 10px;
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
|
||||
.iss-live-title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: #ffd84d;
|
||||
}
|
||||
|
||||
.iss-live-dot {
|
||||
@@ -43,42 +25,126 @@
|
||||
box-shadow: 0 0 6px #ff4444;
|
||||
}
|
||||
|
||||
.iss-live-link {
|
||||
color: #7fe3ff;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.iss-live-link:hover,
|
||||
.iss-live-link:focus-visible {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.iss-live-close {
|
||||
.iss-live-panel .qci-live {
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: #d8f6ff;
|
||||
font-size: 16px;
|
||||
line-height: 1;
|
||||
padding: 2px 4px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* The ISS command panel (src/layers/satellites/issCommand.js): the same
|
||||
floating window, bottom left, collapsed to its header until opened. */
|
||||
.qci-panel.iss-command-panel {
|
||||
top: auto;
|
||||
right: auto;
|
||||
left: 16px;
|
||||
bottom: 96px;
|
||||
width: min(250px, calc(100vw - 32px));
|
||||
}
|
||||
|
||||
.iss-command-title {
|
||||
min-width: 0;
|
||||
letter-spacing: 0.06em;
|
||||
}
|
||||
|
||||
.iss-command-body {
|
||||
max-height: calc(100vh - 230px);
|
||||
overflow-y: auto;
|
||||
padding: 8px 10px 10px;
|
||||
}
|
||||
|
||||
.iss-command-body[hidden],
|
||||
.iss-command-manual[hidden],
|
||||
.iss-command-panel .qci-note[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.iss-command-modes {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.iss-command-mode,
|
||||
.iss-command-button {
|
||||
padding: 5px 7px;
|
||||
border: 1px solid #2a5d78;
|
||||
border-radius: 5px;
|
||||
background: #12283a;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.iss-live-close:hover,
|
||||
.iss-live-close:focus-visible {
|
||||
color: #ffffff;
|
||||
.iss-command-mode.is-active,
|
||||
.iss-command-button.is-active {
|
||||
border-color: #3eabbc;
|
||||
background: #1b4a5c;
|
||||
}
|
||||
|
||||
.iss-live-frame {
|
||||
position: relative;
|
||||
aspect-ratio: 16 / 9;
|
||||
background: #000;
|
||||
.iss-command-mode:focus-visible,
|
||||
.iss-command-button:focus-visible,
|
||||
.iss-command-slider input:focus-visible {
|
||||
outline: 2px solid #7fe3f3;
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
.iss-live-frame iframe {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
.iss-command-panel .qci-note {
|
||||
margin: 6px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.iss-command-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.iss-command-label {
|
||||
margin-bottom: 4px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.iss-command-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.iss-command-sliders {
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.iss-command-slider {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.iss-command-slider span {
|
||||
flex: 0 0 96px;
|
||||
}
|
||||
|
||||
.iss-command-slider input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.iss-command-zoom {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
margin-bottom: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.iss-command-zoom[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.iss-command-status {
|
||||
margin: 0 0 4px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.iss-command-status[hidden],
|
||||
.iss-command-status:empty {
|
||||
display: none;
|
||||
}
|
||||
@@ -16,8 +16,8 @@
|
||||
@import './src/ui/styles/layers.css';
|
||||
@import './src/ui/styles/radio.css';
|
||||
@import './src/ui/styles/cctv.css';
|
||||
@import './src/ui/styles/iss-live.css';
|
||||
@import './src/ui/styles/quebecCctvOverlay.css';
|
||||
@import './src/ui/styles/iss-live.css';
|
||||
@import './src/ui/styles/street-level.css';
|
||||
@import './src/ui/styles/scenes.css';
|
||||
@import './src/ui/styles/bhote-koshi.css';
|
||||
|
||||
Reference in new issue
Block a user