@playcanvas/supersplat-viewer 1.33.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +2 -2
- package/dist/viewer.css +452 -130
- package/dist/viewer.js +896 -691
- package/dist/viewer.js.map +1 -1
- package/docs/api.md +2 -2
- package/package.json +4 -4
- package/public/index.css +452 -130
- package/public/index.js +914 -701
- package/public/index.js.map +1 -1
package/dist/viewer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppBase, AppOptions, CameraComponentSystem, LightComponentSystem, RenderComponentSystem, GSplatComponentSystem, ScriptComponentSystem, ContainerHandler, TextureHandler, GSplatHandler, BinaryHandler, XrManager, Asset, SEMANTIC_POSITION, INDEXFORMAT_UINT32, Vec3,
|
|
1
|
+
import { AppBase, AppOptions, CameraComponentSystem, LightComponentSystem, RenderComponentSystem, GSplatComponentSystem, ScriptComponentSystem, ContainerHandler, TextureHandler, GSplatHandler, BinaryHandler, XrManager, Asset, SEMANTIC_POSITION, INDEXFORMAT_UINT32, Vec3, Script, Entity, Mat4, version as version$1, Quat, math, Pose, OrbitController as OrbitController$1, Vec2, ShaderUtils, Texture, ADDRESS_CLAMP_TO_EDGE, FILTER_LINEAR, PIXELFORMAT_RGBA8, RenderTarget, ASPECT_AUTO, BlendState, drawQuadWithShader, PROJECTION_PERSPECTIVE, GamepadSource, KeyboardMouseSource, MultiTouchSource, InputFrame, Mesh, PRIMITIVE_TRIANGLES, Layer, SORTMODE_MANUAL, CULLFACE_BACK, BLEND_NORMAL, MeshInstance, FUNC_EQUAL, StandardMaterial, Color, FUNC_LESSEQUAL, CULLFACE_NONE, RENDERSTYLE_WIREFRAME, PROJECTION_ORTHOGRAPHIC, Vec4, ShaderChunks, FILTER_NEAREST, PIXELFORMAT_RGBA16F, RenderPassPicker, BLENDEQUATION_ADD, BLENDMODE_ONE, BLENDMODE_ONE_MINUS_SRC_ALPHA, BLENDMODE_ZERO, StorageBuffer, BUFFERUSAGE_COPY_DST, BindGroupFormat, BindUniformBufferFormat, BindStorageBufferFormat, BindStorageTextureFormat, SHADERSTAGE_COMPUTE, TEXTUREDIMENSION_2D, UniformBufferFormat, UniformFormat, UNIFORMTYPE_MAT4, UNIFORMTYPE_UINT, UNIFORMTYPE_FLOAT, Shader, SHADERLANGUAGE_WGSL, Compute, ShaderMaterial, BLEND_PREMULTIPLIED, DEVICETYPE_WEBGL2, MiniStats, BoundingBox, GSPLAT_LODMODE_DISTANCE, GSPLAT_DEBUG_LOD, GSPLAT_DEBUG_NONE, CameraFrame, TONEMAP_NEUTRAL, TONEMAP_ACES2, TONEMAP_ACES, TONEMAP_HEJL, TONEMAP_FILMIC, TONEMAP_LINEAR, TONEMAP_NONE, PIXELFORMAT_RGBA32F, GSPLAT_RENDERER_RASTER_GPU_SORT, GSPLAT_RENDERER_RASTER_CPU_SORT, platform, revision, EventHandler, createGraphicsDevice, Keyboard, TouchDevice as TouchDevice$1, Mouse } from 'playcanvas';
|
|
2
2
|
import { XrControllers } from 'playcanvas/scripts/esm/xr/xr-controllers.mjs';
|
|
3
3
|
import { XrNavigation } from 'playcanvas/scripts/esm/xr/xr-navigation.mjs';
|
|
4
4
|
|
|
@@ -1649,6 +1649,7 @@ var deJson = {
|
|
|
1649
1649
|
"settings.performance-mode": "Leistungsmodus",
|
|
1650
1650
|
"settings.gaming-controls": "Gaming-Steuerung",
|
|
1651
1651
|
"settings.show-annotations": "Anmerkungen anzeigen",
|
|
1652
|
+
"settings.show-collision": "Kollision anzeigen",
|
|
1652
1653
|
"settings.frame": "Einpassen",
|
|
1653
1654
|
"settings.reset": "Zurücksetzen",
|
|
1654
1655
|
"tooltip.play": "Wiedergabe",
|
|
@@ -1658,17 +1659,16 @@ var deJson = {
|
|
|
1658
1659
|
"tooltip.walk-mode": "Gehmodus",
|
|
1659
1660
|
"tooltip.reset-camera": "Kamera zurücksetzen",
|
|
1660
1661
|
"tooltip.frame-scene": "Szene einpassen",
|
|
1661
|
-
"tooltip.show-collision": "Kollision anzeigen",
|
|
1662
1662
|
"tooltip.settings": "Einstellungen",
|
|
1663
|
-
"tooltip.help": "
|
|
1663
|
+
"tooltip.help": "Info",
|
|
1664
|
+
"tooltip.controls": "Steuerung",
|
|
1664
1665
|
"tooltip.enter-ar": "AR starten",
|
|
1665
1666
|
"tooltip.enter-vr": "VR starten",
|
|
1666
1667
|
"tooltip.fullscreen": "Vollbild",
|
|
1667
|
-
"help.tab.desktop": "Desktop",
|
|
1668
|
-
"help.tab.touch": "Touch",
|
|
1669
1668
|
"help.section.orbit": "Umlaufmodus",
|
|
1670
1669
|
"help.section.fly": "Flugmodus",
|
|
1671
1670
|
"help.section.walk": "Gehmodus",
|
|
1671
|
+
"help.section.anim": "Animation",
|
|
1672
1672
|
"help.section.modes": "Modus wechseln",
|
|
1673
1673
|
"help.action.orbit": "Umkreisen",
|
|
1674
1674
|
"help.action.pan": "Schwenken",
|
|
@@ -1691,14 +1691,11 @@ var deJson = {
|
|
|
1691
1691
|
"help.action.toggle-gaming": "Gaming-Steuerung umschalten",
|
|
1692
1692
|
"help.action.show-collision": "Kollision anzeigen",
|
|
1693
1693
|
"help.action.play-pause": "Wiedergabe / Pause",
|
|
1694
|
-
"help.action.toggle-
|
|
1694
|
+
"help.action.toggle-controls": "Steuerung umschalten",
|
|
1695
|
+
"help.action.toggle-help": "Info umschalten",
|
|
1695
1696
|
"help.action.exit-cancel": "Beenden / Abbrechen",
|
|
1696
|
-
"help.
|
|
1697
|
-
"help.
|
|
1698
|
-
"help.key.right-click-drag": "Rechtsklick + Ziehen",
|
|
1699
|
-
"help.key.mouse-wheel": "Mausrad",
|
|
1700
|
-
"help.key.mouse": "Maus",
|
|
1701
|
-
"help.key.double-click": "Doppelklick",
|
|
1697
|
+
"help.action.release-mouse": "Maus freigeben",
|
|
1698
|
+
"help.action.exit-walk": "Gehmodus beenden",
|
|
1702
1699
|
"help.key.double-tap": "Doppeltippen",
|
|
1703
1700
|
"help.key.tap": "Tippen",
|
|
1704
1701
|
"help.key.touch-drag": "Berühren + Ziehen",
|
|
@@ -1707,22 +1704,19 @@ var deJson = {
|
|
|
1707
1704
|
"help.key.pinch": "Zwei-Finger-Zoom",
|
|
1708
1705
|
"help.key.pinch-two-finger": "Zwei-Finger-Zoom / Ziehen",
|
|
1709
1706
|
"help.key.joystick": "Joystick",
|
|
1710
|
-
"help.key.shift-ctrl": "Umschalt / Strg",
|
|
1711
1707
|
"help.key.space": "Leertaste",
|
|
1712
1708
|
"help.key.esc": "Esc",
|
|
1713
1709
|
"xr-modal.title": "WebGL erforderlich",
|
|
1714
1710
|
"xr-modal.message": "AR und VR werden vom WebGPU-Renderer nicht unterstützt. Mit OK wird der Viewer mit WebGL neu geladen.",
|
|
1715
1711
|
"xr-modal.cancel": "Abbrechen",
|
|
1716
|
-
"xr-modal.ok": "OK"
|
|
1717
|
-
"walk-hint.desktop": "Zum Gehen klicken. WASD für freie Bewegung.",
|
|
1718
|
-
"walk-hint.touch-tap": "Zum Gehen tippen. Ziehen, um sich umzusehen.",
|
|
1719
|
-
"walk-hint.touch-gaming": "Mit dem Joystick bewegen. Ziehen, um sich umzusehen. Zum Springen tippen."
|
|
1712
|
+
"xr-modal.ok": "OK"
|
|
1720
1713
|
};
|
|
1721
1714
|
|
|
1722
1715
|
var enJson = {
|
|
1723
1716
|
"settings.performance-mode": "Performance Mode",
|
|
1724
1717
|
"settings.gaming-controls": "Gaming Controls",
|
|
1725
1718
|
"settings.show-annotations": "Show Annotations",
|
|
1719
|
+
"settings.show-collision": "Show Collision",
|
|
1726
1720
|
"settings.frame": "Frame",
|
|
1727
1721
|
"settings.reset": "Reset",
|
|
1728
1722
|
"tooltip.play": "Play",
|
|
@@ -1732,17 +1726,16 @@ var enJson = {
|
|
|
1732
1726
|
"tooltip.walk-mode": "Walk Mode",
|
|
1733
1727
|
"tooltip.reset-camera": "Reset Camera",
|
|
1734
1728
|
"tooltip.frame-scene": "Frame Scene",
|
|
1735
|
-
"tooltip.show-collision": "Show Collision",
|
|
1736
1729
|
"tooltip.settings": "Settings",
|
|
1737
|
-
"tooltip.help": "
|
|
1730
|
+
"tooltip.help": "Info",
|
|
1731
|
+
"tooltip.controls": "Controls",
|
|
1738
1732
|
"tooltip.enter-ar": "Enter AR",
|
|
1739
1733
|
"tooltip.enter-vr": "Enter VR",
|
|
1740
1734
|
"tooltip.fullscreen": "Fullscreen",
|
|
1741
|
-
"help.tab.desktop": "Desktop",
|
|
1742
|
-
"help.tab.touch": "Touch",
|
|
1743
1735
|
"help.section.orbit": "Orbit Mode",
|
|
1744
1736
|
"help.section.fly": "Fly Mode",
|
|
1745
1737
|
"help.section.walk": "Walk Mode",
|
|
1738
|
+
"help.section.anim": "Animation",
|
|
1746
1739
|
"help.section.modes": "Mode Switching",
|
|
1747
1740
|
"help.action.orbit": "Orbit",
|
|
1748
1741
|
"help.action.pan": "Pan",
|
|
@@ -1765,14 +1758,11 @@ var enJson = {
|
|
|
1765
1758
|
"help.action.toggle-gaming": "Toggle Gaming Controls",
|
|
1766
1759
|
"help.action.show-collision": "Show Collision",
|
|
1767
1760
|
"help.action.play-pause": "Play / Pause",
|
|
1768
|
-
"help.action.toggle-
|
|
1761
|
+
"help.action.toggle-controls": "Toggle Controls",
|
|
1762
|
+
"help.action.toggle-help": "Toggle Info",
|
|
1769
1763
|
"help.action.exit-cancel": "Exit / Cancel",
|
|
1770
|
-
"help.
|
|
1771
|
-
"help.
|
|
1772
|
-
"help.key.right-click-drag": "Right Click + Drag",
|
|
1773
|
-
"help.key.mouse-wheel": "Mouse Wheel",
|
|
1774
|
-
"help.key.mouse": "Mouse",
|
|
1775
|
-
"help.key.double-click": "Double-click",
|
|
1764
|
+
"help.action.release-mouse": "Release Mouse",
|
|
1765
|
+
"help.action.exit-walk": "Exit Walk",
|
|
1776
1766
|
"help.key.double-tap": "Double-tap",
|
|
1777
1767
|
"help.key.tap": "Tap",
|
|
1778
1768
|
"help.key.touch-drag": "Touch + Drag",
|
|
@@ -1781,22 +1771,19 @@ var enJson = {
|
|
|
1781
1771
|
"help.key.pinch": "Pinch",
|
|
1782
1772
|
"help.key.pinch-two-finger": "Pinch / Two Finger Drag",
|
|
1783
1773
|
"help.key.joystick": "Joystick",
|
|
1784
|
-
"help.key.shift-ctrl": "Shift / Ctrl",
|
|
1785
1774
|
"help.key.space": "Space",
|
|
1786
1775
|
"help.key.esc": "Esc",
|
|
1787
1776
|
"xr-modal.title": "WebGL Required",
|
|
1788
1777
|
"xr-modal.message": "AR and VR are not supported on the WebGPU renderer. Pressing OK will reload the viewer with WebGL.",
|
|
1789
1778
|
"xr-modal.cancel": "Cancel",
|
|
1790
|
-
"xr-modal.ok": "OK"
|
|
1791
|
-
"walk-hint.desktop": "Click to walk. WASD to move freely.",
|
|
1792
|
-
"walk-hint.touch-tap": "Tap to walk. Drag to look around.",
|
|
1793
|
-
"walk-hint.touch-gaming": "Use the joystick to move. Drag to look around. Tap to jump."
|
|
1779
|
+
"xr-modal.ok": "OK"
|
|
1794
1780
|
};
|
|
1795
1781
|
|
|
1796
1782
|
var esJson = {
|
|
1797
1783
|
"settings.performance-mode": "Modo rendimiento",
|
|
1798
1784
|
"settings.gaming-controls": "Controles de juego",
|
|
1799
1785
|
"settings.show-annotations": "Mostrar anotaciones",
|
|
1786
|
+
"settings.show-collision": "Mostrar colisión",
|
|
1800
1787
|
"settings.frame": "Encuadrar",
|
|
1801
1788
|
"settings.reset": "Restablecer",
|
|
1802
1789
|
"tooltip.play": "Reproducir",
|
|
@@ -1806,17 +1793,16 @@ var esJson = {
|
|
|
1806
1793
|
"tooltip.walk-mode": "Modo caminar",
|
|
1807
1794
|
"tooltip.reset-camera": "Restablecer cámara",
|
|
1808
1795
|
"tooltip.frame-scene": "Encuadrar escena",
|
|
1809
|
-
"tooltip.show-collision": "Mostrar colisión",
|
|
1810
1796
|
"tooltip.settings": "Ajustes",
|
|
1811
|
-
"tooltip.help": "
|
|
1797
|
+
"tooltip.help": "Información",
|
|
1798
|
+
"tooltip.controls": "Controles",
|
|
1812
1799
|
"tooltip.enter-ar": "Entrar en AR",
|
|
1813
1800
|
"tooltip.enter-vr": "Entrar en VR",
|
|
1814
1801
|
"tooltip.fullscreen": "Pantalla completa",
|
|
1815
|
-
"help.tab.desktop": "Escritorio",
|
|
1816
|
-
"help.tab.touch": "Táctil",
|
|
1817
1802
|
"help.section.orbit": "Modo orbital",
|
|
1818
1803
|
"help.section.fly": "Modo vuelo",
|
|
1819
1804
|
"help.section.walk": "Modo caminar",
|
|
1805
|
+
"help.section.anim": "Animación",
|
|
1820
1806
|
"help.section.modes": "Cambio de modo",
|
|
1821
1807
|
"help.action.orbit": "Orbitar",
|
|
1822
1808
|
"help.action.pan": "Desplazar",
|
|
@@ -1839,14 +1825,11 @@ var esJson = {
|
|
|
1839
1825
|
"help.action.toggle-gaming": "Alternar controles de juego",
|
|
1840
1826
|
"help.action.show-collision": "Mostrar colisión",
|
|
1841
1827
|
"help.action.play-pause": "Reproducir / Pausar",
|
|
1842
|
-
"help.action.toggle-
|
|
1828
|
+
"help.action.toggle-controls": "Alternar controles",
|
|
1829
|
+
"help.action.toggle-help": "Alternar información",
|
|
1843
1830
|
"help.action.exit-cancel": "Salir / Cancelar",
|
|
1844
|
-
"help.
|
|
1845
|
-
"help.
|
|
1846
|
-
"help.key.right-click-drag": "Clic derecho + arrastrar",
|
|
1847
|
-
"help.key.mouse-wheel": "Rueda del ratón",
|
|
1848
|
-
"help.key.mouse": "Ratón",
|
|
1849
|
-
"help.key.double-click": "Doble clic",
|
|
1831
|
+
"help.action.release-mouse": "Liberar ratón",
|
|
1832
|
+
"help.action.exit-walk": "Salir de caminar",
|
|
1850
1833
|
"help.key.double-tap": "Doble toque",
|
|
1851
1834
|
"help.key.tap": "Toque",
|
|
1852
1835
|
"help.key.touch-drag": "Toque + arrastrar",
|
|
@@ -1855,22 +1838,19 @@ var esJson = {
|
|
|
1855
1838
|
"help.key.pinch": "Pellizcar",
|
|
1856
1839
|
"help.key.pinch-two-finger": "Pellizcar / Arrastre con dos dedos",
|
|
1857
1840
|
"help.key.joystick": "Joystick",
|
|
1858
|
-
"help.key.shift-ctrl": "Mayús / Ctrl",
|
|
1859
1841
|
"help.key.space": "Espacio",
|
|
1860
1842
|
"help.key.esc": "Esc",
|
|
1861
1843
|
"xr-modal.title": "Se requiere WebGL",
|
|
1862
1844
|
"xr-modal.message": "AR y VR no son compatibles con el renderizador WebGPU. Al pulsar OK se recargará el visor con WebGL.",
|
|
1863
1845
|
"xr-modal.cancel": "Cancelar",
|
|
1864
|
-
"xr-modal.ok": "OK"
|
|
1865
|
-
"walk-hint.desktop": "Haz clic para caminar. WASD para moverte libremente.",
|
|
1866
|
-
"walk-hint.touch-tap": "Toca para caminar. Arrastra para mirar alrededor.",
|
|
1867
|
-
"walk-hint.touch-gaming": "Usa el joystick para moverte. Arrastra para mirar. Toca para saltar."
|
|
1846
|
+
"xr-modal.ok": "OK"
|
|
1868
1847
|
};
|
|
1869
1848
|
|
|
1870
1849
|
var frJson = {
|
|
1871
1850
|
"settings.performance-mode": "Mode performance",
|
|
1872
1851
|
"settings.gaming-controls": "Commandes de jeu",
|
|
1873
1852
|
"settings.show-annotations": "Afficher les annotations",
|
|
1853
|
+
"settings.show-collision": "Afficher les collisions",
|
|
1874
1854
|
"settings.frame": "Cadrer",
|
|
1875
1855
|
"settings.reset": "Réinitialiser",
|
|
1876
1856
|
"tooltip.play": "Lecture",
|
|
@@ -1880,17 +1860,16 @@ var frJson = {
|
|
|
1880
1860
|
"tooltip.walk-mode": "Mode marche",
|
|
1881
1861
|
"tooltip.reset-camera": "Réinitialiser la caméra",
|
|
1882
1862
|
"tooltip.frame-scene": "Cadrer la scène",
|
|
1883
|
-
"tooltip.show-collision": "Afficher les collisions",
|
|
1884
1863
|
"tooltip.settings": "Paramètres",
|
|
1885
|
-
"tooltip.help": "
|
|
1864
|
+
"tooltip.help": "Infos",
|
|
1865
|
+
"tooltip.controls": "Commandes",
|
|
1886
1866
|
"tooltip.enter-ar": "Entrer en AR",
|
|
1887
1867
|
"tooltip.enter-vr": "Entrer en VR",
|
|
1888
1868
|
"tooltip.fullscreen": "Plein écran",
|
|
1889
|
-
"help.tab.desktop": "Bureau",
|
|
1890
|
-
"help.tab.touch": "Tactile",
|
|
1891
1869
|
"help.section.orbit": "Mode orbital",
|
|
1892
1870
|
"help.section.fly": "Mode vol",
|
|
1893
1871
|
"help.section.walk": "Mode marche",
|
|
1872
|
+
"help.section.anim": "Animation",
|
|
1894
1873
|
"help.section.modes": "Changement de mode",
|
|
1895
1874
|
"help.action.orbit": "Orbiter",
|
|
1896
1875
|
"help.action.pan": "Panoramique",
|
|
@@ -1913,14 +1892,11 @@ var frJson = {
|
|
|
1913
1892
|
"help.action.toggle-gaming": "Basculer les commandes de jeu",
|
|
1914
1893
|
"help.action.show-collision": "Afficher les collisions",
|
|
1915
1894
|
"help.action.play-pause": "Lecture / Pause",
|
|
1916
|
-
"help.action.toggle-
|
|
1895
|
+
"help.action.toggle-controls": "Basculer les commandes",
|
|
1896
|
+
"help.action.toggle-help": "Basculer les infos",
|
|
1917
1897
|
"help.action.exit-cancel": "Quitter / Annuler",
|
|
1918
|
-
"help.
|
|
1919
|
-
"help.
|
|
1920
|
-
"help.key.right-click-drag": "Clic droit + glisser",
|
|
1921
|
-
"help.key.mouse-wheel": "Molette",
|
|
1922
|
-
"help.key.mouse": "Souris",
|
|
1923
|
-
"help.key.double-click": "Double clic",
|
|
1898
|
+
"help.action.release-mouse": "Libérer la souris",
|
|
1899
|
+
"help.action.exit-walk": "Quitter la marche",
|
|
1924
1900
|
"help.key.double-tap": "Double tape",
|
|
1925
1901
|
"help.key.tap": "Tape",
|
|
1926
1902
|
"help.key.touch-drag": "Toucher + glisser",
|
|
@@ -1929,22 +1905,19 @@ var frJson = {
|
|
|
1929
1905
|
"help.key.pinch": "Pincer",
|
|
1930
1906
|
"help.key.pinch-two-finger": "Pincer / Glisser à deux doigts",
|
|
1931
1907
|
"help.key.joystick": "Joystick",
|
|
1932
|
-
"help.key.shift-ctrl": "Maj / Ctrl",
|
|
1933
1908
|
"help.key.space": "Espace",
|
|
1934
1909
|
"help.key.esc": "Échap",
|
|
1935
1910
|
"xr-modal.title": "WebGL requis",
|
|
1936
1911
|
"xr-modal.message": "L'AR et la VR ne sont pas prises en charge par le moteur de rendu WebGPU. Cliquer sur OK rechargera le visualiseur avec WebGL.",
|
|
1937
1912
|
"xr-modal.cancel": "Annuler",
|
|
1938
|
-
"xr-modal.ok": "OK"
|
|
1939
|
-
"walk-hint.desktop": "Cliquez pour marcher. WASD pour vous déplacer librement.",
|
|
1940
|
-
"walk-hint.touch-tap": "Tapez pour marcher. Glissez pour regarder autour.",
|
|
1941
|
-
"walk-hint.touch-gaming": "Utilisez le joystick pour vous déplacer. Glissez pour regarder. Tapez pour sauter."
|
|
1913
|
+
"xr-modal.ok": "OK"
|
|
1942
1914
|
};
|
|
1943
1915
|
|
|
1944
1916
|
var jaJson = {
|
|
1945
1917
|
"settings.performance-mode": "パフォーマンスモード",
|
|
1946
1918
|
"settings.gaming-controls": "ゲームコントロール",
|
|
1947
1919
|
"settings.show-annotations": "注釈を表示",
|
|
1920
|
+
"settings.show-collision": "コリジョンを表示",
|
|
1948
1921
|
"settings.frame": "フィット",
|
|
1949
1922
|
"settings.reset": "リセット",
|
|
1950
1923
|
"tooltip.play": "再生",
|
|
@@ -1954,17 +1927,16 @@ var jaJson = {
|
|
|
1954
1927
|
"tooltip.walk-mode": "ウォークモード",
|
|
1955
1928
|
"tooltip.reset-camera": "カメラをリセット",
|
|
1956
1929
|
"tooltip.frame-scene": "シーンにフィット",
|
|
1957
|
-
"tooltip.show-collision": "コリジョンを表示",
|
|
1958
1930
|
"tooltip.settings": "設定",
|
|
1959
|
-
"tooltip.help": "
|
|
1931
|
+
"tooltip.help": "情報",
|
|
1932
|
+
"tooltip.controls": "操作",
|
|
1960
1933
|
"tooltip.enter-ar": "ARを開始",
|
|
1961
1934
|
"tooltip.enter-vr": "VRを開始",
|
|
1962
1935
|
"tooltip.fullscreen": "全画面表示",
|
|
1963
|
-
"help.tab.desktop": "デスクトップ",
|
|
1964
|
-
"help.tab.touch": "タッチ",
|
|
1965
1936
|
"help.section.orbit": "オービットモード",
|
|
1966
1937
|
"help.section.fly": "フライモード",
|
|
1967
1938
|
"help.section.walk": "ウォークモード",
|
|
1939
|
+
"help.section.anim": "アニメーション",
|
|
1968
1940
|
"help.section.modes": "モード切り替え",
|
|
1969
1941
|
"help.action.orbit": "オービット",
|
|
1970
1942
|
"help.action.pan": "パン",
|
|
@@ -1987,14 +1959,11 @@ var jaJson = {
|
|
|
1987
1959
|
"help.action.toggle-gaming": "ゲームコントロールを切り替え",
|
|
1988
1960
|
"help.action.show-collision": "コリジョンを表示",
|
|
1989
1961
|
"help.action.play-pause": "再生 / 一時停止",
|
|
1990
|
-
"help.action.toggle-
|
|
1962
|
+
"help.action.toggle-controls": "操作の切り替え",
|
|
1963
|
+
"help.action.toggle-help": "情報を切り替え",
|
|
1991
1964
|
"help.action.exit-cancel": "終了 / キャンセル",
|
|
1992
|
-
"help.
|
|
1993
|
-
"help.
|
|
1994
|
-
"help.key.right-click-drag": "右クリック + ドラッグ",
|
|
1995
|
-
"help.key.mouse-wheel": "マウスホイール",
|
|
1996
|
-
"help.key.mouse": "マウス",
|
|
1997
|
-
"help.key.double-click": "ダブルクリック",
|
|
1965
|
+
"help.action.release-mouse": "マウスを解放",
|
|
1966
|
+
"help.action.exit-walk": "ウォークを終了",
|
|
1998
1967
|
"help.key.double-tap": "ダブルタップ",
|
|
1999
1968
|
"help.key.tap": "タップ",
|
|
2000
1969
|
"help.key.touch-drag": "タッチ + ドラッグ",
|
|
@@ -2003,22 +1972,19 @@ var jaJson = {
|
|
|
2003
1972
|
"help.key.pinch": "ピンチ",
|
|
2004
1973
|
"help.key.pinch-two-finger": "ピンチ / 2本指でドラッグ",
|
|
2005
1974
|
"help.key.joystick": "ジョイスティック",
|
|
2006
|
-
"help.key.shift-ctrl": "Shift / Ctrl",
|
|
2007
1975
|
"help.key.space": "スペース",
|
|
2008
1976
|
"help.key.esc": "Esc",
|
|
2009
1977
|
"xr-modal.title": "WebGLが必要です",
|
|
2010
1978
|
"xr-modal.message": "ARとVRはWebGPUレンダラーでは利用できません。OKを押すとWebGLでビューアーを再読み込みします。",
|
|
2011
1979
|
"xr-modal.cancel": "キャンセル",
|
|
2012
|
-
"xr-modal.ok": "OK"
|
|
2013
|
-
"walk-hint.desktop": "クリックで歩行。WASDで自由に移動。",
|
|
2014
|
-
"walk-hint.touch-tap": "タップで歩行。ドラッグで視点移動。",
|
|
2015
|
-
"walk-hint.touch-gaming": "ジョイスティックで移動。ドラッグで視点移動。タップでジャンプ。"
|
|
1980
|
+
"xr-modal.ok": "OK"
|
|
2016
1981
|
};
|
|
2017
1982
|
|
|
2018
1983
|
var koJson = {
|
|
2019
1984
|
"settings.performance-mode": "성능 모드",
|
|
2020
1985
|
"settings.gaming-controls": "게임 컨트롤",
|
|
2021
1986
|
"settings.show-annotations": "주석 표시",
|
|
1987
|
+
"settings.show-collision": "충돌 표시",
|
|
2022
1988
|
"settings.frame": "맞춤",
|
|
2023
1989
|
"settings.reset": "재설정",
|
|
2024
1990
|
"tooltip.play": "재생",
|
|
@@ -2028,17 +1994,16 @@ var koJson = {
|
|
|
2028
1994
|
"tooltip.walk-mode": "워크 모드",
|
|
2029
1995
|
"tooltip.reset-camera": "카메라 재설정",
|
|
2030
1996
|
"tooltip.frame-scene": "씬에 맞춤",
|
|
2031
|
-
"tooltip.show-collision": "충돌 표시",
|
|
2032
1997
|
"tooltip.settings": "설정",
|
|
2033
|
-
"tooltip.help": "
|
|
1998
|
+
"tooltip.help": "정보",
|
|
1999
|
+
"tooltip.controls": "조작",
|
|
2034
2000
|
"tooltip.enter-ar": "AR 시작",
|
|
2035
2001
|
"tooltip.enter-vr": "VR 시작",
|
|
2036
2002
|
"tooltip.fullscreen": "전체 화면",
|
|
2037
|
-
"help.tab.desktop": "데스크톱",
|
|
2038
|
-
"help.tab.touch": "터치",
|
|
2039
2003
|
"help.section.orbit": "오빗 모드",
|
|
2040
2004
|
"help.section.fly": "플라이 모드",
|
|
2041
2005
|
"help.section.walk": "워크 모드",
|
|
2006
|
+
"help.section.anim": "애니메이션",
|
|
2042
2007
|
"help.section.modes": "모드 전환",
|
|
2043
2008
|
"help.action.orbit": "오빗",
|
|
2044
2009
|
"help.action.pan": "팬",
|
|
@@ -2061,14 +2026,11 @@ var koJson = {
|
|
|
2061
2026
|
"help.action.toggle-gaming": "게임 컨트롤 전환",
|
|
2062
2027
|
"help.action.show-collision": "충돌 표시",
|
|
2063
2028
|
"help.action.play-pause": "재생 / 일시 정지",
|
|
2064
|
-
"help.action.toggle-
|
|
2029
|
+
"help.action.toggle-controls": "조작 전환",
|
|
2030
|
+
"help.action.toggle-help": "정보 전환",
|
|
2065
2031
|
"help.action.exit-cancel": "나가기 / 취소",
|
|
2066
|
-
"help.
|
|
2067
|
-
"help.
|
|
2068
|
-
"help.key.right-click-drag": "오른쪽 클릭 + 드래그",
|
|
2069
|
-
"help.key.mouse-wheel": "마우스 휠",
|
|
2070
|
-
"help.key.mouse": "마우스",
|
|
2071
|
-
"help.key.double-click": "더블 클릭",
|
|
2032
|
+
"help.action.release-mouse": "마우스 해제",
|
|
2033
|
+
"help.action.exit-walk": "워크 종료",
|
|
2072
2034
|
"help.key.double-tap": "더블 탭",
|
|
2073
2035
|
"help.key.tap": "탭",
|
|
2074
2036
|
"help.key.touch-drag": "터치 + 드래그",
|
|
@@ -2077,22 +2039,19 @@ var koJson = {
|
|
|
2077
2039
|
"help.key.pinch": "핀치",
|
|
2078
2040
|
"help.key.pinch-two-finger": "핀치 / 두 손가락 드래그",
|
|
2079
2041
|
"help.key.joystick": "조이스틱",
|
|
2080
|
-
"help.key.shift-ctrl": "Shift / Ctrl",
|
|
2081
2042
|
"help.key.space": "스페이스",
|
|
2082
2043
|
"help.key.esc": "Esc",
|
|
2083
2044
|
"xr-modal.title": "WebGL 필요",
|
|
2084
2045
|
"xr-modal.message": "AR과 VR은 WebGPU 렌더러에서 지원되지 않습니다. 확인을 누르면 WebGL로 뷰어를 다시 불러옵니다.",
|
|
2085
2046
|
"xr-modal.cancel": "취소",
|
|
2086
|
-
"xr-modal.ok": "확인"
|
|
2087
|
-
"walk-hint.desktop": "클릭하여 걷기. WASD로 자유롭게 이동.",
|
|
2088
|
-
"walk-hint.touch-tap": "탭하여 걷기. 드래그하여 둘러보기.",
|
|
2089
|
-
"walk-hint.touch-gaming": "조이스틱으로 이동. 드래그하여 둘러보기. 탭하여 점프."
|
|
2047
|
+
"xr-modal.ok": "확인"
|
|
2090
2048
|
};
|
|
2091
2049
|
|
|
2092
2050
|
var ptBRJson = {
|
|
2093
2051
|
"settings.performance-mode": "Modo de desempenho",
|
|
2094
2052
|
"settings.gaming-controls": "Controles de jogo",
|
|
2095
2053
|
"settings.show-annotations": "Mostrar anotações",
|
|
2054
|
+
"settings.show-collision": "Mostrar colisão",
|
|
2096
2055
|
"settings.frame": "Enquadrar",
|
|
2097
2056
|
"settings.reset": "Redefinir",
|
|
2098
2057
|
"tooltip.play": "Reproduzir",
|
|
@@ -2102,17 +2061,16 @@ var ptBRJson = {
|
|
|
2102
2061
|
"tooltip.walk-mode": "Modo caminhar",
|
|
2103
2062
|
"tooltip.reset-camera": "Redefinir câmera",
|
|
2104
2063
|
"tooltip.frame-scene": "Enquadrar cena",
|
|
2105
|
-
"tooltip.show-collision": "Mostrar colisão",
|
|
2106
2064
|
"tooltip.settings": "Configurações",
|
|
2107
|
-
"tooltip.help": "
|
|
2065
|
+
"tooltip.help": "Informações",
|
|
2066
|
+
"tooltip.controls": "Controles",
|
|
2108
2067
|
"tooltip.enter-ar": "Entrar em AR",
|
|
2109
2068
|
"tooltip.enter-vr": "Entrar em VR",
|
|
2110
2069
|
"tooltip.fullscreen": "Tela cheia",
|
|
2111
|
-
"help.tab.desktop": "Desktop",
|
|
2112
|
-
"help.tab.touch": "Toque",
|
|
2113
2070
|
"help.section.orbit": "Modo orbital",
|
|
2114
2071
|
"help.section.fly": "Modo voo",
|
|
2115
2072
|
"help.section.walk": "Modo caminhar",
|
|
2073
|
+
"help.section.anim": "Animação",
|
|
2116
2074
|
"help.section.modes": "Troca de modo",
|
|
2117
2075
|
"help.action.orbit": "Orbitar",
|
|
2118
2076
|
"help.action.pan": "Deslocar",
|
|
@@ -2135,14 +2093,11 @@ var ptBRJson = {
|
|
|
2135
2093
|
"help.action.toggle-gaming": "Alternar controles de jogo",
|
|
2136
2094
|
"help.action.show-collision": "Mostrar colisão",
|
|
2137
2095
|
"help.action.play-pause": "Reproduzir / Pausar",
|
|
2138
|
-
"help.action.toggle-
|
|
2096
|
+
"help.action.toggle-controls": "Alternar controles",
|
|
2097
|
+
"help.action.toggle-help": "Alternar informações",
|
|
2139
2098
|
"help.action.exit-cancel": "Sair / Cancelar",
|
|
2140
|
-
"help.
|
|
2141
|
-
"help.
|
|
2142
|
-
"help.key.right-click-drag": "Clique direito + arrastar",
|
|
2143
|
-
"help.key.mouse-wheel": "Roda do mouse",
|
|
2144
|
-
"help.key.mouse": "Mouse",
|
|
2145
|
-
"help.key.double-click": "Clique duplo",
|
|
2099
|
+
"help.action.release-mouse": "Liberar mouse",
|
|
2100
|
+
"help.action.exit-walk": "Sair da caminhada",
|
|
2146
2101
|
"help.key.double-tap": "Toque duplo",
|
|
2147
2102
|
"help.key.tap": "Toque",
|
|
2148
2103
|
"help.key.touch-drag": "Toque + arrastar",
|
|
@@ -2151,22 +2106,19 @@ var ptBRJson = {
|
|
|
2151
2106
|
"help.key.pinch": "Pinçar",
|
|
2152
2107
|
"help.key.pinch-two-finger": "Pinçar / Arrastar com dois dedos",
|
|
2153
2108
|
"help.key.joystick": "Joystick",
|
|
2154
|
-
"help.key.shift-ctrl": "Shift / Ctrl",
|
|
2155
2109
|
"help.key.space": "Espaço",
|
|
2156
2110
|
"help.key.esc": "Esc",
|
|
2157
2111
|
"xr-modal.title": "WebGL necessário",
|
|
2158
2112
|
"xr-modal.message": "AR e VR não são compatíveis com o renderizador WebGPU. Ao pressionar OK, o visualizador será recarregado com WebGL.",
|
|
2159
2113
|
"xr-modal.cancel": "Cancelar",
|
|
2160
|
-
"xr-modal.ok": "OK"
|
|
2161
|
-
"walk-hint.desktop": "Clique para caminhar. WASD para se mover livremente.",
|
|
2162
|
-
"walk-hint.touch-tap": "Toque para caminhar. Arraste para olhar em volta.",
|
|
2163
|
-
"walk-hint.touch-gaming": "Use o joystick para se mover. Arraste para olhar. Toque para pular."
|
|
2114
|
+
"xr-modal.ok": "OK"
|
|
2164
2115
|
};
|
|
2165
2116
|
|
|
2166
2117
|
var ruJson = {
|
|
2167
2118
|
"settings.performance-mode": "Режим производительности",
|
|
2168
2119
|
"settings.gaming-controls": "Игровое управление",
|
|
2169
2120
|
"settings.show-annotations": "Показать аннотации",
|
|
2121
|
+
"settings.show-collision": "Показать коллизию",
|
|
2170
2122
|
"settings.frame": "Кадрировать",
|
|
2171
2123
|
"settings.reset": "Сбросить",
|
|
2172
2124
|
"tooltip.play": "Воспроизвести",
|
|
@@ -2176,17 +2128,16 @@ var ruJson = {
|
|
|
2176
2128
|
"tooltip.walk-mode": "Режим ходьбы",
|
|
2177
2129
|
"tooltip.reset-camera": "Сбросить камеру",
|
|
2178
2130
|
"tooltip.frame-scene": "Кадрировать сцену",
|
|
2179
|
-
"tooltip.show-collision": "Показать коллизию",
|
|
2180
2131
|
"tooltip.settings": "Настройки",
|
|
2181
|
-
"tooltip.help": "
|
|
2132
|
+
"tooltip.help": "Информация",
|
|
2133
|
+
"tooltip.controls": "Управление",
|
|
2182
2134
|
"tooltip.enter-ar": "Войти в AR",
|
|
2183
2135
|
"tooltip.enter-vr": "Войти в VR",
|
|
2184
2136
|
"tooltip.fullscreen": "Полный экран",
|
|
2185
|
-
"help.tab.desktop": "Десктоп",
|
|
2186
|
-
"help.tab.touch": "Сенсор",
|
|
2187
2137
|
"help.section.orbit": "Орбитальный режим",
|
|
2188
2138
|
"help.section.fly": "Режим полёта",
|
|
2189
2139
|
"help.section.walk": "Режим ходьбы",
|
|
2140
|
+
"help.section.anim": "Анимация",
|
|
2190
2141
|
"help.section.modes": "Смена режимов",
|
|
2191
2142
|
"help.action.orbit": "Вращение",
|
|
2192
2143
|
"help.action.pan": "Панорама",
|
|
@@ -2209,14 +2160,11 @@ var ruJson = {
|
|
|
2209
2160
|
"help.action.toggle-gaming": "Переключить игровое управление",
|
|
2210
2161
|
"help.action.show-collision": "Показать коллизию",
|
|
2211
2162
|
"help.action.play-pause": "Воспроизведение / Пауза",
|
|
2212
|
-
"help.action.toggle-
|
|
2163
|
+
"help.action.toggle-controls": "Переключить управление",
|
|
2164
|
+
"help.action.toggle-help": "Переключить информацию",
|
|
2213
2165
|
"help.action.exit-cancel": "Выход / Отмена",
|
|
2214
|
-
"help.
|
|
2215
|
-
"help.
|
|
2216
|
-
"help.key.right-click-drag": "Правый клик + перетаскивание",
|
|
2217
|
-
"help.key.mouse-wheel": "Колесо мыши",
|
|
2218
|
-
"help.key.mouse": "Мышь",
|
|
2219
|
-
"help.key.double-click": "Двойной клик",
|
|
2166
|
+
"help.action.release-mouse": "Освободить мышь",
|
|
2167
|
+
"help.action.exit-walk": "Выйти из ходьбы",
|
|
2220
2168
|
"help.key.double-tap": "Двойной тап",
|
|
2221
2169
|
"help.key.tap": "Тап",
|
|
2222
2170
|
"help.key.touch-drag": "Касание + перетаскивание",
|
|
@@ -2225,22 +2173,19 @@ var ruJson = {
|
|
|
2225
2173
|
"help.key.pinch": "Щипок",
|
|
2226
2174
|
"help.key.pinch-two-finger": "Щипок / Перетаскивание двумя пальцами",
|
|
2227
2175
|
"help.key.joystick": "Джойстик",
|
|
2228
|
-
"help.key.shift-ctrl": "Shift / Ctrl",
|
|
2229
2176
|
"help.key.space": "Пробел",
|
|
2230
2177
|
"help.key.esc": "Esc",
|
|
2231
2178
|
"xr-modal.title": "Требуется WebGL",
|
|
2232
2179
|
"xr-modal.message": "AR и VR не поддерживаются рендером WebGPU. Нажмите OK, чтобы перезагрузить просмотрщик с WebGL.",
|
|
2233
2180
|
"xr-modal.cancel": "Отмена",
|
|
2234
|
-
"xr-modal.ok": "OK"
|
|
2235
|
-
"walk-hint.desktop": "Кликните для ходьбы. WASD для свободного движения.",
|
|
2236
|
-
"walk-hint.touch-tap": "Тапните для ходьбы. Перетаскивайте, чтобы осмотреться.",
|
|
2237
|
-
"walk-hint.touch-gaming": "Используйте джойстик для движения. Перетаскивайте, чтобы осмотреться. Тапните для прыжка."
|
|
2181
|
+
"xr-modal.ok": "OK"
|
|
2238
2182
|
};
|
|
2239
2183
|
|
|
2240
2184
|
var zhCNJson = {
|
|
2241
2185
|
"settings.performance-mode": "性能模式",
|
|
2242
2186
|
"settings.gaming-controls": "游戏控制",
|
|
2243
2187
|
"settings.show-annotations": "显示注释",
|
|
2188
|
+
"settings.show-collision": "显示碰撞",
|
|
2244
2189
|
"settings.frame": "适应",
|
|
2245
2190
|
"settings.reset": "重置",
|
|
2246
2191
|
"tooltip.play": "播放",
|
|
@@ -2250,17 +2195,16 @@ var zhCNJson = {
|
|
|
2250
2195
|
"tooltip.walk-mode": "行走模式",
|
|
2251
2196
|
"tooltip.reset-camera": "重置相机",
|
|
2252
2197
|
"tooltip.frame-scene": "适应场景",
|
|
2253
|
-
"tooltip.show-collision": "显示碰撞",
|
|
2254
2198
|
"tooltip.settings": "设置",
|
|
2255
|
-
"tooltip.help": "
|
|
2199
|
+
"tooltip.help": "信息",
|
|
2200
|
+
"tooltip.controls": "操作",
|
|
2256
2201
|
"tooltip.enter-ar": "进入 AR",
|
|
2257
2202
|
"tooltip.enter-vr": "进入 VR",
|
|
2258
2203
|
"tooltip.fullscreen": "全屏",
|
|
2259
|
-
"help.tab.desktop": "桌面",
|
|
2260
|
-
"help.tab.touch": "触屏",
|
|
2261
2204
|
"help.section.orbit": "环绕模式",
|
|
2262
2205
|
"help.section.fly": "飞行模式",
|
|
2263
2206
|
"help.section.walk": "行走模式",
|
|
2207
|
+
"help.section.anim": "动画",
|
|
2264
2208
|
"help.section.modes": "模式切换",
|
|
2265
2209
|
"help.action.orbit": "环绕",
|
|
2266
2210
|
"help.action.pan": "平移",
|
|
@@ -2283,14 +2227,11 @@ var zhCNJson = {
|
|
|
2283
2227
|
"help.action.toggle-gaming": "切换游戏控制",
|
|
2284
2228
|
"help.action.show-collision": "显示碰撞",
|
|
2285
2229
|
"help.action.play-pause": "播放 / 暂停",
|
|
2286
|
-
"help.action.toggle-
|
|
2230
|
+
"help.action.toggle-controls": "切换操作",
|
|
2231
|
+
"help.action.toggle-help": "切换信息",
|
|
2287
2232
|
"help.action.exit-cancel": "退出 / 取消",
|
|
2288
|
-
"help.
|
|
2289
|
-
"help.
|
|
2290
|
-
"help.key.right-click-drag": "右键点击 + 拖动",
|
|
2291
|
-
"help.key.mouse-wheel": "鼠标滚轮",
|
|
2292
|
-
"help.key.mouse": "鼠标",
|
|
2293
|
-
"help.key.double-click": "双击",
|
|
2233
|
+
"help.action.release-mouse": "释放鼠标",
|
|
2234
|
+
"help.action.exit-walk": "退出行走",
|
|
2294
2235
|
"help.key.double-tap": "双击",
|
|
2295
2236
|
"help.key.tap": "点击",
|
|
2296
2237
|
"help.key.touch-drag": "触摸 + 拖动",
|
|
@@ -2299,16 +2240,12 @@ var zhCNJson = {
|
|
|
2299
2240
|
"help.key.pinch": "捏合",
|
|
2300
2241
|
"help.key.pinch-two-finger": "捏合 / 双指拖动",
|
|
2301
2242
|
"help.key.joystick": "摇杆",
|
|
2302
|
-
"help.key.shift-ctrl": "Shift / Ctrl",
|
|
2303
2243
|
"help.key.space": "空格",
|
|
2304
2244
|
"help.key.esc": "Esc",
|
|
2305
2245
|
"xr-modal.title": "需要 WebGL",
|
|
2306
2246
|
"xr-modal.message": "WebGPU 渲染器不支持 AR 和 VR。按下确定将以 WebGL 重新加载查看器。",
|
|
2307
2247
|
"xr-modal.cancel": "取消",
|
|
2308
|
-
"xr-modal.ok": "确定"
|
|
2309
|
-
"walk-hint.desktop": "点击行走。WASD 自由移动。",
|
|
2310
|
-
"walk-hint.touch-tap": "点击行走。拖动环顾四周。",
|
|
2311
|
-
"walk-hint.touch-gaming": "使用摇杆移动。拖动环顾四周。点击跳跃。"
|
|
2248
|
+
"xr-modal.ok": "确定"
|
|
2312
2249
|
};
|
|
2313
2250
|
|
|
2314
2251
|
const en = enJson;
|
|
@@ -2621,7 +2558,7 @@ const importSettings = (settings) => {
|
|
|
2621
2558
|
return result;
|
|
2622
2559
|
};
|
|
2623
2560
|
|
|
2624
|
-
var version = "1.
|
|
2561
|
+
var version = "1.35.0";
|
|
2625
2562
|
|
|
2626
2563
|
class Tooltip {
|
|
2627
2564
|
register;
|
|
@@ -2721,17 +2658,23 @@ class Tooltip {
|
|
|
2721
2658
|
const initAnnotationControls = (viewer, root) => {
|
|
2722
2659
|
const { state, events, annotations } = viewer;
|
|
2723
2660
|
const nav = root.querySelector('.sse-annotationNav');
|
|
2661
|
+
const info = root.querySelector('.sse-annotationInfo');
|
|
2662
|
+
const number = root.querySelector('.sse-annotationNavNumber');
|
|
2724
2663
|
const title = root.querySelector('.sse-annotationNavTitle');
|
|
2725
2664
|
const prev = root.querySelector('.sse-annotationPrev');
|
|
2726
2665
|
const next = root.querySelector('.sse-annotationNext');
|
|
2727
2666
|
const row = root.querySelector('.sse-annotationsRow');
|
|
2728
2667
|
const check = root.querySelector('.sse-annotationsCheck');
|
|
2729
|
-
// Retain the last title and navigation position when the panel is dismissed
|
|
2668
|
+
// Retain the last title and navigation position when the panel is dismissed, greyed out
|
|
2669
|
+
// while nothing is selected so it does not read as the selection; clicking it selects it.
|
|
2730
2670
|
let currentIndex = state.selectedAnnotation ?? 0;
|
|
2731
2671
|
const update = () => {
|
|
2732
2672
|
currentIndex = state.selectedAnnotation ?? currentIndex;
|
|
2673
|
+
// the number its hotspot shows in the scene
|
|
2674
|
+
number.textContent = annotations[currentIndex] ? String(currentIndex + 1) : '';
|
|
2733
2675
|
title.textContent = annotations[currentIndex]?.title ?? '';
|
|
2734
2676
|
nav.classList.toggle('sse-hidden', !state.loaded || !state.showAnnotations || annotations.length < 2);
|
|
2677
|
+
nav.classList.toggle('sse-unselected', state.selectedAnnotation === null);
|
|
2735
2678
|
nav.classList.toggle('sse-desktop', state.inputMode === 'desktop');
|
|
2736
2679
|
nav.classList.toggle('sse-touch', state.inputMode === 'touch');
|
|
2737
2680
|
nav.classList.toggle('sse-faded-in', !state.controlsHidden);
|
|
@@ -2748,12 +2691,19 @@ const initAnnotationControls = (viewer, root) => {
|
|
|
2748
2691
|
event.stopPropagation();
|
|
2749
2692
|
viewer.selectAnnotation((currentIndex + 1) % annotations.length);
|
|
2750
2693
|
};
|
|
2694
|
+
const onInfo = (event) => {
|
|
2695
|
+
event.stopPropagation();
|
|
2696
|
+
if (state.loaded && state.selectedAnnotation === null && annotations[currentIndex]) {
|
|
2697
|
+
viewer.selectAnnotation(currentIndex);
|
|
2698
|
+
}
|
|
2699
|
+
};
|
|
2751
2700
|
const onVisibility = (event) => {
|
|
2752
2701
|
event.stopPropagation();
|
|
2753
2702
|
state.showAnnotations = !state.showAnnotations;
|
|
2754
2703
|
};
|
|
2755
2704
|
prev.addEventListener('click', onPrev);
|
|
2756
2705
|
next.addEventListener('click', onNext);
|
|
2706
|
+
info.addEventListener('click', onInfo);
|
|
2757
2707
|
row.addEventListener('click', onVisibility);
|
|
2758
2708
|
const subscriptions = [
|
|
2759
2709
|
events.on('loaded:changed', update),
|
|
@@ -2768,38 +2718,21 @@ const initAnnotationControls = (viewer, root) => {
|
|
|
2768
2718
|
subscription.off();
|
|
2769
2719
|
prev.removeEventListener('click', onPrev);
|
|
2770
2720
|
next.removeEventListener('click', onNext);
|
|
2721
|
+
info.removeEventListener('click', onInfo);
|
|
2771
2722
|
row.removeEventListener('click', onVisibility);
|
|
2772
2723
|
};
|
|
2773
2724
|
};
|
|
2774
2725
|
|
|
2775
|
-
// clamp the vertices of the hotspot so it is never clipped by the near or far plane
|
|
2776
|
-
const depthClampGlsl = `
|
|
2777
|
-
float f = gl_Position.z / gl_Position.w;
|
|
2778
|
-
if (f > 1.0) {
|
|
2779
|
-
gl_Position.z = gl_Position.w;
|
|
2780
|
-
} else if (f < -1.0) {
|
|
2781
|
-
gl_Position.z = -gl_Position.w;
|
|
2782
|
-
}
|
|
2783
|
-
`;
|
|
2784
|
-
const depthClampWgsl = `
|
|
2785
|
-
let f = output.position.z / output.position.w;
|
|
2786
|
-
if (f > 1.0) {
|
|
2787
|
-
output.position.z = output.position.w;
|
|
2788
|
-
} else if (f < -1.0) {
|
|
2789
|
-
output.position.z = -output.position.w;
|
|
2790
|
-
}
|
|
2791
|
-
`;
|
|
2792
2726
|
const vec$1 = new Vec3();
|
|
2793
|
-
const HOTSPOT_SIZE = 25;
|
|
2794
|
-
const HOTSPOT_COLOR = new Color(0.8, 0.8, 0.8);
|
|
2795
|
-
const HOVER_COLOR = new Color(1.0, 0.4, 0.0);
|
|
2796
2727
|
/**
|
|
2797
2728
|
* A script for creating interactive 3D annotations in a scene. Each annotation consists of:
|
|
2798
2729
|
*
|
|
2799
|
-
* - A
|
|
2800
|
-
*
|
|
2801
|
-
*
|
|
2802
|
-
* - An annotation panel that shows title and description text.
|
|
2730
|
+
* - A hotspot: a dom circle with the annotation's number, kept over the annotation's position.
|
|
2731
|
+
* `Annotations` tests it against the scene and marks it occluded, which fades it rather than
|
|
2732
|
+
* letting the scene cover it pixel by pixel. It stays clickable either way.
|
|
2733
|
+
* - An annotation panel that shows title and description text, shared by every annotation.
|
|
2734
|
+
*
|
|
2735
|
+
* Styles live in `index.scss`, under `.sse-annotations`.
|
|
2803
2736
|
*/
|
|
2804
2737
|
class Annotation extends Script {
|
|
2805
2738
|
static scriptName = 'annotation';
|
|
@@ -2825,247 +2758,28 @@ class Annotation extends Script {
|
|
|
2825
2758
|
*/
|
|
2826
2759
|
hotspotDom = null;
|
|
2827
2760
|
/**
|
|
2761
|
+
* The hotspot's position in canvas pixels, and its distance from the camera, as of the
|
|
2762
|
+
* last update; null while it is behind the camera. Read by the occlusion test.
|
|
2828
2763
|
* @private
|
|
2829
2764
|
*/
|
|
2830
|
-
|
|
2831
|
-
/**
|
|
2832
|
-
* @private
|
|
2833
|
-
*/
|
|
2834
|
-
materials = [];
|
|
2765
|
+
screen = null;
|
|
2835
2766
|
/**
|
|
2836
2767
|
* Set once the entity is destroyed, so a prerender still queued for this frame does not
|
|
2837
2768
|
* touch torn-down state.
|
|
2838
2769
|
* @private
|
|
2839
2770
|
*/
|
|
2840
2771
|
destroyed = false;
|
|
2841
|
-
/**
|
|
2842
|
-
* Creates the stylesheet the annotation dom needs.
|
|
2843
|
-
* @param {number} size - The size of the hotspot in screen pixels.
|
|
2844
|
-
* @returns {HTMLStyleElement} The style element, not yet attached.
|
|
2845
|
-
* @private
|
|
2846
|
-
*/
|
|
2847
|
-
static _createStyleSheet(size) {
|
|
2848
|
-
const css = `
|
|
2849
|
-
.sse-annotation {
|
|
2850
|
-
display: block;
|
|
2851
|
-
position: absolute;
|
|
2852
|
-
background-color: rgba(0, 0, 0, 0.8);
|
|
2853
|
-
color: white;
|
|
2854
|
-
padding: 8px;
|
|
2855
|
-
border-radius: 4px;
|
|
2856
|
-
font-size: 14px;
|
|
2857
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
|
2858
|
-
pointer-events: none;
|
|
2859
|
-
max-width: 200px;
|
|
2860
|
-
word-wrap: break-word;
|
|
2861
|
-
overflow-x: visible;
|
|
2862
|
-
white-space: normal;
|
|
2863
|
-
width: fit-content;
|
|
2864
|
-
opacity: 0;
|
|
2865
|
-
transition: opacity 0.2s ease-in-out;
|
|
2866
|
-
visibility: hidden;
|
|
2867
|
-
}
|
|
2868
|
-
|
|
2869
|
-
.sse-annotation-title {
|
|
2870
|
-
font-weight: bold;
|
|
2871
|
-
margin-bottom: 4px;
|
|
2872
|
-
}
|
|
2873
|
-
|
|
2874
|
-
/* Tooltip arrow */
|
|
2875
|
-
.sse-annotation.sse-arrow-right::before,
|
|
2876
|
-
.sse-annotation.sse-arrow-left::before {
|
|
2877
|
-
content: "";
|
|
2878
|
-
position: absolute;
|
|
2879
|
-
top: var(--arrow-top, 50%);
|
|
2880
|
-
transform: translateY(-50%);
|
|
2881
|
-
border-top: 8px solid transparent;
|
|
2882
|
-
border-bottom: 8px solid transparent;
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
|
-
.sse-annotation.sse-arrow-right::before {
|
|
2886
|
-
left: -8px;
|
|
2887
|
-
border-right: 8px solid rgba(0, 0, 0, 0.8);
|
|
2888
|
-
}
|
|
2889
|
-
|
|
2890
|
-
.sse-annotation.sse-arrow-left::before {
|
|
2891
|
-
right: -8px;
|
|
2892
|
-
border-left: 8px solid rgba(0, 0, 0, 0.8);
|
|
2893
|
-
}
|
|
2894
|
-
|
|
2895
|
-
.sse-annotation-hotspot {
|
|
2896
|
-
display: none;
|
|
2897
|
-
position: absolute;
|
|
2898
|
-
width: ${size + 5}px;
|
|
2899
|
-
height: ${size + 5}px;
|
|
2900
|
-
opacity: 0;
|
|
2901
|
-
cursor: pointer;
|
|
2902
|
-
transform: translate(-50%, -50%);
|
|
2903
|
-
}
|
|
2904
|
-
`;
|
|
2905
|
-
const style = document.createElement('style');
|
|
2906
|
-
style.textContent = css;
|
|
2907
|
-
return style;
|
|
2908
|
-
}
|
|
2909
|
-
/**
|
|
2910
|
-
* Creates a circular hotspot texture.
|
|
2911
|
-
* @param {AppBase} app - The PlayCanvas AppBase
|
|
2912
|
-
* @param {string} label - Label text to draw on the hotspot
|
|
2913
|
-
* @param {number} [size] - The texture size (should be power of 2)
|
|
2914
|
-
* @param {number} [borderWidth] - The border width in pixels
|
|
2915
|
-
* @returns {Texture} The hotspot texture
|
|
2916
|
-
* @private
|
|
2917
|
-
*/
|
|
2918
|
-
static _createHotspotTexture(app, label, size = 64, borderWidth = 6) {
|
|
2919
|
-
// Create canvas for hotspot texture
|
|
2920
|
-
const canvas = document.createElement('canvas');
|
|
2921
|
-
canvas.width = size;
|
|
2922
|
-
canvas.height = size;
|
|
2923
|
-
const ctx = canvas.getContext('2d');
|
|
2924
|
-
// First clear with stroke color at zero alpha
|
|
2925
|
-
ctx.fillStyle = 'white';
|
|
2926
|
-
ctx.globalAlpha = 0;
|
|
2927
|
-
ctx.fillRect(0, 0, size, size);
|
|
2928
|
-
ctx.globalAlpha = 1.0;
|
|
2929
|
-
// Draw dark circle with light border
|
|
2930
|
-
const centerX = size / 2;
|
|
2931
|
-
const centerY = size / 2;
|
|
2932
|
-
const radius = size / 2 - 4; // Leave space for border
|
|
2933
|
-
// Draw main circle
|
|
2934
|
-
ctx.beginPath();
|
|
2935
|
-
ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
|
|
2936
|
-
ctx.fillStyle = 'black';
|
|
2937
|
-
ctx.fill();
|
|
2938
|
-
// Draw border
|
|
2939
|
-
ctx.beginPath();
|
|
2940
|
-
ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
|
|
2941
|
-
ctx.lineWidth = borderWidth;
|
|
2942
|
-
ctx.strokeStyle = 'white';
|
|
2943
|
-
ctx.stroke();
|
|
2944
|
-
// Draw text
|
|
2945
|
-
ctx.font = 'bold 32px Arial';
|
|
2946
|
-
ctx.textAlign = 'center';
|
|
2947
|
-
ctx.textBaseline = 'middle';
|
|
2948
|
-
ctx.fillStyle = 'white';
|
|
2949
|
-
ctx.fillText(label, Math.floor(canvas.width / 2), Math.floor(canvas.height / 2) + 1);
|
|
2950
|
-
// get pixel data
|
|
2951
|
-
const imageData = ctx.getImageData(0, 0, size, size);
|
|
2952
|
-
const data = imageData.data;
|
|
2953
|
-
// set the color channel of semitransparent pixels to white so the blending at
|
|
2954
|
-
// the edges is correct
|
|
2955
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
2956
|
-
const a = data[i + 3];
|
|
2957
|
-
if (a < 255) {
|
|
2958
|
-
data[i] = 255;
|
|
2959
|
-
data[i + 1] = 255;
|
|
2960
|
-
data[i + 2] = 255;
|
|
2961
|
-
}
|
|
2962
|
-
}
|
|
2963
|
-
const texture = new Texture(app.graphicsDevice, {
|
|
2964
|
-
width: size,
|
|
2965
|
-
height: size,
|
|
2966
|
-
format: PIXELFORMAT_RGBA8,
|
|
2967
|
-
magFilter: FILTER_LINEAR,
|
|
2968
|
-
minFilter: FILTER_LINEAR,
|
|
2969
|
-
mipmaps: false,
|
|
2970
|
-
levels: [new Uint8Array(data.buffer)]
|
|
2971
|
-
});
|
|
2972
|
-
return texture;
|
|
2973
|
-
}
|
|
2974
|
-
/**
|
|
2975
|
-
* Creates a material for hotspot rendering.
|
|
2976
|
-
* @param {Texture} texture - The texture to use for emissive and opacity
|
|
2977
|
-
* @param {Color} color - The emissive colour
|
|
2978
|
-
* @param {object} [options] - Material options
|
|
2979
|
-
* @param {number} [options.opacity] - Base opacity multiplier
|
|
2980
|
-
* @param {boolean} [options.depthTest] - Whether to perform depth testing
|
|
2981
|
-
* @param {boolean} [options.depthWrite] - Whether to write to depth buffer
|
|
2982
|
-
* @returns {StandardMaterial} The configured material
|
|
2983
|
-
* @private
|
|
2984
|
-
*/
|
|
2985
|
-
static _createHotspotMaterial(texture, color, { opacity = 1, depthTest = true, depthWrite = true } = {}) {
|
|
2986
|
-
const material = new StandardMaterial();
|
|
2987
|
-
// Base properties
|
|
2988
|
-
material.diffuse = Color.BLACK;
|
|
2989
|
-
material.emissive.copy(color);
|
|
2990
|
-
material.emissiveMap = texture;
|
|
2991
|
-
material.opacityMap = texture;
|
|
2992
|
-
// Alpha properties
|
|
2993
|
-
material.opacity = opacity;
|
|
2994
|
-
material.alphaTest = 0.01;
|
|
2995
|
-
material.blendState = new BlendState(true, BLENDEQUATION_ADD, BLENDMODE_SRC_ALPHA, BLENDMODE_ONE_MINUS_SRC_ALPHA, BLENDEQUATION_ADD, BLENDMODE_ONE, BLENDMODE_ONE);
|
|
2996
|
-
// Depth properties
|
|
2997
|
-
material.depthTest = depthTest;
|
|
2998
|
-
material.depthWrite = depthWrite;
|
|
2999
|
-
// Rendering properties
|
|
3000
|
-
material.cull = CULLFACE_NONE;
|
|
3001
|
-
material.useLighting = false;
|
|
3002
|
-
material.shaderChunks.glsl.add({
|
|
3003
|
-
litUserMainEndVS: depthClampGlsl
|
|
3004
|
-
});
|
|
3005
|
-
material.shaderChunks.wgsl.add({
|
|
3006
|
-
litUserMainEndVS: depthClampWgsl
|
|
3007
|
-
});
|
|
3008
|
-
material.update();
|
|
3009
|
-
return material;
|
|
3010
|
-
}
|
|
3011
2772
|
initialize() {
|
|
3012
2773
|
const ctx = this.context;
|
|
3013
|
-
// Create texture
|
|
3014
|
-
this.texture = Annotation._createHotspotTexture(this.app, this.label);
|
|
3015
|
-
// Create material the base and overlay material
|
|
3016
|
-
this.materials = [
|
|
3017
|
-
Annotation._createHotspotMaterial(this.texture, ctx.hotspotColor, {
|
|
3018
|
-
opacity: 1,
|
|
3019
|
-
depthTest: true,
|
|
3020
|
-
depthWrite: true
|
|
3021
|
-
}),
|
|
3022
|
-
Annotation._createHotspotMaterial(this.texture, ctx.hotspotColor, {
|
|
3023
|
-
opacity: 0.25,
|
|
3024
|
-
depthTest: false,
|
|
3025
|
-
depthWrite: false
|
|
3026
|
-
})
|
|
3027
|
-
];
|
|
3028
|
-
const base = new Entity('base', this.app);
|
|
3029
|
-
const baseMi = new MeshInstance(ctx.mesh, this.materials[0]);
|
|
3030
|
-
baseMi.cull = false;
|
|
3031
|
-
base.addComponent('render', {
|
|
3032
|
-
layers: [ctx.layers[0].id],
|
|
3033
|
-
meshInstances: [baseMi]
|
|
3034
|
-
});
|
|
3035
|
-
const overlay = new Entity('overlay', this.app);
|
|
3036
|
-
const overlayMi = new MeshInstance(ctx.mesh, this.materials[1]);
|
|
3037
|
-
overlayMi.cull = false;
|
|
3038
|
-
overlay.addComponent('render', {
|
|
3039
|
-
layers: [ctx.layers[1].id],
|
|
3040
|
-
meshInstances: [overlayMi]
|
|
3041
|
-
});
|
|
3042
|
-
this.entity.addChild(base);
|
|
3043
|
-
this.entity.addChild(overlay);
|
|
3044
|
-
// Create hotspot dom
|
|
3045
2774
|
this.hotspotDom = document.createElement('div');
|
|
3046
2775
|
this.hotspotDom.className = 'sse-annotation-hotspot';
|
|
3047
|
-
|
|
2776
|
+
this.hotspotDom.textContent = this.label;
|
|
3048
2777
|
const onClick = (e) => {
|
|
3049
2778
|
e.stopPropagation();
|
|
3050
2779
|
this.fire('select');
|
|
3051
2780
|
};
|
|
3052
2781
|
this.hotspotDom.addEventListener('click', onClick);
|
|
3053
|
-
|
|
3054
|
-
if (ctx.hoverAnnotation === this) {
|
|
3055
|
-
ctx.hoverAnnotation = null;
|
|
3056
|
-
this.setHover(false);
|
|
3057
|
-
}
|
|
3058
|
-
};
|
|
3059
|
-
const enter = () => {
|
|
3060
|
-
if (ctx.hoverAnnotation !== null) {
|
|
3061
|
-
ctx.hoverAnnotation.setHover(false);
|
|
3062
|
-
}
|
|
3063
|
-
ctx.hoverAnnotation = this;
|
|
3064
|
-
this.setHover(true);
|
|
3065
|
-
};
|
|
3066
|
-
this.hotspotDom.addEventListener('pointerenter', enter);
|
|
3067
|
-
this.hotspotDom.addEventListener('pointerleave', leave);
|
|
3068
|
-
ctx.parentDom.appendChild(this.hotspotDom);
|
|
2782
|
+
ctx.hotspotsDom.appendChild(this.hotspotDom);
|
|
3069
2783
|
const onPrerender = () => this._update();
|
|
3070
2784
|
this.app.on('prerender', onPrerender);
|
|
3071
2785
|
// Clean up on entity destruction
|
|
@@ -3073,23 +2787,14 @@ class Annotation extends Script {
|
|
|
3073
2787
|
this.destroyed = true;
|
|
3074
2788
|
this.app.off('prerender', onPrerender);
|
|
3075
2789
|
this.hotspotDom.removeEventListener('click', onClick);
|
|
3076
|
-
this.hotspotDom.removeEventListener('pointerenter', enter);
|
|
3077
|
-
this.hotspotDom.removeEventListener('pointerleave', leave);
|
|
3078
2790
|
this.hotspotDom.remove();
|
|
3079
|
-
if (ctx.hoverAnnotation === this) {
|
|
3080
|
-
ctx.hoverAnnotation = null;
|
|
3081
|
-
}
|
|
3082
2791
|
if (ctx.activeAnnotation === this) {
|
|
3083
2792
|
this.hideTooltip();
|
|
3084
2793
|
}
|
|
3085
|
-
this.materials.forEach((mat) => mat.destroy());
|
|
3086
|
-
this.materials = [];
|
|
3087
|
-
this.texture.destroy();
|
|
3088
|
-
this.texture = null;
|
|
3089
2794
|
});
|
|
3090
2795
|
}
|
|
3091
2796
|
/**
|
|
3092
|
-
* Update screen-space elements
|
|
2797
|
+
* Update the screen-space elements for this annotation. Called each frame from the
|
|
3093
2798
|
* prerender callback, and also directly from showTooltip to ensure the tooltip is positioned
|
|
3094
2799
|
* correctly even when the camera hasn't moved (e.g. annotations sharing the same camera pose).
|
|
3095
2800
|
* @private
|
|
@@ -3099,47 +2804,35 @@ class Annotation extends Script {
|
|
|
3099
2804
|
return;
|
|
3100
2805
|
const { camera } = this.context;
|
|
3101
2806
|
const position = this.entity.getPosition();
|
|
3102
|
-
|
|
3103
|
-
const { viewMatrix } = camera.camera;
|
|
3104
|
-
viewMatrix.transformPoint(position, vec$1);
|
|
2807
|
+
camera.camera.viewMatrix.transformPoint(position, vec$1);
|
|
3105
2808
|
if (vec$1.z >= 0) {
|
|
2809
|
+
this.screen = null;
|
|
3106
2810
|
this._hideElements();
|
|
3107
2811
|
return;
|
|
3108
2812
|
}
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
const { opacity } = this.context;
|
|
3114
|
-
this.materials[0].opacity = opacity;
|
|
3115
|
-
this.materials[1].opacity = 0.25 * opacity;
|
|
3116
|
-
this.materials[0].setParameter('material_opacity', opacity);
|
|
3117
|
-
this.materials[1].setParameter('material_opacity', 0.25 * opacity);
|
|
2813
|
+
const screenPos = camera.camera.worldToScreen(position);
|
|
2814
|
+
const distance = camera.getPosition().distance(position);
|
|
2815
|
+
this.screen = { x: screenPos.x, y: screenPos.y, distance };
|
|
2816
|
+
this._updatePositions(screenPos, distance);
|
|
3118
2817
|
}
|
|
3119
2818
|
/**
|
|
3120
|
-
*
|
|
3121
|
-
* @param
|
|
2819
|
+
* Mark the hotspot as hidden behind the scene, which fades it to a faint outline.
|
|
2820
|
+
* @param occluded - Whether scene content covers the annotation's position.
|
|
3122
2821
|
* @private
|
|
3123
2822
|
*/
|
|
3124
|
-
|
|
3125
|
-
this.
|
|
3126
|
-
material.emissive.copy(hover ? this.context.hoverColor : this.context.hotspotColor);
|
|
3127
|
-
material.update();
|
|
3128
|
-
});
|
|
3129
|
-
this.fire('hover', hover);
|
|
2823
|
+
setOccluded(occluded) {
|
|
2824
|
+
this.hotspotDom.classList.toggle('sse-occluded', occluded);
|
|
3130
2825
|
}
|
|
3131
2826
|
/**
|
|
3132
2827
|
* @private
|
|
3133
2828
|
*/
|
|
3134
2829
|
showTooltip() {
|
|
3135
2830
|
const ctx = this.context;
|
|
3136
|
-
clearTimeout(ctx.hideTimeout);
|
|
3137
|
-
ctx.hideTimeout = null;
|
|
3138
2831
|
ctx.activeAnnotation = this;
|
|
3139
|
-
ctx.tooltipDom.style.visibility = 'visible';
|
|
3140
|
-
ctx.tooltipDom.style.opacity = '1';
|
|
3141
2832
|
ctx.titleDom.textContent = this.title;
|
|
3142
2833
|
ctx.textDom.textContent = this.text;
|
|
2834
|
+
ctx.tooltipDom.classList.add('sse-visible');
|
|
2835
|
+
this.hotspotDom.classList.add('sse-active');
|
|
3143
2836
|
// Immediately update incase the camera doesn't move
|
|
3144
2837
|
this._update();
|
|
3145
2838
|
}
|
|
@@ -3148,17 +2841,9 @@ class Annotation extends Script {
|
|
|
3148
2841
|
*/
|
|
3149
2842
|
hideTooltip() {
|
|
3150
2843
|
const ctx = this.context;
|
|
3151
|
-
const { tooltipDom } = ctx;
|
|
3152
2844
|
ctx.activeAnnotation = null;
|
|
3153
|
-
tooltipDom.
|
|
3154
|
-
|
|
3155
|
-
clearTimeout(ctx.hideTimeout);
|
|
3156
|
-
ctx.hideTimeout = setTimeout(() => {
|
|
3157
|
-
ctx.hideTimeout = null;
|
|
3158
|
-
if (tooltipDom.style.opacity === '0') {
|
|
3159
|
-
tooltipDom.style.visibility = 'hidden';
|
|
3160
|
-
}
|
|
3161
|
-
}, 200); // Match the transition duration
|
|
2845
|
+
ctx.tooltipDom.classList.remove('sse-visible');
|
|
2846
|
+
this.hotspotDom.classList.remove('sse-active');
|
|
3162
2847
|
}
|
|
3163
2848
|
/**
|
|
3164
2849
|
* Hide all elements when annotation is behind camera.
|
|
@@ -3167,173 +2852,118 @@ class Annotation extends Script {
|
|
|
3167
2852
|
_hideElements() {
|
|
3168
2853
|
this.hotspotDom.style.display = 'none';
|
|
3169
2854
|
if (this.context.activeAnnotation === this) {
|
|
3170
|
-
this.context.tooltipDom.
|
|
3171
|
-
this.context.tooltipDom.style.opacity = '0';
|
|
2855
|
+
this.context.tooltipDom.classList.remove('sse-visible');
|
|
3172
2856
|
}
|
|
3173
2857
|
}
|
|
3174
2858
|
/**
|
|
3175
2859
|
* Update screen-space positions of HTML elements.
|
|
3176
2860
|
* @param {Vec3} screenPos - Screen coordinate
|
|
2861
|
+
* @param {number} distance - Distance from the camera, which orders overlapping hotspots
|
|
3177
2862
|
* @private
|
|
3178
2863
|
*/
|
|
3179
|
-
_updatePositions(screenPos) {
|
|
3180
|
-
// Show and position hotspot
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
2864
|
+
_updatePositions(screenPos, distance) {
|
|
2865
|
+
// Show and position hotspot; a transform rather than left/top, so moving it each frame
|
|
2866
|
+
// does not trigger layout
|
|
2867
|
+
const hotspot = this.hotspotDom;
|
|
2868
|
+
hotspot.style.display = 'flex';
|
|
2869
|
+
hotspot.style.transform = `translate(${screenPos.x}px, ${screenPos.y}px) translate(-50%, -50%)`;
|
|
2870
|
+
// nearer hotspots draw over farther ones
|
|
2871
|
+
hotspot.style.zIndex = String(Math.round(100000 / (1 + distance)));
|
|
3184
2872
|
const ctx = this.context;
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
ctx.tooltipDom.style.visibility = 'visible';
|
|
3188
|
-
ctx.tooltipDom.style.opacity = '1';
|
|
2873
|
+
if (ctx.activeAnnotation !== this) {
|
|
2874
|
+
return;
|
|
3189
2875
|
}
|
|
2876
|
+
// Re-show tooltip if it was hidden while behind camera
|
|
2877
|
+
const tooltip = ctx.tooltipDom;
|
|
2878
|
+
tooltip.classList.add('sse-visible');
|
|
3190
2879
|
// Position tooltip, clamped to the canvas (screenPos is in canvas pixels)
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
tooltip.style.transform = 'none';
|
|
3218
|
-
tooltip.style.left = `${left}px`;
|
|
3219
|
-
tooltip.style.top = `${top}px`;
|
|
3220
|
-
}
|
|
3221
|
-
}
|
|
3222
|
-
/**
|
|
3223
|
-
* Update 3D rotation and scale of hotspot planes.
|
|
3224
|
-
* @param {number} viewDepth - The view-space depth (positive distance along the camera's forward direction)
|
|
3225
|
-
* @private
|
|
3226
|
-
*/
|
|
3227
|
-
_updateRotationAndScale(viewDepth) {
|
|
3228
|
-
// Copy camera rotation to align with view plane
|
|
3229
|
-
const cameraRotation = this.context.camera.getRotation();
|
|
3230
|
-
this._updateHotspotTransform(this.entity, cameraRotation);
|
|
3231
|
-
// Calculate scale based on view depth to maintain constant screen size
|
|
3232
|
-
const scale = this._calculateScreenSpaceScale(viewDepth);
|
|
3233
|
-
this.entity.setLocalScale(scale, scale, scale);
|
|
3234
|
-
}
|
|
3235
|
-
/**
|
|
3236
|
-
* Update rotation of a single hotspot entity.
|
|
3237
|
-
* @param {Entity} hotspot - The hotspot entity to update
|
|
3238
|
-
* @param {Quat} cameraRotation - The camera's current rotation
|
|
3239
|
-
* @private
|
|
3240
|
-
*/
|
|
3241
|
-
_updateHotspotTransform(hotspot, cameraRotation) {
|
|
3242
|
-
hotspot.setRotation(cameraRotation);
|
|
3243
|
-
hotspot.rotateLocal(90, 0, 0);
|
|
3244
|
-
}
|
|
3245
|
-
/**
|
|
3246
|
-
* Calculate scale factor to maintain constant screen-space size.
|
|
3247
|
-
* @param {number} viewDepth - The view-space depth (positive distance along the camera's forward direction)
|
|
3248
|
-
* @returns {number} The scale to apply to hotspot entities
|
|
3249
|
-
* @private
|
|
3250
|
-
*/
|
|
3251
|
-
_calculateScreenSpaceScale(viewDepth) {
|
|
3252
|
-
// Use the canvas's CSS/client height instead of graphics device height
|
|
3253
|
-
const canvas = this.app.graphicsDevice.canvas;
|
|
3254
|
-
const screenHeight = canvas.clientHeight;
|
|
3255
|
-
// Use view-space depth (not Euclidean distance) to match the projection matrix
|
|
3256
|
-
const projMatrix = this.context.camera.camera.projectionMatrix;
|
|
3257
|
-
const worldSize = (HOTSPOT_SIZE / screenHeight) * ((2 * viewDepth) / projMatrix.data[5]);
|
|
3258
|
-
return worldSize;
|
|
2880
|
+
const margin = 8;
|
|
2881
|
+
const arrowOffset = 24;
|
|
2882
|
+
const tw = tooltip.offsetWidth;
|
|
2883
|
+
const th = tooltip.offsetHeight;
|
|
2884
|
+
const vw = ctx.canvas.clientWidth;
|
|
2885
|
+
const vh = ctx.canvas.clientHeight;
|
|
2886
|
+
// Default position: to the right of hotspot, vertically centered
|
|
2887
|
+
let left = screenPos.x + arrowOffset;
|
|
2888
|
+
let top = screenPos.y - th / 2;
|
|
2889
|
+
let flipped = false;
|
|
2890
|
+
// If tooltip overflows right edge, flip to left side of hotspot
|
|
2891
|
+
if (left + tw > vw - margin) {
|
|
2892
|
+
left = screenPos.x - arrowOffset - tw;
|
|
2893
|
+
flipped = true;
|
|
2894
|
+
}
|
|
2895
|
+
// Clamp horizontal
|
|
2896
|
+
left = Math.max(margin, Math.min(left, vw - tw - margin));
|
|
2897
|
+
// Clamp vertical
|
|
2898
|
+
top = Math.max(margin, Math.min(top, vh - th - margin));
|
|
2899
|
+
// Position arrow to point at the hotspot, clamped within the tooltip
|
|
2900
|
+
const arrowY = Math.max(16, Math.min(screenPos.y - top, th - 16));
|
|
2901
|
+
tooltip.style.setProperty('--arrow-top', `${arrowY}px`);
|
|
2902
|
+
tooltip.classList.toggle('sse-arrow-right', !flipped);
|
|
2903
|
+
tooltip.classList.toggle('sse-arrow-left', flipped);
|
|
2904
|
+
tooltip.style.left = `${left}px`;
|
|
2905
|
+
tooltip.style.top = `${top}px`;
|
|
3259
2906
|
}
|
|
3260
2907
|
}
|
|
3261
2908
|
/**
|
|
3262
|
-
* Everything the annotations of one viewer share: the dom they live in
|
|
3263
|
-
*
|
|
3264
|
-
*
|
|
3265
|
-
* Owned by `Annotations`, which removes `parentDom` on destroy; the mesh is released through
|
|
3266
|
-
* the mesh instances when the annotation entities go.
|
|
2909
|
+
* Everything the annotations of one viewer share: the dom they live in, the camera they follow,
|
|
2910
|
+
* the single tooltip, and the active bookkeeping. One per viewer, so two viewers on a page never
|
|
2911
|
+
* fight over shared state. Owned by `Annotations`, which removes `parentDom` on destroy.
|
|
3267
2912
|
*/
|
|
3268
2913
|
class AnnotationContext {
|
|
3269
2914
|
parentDom;
|
|
2915
|
+
// the hotspots' own layer, beneath the tooltip: their depth ordering stays inside it, so
|
|
2916
|
+
// no hotspot can draw over the tooltip
|
|
2917
|
+
hotspotsDom;
|
|
3270
2918
|
canvas;
|
|
3271
2919
|
camera;
|
|
3272
|
-
layers;
|
|
3273
|
-
mesh;
|
|
3274
2920
|
tooltipDom;
|
|
3275
2921
|
titleDom;
|
|
3276
2922
|
textDom;
|
|
3277
|
-
// Mutable copies: `Annotations` converts them to gamma space when post effects are active.
|
|
3278
|
-
hotspotColor = HOTSPOT_COLOR.clone();
|
|
3279
|
-
hoverColor = HOVER_COLOR.clone();
|
|
3280
2923
|
activeAnnotation = null;
|
|
3281
|
-
|
|
3282
|
-
opacity = 1.0;
|
|
3283
|
-
hideTimeout = null;
|
|
3284
|
-
constructor(app, camera, parentDom) {
|
|
2924
|
+
constructor(canvas, camera, parentDom) {
|
|
3285
2925
|
this.parentDom = parentDom;
|
|
3286
|
-
this.canvas =
|
|
2926
|
+
this.canvas = canvas;
|
|
3287
2927
|
this.camera = camera;
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
const idx = semitrans ? layers.getTransparentIndex(worldLayer) : layers.getOpaqueIndex(worldLayer);
|
|
3294
|
-
layers.insert(layer, idx + 1);
|
|
3295
|
-
return layer;
|
|
3296
|
-
};
|
|
3297
|
-
this.layers = [createLayer('HotspotBase', false), createLayer('HotspotOverlay', true)];
|
|
3298
|
-
camera.camera.layers = [...camera.camera.layers, ...this.layers.map((layer) => layer.id)];
|
|
3299
|
-
this.mesh = Mesh.fromGeometry(app.graphicsDevice, new PlaneGeometry({
|
|
3300
|
-
widthSegments: 1,
|
|
3301
|
-
lengthSegments: 1
|
|
3302
|
-
}));
|
|
3303
|
-
// Initialize tooltip dom
|
|
2928
|
+
this.hotspotsDom = document.createElement('div');
|
|
2929
|
+
this.hotspotsDom.className = 'sse-annotation-hotspots';
|
|
2930
|
+
parentDom.appendChild(this.hotspotsDom);
|
|
2931
|
+
// the tooltip: the title, then the text. No number: the selected hotspot beside it
|
|
2932
|
+
// already shows it
|
|
3304
2933
|
this.tooltipDom = document.createElement('div');
|
|
3305
2934
|
this.tooltipDom.className = 'sse-annotation';
|
|
3306
2935
|
this.titleDom = document.createElement('div');
|
|
3307
2936
|
this.titleDom.className = 'sse-annotation-title';
|
|
3308
|
-
this.tooltipDom.appendChild(this.titleDom);
|
|
3309
2937
|
this.textDom = document.createElement('div');
|
|
3310
2938
|
this.textDom.className = 'sse-annotation-text';
|
|
3311
|
-
this.tooltipDom.
|
|
2939
|
+
this.tooltipDom.append(this.titleDom, this.textDom);
|
|
3312
2940
|
parentDom.appendChild(this.tooltipDom);
|
|
3313
2941
|
}
|
|
3314
2942
|
}
|
|
3315
2943
|
|
|
2944
|
+
// how long the camera must be still before the hotspots are tested against the scene
|
|
2945
|
+
const SETTLE_MS = 150;
|
|
2946
|
+
// splats must cover at least this much of a hotspot's pixel to hide it, so haze does not
|
|
2947
|
+
const OCCLUDING_COVERAGE = 0.5;
|
|
2948
|
+
// an annotation sits on the surface it describes, so the scene there is at about its distance;
|
|
2949
|
+
// only content this much nearer than the annotation counts as in front of it
|
|
2950
|
+
const OCCLUSION_TOLERANCE = 0.05;
|
|
3316
2951
|
// Built-in hotspot and panel presentation. Selection and camera navigation belong to the viewer.
|
|
3317
2952
|
class Annotations {
|
|
3318
|
-
app;
|
|
3319
2953
|
parentDom;
|
|
3320
2954
|
parent;
|
|
3321
|
-
context;
|
|
3322
2955
|
subscriptions;
|
|
3323
2956
|
removeClick;
|
|
3324
|
-
|
|
2957
|
+
removeOcclusion;
|
|
2958
|
+
constructor(viewer, root, camera, getPicker) {
|
|
3325
2959
|
const { app, state, events, annotations } = viewer;
|
|
3326
|
-
this.app = app;
|
|
3327
2960
|
const parentDom = document.createElement('div');
|
|
3328
2961
|
parentDom.className = 'sse-annotations';
|
|
3329
|
-
|
|
2962
|
+
// over the scene, beneath the ui
|
|
2963
|
+
root.querySelector('.sse-sceneLayer').appendChild(parentDom);
|
|
3330
2964
|
this.parentDom = parentDom;
|
|
3331
|
-
const
|
|
3332
|
-
|
|
3333
|
-
if (hasCameraFrame) {
|
|
3334
|
-
context.hotspotColor.gamma();
|
|
3335
|
-
context.hoverColor.gamma();
|
|
3336
|
-
}
|
|
2965
|
+
const canvas = app.graphicsDevice.canvas;
|
|
2966
|
+
const context = new AnnotationContext(canvas, camera, parentDom);
|
|
3337
2967
|
const parent = new Entity('annotations', app);
|
|
3338
2968
|
app.root.addChild(parent);
|
|
3339
2969
|
this.parent = parent;
|
|
@@ -3352,15 +2982,99 @@ class Annotations {
|
|
|
3352
2982
|
parent.addChild(entity);
|
|
3353
2983
|
scripts.push(script);
|
|
3354
2984
|
script.on('select', () => viewer.selectAnnotation(i));
|
|
3355
|
-
script.on('hover', () => {
|
|
3356
|
-
app.renderNextFrame = true;
|
|
3357
|
-
});
|
|
3358
2985
|
}
|
|
2986
|
+
// Occlusion: a hotspot is either in front of the scene or behind it, never partly
|
|
2987
|
+
// covered. Once the camera has been still for a moment, pick the scene at every hotspot
|
|
2988
|
+
// on screen and fade the ones it covers; while the camera moves they keep their state.
|
|
2989
|
+
// One pick pass per stop, not per frame.
|
|
2990
|
+
let destroyed = false;
|
|
2991
|
+
let settleTimer = null;
|
|
2992
|
+
// bumped on every camera move, so a test that resolves after the camera moved again is
|
|
2993
|
+
// discarded rather than applied to a pose it was not taken from
|
|
2994
|
+
let pose = 0;
|
|
2995
|
+
const lastView = new Mat4();
|
|
2996
|
+
const lastProjection = new Mat4();
|
|
2997
|
+
const testOcclusion = async () => {
|
|
2998
|
+
settleTimer = null;
|
|
2999
|
+
const picker = getPicker();
|
|
3000
|
+
if (destroyed || !picker || parentDom.style.display === 'none')
|
|
3001
|
+
return;
|
|
3002
|
+
const width = canvas.clientWidth;
|
|
3003
|
+
const height = canvas.clientHeight;
|
|
3004
|
+
const targets = scripts.filter(({ screen }) => {
|
|
3005
|
+
return screen && screen.x >= 0 && screen.x < width && screen.y >= 0 && screen.y < height;
|
|
3006
|
+
});
|
|
3007
|
+
if (targets.length === 0)
|
|
3008
|
+
return;
|
|
3009
|
+
const testedPose = pose;
|
|
3010
|
+
let hits;
|
|
3011
|
+
try {
|
|
3012
|
+
hits = await picker.pickMany(targets.map(({ screen }) => ({ x: screen.x / width, y: screen.y / height })));
|
|
3013
|
+
}
|
|
3014
|
+
catch {
|
|
3015
|
+
// a read-back that failed (a lost device, say): keep the hotspots as they are, and
|
|
3016
|
+
// the next camera stop or content change tests again
|
|
3017
|
+
return;
|
|
3018
|
+
}
|
|
3019
|
+
if (destroyed || testedPose !== pose)
|
|
3020
|
+
return;
|
|
3021
|
+
const cameraPosition = camera.getPosition();
|
|
3022
|
+
targets.forEach((script, i) => {
|
|
3023
|
+
const hit = hits[i];
|
|
3024
|
+
const occluded = !!hit &&
|
|
3025
|
+
hit.alpha >= OCCLUDING_COVERAGE &&
|
|
3026
|
+
cameraPosition.distance(hit.position) < script.screen.distance * (1 - OCCLUSION_TOLERANCE);
|
|
3027
|
+
script.setOccluded(occluded);
|
|
3028
|
+
});
|
|
3029
|
+
};
|
|
3030
|
+
const scheduleOcclusion = () => {
|
|
3031
|
+
if (settleTimer)
|
|
3032
|
+
clearTimeout(settleTimer);
|
|
3033
|
+
settleTimer = setTimeout(testOcclusion, SETTLE_MS);
|
|
3034
|
+
};
|
|
3035
|
+
// after each frame, since the hotspots' screen positions are updated in prerender
|
|
3036
|
+
const onFrameEnd = () => {
|
|
3037
|
+
const { viewMatrix, projectionMatrix } = camera.camera;
|
|
3038
|
+
if (lastView.equals(viewMatrix) && lastProjection.equals(projectionMatrix))
|
|
3039
|
+
return;
|
|
3040
|
+
lastView.copy(viewMatrix);
|
|
3041
|
+
lastProjection.copy(projectionMatrix);
|
|
3042
|
+
pose++;
|
|
3043
|
+
scheduleOcclusion();
|
|
3044
|
+
};
|
|
3045
|
+
app.on('frameend', onFrameEnd);
|
|
3046
|
+
// The scene can change under a still camera: finer detail streams in after the reveal,
|
|
3047
|
+
// and after every move. The engine reports each frame whether all the detail it wants is
|
|
3048
|
+
// resident; when that turns true, new content has landed, so drop the picker's cached
|
|
3049
|
+
// render (it only knows about the camera) and test again.
|
|
3050
|
+
const gsplatSystem = app.systems.gsplat;
|
|
3051
|
+
let contentReady = false;
|
|
3052
|
+
const onFrameReady = (frameCamera, _layer, ready) => {
|
|
3053
|
+
if (frameCamera !== camera.camera)
|
|
3054
|
+
return;
|
|
3055
|
+
if (ready && !contentReady) {
|
|
3056
|
+
getPicker()?.invalidate();
|
|
3057
|
+
pose++;
|
|
3058
|
+
scheduleOcclusion();
|
|
3059
|
+
}
|
|
3060
|
+
contentReady = ready;
|
|
3061
|
+
};
|
|
3062
|
+
gsplatSystem.on('frame:ready', onFrameReady);
|
|
3063
|
+
this.removeOcclusion = () => {
|
|
3064
|
+
destroyed = true;
|
|
3065
|
+
if (settleTimer)
|
|
3066
|
+
clearTimeout(settleTimer);
|
|
3067
|
+
app.off('frameend', onFrameEnd);
|
|
3068
|
+
gsplatSystem.off('frame:ready', onFrameReady);
|
|
3069
|
+
};
|
|
3359
3070
|
const update = () => {
|
|
3360
3071
|
const firstPersonGamingControls = (state.cameraMode === 'walk' || state.cameraMode === 'fly') && state.gamingControls;
|
|
3361
3072
|
const hidden = !state.loaded || !state.showAnnotations || state.controlsHidden || firstPersonGamingControls;
|
|
3073
|
+
const wasHidden = parentDom.style.display === 'none';
|
|
3362
3074
|
parentDom.style.display = hidden ? 'none' : 'block';
|
|
3363
|
-
|
|
3075
|
+
// hotspots coming back may have been covered or uncovered while hidden
|
|
3076
|
+
if (wasHidden && !hidden)
|
|
3077
|
+
scheduleOcclusion();
|
|
3364
3078
|
const selected = hidden || state.selectedAnnotation === null ? null : scripts[state.selectedAnnotation];
|
|
3365
3079
|
if (selected !== context.activeAnnotation) {
|
|
3366
3080
|
context.activeAnnotation?.hideTooltip();
|
|
@@ -3388,12 +3102,8 @@ class Annotations {
|
|
|
3388
3102
|
for (const subscription of this.subscriptions)
|
|
3389
3103
|
subscription.off();
|
|
3390
3104
|
this.removeClick();
|
|
3105
|
+
this.removeOcclusion();
|
|
3391
3106
|
this.parent.destroy();
|
|
3392
|
-
clearTimeout(this.context.hideTimeout);
|
|
3393
|
-
const { camera, layers } = this.context;
|
|
3394
|
-
camera.camera.layers = camera.camera.layers.filter((id) => !layers.some((layer) => layer.id === id));
|
|
3395
|
-
for (const layer of layers)
|
|
3396
|
-
this.app.scene.layers.remove(layer);
|
|
3397
3107
|
this.parentDom.remove();
|
|
3398
3108
|
}
|
|
3399
3109
|
}
|
|
@@ -3447,6 +3157,272 @@ const initCameraControls = (viewer, root) => {
|
|
|
3447
3157
|
};
|
|
3448
3158
|
};
|
|
3449
3159
|
|
|
3160
|
+
// Whether the panel is open. New users see it open; once they close it, it stays closed.
|
|
3161
|
+
const OPEN_KEY = 'controlsPanelOpen';
|
|
3162
|
+
const readOpen = () => {
|
|
3163
|
+
try {
|
|
3164
|
+
return localStorage.getItem(OPEN_KEY) !== 'false';
|
|
3165
|
+
}
|
|
3166
|
+
catch {
|
|
3167
|
+
// Embedded documents can be denied storage.
|
|
3168
|
+
return true;
|
|
3169
|
+
}
|
|
3170
|
+
};
|
|
3171
|
+
const writeOpen = (open) => {
|
|
3172
|
+
try {
|
|
3173
|
+
localStorage.setItem(OPEN_KEY, String(open));
|
|
3174
|
+
}
|
|
3175
|
+
catch {
|
|
3176
|
+
// Storage may be blocked or full; the choice still holds for this viewer.
|
|
3177
|
+
}
|
|
3178
|
+
};
|
|
3179
|
+
const key = (label) => ({ kind: 'key', label });
|
|
3180
|
+
const mouse = (button, suffix) => ({ kind: 'mouse', button, suffix });
|
|
3181
|
+
// one line of keycaps rather than the studio's two-row cluster, so every row is the same height
|
|
3182
|
+
const wasd = ['W', 'A', 'S', 'D'].map(key);
|
|
3183
|
+
const or = { kind: 'or' };
|
|
3184
|
+
// mouse outline with the pressed button filled, after the studio's navigation guide
|
|
3185
|
+
const mouseButtonPaths = {
|
|
3186
|
+
left: '<path class="sse-mouseActive" d="M1 9a8 8 0 0 1 8-8v8Z"/>',
|
|
3187
|
+
right: '<path class="sse-mouseActive" d="M17 9a8 8 0 0 0-8-8v8Z"/>',
|
|
3188
|
+
wheel: '<rect class="sse-mouseActive" x="7.5" y="3.5" width="3" height="6" rx="1.5"/>',
|
|
3189
|
+
none: ''
|
|
3190
|
+
};
|
|
3191
|
+
const mouseSvg = (button) => '<svg class="sse-mouseIcon" viewBox="0 0 18 26" aria-hidden="true">' +
|
|
3192
|
+
`${mouseButtonPaths[button]}` +
|
|
3193
|
+
'<rect class="sse-mouseBody" x="1" y="1" width="16" height="24" rx="8"/>' +
|
|
3194
|
+
'<path class="sse-mouseSplit" d="M9 1v8M1 9h16"/>' +
|
|
3195
|
+
'</svg>';
|
|
3196
|
+
const dragSvg = '<svg class="sse-dragIcon" viewBox="0 0 12 12" aria-hidden="true">' +
|
|
3197
|
+
'<path d="M6 1v10M1 6h10M4 3l2-2 2 2M4 9l2 2 2-2M3 4 1 6l2 2M9 4l2 2-2 2"/>' +
|
|
3198
|
+
'</svg>';
|
|
3199
|
+
const titles = {
|
|
3200
|
+
orbit: 'help.section.orbit',
|
|
3201
|
+
fly: 'help.section.fly',
|
|
3202
|
+
walk: 'help.section.walk',
|
|
3203
|
+
anim: 'help.section.anim'
|
|
3204
|
+
};
|
|
3205
|
+
const icons = {
|
|
3206
|
+
orbit: '#orbitIcon',
|
|
3207
|
+
fly: '#flyIcon',
|
|
3208
|
+
walk: '#walkIcon',
|
|
3209
|
+
anim: '#playIcon'
|
|
3210
|
+
};
|
|
3211
|
+
// gaming controls (mouse capture on desktop, the joystick on touch) only apply to fly and walk
|
|
3212
|
+
const isGaming = (state) => state.gamingControls && (state.cameraMode === 'fly' || state.cameraMode === 'walk');
|
|
3213
|
+
// the controls for the viewer's current camera mode, input mode and gaming controls; no rows
|
|
3214
|
+
// where there is nothing to list. Each list keeps the mouse rows together ahead of the keys
|
|
3215
|
+
const describe = (state, localize) => {
|
|
3216
|
+
const { cameraMode } = state;
|
|
3217
|
+
const gaming = isGaming(state);
|
|
3218
|
+
const space = key(localize('help.key.space'));
|
|
3219
|
+
const esc = key(localize('help.key.esc'));
|
|
3220
|
+
const runSlow = ['run-slow', key('Shift'), or, key('Ctrl')];
|
|
3221
|
+
const reset = ['reset-camera', key('R')];
|
|
3222
|
+
const gesture = (name) => ({ kind: 'gesture', label: localize(`help.key.${name}`) });
|
|
3223
|
+
let rows;
|
|
3224
|
+
if (state.inputMode === 'desktop') {
|
|
3225
|
+
switch (cameraMode) {
|
|
3226
|
+
case 'orbit':
|
|
3227
|
+
rows = [
|
|
3228
|
+
['orbit', mouse('left', 'drag')],
|
|
3229
|
+
['pan', mouse('right', 'drag')],
|
|
3230
|
+
['zoom', mouse('wheel')],
|
|
3231
|
+
['set-focus', mouse('left')],
|
|
3232
|
+
['fly-to-point', mouse('left', 'double')],
|
|
3233
|
+
['frame-scene', key('F')],
|
|
3234
|
+
reset
|
|
3235
|
+
];
|
|
3236
|
+
break;
|
|
3237
|
+
case 'fly':
|
|
3238
|
+
rows = gaming
|
|
3239
|
+
? [
|
|
3240
|
+
['look-around', mouse('none', 'drag')],
|
|
3241
|
+
['move', ...wasd],
|
|
3242
|
+
['vertical', key('Q'), key('E')],
|
|
3243
|
+
runSlow,
|
|
3244
|
+
reset,
|
|
3245
|
+
['release-mouse', esc]
|
|
3246
|
+
]
|
|
3247
|
+
: [
|
|
3248
|
+
['fly-to', mouse('left')],
|
|
3249
|
+
['look-around', mouse('left', 'drag')],
|
|
3250
|
+
['pan', mouse('right', 'drag')],
|
|
3251
|
+
['focus-point', mouse('left', 'double')],
|
|
3252
|
+
['move', ...wasd],
|
|
3253
|
+
runSlow,
|
|
3254
|
+
reset
|
|
3255
|
+
];
|
|
3256
|
+
break;
|
|
3257
|
+
case 'walk':
|
|
3258
|
+
rows = gaming
|
|
3259
|
+
? [
|
|
3260
|
+
['look-around', mouse('none', 'drag')],
|
|
3261
|
+
['move', ...wasd],
|
|
3262
|
+
['jump', space],
|
|
3263
|
+
runSlow,
|
|
3264
|
+
reset,
|
|
3265
|
+
['release-mouse', esc]
|
|
3266
|
+
]
|
|
3267
|
+
: [
|
|
3268
|
+
['walk-to', mouse('left')],
|
|
3269
|
+
['look-around', mouse('left', 'drag')],
|
|
3270
|
+
['fly-to-point', mouse('left', 'double')],
|
|
3271
|
+
['move', ...wasd],
|
|
3272
|
+
runSlow,
|
|
3273
|
+
reset,
|
|
3274
|
+
['exit-walk', esc]
|
|
3275
|
+
];
|
|
3276
|
+
break;
|
|
3277
|
+
case 'anim':
|
|
3278
|
+
rows = [
|
|
3279
|
+
['play-pause', space],
|
|
3280
|
+
['exit-cancel', esc]
|
|
3281
|
+
];
|
|
3282
|
+
break;
|
|
3283
|
+
}
|
|
3284
|
+
// not while the mouse is captured, where the ui closes the info box as soon as it opens
|
|
3285
|
+
if (!gaming) {
|
|
3286
|
+
rows.push(null, ['toggle-controls', key('H')], ['toggle-help', key('Shift'), key('H')]);
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
else {
|
|
3290
|
+
switch (cameraMode) {
|
|
3291
|
+
case 'orbit':
|
|
3292
|
+
rows = [
|
|
3293
|
+
['orbit', gesture('one-finger-drag')],
|
|
3294
|
+
['pan', gesture('two-finger-drag')],
|
|
3295
|
+
['zoom', gesture('pinch')],
|
|
3296
|
+
['set-focus', gesture('tap')],
|
|
3297
|
+
['fly-to-point', gesture('double-tap')]
|
|
3298
|
+
];
|
|
3299
|
+
break;
|
|
3300
|
+
case 'fly':
|
|
3301
|
+
rows = gaming
|
|
3302
|
+
? [
|
|
3303
|
+
['look-around', gesture('touch-drag')],
|
|
3304
|
+
['move', gesture('joystick')]
|
|
3305
|
+
]
|
|
3306
|
+
: [
|
|
3307
|
+
['fly-to', gesture('tap')],
|
|
3308
|
+
['look-around', gesture('touch-drag')],
|
|
3309
|
+
['move', gesture('pinch-two-finger')],
|
|
3310
|
+
['focus-point', gesture('double-tap')]
|
|
3311
|
+
];
|
|
3312
|
+
break;
|
|
3313
|
+
case 'walk':
|
|
3314
|
+
rows = gaming
|
|
3315
|
+
? [
|
|
3316
|
+
['look-around', gesture('touch-drag')],
|
|
3317
|
+
['move', gesture('joystick')],
|
|
3318
|
+
['jump', gesture('tap')]
|
|
3319
|
+
]
|
|
3320
|
+
: [
|
|
3321
|
+
['walk-to', gesture('tap')],
|
|
3322
|
+
['look-around', gesture('touch-drag')],
|
|
3323
|
+
['fly-to-point', gesture('double-tap')]
|
|
3324
|
+
];
|
|
3325
|
+
break;
|
|
3326
|
+
case 'anim':
|
|
3327
|
+
// the animation has no touch controls of its own: any touch takes over
|
|
3328
|
+
rows = [];
|
|
3329
|
+
break;
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
return {
|
|
3333
|
+
title: localize(titles[cameraMode]),
|
|
3334
|
+
subtitle: gaming ? localize('settings.gaming-controls') : '',
|
|
3335
|
+
icon: icons[cameraMode],
|
|
3336
|
+
rows
|
|
3337
|
+
};
|
|
3338
|
+
};
|
|
3339
|
+
const renderToken = (token) => {
|
|
3340
|
+
const span = (className, text) => {
|
|
3341
|
+
const element = document.createElement('span');
|
|
3342
|
+
element.className = className;
|
|
3343
|
+
if (text)
|
|
3344
|
+
element.textContent = text;
|
|
3345
|
+
return element;
|
|
3346
|
+
};
|
|
3347
|
+
const kbd = (label) => {
|
|
3348
|
+
const element = document.createElement('kbd');
|
|
3349
|
+
element.className = 'sse-key';
|
|
3350
|
+
element.textContent = label;
|
|
3351
|
+
return element;
|
|
3352
|
+
};
|
|
3353
|
+
switch (token.kind) {
|
|
3354
|
+
case 'key':
|
|
3355
|
+
return kbd(token.label);
|
|
3356
|
+
case 'mouse': {
|
|
3357
|
+
const element = span('sse-mouse');
|
|
3358
|
+
// the mouse comes last, so every mouse lines up in the right-hand column like the
|
|
3359
|
+
// single keycaps. Constant markup only: nothing localized or external reaches innerHTML
|
|
3360
|
+
element.innerHTML = (token.suffix === 'drag' ? dragSvg : '') + mouseSvg(token.button);
|
|
3361
|
+
if (token.suffix === 'double')
|
|
3362
|
+
element.prepend(span('sse-mouseCount', '×2'));
|
|
3363
|
+
return element;
|
|
3364
|
+
}
|
|
3365
|
+
case 'gesture':
|
|
3366
|
+
return span('sse-gesture', token.label);
|
|
3367
|
+
case 'or':
|
|
3368
|
+
return span('sse-or', '/');
|
|
3369
|
+
}
|
|
3370
|
+
};
|
|
3371
|
+
/**
|
|
3372
|
+
* Fills the controls panel with the current camera mode and its controls, following the camera
|
|
3373
|
+
* mode, input mode and gaming controls (mouse capture on desktop). Opening and closing belong to
|
|
3374
|
+
* ui.ts, which toggles it from the toolbar like the settings and info panels.
|
|
3375
|
+
*/
|
|
3376
|
+
const initControlsHint = (viewer, root, localize) => {
|
|
3377
|
+
const { state, events } = viewer;
|
|
3378
|
+
const icon = root.querySelector('.sse-controlsHintIcon > use');
|
|
3379
|
+
const title = root.querySelector('.sse-controlsHintTitle');
|
|
3380
|
+
const subtitle = root.querySelector('.sse-controlsHintSubtitle');
|
|
3381
|
+
const rowsElement = root.querySelector('.sse-controlsHintRows');
|
|
3382
|
+
let rendered = '';
|
|
3383
|
+
const render = (hint) => {
|
|
3384
|
+
icon.setAttribute('href', hint.icon);
|
|
3385
|
+
title.textContent = hint.title;
|
|
3386
|
+
subtitle.textContent = hint.subtitle;
|
|
3387
|
+
rowsElement.replaceChildren(...hint.rows.map((row) => {
|
|
3388
|
+
const element = document.createElement('div');
|
|
3389
|
+
if (!row) {
|
|
3390
|
+
element.className = 'sse-divider';
|
|
3391
|
+
return element;
|
|
3392
|
+
}
|
|
3393
|
+
const [action, ...tokens] = row;
|
|
3394
|
+
const name = document.createElement('span');
|
|
3395
|
+
name.className = 'sse-controlsHintAction';
|
|
3396
|
+
name.textContent = localize(`help.action.${action}`);
|
|
3397
|
+
const inputs = document.createElement('span');
|
|
3398
|
+
inputs.className = 'sse-controlsHintInputs';
|
|
3399
|
+
inputs.append(...tokens.map(renderToken));
|
|
3400
|
+
element.className = 'sse-controlsHintItem';
|
|
3401
|
+
element.append(name, inputs);
|
|
3402
|
+
return element;
|
|
3403
|
+
}));
|
|
3404
|
+
};
|
|
3405
|
+
// re-render when the page changes; a state change that leaves it as it was (G in orbit)
|
|
3406
|
+
// renders nothing
|
|
3407
|
+
const update = () => {
|
|
3408
|
+
const signature = `${state.cameraMode}:${state.inputMode}:${isGaming(state)}`;
|
|
3409
|
+
if (signature !== rendered) {
|
|
3410
|
+
rendered = signature;
|
|
3411
|
+
render(describe(state, localize));
|
|
3412
|
+
}
|
|
3413
|
+
};
|
|
3414
|
+
const subscriptions = [
|
|
3415
|
+
events.on('cameraMode:changed', update),
|
|
3416
|
+
events.on('inputMode:changed', update),
|
|
3417
|
+
events.on('gamingControls:changed', update)
|
|
3418
|
+
];
|
|
3419
|
+
update();
|
|
3420
|
+
return () => {
|
|
3421
|
+
for (const subscription of subscriptions)
|
|
3422
|
+
subscription.off();
|
|
3423
|
+
};
|
|
3424
|
+
};
|
|
3425
|
+
|
|
3450
3426
|
const initFullscreenControls = (viewer, root) => {
|
|
3451
3427
|
const enter = root.querySelector('.sse-enterFullscreen');
|
|
3452
3428
|
const exit = root.querySelector('.sse-exitFullscreen');
|
|
@@ -3791,10 +3767,22 @@ const initPoster = (root, image, events) => {
|
|
|
3791
3767
|
};
|
|
3792
3768
|
events.on('progress:changed', blur);
|
|
3793
3769
|
};
|
|
3770
|
+
// the gpu the renderer runs on, as the browser names it: the WebGPU adapter's description,
|
|
3771
|
+
// or WebGL's unmasked renderer string. Empty where the browser withholds it
|
|
3772
|
+
const getGpuName = (device) => {
|
|
3773
|
+
const { gpuAdapter, unmaskedRenderer } = device;
|
|
3774
|
+
const info = gpuAdapter?.info;
|
|
3775
|
+
if (info) {
|
|
3776
|
+
return info.description || [info.vendor, info.architecture, info.device].filter(Boolean).join(' / ');
|
|
3777
|
+
}
|
|
3778
|
+
return unmaskedRenderer ?? '';
|
|
3779
|
+
};
|
|
3794
3780
|
// Returns a function that removes the listeners added outside the ui subtree (window,
|
|
3795
3781
|
// document, screen) and cancels pending timers. Listeners on the subtree's own elements are
|
|
3796
3782
|
// released with the elements.
|
|
3797
|
-
|
|
3783
|
+
// `getPicker` returns the viewer's picker once the scene has loaded, for the annotation
|
|
3784
|
+
// occlusion test
|
|
3785
|
+
const initUI = (global, viewer, getPicker) => {
|
|
3798
3786
|
const { root, localize } = global;
|
|
3799
3787
|
const { events, state } = viewer;
|
|
3800
3788
|
const disposers = [];
|
|
@@ -3805,17 +3793,20 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
3805
3793
|
// Acquire Elements
|
|
3806
3794
|
const dom = [
|
|
3807
3795
|
'ui',
|
|
3796
|
+
'sceneLayer',
|
|
3808
3797
|
'controlsWrap',
|
|
3798
|
+
'annotationNav',
|
|
3809
3799
|
'arMode',
|
|
3810
3800
|
'vrMode',
|
|
3811
3801
|
'enterFullscreen',
|
|
3812
3802
|
'exitFullscreen',
|
|
3813
3803
|
'info',
|
|
3814
3804
|
'infoPanel',
|
|
3815
|
-
'
|
|
3816
|
-
'
|
|
3817
|
-
'
|
|
3818
|
-
'
|
|
3805
|
+
'infoClose',
|
|
3806
|
+
'infoShortcuts',
|
|
3807
|
+
'rendererName',
|
|
3808
|
+
'gpuName',
|
|
3809
|
+
'engineVersionLabel',
|
|
3819
3810
|
'buttonContainer',
|
|
3820
3811
|
'play',
|
|
3821
3812
|
'pause',
|
|
@@ -3827,48 +3818,47 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
3827
3818
|
'performanceModeRow',
|
|
3828
3819
|
'performanceModeCheck',
|
|
3829
3820
|
'performanceModeOption',
|
|
3830
|
-
'gamingControlsDivider',
|
|
3831
3821
|
'gamingControlsRow',
|
|
3832
3822
|
'gamingControlsCheck',
|
|
3833
3823
|
'gamingControlsOption',
|
|
3834
|
-
'
|
|
3835
|
-
'
|
|
3836
|
-
'
|
|
3837
|
-
'desktopGamingControls',
|
|
3838
|
-
'touchFlyClickToWalk',
|
|
3839
|
-
'touchFlyGamingControls',
|
|
3840
|
-
'touchClickToWalk',
|
|
3841
|
-
'touchGamingControls',
|
|
3842
|
-
'walkHint',
|
|
3824
|
+
'controlsButton',
|
|
3825
|
+
'controlsHint',
|
|
3826
|
+
'controlsHintClose',
|
|
3843
3827
|
'reset',
|
|
3844
3828
|
'frame',
|
|
3845
3829
|
'loadingWrap',
|
|
3846
3830
|
'loadingText',
|
|
3847
3831
|
'loadingBar',
|
|
3848
|
-
'
|
|
3849
|
-
'
|
|
3832
|
+
'showCollisionRow',
|
|
3833
|
+
'showCollisionCheck',
|
|
3834
|
+
'showCollisionShortcut',
|
|
3835
|
+
'walkShortcut',
|
|
3836
|
+
'playShortcut',
|
|
3850
3837
|
'tooltip',
|
|
3851
3838
|
'viewerBranding',
|
|
3852
|
-
'viewerTitle',
|
|
3853
3839
|
'appVersionLabel'
|
|
3854
3840
|
].reduce((acc, name) => {
|
|
3855
3841
|
acc[name] = root.querySelector(`.sse-${name}`);
|
|
3856
3842
|
return acc;
|
|
3857
3843
|
}, {});
|
|
3858
|
-
// populate the info
|
|
3844
|
+
// populate the info panel: versions, the renderer and the gpu it runs on
|
|
3859
3845
|
dom.appVersionLabel.textContent = version;
|
|
3846
|
+
dom.engineVersionLabel.textContent = version$1;
|
|
3847
|
+
dom.rendererName.textContent = global.renderer === 'webgpu' ? 'WebGPU' : 'WebGL 2';
|
|
3848
|
+
dom.gpuName.textContent = getGpuName(global.app.graphicsDevice);
|
|
3860
3849
|
// Remove focus from buttons after click so keyboard input isn't captured by the UI
|
|
3861
3850
|
dom.ui.addEventListener('click', () => {
|
|
3862
3851
|
document.activeElement?.blur();
|
|
3863
3852
|
});
|
|
3864
3853
|
// Forward wheel events from UI overlays to the canvas so the camera zooms
|
|
3865
|
-
// instead of the page scrolling (e.g. annotation nav, tooltips,
|
|
3854
|
+
// instead of the page scrolling (e.g. annotation nav, tooltips), and from the
|
|
3855
|
+
// scene layer beside the ui (the annotation hotspots), which the ui does not contain.
|
|
3866
3856
|
// The non-standard wheelDelta{X,Y} properties aren't part of WheelEventInit,
|
|
3867
3857
|
// so they get dropped by `new WheelEvent(type, init)`. We re-attach them so
|
|
3868
3858
|
// the trackpad-vs-mouse classifier in input-controller.ts behaves the same
|
|
3869
3859
|
// whether the event originated on the canvas or was forwarded from the UI.
|
|
3870
3860
|
const canvas = global.app.graphicsDevice.canvas;
|
|
3871
|
-
|
|
3861
|
+
const forwardWheel = (event) => {
|
|
3872
3862
|
event.preventDefault();
|
|
3873
3863
|
const forwarded = new WheelEvent(event.type, event);
|
|
3874
3864
|
const src = event;
|
|
@@ -3878,7 +3868,11 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
3878
3868
|
}
|
|
3879
3869
|
}
|
|
3880
3870
|
canvas.dispatchEvent(forwarded);
|
|
3881
|
-
}
|
|
3871
|
+
};
|
|
3872
|
+
// both are the canvas's siblings, so a forwarded event cannot bubble back into either
|
|
3873
|
+
for (const layer of [dom.ui, dom.sceneLayer]) {
|
|
3874
|
+
layer.addEventListener('wheel', forwardWheel, { passive: false });
|
|
3875
|
+
}
|
|
3882
3876
|
// Handle loading progress updates
|
|
3883
3877
|
const updateLoadingProgress = (progress) => {
|
|
3884
3878
|
dom.loadingText.textContent = `${progress}%`;
|
|
@@ -3910,122 +3904,217 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
3910
3904
|
});
|
|
3911
3905
|
const updateGamingSettingsVisibility = () => {
|
|
3912
3906
|
const isDesktop = state.inputMode === 'desktop';
|
|
3913
|
-
dom.gamingControlsDivider.classList.toggle('sse-hidden', isDesktop);
|
|
3914
3907
|
dom.gamingControlsRow.classList.toggle('sse-hidden', isDesktop);
|
|
3915
3908
|
};
|
|
3916
3909
|
on('inputMode:changed', updateGamingSettingsVisibility);
|
|
3917
3910
|
updateGamingSettingsVisibility();
|
|
3918
3911
|
const updateGamingControls = () => {
|
|
3919
3912
|
dom.gamingControlsCheck.classList.toggle('sse-active', state.gamingControls);
|
|
3920
|
-
dom.desktopFlyClickToFly.classList.toggle('sse-hidden', state.gamingControls);
|
|
3921
|
-
dom.desktopFlyGamingControls.classList.toggle('sse-hidden', !state.gamingControls);
|
|
3922
|
-
dom.desktopClickToWalk.classList.toggle('sse-hidden', state.gamingControls);
|
|
3923
|
-
dom.desktopGamingControls.classList.toggle('sse-hidden', !state.gamingControls);
|
|
3924
|
-
dom.touchFlyClickToWalk.classList.toggle('sse-hidden', state.gamingControls);
|
|
3925
|
-
dom.touchFlyGamingControls.classList.toggle('sse-hidden', !state.gamingControls);
|
|
3926
|
-
dom.touchClickToWalk.classList.toggle('sse-hidden', state.gamingControls);
|
|
3927
|
-
dom.touchGamingControls.classList.toggle('sse-hidden', !state.gamingControls);
|
|
3928
3913
|
};
|
|
3929
3914
|
on('gamingControls:changed', updateGamingControls);
|
|
3930
|
-
on('inputMode:changed', updateGamingControls);
|
|
3931
3915
|
updateGamingControls();
|
|
3932
|
-
//
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3916
|
+
// The settings, controls and info buttons are toggles: each shows active while its panel is
|
|
3917
|
+
// open. Every open and close goes through these so the two cannot disagree.
|
|
3918
|
+
const isVisible = (panel) => !panel.classList.contains('sse-hidden');
|
|
3919
|
+
// The controls panel and the settings panel share the space above the toolbar. The controls
|
|
3920
|
+
// panel's open state is the user's choice and persists: it stays open while the scene is used,
|
|
3921
|
+
// and shows once the scene has loaded. Settings is a quick look, so while it is open it only
|
|
3922
|
+
// stands in for the controls panel, which comes back when it closes.
|
|
3923
|
+
let controlsOpen = readOpen();
|
|
3924
|
+
const applyControls = () => {
|
|
3925
|
+
const visible = controlsOpen && state.loaded && !isVisible(dom.settingsPanel);
|
|
3926
|
+
dom.controlsHint.classList.toggle('sse-hidden', !visible);
|
|
3927
|
+
dom.controlsButton.classList.toggle('sse-active', visible);
|
|
3928
|
+
};
|
|
3929
|
+
const showSettings = (visible) => {
|
|
3930
|
+
dom.settingsPanel.classList.toggle('sse-hidden', !visible);
|
|
3931
|
+
dom.settings.classList.toggle('sse-active', visible);
|
|
3932
|
+
applyControls();
|
|
3933
|
+
};
|
|
3934
|
+
// the toolbar button toggles what it shows, so opening the panel from under settings
|
|
3935
|
+
// closes settings rather than leaving the panel open and unseen
|
|
3936
|
+
const showControls = (open) => {
|
|
3937
|
+
controlsOpen = open;
|
|
3938
|
+
writeOpen(open);
|
|
3939
|
+
if (open)
|
|
3940
|
+
showSettings(false);
|
|
3941
|
+
applyControls();
|
|
3946
3942
|
};
|
|
3947
|
-
|
|
3948
|
-
|
|
3943
|
+
on('loaded:changed', applyControls);
|
|
3944
|
+
applyControls();
|
|
3945
|
+
// clicks rather than input events, so they restart the fade timer themselves
|
|
3946
|
+
const toggleControls = () => showControls(!isVisible(dom.controlsHint));
|
|
3947
|
+
dom.controlsButton.addEventListener('click', () => {
|
|
3948
|
+
toggleControls();
|
|
3949
|
+
showUI();
|
|
3949
3950
|
});
|
|
3950
|
-
dom.
|
|
3951
|
-
|
|
3951
|
+
dom.controlsHintClose.addEventListener('click', () => {
|
|
3952
|
+
showControls(false);
|
|
3953
|
+
showUI();
|
|
3952
3954
|
});
|
|
3953
|
-
const
|
|
3954
|
-
|
|
3955
|
-
|
|
3955
|
+
const showInfo = (visible) => {
|
|
3956
|
+
// the shortcuts are keyboard shortcuts, and list only what this scene offers, as the
|
|
3957
|
+
// toolbar does: walk needs collision, play needs an animation
|
|
3958
|
+
dom.infoShortcuts.classList.toggle('sse-hidden', state.inputMode !== 'desktop');
|
|
3959
|
+
dom.walkShortcut.classList.toggle('sse-hidden', !state.walkAllowed);
|
|
3960
|
+
dom.playShortcut.classList.toggle('sse-hidden', !state.hasAnimation);
|
|
3961
|
+
dom.infoPanel.classList.toggle('sse-hidden', !visible);
|
|
3962
|
+
dom.info.classList.toggle('sse-active', visible);
|
|
3956
3963
|
};
|
|
3957
|
-
|
|
3964
|
+
// Info panel
|
|
3965
|
+
const toggleHelp = () => showInfo(!isVisible(dom.infoPanel));
|
|
3966
|
+
// these close a panel without an input event, so they restart the fade timer themselves
|
|
3967
|
+
dom.info.addEventListener('click', () => {
|
|
3968
|
+
toggleHelp();
|
|
3969
|
+
showUI();
|
|
3970
|
+
});
|
|
3971
|
+
// the panel covers the viewer, so this is also how a second click on the button closes it
|
|
3958
3972
|
dom.infoPanel.addEventListener('pointerdown', () => {
|
|
3959
|
-
|
|
3973
|
+
showInfo(false);
|
|
3974
|
+
showUI();
|
|
3975
|
+
});
|
|
3976
|
+
dom.infoClose.addEventListener('click', () => {
|
|
3977
|
+
showInfo(false);
|
|
3978
|
+
showUI();
|
|
3960
3979
|
});
|
|
3961
3980
|
on('inputEvent', (event) => {
|
|
3962
3981
|
if (event === 'toggleHelp') {
|
|
3963
3982
|
toggleHelp();
|
|
3964
3983
|
}
|
|
3984
|
+
else if (event === 'toggleControls') {
|
|
3985
|
+
toggleControls();
|
|
3986
|
+
}
|
|
3965
3987
|
else if (event === 'cancel') {
|
|
3966
3988
|
// close info panel on cancel
|
|
3967
|
-
|
|
3968
|
-
|
|
3989
|
+
showInfo(false);
|
|
3990
|
+
showSettings(false);
|
|
3969
3991
|
}
|
|
3970
3992
|
else if (event === 'interrupt') {
|
|
3971
|
-
|
|
3993
|
+
showSettings(false);
|
|
3972
3994
|
}
|
|
3973
3995
|
});
|
|
3974
|
-
//
|
|
3996
|
+
// after 3 seconds of inactivity the controls dim, then hide 2.5 seconds later
|
|
3975
3997
|
on('controlsHidden:changed', (value) => {
|
|
3976
3998
|
dom.controlsWrap.classList.toggle('sse-faded-out', value);
|
|
3977
3999
|
dom.controlsWrap.classList.toggle('sse-faded-in', !value);
|
|
3978
4000
|
});
|
|
3979
4001
|
// show the ui and start a timer to hide it again
|
|
3980
4002
|
let uiTimeout = null;
|
|
4003
|
+
// the controls dim for a moment before hiding, both when idle and when the mouse is
|
|
4004
|
+
// captured, so they are seen to be going rather than vanishing at once
|
|
4005
|
+
let dimTimeout = null;
|
|
4006
|
+
// the pointer is over the controls: hold them up, and restart the timer on leaving
|
|
4007
|
+
let hovering = false;
|
|
3981
4008
|
disposers.push(() => {
|
|
3982
4009
|
if (uiTimeout) {
|
|
3983
4010
|
clearTimeout(uiTimeout);
|
|
3984
4011
|
uiTimeout = null;
|
|
3985
4012
|
}
|
|
4013
|
+
if (dimTimeout) {
|
|
4014
|
+
clearTimeout(dimTimeout);
|
|
4015
|
+
dimTimeout = null;
|
|
4016
|
+
}
|
|
3986
4017
|
});
|
|
3987
4018
|
const isPointerCapturedMode = () => state.inputMode === 'desktop' &&
|
|
3988
4019
|
state.gamingControls &&
|
|
3989
4020
|
(state.cameraMode === 'walk' || state.cameraMode === 'fly');
|
|
4021
|
+
const setDimmed = (dimmed) => {
|
|
4022
|
+
dom.controlsWrap.classList.toggle('sse-dimmed', dimmed);
|
|
4023
|
+
dom.annotationNav.classList.toggle('sse-dimmed', dimmed);
|
|
4024
|
+
};
|
|
4025
|
+
const clearDim = () => {
|
|
4026
|
+
if (dimTimeout) {
|
|
4027
|
+
clearTimeout(dimTimeout);
|
|
4028
|
+
dimTimeout = null;
|
|
4029
|
+
}
|
|
4030
|
+
setDimmed(false);
|
|
4031
|
+
};
|
|
3990
4032
|
const hideUI = () => {
|
|
3991
4033
|
if (uiTimeout) {
|
|
3992
4034
|
clearTimeout(uiTimeout);
|
|
3993
4035
|
uiTimeout = null;
|
|
3994
4036
|
}
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
4037
|
+
clearDim();
|
|
4038
|
+
hovering = false;
|
|
4039
|
+
showInfo(false);
|
|
4040
|
+
showSettings(false);
|
|
3998
4041
|
state.controlsHidden = true;
|
|
3999
4042
|
};
|
|
4043
|
+
// controlsHidden stays false while dimmed, so a host reading it sees dimmed controls as
|
|
4044
|
+
// shown; it turns true only once they are gone
|
|
4045
|
+
const dimThenHide = () => {
|
|
4046
|
+
clearDim();
|
|
4047
|
+
setDimmed(true);
|
|
4048
|
+
dimTimeout = setTimeout(hideUI, 2500);
|
|
4049
|
+
};
|
|
4050
|
+
// entering capture: the controls stay, dimmed, then hide
|
|
4051
|
+
const dimUI = () => {
|
|
4052
|
+
if (uiTimeout) {
|
|
4053
|
+
clearTimeout(uiTimeout);
|
|
4054
|
+
uiTimeout = null;
|
|
4055
|
+
}
|
|
4056
|
+
showInfo(false);
|
|
4057
|
+
showSettings(false);
|
|
4058
|
+
state.controlsHidden = false;
|
|
4059
|
+
dimThenHide();
|
|
4060
|
+
};
|
|
4000
4061
|
const showUI = () => {
|
|
4001
4062
|
if (isPointerCapturedMode()) {
|
|
4002
|
-
|
|
4063
|
+
// input while captured (mouse look fires it constantly) does not bring the controls
|
|
4064
|
+
// back or cut the dim short; it only closes a panel a shortcut may have opened
|
|
4065
|
+
if (dimTimeout) {
|
|
4066
|
+
showInfo(false);
|
|
4067
|
+
showSettings(false);
|
|
4068
|
+
}
|
|
4069
|
+
else {
|
|
4070
|
+
hideUI();
|
|
4071
|
+
}
|
|
4003
4072
|
return;
|
|
4004
4073
|
}
|
|
4005
4074
|
if (uiTimeout) {
|
|
4006
4075
|
clearTimeout(uiTimeout);
|
|
4007
4076
|
}
|
|
4077
|
+
clearDim();
|
|
4008
4078
|
state.controlsHidden = false;
|
|
4009
4079
|
uiTimeout = setTimeout(() => {
|
|
4010
4080
|
uiTimeout = null;
|
|
4081
|
+
// the controls stay while a panel is open or the pointer is over them; closing the
|
|
4082
|
+
// panel or leaving restarts this timer
|
|
4083
|
+
if (hovering || isVisible(dom.settingsPanel) || isVisible(dom.infoPanel) || isVisible(dom.controlsHint)) {
|
|
4084
|
+
return;
|
|
4085
|
+
}
|
|
4011
4086
|
if (state.selectedAnnotation === null || !state.showAnnotations) {
|
|
4012
|
-
|
|
4087
|
+
dimThenHide();
|
|
4013
4088
|
}
|
|
4014
|
-
},
|
|
4089
|
+
}, 3000);
|
|
4015
4090
|
};
|
|
4091
|
+
// entering also restores dimmed controls to full
|
|
4092
|
+
dom.controlsWrap.addEventListener('pointerenter', () => {
|
|
4093
|
+
hovering = true;
|
|
4094
|
+
showUI();
|
|
4095
|
+
});
|
|
4096
|
+
dom.controlsWrap.addEventListener('pointerleave', () => {
|
|
4097
|
+
hovering = false;
|
|
4098
|
+
showUI();
|
|
4099
|
+
});
|
|
4016
4100
|
// Show controls once loaded
|
|
4017
4101
|
on('loaded:changed', () => {
|
|
4018
4102
|
dom.controlsWrap.classList.remove('sse-hidden');
|
|
4019
4103
|
showUI();
|
|
4020
4104
|
});
|
|
4021
4105
|
on('inputEvent', showUI);
|
|
4106
|
+
// dim on entering capture, show on leaving it; any other mode change just shows the controls
|
|
4107
|
+
let wasCaptured = false;
|
|
4022
4108
|
const updateCapturedUI = () => {
|
|
4023
|
-
|
|
4024
|
-
|
|
4109
|
+
const captured = isPointerCapturedMode();
|
|
4110
|
+
if (captured && !wasCaptured) {
|
|
4111
|
+
dimUI();
|
|
4025
4112
|
}
|
|
4026
|
-
else {
|
|
4113
|
+
else if (!captured) {
|
|
4114
|
+
clearDim();
|
|
4027
4115
|
showUI();
|
|
4028
4116
|
}
|
|
4117
|
+
wasCaptured = captured;
|
|
4029
4118
|
};
|
|
4030
4119
|
on('cameraMode:changed', updateCapturedUI);
|
|
4031
4120
|
on('inputMode:changed', updateCapturedUI);
|
|
@@ -4034,51 +4123,30 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4034
4123
|
on('selectedAnnotation:changed', showUI);
|
|
4035
4124
|
disposers.push(initPlayback(viewer, root, showUI));
|
|
4036
4125
|
disposers.push(initCameraControls(viewer, root));
|
|
4126
|
+
disposers.push(initControlsHint(viewer, root, localize));
|
|
4037
4127
|
disposers.push(initFullscreenControls(viewer, root));
|
|
4038
4128
|
disposers.push(initXrControls(viewer, root));
|
|
4039
|
-
//
|
|
4040
|
-
|
|
4041
|
-
const getWalkHintText = () => {
|
|
4042
|
-
if (state.inputMode === 'desktop') {
|
|
4043
|
-
return localize('walk-hint.desktop');
|
|
4044
|
-
}
|
|
4045
|
-
return localize(state.gamingControls ? 'walk-hint.touch-gaming' : 'walk-hint.touch-tap');
|
|
4046
|
-
};
|
|
4047
|
-
on('cameraMode:changed', (value) => {
|
|
4048
|
-
if (value === 'walk' && !walkHintShown && !isPointerCapturedMode()) {
|
|
4049
|
-
walkHintShown = true;
|
|
4050
|
-
dom.walkHint.textContent = getWalkHintText();
|
|
4051
|
-
dom.walkHint.classList.remove('sse-hidden');
|
|
4052
|
-
}
|
|
4053
|
-
else if (value !== 'walk') {
|
|
4054
|
-
dom.walkHint.classList.add('sse-hidden');
|
|
4055
|
-
}
|
|
4056
|
-
});
|
|
4057
|
-
const dismissWalkHint = () => dom.walkHint.classList.add('sse-hidden');
|
|
4058
|
-
dom.walkHint.addEventListener('click', dismissWalkHint);
|
|
4059
|
-
on('inputEvent', (type) => {
|
|
4060
|
-
if (type === 'interrupt')
|
|
4061
|
-
dismissWalkHint();
|
|
4062
|
-
});
|
|
4063
|
-
// Collision overlay toggle + matching help-panel row (only visible when overlay is available)
|
|
4129
|
+
// Collision overlay: a settings row and the matching info-panel shortcut, shown only when
|
|
4130
|
+
// the scene ships an overlay
|
|
4064
4131
|
on('hasCollisionOverlay:changed', (value) => {
|
|
4065
|
-
dom.
|
|
4066
|
-
dom.
|
|
4132
|
+
dom.showCollisionRow.classList.toggle('sse-hidden', !value);
|
|
4133
|
+
dom.showCollisionShortcut.classList.toggle('sse-hidden', !value);
|
|
4067
4134
|
});
|
|
4068
|
-
dom.
|
|
4135
|
+
dom.showCollisionRow.addEventListener('click', () => {
|
|
4069
4136
|
state.collisionOverlayEnabled = !state.collisionOverlayEnabled;
|
|
4070
4137
|
});
|
|
4071
4138
|
on('collisionOverlayEnabled:changed', (value) => {
|
|
4072
|
-
dom.
|
|
4139
|
+
dom.showCollisionCheck.classList.toggle('sse-active', value);
|
|
4073
4140
|
});
|
|
4074
4141
|
dom.settings.addEventListener('click', () => {
|
|
4075
|
-
dom.settingsPanel
|
|
4142
|
+
showSettings(!isVisible(dom.settingsPanel));
|
|
4143
|
+
showUI();
|
|
4076
4144
|
});
|
|
4077
4145
|
// Initialize touch joystick for fly mode
|
|
4078
4146
|
disposers.push(initJoystick(viewer, root));
|
|
4079
4147
|
disposers.push(initAnnotationControls(viewer, root));
|
|
4080
4148
|
if (viewer.annotations.length > 0) {
|
|
4081
|
-
const annotations = new Annotations(viewer, root, global.camera,
|
|
4149
|
+
const annotations = new Annotations(viewer, root, global.camera, getPicker);
|
|
4082
4150
|
disposers.push(() => annotations.destroy());
|
|
4083
4151
|
}
|
|
4084
4152
|
// tooltips
|
|
@@ -4091,9 +4159,9 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4091
4159
|
tooltip.register(dom.fpsCamera, localize('tooltip.walk-mode'), 'top');
|
|
4092
4160
|
tooltip.register(dom.reset, localize('tooltip.reset-camera'), 'bottom');
|
|
4093
4161
|
tooltip.register(dom.frame, localize('tooltip.frame-scene'), 'bottom');
|
|
4094
|
-
tooltip.register(dom.showCollision, localize('tooltip.show-collision'), 'top');
|
|
4095
4162
|
tooltip.register(dom.settings, localize('tooltip.settings'), 'top');
|
|
4096
4163
|
tooltip.register(dom.info, localize('tooltip.help'), 'top');
|
|
4164
|
+
tooltip.register(dom.controlsButton, localize('tooltip.controls'), 'top');
|
|
4097
4165
|
tooltip.register(dom.arMode, localize('tooltip.enter-ar'), 'top');
|
|
4098
4166
|
tooltip.register(dom.vrMode, localize('tooltip.enter-vr'), 'top');
|
|
4099
4167
|
tooltip.register(dom.enterFullscreen, localize('tooltip.fullscreen'), 'top');
|
|
@@ -4114,7 +4182,6 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4114
4182
|
}
|
|
4115
4183
|
dom.viewerBranding.href = viewUrl.toString();
|
|
4116
4184
|
dom.viewerBranding.classList.remove('sse-hidden');
|
|
4117
|
-
dom.viewerTitle.href = viewUrl.toString();
|
|
4118
4185
|
}
|
|
4119
4186
|
return () => {
|
|
4120
4187
|
for (const dispose of disposers) {
|
|
@@ -4123,7 +4190,7 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4123
4190
|
};
|
|
4124
4191
|
};
|
|
4125
4192
|
|
|
4126
|
-
var uiHtml = "\n<canvas></canvas>\n\n<div class=\"sse-ui\">\n <div class=\"sse-poster\"></div>\n\n \n <a class=\"sse-viewerBranding sse-hidden\" target=\"_blank\" rel=\"noopener noreferrer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"64 64 384 384\" role=\"img\" aria-label=\"SuperSplat\">\n <path\n fill=\"#F26722\"\n d=\"M129.83,217c9.75,0,17.64-7.9,17.64-17.64s-7.9-17.64-17.64-17.64-17.64,7.9-17.64,17.64,7.9,17.64,17.64,17.64Z\"\n />\n <path\n fill=\"#F26722\"\n d=\"M388.74,253.94c-12.46,0-22.57,10.11-22.57,22.57s10.11,22.57,22.57,22.57,22.57-10.11,22.57-22.57-10.11-22.57-22.57-22.57h0Z\"\n />\n <path\n fill=\"#F26722\"\n d=\"M345.26,161.1h.02c.37-.05.65-.22.97-.33,16.78-2.32,29.75-16.57,29.75-33.99,0-19.04-15.43-34.46-34.46-34.46s-34.46,15.43-34.46,34.46c0,4.29.88,8.35,2.32,12.14.04.12-.01.25.04.38,10.55,29.18-22.33,23.62-39.07,20.74-.49-.09-.88-.07-1.32-.11-4.27-.56-8.59-.97-13.03-.97-53.93,0-97.64,43.71-97.64,97.64,0,9.84,1.48,19.32,4.2,28.28.04.1,0,.17.05.27,8.97,30.15-14.83,25.49-25.52,25.69-1.04-.13-2.09-.32-3.18-.32-13.51,0-24.45,10.94-24.45,24.45s10.94,24.45,24.45,24.45c11.69,0,21.44-8.22,23.85-19.19h.02c6.31-26.57,25.9-18.02,31.15-12.67.2.2.4.26.59.42,17.44,16.25,40.75,26.26,66.47,26.26.67,0,1.34-.09,2.01-.1.66.01,1.31.04,2.04.04,9.7-.04,17.82,10.91,4.94,29.68h.13c-4.42,6.01-7.1,13.36-7.1,21.41,0,20.09,16.29,36.39,36.39,36.39s36.39-16.29,36.39-36.39c0-15.4-9.61-28.49-23.12-33.81-.32-.15-.61-.29-.98-.45-12.28-4.94-25.43-17.69-6.89-27.1l-.04-.1c31.93-16.06,53.88-49.02,53.88-87.2,0-21.15-6.8-40.68-18.23-56.66-.13-.23-.23-.47-.44-.74-23.15-31.67-2.37-36.07,10.3-38.09h-.01Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M230.79,284.71c0,7.95-6.44,14.38-14.38,14.38s-14.38-6.44-14.38-14.38v-22.95c0-7.95,6.44-14.38,14.38-14.38s14.38,6.44,14.38,14.38v22.95Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M309.78,284.71c0,7.95-6.44,14.38-14.38,14.38s-14.38-6.44-14.38-14.38v-22.95c0-7.95,6.44-14.38,14.38-14.38s14.38,6.44,14.38,14.38v22.95Z\"\n />\n </svg>\n <span>SuperSplat</span>\n </a>\n\n \n <div class=\"sse-loadingWrap\">\n <div class=\"sse-loadingText\"></div>\n <div class=\"sse-loadingBar\"></div>\n </div>\n\n <div class=\"sse-controlsWrap sse-hidden\">\n \n <div class=\"sse-timelineContainer sse-hidden\">\n <div class=\"sse-line\"></div>\n <div class=\"sse-handle\"></div>\n <div class=\"sse-time sse-hidden\">0:00</div>\n </div>\n\n \n <div class=\"sse-buttonsContainer\">\n <div class=\"sse-buttonGroup\">\n <button class=\"sse-play sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#playIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#playIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-pause sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24px\" height=\"24px\">\n <g class=\"sse-stroke\"><use href=\"#pauseIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#pauseIcon\" /></g>\n </svg>\n </button>\n </div>\n\n <div class=\"sse-spacer\"></div>\n\n <div class=\"sse-buttonGroup\">\n <button class=\"sse-orbitCamera sse-controlButton sse-toggle sse-left\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#orbitIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#orbitIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-flyCamera sse-controlButton sse-toggle sse-right\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#flyIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#flyIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-fpsCamera sse-controlButton sse-toggle sse-right sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#walkIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#walkIcon\" /></g>\n </svg>\n </button>\n </div>\n\n <div class=\"sse-buttonGroup\">\n <button class=\"sse-arMode sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#arIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#arIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-vrMode sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#vrIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#vrIcon\" /></g>\n </svg>\n </button>\n\n <button class=\"sse-showCollision sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#voxelIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#voxelIcon\" /></g>\n </svg>\n </button>\n\n <button class=\"sse-info sse-controlButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#infoIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#infoIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-settings sse-controlButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#settingsIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#settingsIcon\" /></g>\n </svg>\n </button>\n\n <button class=\"sse-enterFullscreen sse-controlButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#enterFullscreenIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#enterFullscreenIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-exitFullscreen sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#exitFullscreenIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#exitFullscreenIcon\" /></g>\n </svg>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"sse-walkHint sse-walkHint sse-hidden\"></div>\n\n \n <div class=\"sse-settingsPanel sse-hidden\">\n <div class=\"sse-performanceModeRow sse-settingsRow\">\n <div class=\"sse-performanceModeOption\" data-i18n=\"settings.performance-mode\">Performance Mode</div>\n <div class=\"sse-performanceModeCheck sse-toggleSwitch\">\n <div class=\"sse-toggleTrack\"><div class=\"sse-toggleThumb\"></div></div>\n </div>\n </div>\n <div class=\"sse-gamingControlsDivider sse-divider\"></div>\n <div class=\"sse-gamingControlsRow sse-settingsRow\">\n <div class=\"sse-gamingControlsOption\" data-i18n=\"settings.gaming-controls\">Gaming Controls</div>\n <div class=\"sse-gamingControlsCheck sse-toggleSwitch\">\n <div class=\"sse-toggleTrack\"><div class=\"sse-toggleThumb\"></div></div>\n </div>\n </div>\n <div class=\"sse-annotationsRow sse-settingsRow\">\n <div class=\"sse-annotationsOption\" data-i18n=\"settings.show-annotations\">Show Annotations</div>\n <div class=\"sse-annotationsCheck sse-toggleSwitch sse-active\">\n <div class=\"sse-toggleTrack\"><div class=\"sse-toggleThumb\"></div></div>\n </div>\n </div>\n <div class=\"sse-divider\"></div>\n <div class=\"sse-settingsRow\">\n <button class=\"sse-frame\" data-i18n=\"settings.frame\">Frame</button>\n <button class=\"sse-reset\" data-i18n=\"settings.reset\">Reset</button>\n </div>\n </div>\n\n \n <div class=\"sse-infoPanel sse-hidden\">\n <div class=\"sse-infoPanelContent\" onpointerdown=\"event.stopPropagation()\" onwheel=\"event.stopPropagation()\">\n <a class=\"sse-viewerTitle\" target=\"_blank\" rel=\"noopener noreferrer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 32 32\">\n <g class=\"sse-stroke\"><use href=\"#supersplatIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#supersplatIcon\" /></g>\n </svg>\n <span class=\"sse-title-name\">SuperSplat Viewer</span>\n <span class=\"sse-title-version\">v<span class=\"sse-appVersionLabel\"></span></span>\n </a>\n <div class=\"sse-infoPanels\">\n <div class=\"sse-desktopInfoPanel\">\n <div class=\"sse-control-spacer\"></div>\n <h1 data-i18n=\"help.section.orbit\">Orbit Mode</h1>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.orbit\">Orbit</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.left-click-drag\">Left Click + Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.pan\">Pan</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.right-click-drag\">Right Click + Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.zoom\">Zoom</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.mouse-wheel\">Mouse Wheel</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.set-focus\">Set Focus</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.left-click\">Left Click</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.fly-to-point\">Fly to Point</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.double-click\">Double-click</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.frame-scene\">Frame Scene</span>\n <span class=\"sse-control-key\">F</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.reset-camera\">Reset Camera</span>\n <span class=\"sse-control-key\">R</span>\n </div>\n <div class=\"sse-control-spacer\"></div>\n <h1 data-i18n=\"help.section.fly\">Fly Mode</h1>\n <div class=\"sse-desktopFlyClickToFly\">\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.fly-to\">Fly To</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.left-click\">Left Click</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.look-around\">Look Around</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.left-click-drag\">Left Click + Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.pan\">Pan</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.right-click-drag\"\n >Right Click + Drag</span\n >\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.move\">Move</span>\n <span class=\"sse-control-key\">W,S,A,D</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.run-slow\">Run / Slow</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.shift-ctrl\">Shift / Ctrl</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.focus-point\">Focus Point</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.double-click\">Double-click</span>\n </div>\n </div>\n <div class=\"sse-desktopFlyGamingControls sse-hidden\">\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.look-around\">Look Around</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.mouse\">Mouse</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.move\">Move</span>\n <span class=\"sse-control-key\">W,S,A,D</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.vertical\">Vertical</span>\n <span class=\"sse-control-key\">Q,E</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.run-slow\">Run / Slow</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.shift-ctrl\">Shift / Ctrl</span>\n </div>\n </div>\n <div class=\"sse-control-spacer\"></div>\n <h1 data-i18n=\"help.section.walk\">Walk Mode</h1>\n <div class=\"sse-desktopClickToWalk\">\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.walk-to\">Walk To</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.left-click\">Left Click</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.look-around\">Look Around</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.left-click-drag\">Left Click + Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.run-slow\">Run / Slow</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.shift-ctrl\">Shift / Ctrl</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.fly-to-point\">Fly to Point</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.double-click\">Double-click</span>\n </div>\n </div>\n <div class=\"sse-desktopGamingControls\">\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.look-around\">Look Around</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.mouse\">Mouse</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.move\">Move</span>\n <span class=\"sse-control-key\">W,S,A,D</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.jump\">Jump</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.space\">Space</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.run-slow\">Run / Slow</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.shift-ctrl\">Shift / Ctrl</span>\n </div>\n </div>\n <div class=\"sse-control-spacer\"></div>\n <h1 data-i18n=\"help.section.modes\">Mode Switching</h1>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.orbit-mode\">Orbit Mode</span>\n <span class=\"sse-control-key\">1</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.fly-mode\">Fly Mode</span>\n <span class=\"sse-control-key\">2</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.toggle-walk\">Toggle Walk</span>\n <span class=\"sse-control-key\">3</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.toggle-gaming\"\n >Toggle Gaming Controls</span\n >\n <span class=\"sse-control-key\">G</span>\n </div>\n <div class=\"sse-desktopShowCollisionHelp sse-control-item sse-hidden\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.show-collision\">Show Collision</span>\n <span class=\"sse-control-key\">V</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.play-pause\">Play / Pause</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.space\">Space</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.toggle-help\">Toggle Help</span>\n <span class=\"sse-control-key\">H</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.exit-cancel\">Exit / Cancel</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.esc\">Esc</span>\n </div>\n </div>\n <div class=\"sse-touchInfoPanel sse-hidden\">\n <div class=\"sse-control-spacer\"></div>\n <h1 data-i18n=\"help.section.orbit\">Orbit Mode</h1>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.orbit\">Orbit</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.one-finger-drag\">One Finger Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.pan\">Pan</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.two-finger-drag\">Two Finger Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.zoom\">Zoom</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.pinch\">Pinch</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.set-focus\">Set Focus</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.tap\">Tap</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.fly-to-point\">Fly to Point</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.double-tap\">Double-tap</span>\n </div>\n <div class=\"sse-control-spacer\"></div>\n <h1 data-i18n=\"help.section.fly\">Fly Mode</h1>\n <div class=\"sse-touchFlyClickToWalk\">\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.fly-to\">Fly To</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.tap\">Tap</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.look-around\">Look Around</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.touch-drag\">Touch + Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.move\">Move</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.pinch-two-finger\"\n >Pinch / Two Finger Drag</span\n >\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.focus-point\">Focus Point</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.double-tap\">Double-tap</span>\n </div>\n </div>\n <div class=\"sse-touchFlyGamingControls sse-hidden\">\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.look-around\">Look Around</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.touch-drag\">Touch + Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.move\">Move</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.joystick\">Joystick</span>\n </div>\n </div>\n <div class=\"sse-control-spacer\"></div>\n <h1 data-i18n=\"help.section.walk\">Walk Mode</h1>\n <div class=\"sse-touchClickToWalk\">\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.walk-to\">Walk To</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.tap\">Tap</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.look-around\">Look Around</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.touch-drag\">Touch + Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.fly-to-point\">Fly to Point</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.double-tap\">Double-tap</span>\n </div>\n </div>\n <div class=\"sse-touchGamingControls sse-hidden\">\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.look-around\">Look Around</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.touch-drag\">Touch + Drag</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.move\">Move</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.joystick\">Joystick</span>\n </div>\n <div class=\"sse-control-item\">\n <span class=\"sse-control-action\" data-i18n=\"help.action.jump\">Jump</span>\n <span class=\"sse-control-key\" data-i18n=\"help.key.tap\">Tap</span>\n </div>\n </div>\n </div>\n </div>\n <div class=\"sse-tabs\">\n <div class=\"sse-desktopTab sse-tab sse-active\" data-i18n=\"help.tab.desktop\">Desktop</div>\n <div class=\"sse-touchTab sse-tab\" data-i18n=\"help.tab.touch\">Touch</div>\n </div>\n </div>\n </div>\n\n \n <div class=\"sse-joystickBase sse-hidden\">\n <div class=\"sse-joystick\"></div>\n </div>\n\n \n <div class=\"sse-annotationNav sse-hidden\">\n <button class=\"sse-annotationPrev\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\">\n <g class=\"sse-stroke\"><use href=\"#chevronLeftIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#chevronLeftIcon\" /></g>\n </svg>\n </button>\n <div class=\"sse-annotationInfo\">\n <span class=\"sse-annotationNavTitle\"></span>\n </div>\n <button class=\"sse-annotationNext\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\">\n <g class=\"sse-stroke\"><use href=\"#chevronRightIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#chevronRightIcon\" /></g>\n </svg>\n </button>\n </div>\n\n \n <div class=\"sse-tooltip\"></div>\n\n \n <div class=\"sse-xrModal sse-hidden\" onwheel=\"event.stopPropagation()\">\n <div class=\"sse-xrModalContent\" onpointerdown=\"event.stopPropagation()\">\n <h2 data-i18n=\"xr-modal.title\">WebGL Required</h2>\n <p data-i18n=\"xr-modal.message\">\n AR and VR are not supported on the WebGPU renderer. Pressing OK will reload the viewer with WebGL.\n </p>\n <div class=\"sse-xrModalButtons\">\n <button class=\"sse-xrModalCancel\" data-i18n=\"xr-modal.cancel\">Cancel</button>\n <button class=\"sse-xrModalOk\" data-i18n=\"xr-modal.ok\">OK</button>\n </div>\n </div>\n </div>\n</div>\n\n<svg>\n <symbol id=\"playIcon\" viewBox=\"-2 0 24 24\">\n <path\n d=\"M1 1.98725C1 1.20022 1.87789 0.730421 2.5332 1.16694L14.5605 9.18061C15.146 9.57066 15.146 10.4302 14.5605 10.8203L2.5332 18.833C1.87788 19.2695 1 18.7997 1 18.0126V1.98725Z\"\n transform=\"translate(2 2)\"\n />\n </symbol>\n <symbol id=\"pauseIcon\" viewBox=\"0 0 20 20\">\n <path d=\"M5 16V4h3v12H5zm7-12h3v12h-3V4z\" />\n </symbol>\n <symbol id=\"orbitIcon\" viewBox=\"-2 -2 20 20\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M4.44728 1.7561C6.14077 0.763957 8.53159 1.57857 10.4375 3.58357C12.75 3.02099 14.4585 3.40647 14.6491 4.73071C14.7831 5.66256 14.139 6.87994 12.9942 8.09008C13.7427 10.7586 13.2413 13.2551 11.5527 14.2444C9.85867 15.2369 7.46679 14.4208 5.56056 12.4143C3.34914 12.9521 1.691 12.6254 1.38412 11.4371L1.35092 11.2698C1.21678 10.3379 1.85972 9.11931 3.00457 7.90909C2.28693 5.34963 2.72037 2.94871 4.24741 1.88435L4.44728 1.7561ZM11.9889 9.03995C11.002 9.88136 9.79998 10.6808 8.47918 11.3303L8.13673 11.4937C7.70533 11.6942 7.28148 11.8681 6.8698 12.0172C7.32387 12.4287 7.79226 12.7587 8.25326 12.9983C9.39237 13.5903 10.3231 13.574 10.946 13.2092C11.5745 12.841 12.0613 12.0184 12.1263 10.7086C12.1518 10.1934 12.1065 9.62999 11.9889 9.03995ZM3.46225 9.20206C3.15128 9.5802 2.91825 9.93412 2.76238 10.2489C2.54363 10.6909 2.51958 10.967 2.53842 11.0985C2.54902 11.1721 2.56635 11.2146 2.67058 11.2763C2.81832 11.3636 3.12484 11.4626 3.6478 11.467C3.95641 11.4696 4.3074 11.4373 4.69402 11.3707C4.45655 11.0439 4.23084 10.6971 4.02215 10.3303C3.81017 9.95774 3.62416 9.58004 3.46225 9.20206ZM10.0358 4.9423C9.42018 5.13611 8.75205 5.40184 8.05014 5.74698C6.61265 6.45384 5.33887 7.34291 4.37175 8.24373C4.55213 8.73829 4.78227 9.2401 5.06511 9.73722C5.33995 10.2202 5.64271 10.6614 5.96355 11.0575C6.5793 10.8637 7.24782 10.5987 7.94988 10.2535C9.38732 9.54667 10.6605 8.65688 11.6276 7.7561C11.4473 7.26173 11.2176 6.76019 10.9349 6.26326C10.66 5.78001 10.3568 5.33855 10.0358 4.9423ZM7.74675 3.00219C6.60759 2.41015 5.67698 2.42644 5.05405 2.79126C4.42548 3.15953 3.93866 3.98199 3.87371 5.29191C3.84822 5.80668 3.89236 6.36967 4.00978 6.95922C4.91091 6.19088 5.9923 5.45862 7.17905 4.84269L7.52084 4.67016C8.07056 4.39986 8.6096 4.17089 9.12957 3.98266C8.67568 3.57138 8.20757 3.24172 7.74675 3.00219ZM12.3522 4.53344C12.0433 4.53086 11.6918 4.56177 11.3047 4.6285C11.5425 4.95566 11.7689 5.3029 11.9779 5.67016C12.1897 6.04255 12.3753 6.41999 12.5371 6.79777C12.8481 6.41965 13.0818 6.06635 13.2376 5.75154C13.4564 5.30973 13.4804 5.03352 13.4616 4.90193C13.451 4.82831 13.4337 4.7859 13.3294 4.7242C13.1817 4.63684 12.8753 4.53787 12.3522 4.53344Z\"\n />\n </symbol>\n <symbol id=\"flyIcon\" viewBox=\"-2 -2 20 20\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 1.33337C13.4727 1.33337 14.6666 2.52728 14.6666 4.00004C14.6666 5.4728 13.4727 6.66671 12 6.66671C11.4931 6.66671 11.0194 6.52491 10.6159 6.27934L10.2721 6.62374C10.0345 6.86142 9.90102 7.18411 9.90102 7.52022V8.47986C9.90102 8.81597 10.0345 9.13866 10.2721 9.37634L10.6159 9.72009C11.0193 9.47463 11.4932 9.33337 12 9.33337C13.4727 9.33337 14.6666 10.5273 14.6666 12C14.6666 13.4728 13.4727 14.6667 12 14.6667C10.5272 14.6667 9.33331 13.4728 9.33331 12C9.33331 11.4932 9.47457 11.0194 9.72003 10.6159L9.37628 10.2722C9.1386 10.0345 8.81591 9.90108 8.4798 9.90108H7.52016C7.18405 9.90108 6.86136 10.0345 6.62368 10.2722L6.27928 10.6159C6.52485 11.0195 6.66665 11.4931 6.66665 12C6.66665 13.4728 5.47274 14.6667 3.99998 14.6667C2.52722 14.6667 1.33331 13.4728 1.33331 12C1.33331 10.5273 2.52722 9.33337 3.99998 9.33337C4.50658 9.33337 4.98008 9.47481 5.38344 9.72009L5.72784 9.37634C5.9655 9.13866 6.09894 8.81597 6.09894 8.47986V7.52022C6.09894 7.18411 5.9655 6.86142 5.72784 6.62374L5.38344 6.27934C4.98001 6.52473 4.5067 6.66671 3.99998 6.66671C2.52722 6.66671 1.33331 5.4728 1.33331 4.00004C1.33331 2.52728 2.52722 1.33337 3.99998 1.33337C5.47274 1.33337 6.66665 2.52728 6.66665 4.00004C6.66665 4.50676 6.52467 4.98008 6.27928 5.3835L6.62368 5.72791C6.86136 5.96556 7.18405 6.099 7.52016 6.099H8.4798C8.81591 6.099 9.1386 5.96556 9.37628 5.72791L9.72003 5.3835C9.47475 4.98014 9.33331 4.50664 9.33331 4.00004C9.33331 2.52728 10.5272 1.33337 12 1.33337ZM3.99998 10.3998C3.11632 10.3998 2.39972 11.1164 2.39972 12C2.39972 12.8837 3.11632 13.6003 3.99998 13.6003C4.88364 13.6003 5.60024 12.8837 5.60024 12C5.60024 11.7911 5.55917 11.5919 5.48631 11.4089L4.41469 12.4812C4.16723 12.7284 3.76625 12.7286 3.51886 12.4812C3.27147 12.2338 3.27158 11.8328 3.51886 11.5853L4.59047 10.5131C4.40769 10.4404 4.20862 10.3998 3.99998 10.3998ZM12 10.3998C11.7911 10.3998 11.5918 10.4403 11.4088 10.5131L12.4811 11.5853C12.7284 11.8328 12.7285 12.2338 12.4811 12.4812C12.2337 12.7286 11.8327 12.7284 11.5853 12.4812L10.513 11.4089C10.4402 11.5918 10.3997 11.7912 10.3997 12C10.3997 12.8837 11.1163 13.6003 12 13.6003C12.8836 13.6003 13.6002 12.8837 13.6002 12C13.6002 11.1164 12.8836 10.3998 12 10.3998ZM3.99998 2.39978C3.11632 2.39978 2.39972 3.11639 2.39972 4.00004C2.39972 4.8837 3.11632 5.6003 3.99998 5.6003C4.20871 5.6003 4.40763 5.55909 4.59047 5.48637L3.51886 4.41475C3.27158 4.16729 3.27147 3.76631 3.51886 3.51892C3.76625 3.27153 4.16723 3.27164 4.41469 3.51892L5.48631 4.59054C5.55903 4.40769 5.60024 4.20877 5.60024 4.00004C5.60024 3.11639 4.88364 2.39978 3.99998 2.39978ZM12 2.39978C11.1163 2.39978 10.3997 3.11639 10.3997 4.00004C10.3997 4.20868 10.4403 4.40775 10.513 4.59054L11.5853 3.51892C11.8327 3.27164 12.2337 3.27153 12.4811 3.51892C12.7285 3.76631 12.7284 4.16729 12.4811 4.41475L11.4088 5.48637C11.5918 5.55923 11.791 5.6003 12 5.6003C12.8836 5.6003 13.6002 4.8837 13.6002 4.00004C13.6002 3.11639 12.8836 2.39978 12 2.39978Z\"\n />\n </symbol>\n <symbol id=\"walkIcon\" viewBox=\"-2 -2 20 20\">\n <path d=\"M9.75 2a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zM5.25 4.75h5.5v4.5h-.5v5h-2v-5h-.5v5h-2v-5h-.5z\" />\n </symbol>\n <symbol id=\"arIcon\" viewBox=\"0 0 24 24\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 15.3994V6H16.9629C18.2109 6 19.1167 6.1089 19.6797 6.32715C20.248 6.53997 20.7021 6.92247 21.042 7.47363C21.3818 8.02476 21.5518 8.65491 21.5518 9.36426C21.5518 10.2645 21.2943 11.0093 20.7793 11.5986C20.2641 12.1825 19.4938 12.5513 18.4688 12.7041C18.9786 13.0097 19.3983 13.3453 19.7275 13.7109C20.0621 14.0766 20.5113 14.7261 21.0742 15.6592L22.5 18H19.6797L17.9746 15.3887C17.3694 14.4559 16.9555 13.8691 16.7324 13.6289C16.5095 13.3835 16.2729 13.2172 16.0234 13.1299C15.7738 13.0371 15.3777 12.9902 14.8359 12.9902H14.3584V18H10.4053L9.35742 15.2744H4.56055L3.57031 18H1L5.67383 6H8.23633L12 15.3994ZM5.30566 13.252H8.58008L6.92676 8.7998L5.30566 13.252ZM14.3584 11.0752H16.1025C17.2336 11.0752 17.9401 11.0259 18.2217 10.9277C18.5032 10.8295 18.7235 10.66 18.8828 10.4199C19.0421 10.1798 19.1221 9.87966 19.1221 9.51953C19.122 9.11597 19.016 8.79138 18.8037 8.5459C18.5966 8.29488 18.3013 8.13677 17.9189 8.07129C17.7276 8.04401 17.1541 8.03027 16.1982 8.03027H14.3584V11.0752Z\"\n />\n </symbol>\n <symbol id=\"vrIcon\" viewBox=\"0 0 24 24\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M5.52148 10.7021L7.15918 15.1133L8.76465 10.7021L9.50195 8.7002L10.4834 6H16.9541C18.1903 6 19.0879 6.10801 19.6455 6.32422C20.2081 6.53499 20.6576 6.9134 20.9941 7.45898C21.3308 8.00484 21.499 8.62946 21.499 9.33203C21.499 10.2239 21.2446 10.9622 20.7344 11.5459C20.2241 12.1242 19.4606 12.4893 18.4453 12.6406C18.9503 12.9433 19.3662 13.2756 19.6924 13.6377C20.0238 13.9999 20.4688 14.6432 21.0264 15.5674L22.4385 17.8857H19.6455L17.9561 15.2998C17.3565 14.3758 16.9466 13.7946 16.7256 13.5566C16.5047 13.3135 16.2706 13.148 16.0234 13.0615C15.7762 12.9696 15.3841 12.9238 14.8477 12.9238H14.374V17.8857H12.0381V8.54395L8.39941 17.8857H5.86133L1.10254 6H3.71289L5.52148 10.7021ZM14.374 11.0264H16.1025C17.2228 11.0264 17.9224 10.9781 18.2012 10.8809C18.4799 10.7836 17.6986 10.6157 18.8564 10.3779C19.0141 10.1402 19.0928 9.84288 19.0928 9.48633C19.0928 9.08641 18.9877 8.7647 18.7773 8.52148C18.5722 8.27286 18.2801 8.11565 17.9014 8.05078C17.712 8.02376 17.1439 8.01075 16.1973 8.01074H14.374V11.0264Z\"\n />\n </symbol>\n <symbol id=\"infoIcon\" viewBox=\"-2 -2 24 24\">\n <path\n d=\"M9.98633 7.58301C10.2598 7.58301 10.4854 7.67643 10.6631 7.86328C10.8408 8.05013 10.9297 8.3099 10.9297 8.64258V14.0361C10.9297 14.4098 10.8408 14.6924 10.6631 14.8838C10.4854 15.0752 10.2598 15.1709 9.98633 15.1709C9.71289 15.1709 9.48958 15.0729 9.31641 14.877C9.14779 14.681 9.06348 14.4007 9.06348 14.0361V8.69727C9.06348 8.32812 9.14779 8.05013 9.31641 7.86328C9.48958 7.67643 9.71289 7.58301 9.98633 7.58301Z\"\n />\n <path\n d=\"M10.0068 4.88965C10.2484 4.88965 10.4626 4.96712 10.6494 5.12207C10.8363 5.27702 10.9297 5.5026 10.9297 5.79883C10.9297 6.08594 10.8385 6.31152 10.6562 6.47559C10.474 6.63509 10.2575 6.71484 10.0068 6.71484C9.74707 6.71484 9.52376 6.63509 9.33691 6.47559C9.15462 6.31608 9.06348 6.09049 9.06348 5.79883C9.06348 5.53451 9.1569 5.31803 9.34375 5.14941C9.53516 4.97624 9.75618 4.88965 10.0068 4.88965Z\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM10 1.7998C5.47126 1.7998 1.7998 5.47126 1.7998 10C1.7998 14.5287 5.47126 18.2002 10 18.2002C14.5287 18.2002 18.2002 14.5287 18.2002 10C18.2002 5.47126 14.5287 1.7998 10 1.7998Z\"\n />\n </symbol>\n <symbol id=\"settingsIcon\" viewBox=\"0 0 24 24\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8ZM12 9.7998C10.785 9.7998 9.7998 10.785 9.7998 12C9.7998 13.215 10.785 14.2002 12 14.2002C13.215 14.2002 14.2002 13.215 14.2002 12C14.2002 10.785 13.215 9.7998 12 9.7998Z\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.7119 2.2002C13.1961 2.20028 13.6296 2.49055 13.8164 2.93066L13.8506 3.02051L14.3652 4.56641C14.7875 4.70091 15.1932 4.87075 15.5801 5.07129L17.042 4.3418L17.1299 4.30176C17.5436 4.13502 18.017 4.21245 18.3564 4.50195L18.4268 4.56641L19.4336 5.57324C19.7985 5.93836 19.8889 6.49621 19.6582 6.95801L18.9268 8.41895C19.1274 8.80592 19.2971 9.21159 19.4316 9.63379L20.9795 10.1504C21.4693 10.3138 21.7997 10.7717 21.7998 11.2881V12.7119C21.7997 13.2284 21.4695 13.6873 20.9795 13.8506L19.4316 14.3652C19.2971 14.7875 19.1274 15.1932 18.9268 15.5801L19.6582 17.042C19.8889 17.5038 19.7985 18.0616 19.4336 18.4268L18.4268 19.4336C18.0616 19.7985 17.5038 19.8889 17.042 19.6582L15.5801 18.9268C15.1932 19.1274 14.7875 19.2971 14.3652 19.4316L13.8506 20.9795C13.6873 21.4695 13.2284 21.7997 12.7119 21.7998H11.2881C10.7717 21.7997 10.3138 21.4693 10.1504 20.9795L9.63379 19.4316C9.21159 19.2971 8.80592 19.1274 8.41895 18.9268L6.95801 19.6582C6.49621 19.8889 5.93836 19.7985 5.57324 19.4336L4.56641 18.4268C4.20146 18.0617 4.1112 17.5038 4.3418 17.042L5.07129 15.5801C4.87075 15.1932 4.70091 14.7875 4.56641 14.3652L3.02051 13.8506C2.53057 13.6873 2.20029 13.2283 2.2002 12.7119V11.2881C2.20024 10.7718 2.53076 10.3139 3.02051 10.1504L4.56641 9.63379C4.70094 9.21149 4.86966 8.80498 5.07031 8.41797L4.3418 6.95801C4.11113 6.49617 4.20145 5.93834 4.56641 5.57324L5.57324 4.56641C5.93834 4.20145 6.49617 4.11113 6.95801 4.3418L8.41797 5.07031C8.80498 4.86966 9.21149 4.70094 9.63379 4.56641L10.1504 3.02051L10.1836 2.92969C10.3706 2.49001 10.8042 2.20023 11.2881 2.2002H12.7119ZM11.0186 5.4707L10.8809 5.88477L10.458 5.99316C9.88479 6.13982 9.34317 6.36768 8.84473 6.66309L8.46875 6.88477L8.0791 6.69043L6.50098 5.90137L5.90137 6.50098L6.69043 8.0791L6.88477 8.46875L6.66309 8.84473C6.36768 9.34317 6.13982 9.88479 5.99316 10.458L5.88477 10.8809L5.4707 11.0186L3.7998 11.5762V12.4229L5.4707 12.9805L5.88477 13.1182L5.99316 13.541C6.13969 14.1141 6.36763 14.6556 6.66309 15.1543L6.88477 15.5303L6.69043 15.9199L5.90137 17.498L6.50098 18.0977L8.0791 17.3086L8.46875 17.1133L8.84473 17.3359C9.34314 17.6314 9.88463 17.8591 10.458 18.0059L10.8809 18.1143L11.0186 18.5283L11.5771 20.2002H12.4229L13.1182 18.1143L13.541 18.0059C14.1143 17.8593 14.6556 17.6314 15.1543 17.3359L15.5303 17.1143L15.9199 17.3086L17.498 18.0977L18.0977 17.498L17.3086 15.9199L17.1143 15.5303L17.3359 15.1543C17.6314 14.6556 17.8593 14.1143 18.0059 13.541L18.1143 13.1182L20.2002 12.4229V11.5762L18.1143 10.8809L18.0059 10.458C17.8591 9.88463 17.6314 9.34314 17.3359 8.84473L17.1133 8.46875L17.3086 8.0791L18.0977 6.50098L17.498 5.90137L15.9199 6.69043L15.5303 6.88477L15.1543 6.66309C14.6556 6.36763 14.1141 6.13969 13.541 5.99316L13.1182 5.88477L12.9805 5.4707L12.4229 3.7998H11.5762L11.0186 5.4707Z\"\n />\n </symbol>\n <symbol id=\"enterFullscreenIcon\" viewBox=\"0 0 24 24\">\n <path\n d=\"M3 14.7002C3.49693 14.7002 3.90018 15.1027 3.90039 15.5996V20C3.90039 20.0552 3.94477 20.0996 4 20.0996H8.40039C8.89727 20.0998 9.2998 20.5031 9.2998 21C9.2998 21.4969 8.89727 21.9002 8.40039 21.9004H4C2.95066 21.9004 2.09961 21.0493 2.09961 20V15.5996C2.09982 15.1027 2.50307 14.7002 3 14.7002Z\"\n />\n <path\n d=\"M21 14.7002C21.4969 14.7002 21.9002 15.1027 21.9004 15.5996V20C21.9004 21.0493 21.0493 21.9004 20 21.9004H15.5996C15.1027 21.9002 14.7002 21.4969 14.7002 21C14.7002 20.5031 15.1027 20.0998 15.5996 20.0996H20C20.0552 20.0996 20.0996 20.0552 20.0996 20V15.5996C20.0998 15.1027 20.5031 14.7002 21 14.7002Z\"\n />\n <path\n d=\"M8.40039 2.09961C8.89727 2.09982 9.2998 2.50307 9.2998 3C9.2998 3.49693 8.89727 3.90018 8.40039 3.90039H4C3.94477 3.90039 3.90039 3.94477 3.90039 4V8.40039C3.90018 8.89727 3.49693 9.2998 3 9.2998C2.50307 9.2998 2.09982 8.89727 2.09961 8.40039V4C2.09961 2.95066 2.95066 2.09961 4 2.09961H8.40039Z\"\n />\n <path\n d=\"M20 2.09961C21.0493 2.09961 21.9004 2.95066 21.9004 4V8.40039C21.9002 8.89727 21.4969 9.2998 21 9.2998C20.5031 9.2998 20.0998 8.89727 20.0996 8.40039V4C20.0996 3.94477 20.0552 3.90039 20 3.90039H15.5996C15.1027 3.90018 14.7002 3.49693 14.7002 3C14.7002 2.50307 15.1027 2.09982 15.5996 2.09961H20Z\"\n />\n </symbol>\n <symbol id=\"chevronLeftIcon\" viewBox=\"0 0 24 24\">\n <path d=\"M15 19l-7-7 7-7\" />\n </symbol>\n <symbol id=\"chevronRightIcon\" viewBox=\"0 0 24 24\">\n <path d=\"M9 5l7 7-7 7\" />\n </symbol>\n <symbol id=\"voxelIcon\" viewBox=\"0 0 16 16\">\n <path\n d=\"M8 1L2 4.5v7L8 15l6-3.5v-7L8 1zm0 1.15L12.85 5 8 7.85 3.15 5 8 2.15zM3 5.85l4.5 2.6v5.1L3 10.95V5.85zm5.5 7.7v-5.1L13 5.85v5.1l-4.5 2.6z\"\n />\n </symbol>\n <symbol id=\"exitFullscreenIcon\" viewBox=\"0 0 24 24\">\n <path\n d=\"M8 15.0996C8.49706 15.0996 8.90039 15.5029 8.90039 16V21C8.90039 21.4971 8.49706 21.9004 8 21.9004C7.50294 21.9004 7.09961 21.4971 7.09961 21V16.9004H3C2.50294 16.9004 2.09961 16.4971 2.09961 16C2.09961 15.5029 2.50294 15.0996 3 15.0996H8Z\"\n />\n <path\n d=\"M21 15.0996C21.4971 15.0996 21.9004 15.5029 21.9004 16C21.9004 16.4971 21.4971 16.9004 21 16.9004H16.9004V21C16.9004 21.4971 16.4971 21.9004 16 21.9004C15.5029 21.9004 15.0996 21.4971 15.0996 21V16C15.0996 15.5029 15.5029 15.0996 16 15.0996H21Z\"\n />\n <path\n d=\"M8 2.09961C8.49706 2.09961 8.90039 2.50294 8.90039 3V8C8.90039 8.49706 8.49706 8.90039 8 8.90039H3C2.50294 8.90039 2.09961 8.49706 2.09961 8C2.09961 7.50294 2.50294 7.09961 3 7.09961H7.09961V3C7.09961 2.50294 7.50294 2.09961 8 2.09961Z\"\n />\n <path\n d=\"M16 2.09961C16.4971 2.09961 16.9004 2.50294 16.9004 3V7.09961H21C21.4971 7.09961 21.9004 7.50294 21.9004 8C21.9004 8.49706 21.4971 8.90039 21 8.90039H16C15.5029 8.90039 15.0996 8.49706 15.0996 8V3C15.0996 2.50294 15.5029 2.09961 16 2.09961Z\"\n />\n </symbol>\n</svg>\n";
|
|
4193
|
+
var uiHtml = "\n<canvas></canvas>\n\n<div class=\"sse-sceneLayer\"></div>\n\n<div class=\"sse-ui\">\n <div class=\"sse-poster\"></div>\n\n \n <a class=\"sse-viewerBranding sse-hidden\" target=\"_blank\" rel=\"noopener noreferrer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"64 64 384 384\" role=\"img\" aria-label=\"SuperSplat\">\n <path\n fill=\"#F26722\"\n d=\"M129.83,217c9.75,0,17.64-7.9,17.64-17.64s-7.9-17.64-17.64-17.64-17.64,7.9-17.64,17.64,7.9,17.64,17.64,17.64Z\"\n />\n <path\n fill=\"#F26722\"\n d=\"M388.74,253.94c-12.46,0-22.57,10.11-22.57,22.57s10.11,22.57,22.57,22.57,22.57-10.11,22.57-22.57-10.11-22.57-22.57-22.57h0Z\"\n />\n <path\n fill=\"#F26722\"\n d=\"M345.26,161.1h.02c.37-.05.65-.22.97-.33,16.78-2.32,29.75-16.57,29.75-33.99,0-19.04-15.43-34.46-34.46-34.46s-34.46,15.43-34.46,34.46c0,4.29.88,8.35,2.32,12.14.04.12-.01.25.04.38,10.55,29.18-22.33,23.62-39.07,20.74-.49-.09-.88-.07-1.32-.11-4.27-.56-8.59-.97-13.03-.97-53.93,0-97.64,43.71-97.64,97.64,0,9.84,1.48,19.32,4.2,28.28.04.1,0,.17.05.27,8.97,30.15-14.83,25.49-25.52,25.69-1.04-.13-2.09-.32-3.18-.32-13.51,0-24.45,10.94-24.45,24.45s10.94,24.45,24.45,24.45c11.69,0,21.44-8.22,23.85-19.19h.02c6.31-26.57,25.9-18.02,31.15-12.67.2.2.4.26.59.42,17.44,16.25,40.75,26.26,66.47,26.26.67,0,1.34-.09,2.01-.1.66.01,1.31.04,2.04.04,9.7-.04,17.82,10.91,4.94,29.68h.13c-4.42,6.01-7.1,13.36-7.1,21.41,0,20.09,16.29,36.39,36.39,36.39s36.39-16.29,36.39-36.39c0-15.4-9.61-28.49-23.12-33.81-.32-.15-.61-.29-.98-.45-12.28-4.94-25.43-17.69-6.89-27.1l-.04-.1c31.93-16.06,53.88-49.02,53.88-87.2,0-21.15-6.8-40.68-18.23-56.66-.13-.23-.23-.47-.44-.74-23.15-31.67-2.37-36.07,10.3-38.09h-.01Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M230.79,284.71c0,7.95-6.44,14.38-14.38,14.38s-14.38-6.44-14.38-14.38v-22.95c0-7.95,6.44-14.38,14.38-14.38s14.38,6.44,14.38,14.38v22.95Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M309.78,284.71c0,7.95-6.44,14.38-14.38,14.38s-14.38-6.44-14.38-14.38v-22.95c0-7.95,6.44-14.38,14.38-14.38s14.38,6.44,14.38,14.38v22.95Z\"\n />\n </svg>\n <span>SuperSplat</span>\n </a>\n\n \n <div class=\"sse-loadingWrap\">\n <div class=\"sse-loadingText\"></div>\n <div class=\"sse-loadingBar\"></div>\n </div>\n\n <div class=\"sse-controlsWrap sse-hidden\">\n \n <div class=\"sse-timelineContainer sse-hidden\">\n <div class=\"sse-line\"></div>\n <div class=\"sse-handle\"></div>\n <div class=\"sse-time sse-hidden\">0:00</div>\n </div>\n\n \n <div class=\"sse-buttonsContainer\">\n <div class=\"sse-buttonGroup\">\n <button class=\"sse-play sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#playIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#playIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-pause sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24px\" height=\"24px\">\n <g class=\"sse-stroke\"><use href=\"#pauseIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#pauseIcon\" /></g>\n </svg>\n </button>\n </div>\n\n <div class=\"sse-spacer\"></div>\n\n <div class=\"sse-buttonGroup\">\n <button class=\"sse-orbitCamera sse-controlButton sse-toggle sse-left\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#orbitIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#orbitIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-flyCamera sse-controlButton sse-toggle sse-right\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#flyIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#flyIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-fpsCamera sse-controlButton sse-toggle sse-right sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#walkIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#walkIcon\" /></g>\n </svg>\n </button>\n </div>\n\n <div class=\"sse-buttonGroup\">\n \n <button class=\"sse-settings sse-controlButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#settingsIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#settingsIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-controlsButton sse-controlButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#keyboardIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#keyboardIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-info sse-controlButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#infoIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#infoIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-arMode sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#arIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#arIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-vrMode sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#vrIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#vrIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-enterFullscreen sse-controlButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#enterFullscreenIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#enterFullscreenIcon\" /></g>\n </svg>\n </button>\n <button class=\"sse-exitFullscreen sse-controlButton sse-hidden\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\">\n <g class=\"sse-stroke\"><use href=\"#exitFullscreenIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#exitFullscreenIcon\" /></g>\n </svg>\n </button>\n </div>\n </div>\n </div>\n\n \n <div class=\"sse-joystickBase sse-hidden\">\n <div class=\"sse-joystick\"></div>\n </div>\n\n \n <div class=\"sse-annotationNav sse-hidden\">\n <button class=\"sse-annotationPrev\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\">\n <g class=\"sse-stroke\"><use href=\"#chevronLeftIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#chevronLeftIcon\" /></g>\n </svg>\n </button>\n <div class=\"sse-annotationInfo\">\n <span class=\"sse-annotationNavNumber\"></span>\n <span class=\"sse-annotationNavTitle\"></span>\n </div>\n <button class=\"sse-annotationNext\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\">\n <g class=\"sse-stroke\"><use href=\"#chevronRightIcon\" /></g>\n <g class=\"sse-fill\"><use href=\"#chevronRightIcon\" /></g>\n </svg>\n </button>\n </div>\n\n \n <div class=\"sse-controlsHint sse-hidden\">\n <div class=\"sse-controlsHintHeader\">\n <svg class=\"sse-controlsHintIcon\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <use href=\"#orbitIcon\" />\n </svg>\n <div class=\"sse-controlsHintTitles\">\n <span class=\"sse-controlsHintTitle\"></span>\n <span class=\"sse-controlsHintSubtitle\"></span>\n </div>\n <button class=\"sse-controlsHintClose sse-panelButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"><use href=\"#closeIcon\" /></svg>\n </button>\n </div>\n <div class=\"sse-controlsHintRows\"></div>\n </div>\n\n \n <div class=\"sse-settingsPanel sse-hidden\">\n \n <div class=\"sse-settingsGroup\">\n <div class=\"sse-annotationsRow sse-settingsRow\">\n <div class=\"sse-annotationsOption\" data-i18n=\"settings.show-annotations\">Show Annotations</div>\n <div class=\"sse-annotationsCheck sse-toggleSwitch sse-active\">\n <div class=\"sse-toggleTrack\"><div class=\"sse-toggleThumb\"></div></div>\n </div>\n </div>\n <div class=\"sse-showCollisionRow sse-settingsRow sse-hidden\">\n <div class=\"sse-showCollisionOption\" data-i18n=\"settings.show-collision\">Show Collision</div>\n <div class=\"sse-showCollisionCheck sse-toggleSwitch\">\n <div class=\"sse-toggleTrack\"><div class=\"sse-toggleThumb\"></div></div>\n </div>\n </div>\n </div>\n \n <div class=\"sse-settingsGroup\">\n <div class=\"sse-gamingControlsRow sse-settingsRow\">\n <div class=\"sse-gamingControlsOption\" data-i18n=\"settings.gaming-controls\">Gaming Controls</div>\n <div class=\"sse-gamingControlsCheck sse-toggleSwitch\">\n <div class=\"sse-toggleTrack\"><div class=\"sse-toggleThumb\"></div></div>\n </div>\n </div>\n <div class=\"sse-performanceModeRow sse-settingsRow\">\n <div class=\"sse-performanceModeOption\" data-i18n=\"settings.performance-mode\">Performance Mode</div>\n <div class=\"sse-performanceModeCheck sse-toggleSwitch\">\n <div class=\"sse-toggleTrack\"><div class=\"sse-toggleThumb\"></div></div>\n </div>\n </div>\n </div>\n \n <div class=\"sse-settingsGroup\">\n <div class=\"sse-settingsRow\">\n <button class=\"sse-frame\" data-i18n=\"settings.frame\">Frame</button>\n <button class=\"sse-reset\" data-i18n=\"settings.reset\">Reset</button>\n </div>\n </div>\n </div>\n\n \n <div class=\"sse-tooltip\"></div>\n\n \n <div class=\"sse-infoPanel sse-hidden\">\n <div class=\"sse-infoPanelContent\" onpointerdown=\"event.stopPropagation()\" onwheel=\"event.stopPropagation()\">\n <button class=\"sse-infoClose sse-panelButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"><use href=\"#closeIcon\" /></svg>\n </button>\n <a\n class=\"sse-viewerTitle\"\n href=\"https://github.com/playcanvas/supersplat-viewer\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <svg class=\"sse-viewerLogo\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <use href=\"#supersplatIcon\" />\n </svg>\n <span class=\"sse-title-name\">SuperSplat Viewer</span>\n <span class=\"sse-title-version\">v<span class=\"sse-appVersionLabel\"></span></span>\n </a>\n <div class=\"sse-infoGpu\">\n <span class=\"sse-rendererName\"></span>\n <span class=\"sse-gpuName\"></span>\n </div>\n <div class=\"sse-infoLinks\">\n <a\n class=\"sse-infoLink\"\n href=\"https://github.com/playcanvas/engine\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <span>PlayCanvas Engine</span>\n <span class=\"sse-infoLinkVersion\">v<span class=\"sse-engineVersionLabel\"></span></span>\n </a>\n </div>\n <div class=\"sse-infoShortcuts\">\n <h1 data-i18n=\"help.section.modes\">Mode Switching</h1>\n <div class=\"sse-infoShortcut\">\n <span data-i18n=\"help.action.orbit-mode\">Orbit Mode</span>\n <kbd class=\"sse-key\">1</kbd>\n </div>\n <div class=\"sse-infoShortcut\">\n <span data-i18n=\"help.action.fly-mode\">Fly Mode</span>\n <kbd class=\"sse-key\">2</kbd>\n </div>\n <div class=\"sse-walkShortcut sse-infoShortcut\">\n <span data-i18n=\"help.action.toggle-walk\">Toggle Walk</span>\n <kbd class=\"sse-key\">3</kbd>\n </div>\n <div class=\"sse-infoShortcut\">\n <span data-i18n=\"help.action.toggle-gaming\">Toggle Gaming Controls</span>\n <kbd class=\"sse-key\">G</kbd>\n </div>\n <div class=\"sse-showCollisionShortcut sse-infoShortcut sse-hidden\">\n <span data-i18n=\"help.action.show-collision\">Show Collision</span>\n <kbd class=\"sse-key\">V</kbd>\n </div>\n <div class=\"sse-playShortcut sse-infoShortcut\">\n <span data-i18n=\"help.action.play-pause\">Play / Pause</span>\n <kbd class=\"sse-key\" data-i18n=\"help.key.space\">Space</kbd>\n </div>\n <div class=\"sse-infoShortcut\">\n <span data-i18n=\"help.action.toggle-controls\">Toggle Controls</span>\n <kbd class=\"sse-key\">H</kbd>\n </div>\n <div class=\"sse-infoShortcut\">\n <span data-i18n=\"help.action.toggle-help\">Toggle Info</span>\n <span class=\"sse-keys\"><kbd class=\"sse-key\">Shift</kbd><kbd class=\"sse-key\">H</kbd></span>\n </div>\n <div class=\"sse-infoShortcut\">\n <span data-i18n=\"help.action.exit-cancel\">Exit / Cancel</span>\n <kbd class=\"sse-key\" data-i18n=\"help.key.esc\">Esc</kbd>\n </div>\n </div>\n </div>\n </div>\n\n \n <div class=\"sse-xrModal sse-hidden\" onwheel=\"event.stopPropagation()\">\n <div class=\"sse-xrModalContent\" onpointerdown=\"event.stopPropagation()\">\n <h2 data-i18n=\"xr-modal.title\">WebGL Required</h2>\n <p data-i18n=\"xr-modal.message\">\n AR and VR are not supported on the WebGPU renderer. Pressing OK will reload the viewer with WebGL.\n </p>\n <div class=\"sse-xrModalButtons\">\n <button class=\"sse-xrModalCancel\" data-i18n=\"xr-modal.cancel\">Cancel</button>\n <button class=\"sse-xrModalOk\" data-i18n=\"xr-modal.ok\">OK</button>\n </div>\n </div>\n </div>\n</div>\n\n<svg>\n <symbol id=\"playIcon\" viewBox=\"-2 0 24 24\">\n <path\n d=\"M1 1.98725C1 1.20022 1.87789 0.730421 2.5332 1.16694L14.5605 9.18061C15.146 9.57066 15.146 10.4302 14.5605 10.8203L2.5332 18.833C1.87788 19.2695 1 18.7997 1 18.0126V1.98725Z\"\n transform=\"translate(2 2)\"\n />\n </symbol>\n <symbol id=\"pauseIcon\" viewBox=\"0 0 20 20\">\n <path d=\"M5 16V4h3v12H5zm7-12h3v12h-3V4z\" />\n </symbol>\n <symbol id=\"orbitIcon\" viewBox=\"-2 -2 20 20\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M4.44728 1.7561C6.14077 0.763957 8.53159 1.57857 10.4375 3.58357C12.75 3.02099 14.4585 3.40647 14.6491 4.73071C14.7831 5.66256 14.139 6.87994 12.9942 8.09008C13.7427 10.7586 13.2413 13.2551 11.5527 14.2444C9.85867 15.2369 7.46679 14.4208 5.56056 12.4143C3.34914 12.9521 1.691 12.6254 1.38412 11.4371L1.35092 11.2698C1.21678 10.3379 1.85972 9.11931 3.00457 7.90909C2.28693 5.34963 2.72037 2.94871 4.24741 1.88435L4.44728 1.7561ZM11.9889 9.03995C11.002 9.88136 9.79998 10.6808 8.47918 11.3303L8.13673 11.4937C7.70533 11.6942 7.28148 11.8681 6.8698 12.0172C7.32387 12.4287 7.79226 12.7587 8.25326 12.9983C9.39237 13.5903 10.3231 13.574 10.946 13.2092C11.5745 12.841 12.0613 12.0184 12.1263 10.7086C12.1518 10.1934 12.1065 9.62999 11.9889 9.03995ZM3.46225 9.20206C3.15128 9.5802 2.91825 9.93412 2.76238 10.2489C2.54363 10.6909 2.51958 10.967 2.53842 11.0985C2.54902 11.1721 2.56635 11.2146 2.67058 11.2763C2.81832 11.3636 3.12484 11.4626 3.6478 11.467C3.95641 11.4696 4.3074 11.4373 4.69402 11.3707C4.45655 11.0439 4.23084 10.6971 4.02215 10.3303C3.81017 9.95774 3.62416 9.58004 3.46225 9.20206ZM10.0358 4.9423C9.42018 5.13611 8.75205 5.40184 8.05014 5.74698C6.61265 6.45384 5.33887 7.34291 4.37175 8.24373C4.55213 8.73829 4.78227 9.2401 5.06511 9.73722C5.33995 10.2202 5.64271 10.6614 5.96355 11.0575C6.5793 10.8637 7.24782 10.5987 7.94988 10.2535C9.38732 9.54667 10.6605 8.65688 11.6276 7.7561C11.4473 7.26173 11.2176 6.76019 10.9349 6.26326C10.66 5.78001 10.3568 5.33855 10.0358 4.9423ZM7.74675 3.00219C6.60759 2.41015 5.67698 2.42644 5.05405 2.79126C4.42548 3.15953 3.93866 3.98199 3.87371 5.29191C3.84822 5.80668 3.89236 6.36967 4.00978 6.95922C4.91091 6.19088 5.9923 5.45862 7.17905 4.84269L7.52084 4.67016C8.07056 4.39986 8.6096 4.17089 9.12957 3.98266C8.67568 3.57138 8.20757 3.24172 7.74675 3.00219ZM12.3522 4.53344C12.0433 4.53086 11.6918 4.56177 11.3047 4.6285C11.5425 4.95566 11.7689 5.3029 11.9779 5.67016C12.1897 6.04255 12.3753 6.41999 12.5371 6.79777C12.8481 6.41965 13.0818 6.06635 13.2376 5.75154C13.4564 5.30973 13.4804 5.03352 13.4616 4.90193C13.451 4.82831 13.4337 4.7859 13.3294 4.7242C13.1817 4.63684 12.8753 4.53787 12.3522 4.53344Z\"\n />\n </symbol>\n <symbol id=\"flyIcon\" viewBox=\"-2 -2 20 20\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 1.33337C13.4727 1.33337 14.6666 2.52728 14.6666 4.00004C14.6666 5.4728 13.4727 6.66671 12 6.66671C11.4931 6.66671 11.0194 6.52491 10.6159 6.27934L10.2721 6.62374C10.0345 6.86142 9.90102 7.18411 9.90102 7.52022V8.47986C9.90102 8.81597 10.0345 9.13866 10.2721 9.37634L10.6159 9.72009C11.0193 9.47463 11.4932 9.33337 12 9.33337C13.4727 9.33337 14.6666 10.5273 14.6666 12C14.6666 13.4728 13.4727 14.6667 12 14.6667C10.5272 14.6667 9.33331 13.4728 9.33331 12C9.33331 11.4932 9.47457 11.0194 9.72003 10.6159L9.37628 10.2722C9.1386 10.0345 8.81591 9.90108 8.4798 9.90108H7.52016C7.18405 9.90108 6.86136 10.0345 6.62368 10.2722L6.27928 10.6159C6.52485 11.0195 6.66665 11.4931 6.66665 12C6.66665 13.4728 5.47274 14.6667 3.99998 14.6667C2.52722 14.6667 1.33331 13.4728 1.33331 12C1.33331 10.5273 2.52722 9.33337 3.99998 9.33337C4.50658 9.33337 4.98008 9.47481 5.38344 9.72009L5.72784 9.37634C5.9655 9.13866 6.09894 8.81597 6.09894 8.47986V7.52022C6.09894 7.18411 5.9655 6.86142 5.72784 6.62374L5.38344 6.27934C4.98001 6.52473 4.5067 6.66671 3.99998 6.66671C2.52722 6.66671 1.33331 5.4728 1.33331 4.00004C1.33331 2.52728 2.52722 1.33337 3.99998 1.33337C5.47274 1.33337 6.66665 2.52728 6.66665 4.00004C6.66665 4.50676 6.52467 4.98008 6.27928 5.3835L6.62368 5.72791C6.86136 5.96556 7.18405 6.099 7.52016 6.099H8.4798C8.81591 6.099 9.1386 5.96556 9.37628 5.72791L9.72003 5.3835C9.47475 4.98014 9.33331 4.50664 9.33331 4.00004C9.33331 2.52728 10.5272 1.33337 12 1.33337ZM3.99998 10.3998C3.11632 10.3998 2.39972 11.1164 2.39972 12C2.39972 12.8837 3.11632 13.6003 3.99998 13.6003C4.88364 13.6003 5.60024 12.8837 5.60024 12C5.60024 11.7911 5.55917 11.5919 5.48631 11.4089L4.41469 12.4812C4.16723 12.7284 3.76625 12.7286 3.51886 12.4812C3.27147 12.2338 3.27158 11.8328 3.51886 11.5853L4.59047 10.5131C4.40769 10.4404 4.20862 10.3998 3.99998 10.3998ZM12 10.3998C11.7911 10.3998 11.5918 10.4403 11.4088 10.5131L12.4811 11.5853C12.7284 11.8328 12.7285 12.2338 12.4811 12.4812C12.2337 12.7286 11.8327 12.7284 11.5853 12.4812L10.513 11.4089C10.4402 11.5918 10.3997 11.7912 10.3997 12C10.3997 12.8837 11.1163 13.6003 12 13.6003C12.8836 13.6003 13.6002 12.8837 13.6002 12C13.6002 11.1164 12.8836 10.3998 12 10.3998ZM3.99998 2.39978C3.11632 2.39978 2.39972 3.11639 2.39972 4.00004C2.39972 4.8837 3.11632 5.6003 3.99998 5.6003C4.20871 5.6003 4.40763 5.55909 4.59047 5.48637L3.51886 4.41475C3.27158 4.16729 3.27147 3.76631 3.51886 3.51892C3.76625 3.27153 4.16723 3.27164 4.41469 3.51892L5.48631 4.59054C5.55903 4.40769 5.60024 4.20877 5.60024 4.00004C5.60024 3.11639 4.88364 2.39978 3.99998 2.39978ZM12 2.39978C11.1163 2.39978 10.3997 3.11639 10.3997 4.00004C10.3997 4.20868 10.4403 4.40775 10.513 4.59054L11.5853 3.51892C11.8327 3.27164 12.2337 3.27153 12.4811 3.51892C12.7285 3.76631 12.7284 4.16729 12.4811 4.41475L11.4088 5.48637C11.5918 5.55923 11.791 5.6003 12 5.6003C12.8836 5.6003 13.6002 4.8837 13.6002 4.00004C13.6002 3.11639 12.8836 2.39978 12 2.39978Z\"\n />\n </symbol>\n <symbol id=\"walkIcon\" viewBox=\"-2 -2 20 20\">\n <path d=\"M9.75 2a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zM5.25 4.75h5.5v4.5h-.5v5h-2v-5h-.5v5h-2v-5h-.5z\" />\n </symbol>\n <symbol id=\"arIcon\" viewBox=\"0 0 24 24\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 15.3994V6H16.9629C18.2109 6 19.1167 6.1089 19.6797 6.32715C20.248 6.53997 20.7021 6.92247 21.042 7.47363C21.3818 8.02476 21.5518 8.65491 21.5518 9.36426C21.5518 10.2645 21.2943 11.0093 20.7793 11.5986C20.2641 12.1825 19.4938 12.5513 18.4688 12.7041C18.9786 13.0097 19.3983 13.3453 19.7275 13.7109C20.0621 14.0766 20.5113 14.7261 21.0742 15.6592L22.5 18H19.6797L17.9746 15.3887C17.3694 14.4559 16.9555 13.8691 16.7324 13.6289C16.5095 13.3835 16.2729 13.2172 16.0234 13.1299C15.7738 13.0371 15.3777 12.9902 14.8359 12.9902H14.3584V18H10.4053L9.35742 15.2744H4.56055L3.57031 18H1L5.67383 6H8.23633L12 15.3994ZM5.30566 13.252H8.58008L6.92676 8.7998L5.30566 13.252ZM14.3584 11.0752H16.1025C17.2336 11.0752 17.9401 11.0259 18.2217 10.9277C18.5032 10.8295 18.7235 10.66 18.8828 10.4199C19.0421 10.1798 19.1221 9.87966 19.1221 9.51953C19.122 9.11597 19.016 8.79138 18.8037 8.5459C18.5966 8.29488 18.3013 8.13677 17.9189 8.07129C17.7276 8.04401 17.1541 8.03027 16.1982 8.03027H14.3584V11.0752Z\"\n />\n </symbol>\n <symbol id=\"vrIcon\" viewBox=\"0 0 24 24\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M5.52148 10.7021L7.15918 15.1133L8.76465 10.7021L9.50195 8.7002L10.4834 6H16.9541C18.1903 6 19.0879 6.10801 19.6455 6.32422C20.2081 6.53499 20.6576 6.9134 20.9941 7.45898C21.3308 8.00484 21.499 8.62946 21.499 9.33203C21.499 10.2239 21.2446 10.9622 20.7344 11.5459C20.2241 12.1242 19.4606 12.4893 18.4453 12.6406C18.9503 12.9433 19.3662 13.2756 19.6924 13.6377C20.0238 13.9999 20.4688 14.6432 21.0264 15.5674L22.4385 17.8857H19.6455L17.9561 15.2998C17.3565 14.3758 16.9466 13.7946 16.7256 13.5566C16.5047 13.3135 16.2706 13.148 16.0234 13.0615C15.7762 12.9696 15.3841 12.9238 14.8477 12.9238H14.374V17.8857H12.0381V8.54395L8.39941 17.8857H5.86133L1.10254 6H3.71289L5.52148 10.7021ZM14.374 11.0264H16.1025C17.2228 11.0264 17.9224 10.9781 18.2012 10.8809C18.4799 10.7836 17.6986 10.6157 18.8564 10.3779C19.0141 10.1402 19.0928 9.84288 19.0928 9.48633C19.0928 9.08641 18.9877 8.7647 18.7773 8.52148C18.5722 8.27286 18.2801 8.11565 17.9014 8.05078C17.712 8.02376 17.1439 8.01075 16.1973 8.01074H14.374V11.0264Z\"\n />\n </symbol>\n <symbol id=\"infoIcon\" viewBox=\"-2 -2 24 24\">\n <path\n d=\"M9.98633 7.58301C10.2598 7.58301 10.4854 7.67643 10.6631 7.86328C10.8408 8.05013 10.9297 8.3099 10.9297 8.64258V14.0361C10.9297 14.4098 10.8408 14.6924 10.6631 14.8838C10.4854 15.0752 10.2598 15.1709 9.98633 15.1709C9.71289 15.1709 9.48958 15.0729 9.31641 14.877C9.14779 14.681 9.06348 14.4007 9.06348 14.0361V8.69727C9.06348 8.32812 9.14779 8.05013 9.31641 7.86328C9.48958 7.67643 9.71289 7.58301 9.98633 7.58301Z\"\n />\n <path\n d=\"M10.0068 4.88965C10.2484 4.88965 10.4626 4.96712 10.6494 5.12207C10.8363 5.27702 10.9297 5.5026 10.9297 5.79883C10.9297 6.08594 10.8385 6.31152 10.6562 6.47559C10.474 6.63509 10.2575 6.71484 10.0068 6.71484C9.74707 6.71484 9.52376 6.63509 9.33691 6.47559C9.15462 6.31608 9.06348 6.09049 9.06348 5.79883C9.06348 5.53451 9.1569 5.31803 9.34375 5.14941C9.53516 4.97624 9.75618 4.88965 10.0068 4.88965Z\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM10 1.7998C5.47126 1.7998 1.7998 5.47126 1.7998 10C1.7998 14.5287 5.47126 18.2002 10 18.2002C14.5287 18.2002 18.2002 14.5287 18.2002 10C18.2002 5.47126 14.5287 1.7998 10 1.7998Z\"\n />\n </symbol>\n <symbol id=\"settingsIcon\" viewBox=\"0 0 24 24\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8ZM12 9.7998C10.785 9.7998 9.7998 10.785 9.7998 12C9.7998 13.215 10.785 14.2002 12 14.2002C13.215 14.2002 14.2002 13.215 14.2002 12C14.2002 10.785 13.215 9.7998 12 9.7998Z\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.7119 2.2002C13.1961 2.20028 13.6296 2.49055 13.8164 2.93066L13.8506 3.02051L14.3652 4.56641C14.7875 4.70091 15.1932 4.87075 15.5801 5.07129L17.042 4.3418L17.1299 4.30176C17.5436 4.13502 18.017 4.21245 18.3564 4.50195L18.4268 4.56641L19.4336 5.57324C19.7985 5.93836 19.8889 6.49621 19.6582 6.95801L18.9268 8.41895C19.1274 8.80592 19.2971 9.21159 19.4316 9.63379L20.9795 10.1504C21.4693 10.3138 21.7997 10.7717 21.7998 11.2881V12.7119C21.7997 13.2284 21.4695 13.6873 20.9795 13.8506L19.4316 14.3652C19.2971 14.7875 19.1274 15.1932 18.9268 15.5801L19.6582 17.042C19.8889 17.5038 19.7985 18.0616 19.4336 18.4268L18.4268 19.4336C18.0616 19.7985 17.5038 19.8889 17.042 19.6582L15.5801 18.9268C15.1932 19.1274 14.7875 19.2971 14.3652 19.4316L13.8506 20.9795C13.6873 21.4695 13.2284 21.7997 12.7119 21.7998H11.2881C10.7717 21.7997 10.3138 21.4693 10.1504 20.9795L9.63379 19.4316C9.21159 19.2971 8.80592 19.1274 8.41895 18.9268L6.95801 19.6582C6.49621 19.8889 5.93836 19.7985 5.57324 19.4336L4.56641 18.4268C4.20146 18.0617 4.1112 17.5038 4.3418 17.042L5.07129 15.5801C4.87075 15.1932 4.70091 14.7875 4.56641 14.3652L3.02051 13.8506C2.53057 13.6873 2.20029 13.2283 2.2002 12.7119V11.2881C2.20024 10.7718 2.53076 10.3139 3.02051 10.1504L4.56641 9.63379C4.70094 9.21149 4.86966 8.80498 5.07031 8.41797L4.3418 6.95801C4.11113 6.49617 4.20145 5.93834 4.56641 5.57324L5.57324 4.56641C5.93834 4.20145 6.49617 4.11113 6.95801 4.3418L8.41797 5.07031C8.80498 4.86966 9.21149 4.70094 9.63379 4.56641L10.1504 3.02051L10.1836 2.92969C10.3706 2.49001 10.8042 2.20023 11.2881 2.2002H12.7119ZM11.0186 5.4707L10.8809 5.88477L10.458 5.99316C9.88479 6.13982 9.34317 6.36768 8.84473 6.66309L8.46875 6.88477L8.0791 6.69043L6.50098 5.90137L5.90137 6.50098L6.69043 8.0791L6.88477 8.46875L6.66309 8.84473C6.36768 9.34317 6.13982 9.88479 5.99316 10.458L5.88477 10.8809L5.4707 11.0186L3.7998 11.5762V12.4229L5.4707 12.9805L5.88477 13.1182L5.99316 13.541C6.13969 14.1141 6.36763 14.6556 6.66309 15.1543L6.88477 15.5303L6.69043 15.9199L5.90137 17.498L6.50098 18.0977L8.0791 17.3086L8.46875 17.1133L8.84473 17.3359C9.34314 17.6314 9.88463 17.8591 10.458 18.0059L10.8809 18.1143L11.0186 18.5283L11.5771 20.2002H12.4229L13.1182 18.1143L13.541 18.0059C14.1143 17.8593 14.6556 17.6314 15.1543 17.3359L15.5303 17.1143L15.9199 17.3086L17.498 18.0977L18.0977 17.498L17.3086 15.9199L17.1143 15.5303L17.3359 15.1543C17.6314 14.6556 17.8593 14.1143 18.0059 13.541L18.1143 13.1182L20.2002 12.4229V11.5762L18.1143 10.8809L18.0059 10.458C17.8591 9.88463 17.6314 9.34314 17.3359 8.84473L17.1133 8.46875L17.3086 8.0791L18.0977 6.50098L17.498 5.90137L15.9199 6.69043L15.5303 6.88477L15.1543 6.66309C14.6556 6.36763 14.1141 6.13969 13.541 5.99316L13.1182 5.88477L12.9805 5.4707L12.4229 3.7998H11.5762L11.0186 5.4707Z\"\n />\n </symbol>\n <symbol id=\"enterFullscreenIcon\" viewBox=\"0 0 24 24\">\n <path\n d=\"M3 14.7002C3.49693 14.7002 3.90018 15.1027 3.90039 15.5996V20C3.90039 20.0552 3.94477 20.0996 4 20.0996H8.40039C8.89727 20.0998 9.2998 20.5031 9.2998 21C9.2998 21.4969 8.89727 21.9002 8.40039 21.9004H4C2.95066 21.9004 2.09961 21.0493 2.09961 20V15.5996C2.09982 15.1027 2.50307 14.7002 3 14.7002Z\"\n />\n <path\n d=\"M21 14.7002C21.4969 14.7002 21.9002 15.1027 21.9004 15.5996V20C21.9004 21.0493 21.0493 21.9004 20 21.9004H15.5996C15.1027 21.9002 14.7002 21.4969 14.7002 21C14.7002 20.5031 15.1027 20.0998 15.5996 20.0996H20C20.0552 20.0996 20.0996 20.0552 20.0996 20V15.5996C20.0998 15.1027 20.5031 14.7002 21 14.7002Z\"\n />\n <path\n d=\"M8.40039 2.09961C8.89727 2.09982 9.2998 2.50307 9.2998 3C9.2998 3.49693 8.89727 3.90018 8.40039 3.90039H4C3.94477 3.90039 3.90039 3.94477 3.90039 4V8.40039C3.90018 8.89727 3.49693 9.2998 3 9.2998C2.50307 9.2998 2.09982 8.89727 2.09961 8.40039V4C2.09961 2.95066 2.95066 2.09961 4 2.09961H8.40039Z\"\n />\n <path\n d=\"M20 2.09961C21.0493 2.09961 21.9004 2.95066 21.9004 4V8.40039C21.9002 8.89727 21.4969 9.2998 21 9.2998C20.5031 9.2998 20.0998 8.89727 20.0996 8.40039V4C20.0996 3.94477 20.0552 3.90039 20 3.90039H15.5996C15.1027 3.90018 14.7002 3.49693 14.7002 3C14.7002 2.50307 15.1027 2.09982 15.5996 2.09961H20Z\"\n />\n </symbol>\n <symbol id=\"supersplatIcon\" viewBox=\"64 64 384 384\">\n <path\n fill=\"#F26722\"\n d=\"M129.83,217c9.75,0,17.64-7.9,17.64-17.64s-7.9-17.64-17.64-17.64-17.64,7.9-17.64,17.64,7.9,17.64,17.64,17.64Z\"\n />\n <path\n fill=\"#F26722\"\n d=\"M388.74,253.94c-12.46,0-22.57,10.11-22.57,22.57s10.11,22.57,22.57,22.57,22.57-10.11,22.57-22.57-10.11-22.57-22.57-22.57h0Z\"\n />\n <path\n fill=\"#F26722\"\n d=\"M345.26,161.1h.02c.37-.05.65-.22.97-.33,16.78-2.32,29.75-16.57,29.75-33.99,0-19.04-15.43-34.46-34.46-34.46s-34.46,15.43-34.46,34.46c0,4.29.88,8.35,2.32,12.14.04.12-.01.25.04.38,10.55,29.18-22.33,23.62-39.07,20.74-.49-.09-.88-.07-1.32-.11-4.27-.56-8.59-.97-13.03-.97-53.93,0-97.64,43.71-97.64,97.64,0,9.84,1.48,19.32,4.2,28.28.04.1,0,.17.05.27,8.97,30.15-14.83,25.49-25.52,25.69-1.04-.13-2.09-.32-3.18-.32-13.51,0-24.45,10.94-24.45,24.45s10.94,24.45,24.45,24.45c11.69,0,21.44-8.22,23.85-19.19h.02c6.31-26.57,25.9-18.02,31.15-12.67.2.2.4.26.59.42,17.44,16.25,40.75,26.26,66.47,26.26.67,0,1.34-.09,2.01-.1.66.01,1.31.04,2.04.04,9.7-.04,17.82,10.91,4.94,29.68h.13c-4.42,6.01-7.1,13.36-7.1,21.41,0,20.09,16.29,36.39,36.39,36.39s36.39-16.29,36.39-36.39c0-15.4-9.61-28.49-23.12-33.81-.32-.15-.61-.29-.98-.45-12.28-4.94-25.43-17.69-6.89-27.1l-.04-.1c31.93-16.06,53.88-49.02,53.88-87.2,0-21.15-6.8-40.68-18.23-56.66-.13-.23-.23-.47-.44-.74-23.15-31.67-2.37-36.07,10.3-38.09h-.01Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M230.79,284.71c0,7.95-6.44,14.38-14.38,14.38s-14.38-6.44-14.38-14.38v-22.95c0-7.95,6.44-14.38,14.38-14.38s14.38,6.44,14.38,14.38v22.95Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M309.78,284.71c0,7.95-6.44,14.38-14.38,14.38s-14.38-6.44-14.38-14.38v-22.95c0-7.95,6.44-14.38,14.38-14.38s14.38,6.44,14.38,14.38v22.95Z\"\n />\n </symbol>\n <symbol id=\"keyboardIcon\" viewBox=\"0 0 24 24\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M4 5.5h16a2.5 2.5 0 0 1 2.5 2.5v8a2.5 2.5 0 0 1-2.5 2.5H4A2.5 2.5 0 0 1 1.5 16V8A2.5 2.5 0 0 1 4 5.5Zm0 1.8a.7.7 0 0 0-.7.7v8c0 .39.31.7.7.7h16a.7.7 0 0 0 .7-.7V8a.7.7 0 0 0-.7-.7H4Z\"\n />\n <path d=\"M5 9h2v2H5zM8.5 9h2v2h-2zM12 9h2v2h-2zM15.5 9h2v2h-2zM7 13h10v2H7z\" />\n </symbol>\n <symbol id=\"closeIcon\" viewBox=\"0 0 24 24\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </symbol>\n <symbol id=\"chevronLeftIcon\" viewBox=\"0 0 24 24\">\n <path d=\"M15 19l-7-7 7-7\" />\n </symbol>\n <symbol id=\"chevronRightIcon\" viewBox=\"0 0 24 24\">\n <path d=\"M9 5l7 7-7 7\" />\n </symbol>\n <symbol id=\"exitFullscreenIcon\" viewBox=\"0 0 24 24\">\n <path\n d=\"M8 15.0996C8.49706 15.0996 8.90039 15.5029 8.90039 16V21C8.90039 21.4971 8.49706 21.9004 8 21.9004C7.50294 21.9004 7.09961 21.4971 7.09961 21V16.9004H3C2.50294 16.9004 2.09961 16.4971 2.09961 16C2.09961 15.5029 2.50294 15.0996 3 15.0996H8Z\"\n />\n <path\n d=\"M21 15.0996C21.4971 15.0996 21.9004 15.5029 21.9004 16C21.9004 16.4971 21.4971 16.9004 21 16.9004H16.9004V21C16.9004 21.4971 16.4971 21.9004 16 21.9004C15.5029 21.9004 15.0996 21.4971 15.0996 21V16C15.0996 15.5029 15.5029 15.0996 16 15.0996H21Z\"\n />\n <path\n d=\"M8 2.09961C8.49706 2.09961 8.90039 2.50294 8.90039 3V8C8.90039 8.49706 8.49706 8.90039 8 8.90039H3C2.50294 8.90039 2.09961 8.49706 2.09961 8C2.09961 7.50294 2.50294 7.09961 3 7.09961H7.09961V3C7.09961 2.50294 7.50294 2.09961 8 2.09961Z\"\n />\n <path\n d=\"M16 2.09961C16.4971 2.09961 16.9004 2.50294 16.9004 3V7.09961H21C21.4971 7.09961 21.9004 7.50294 21.9004 8C21.9004 8.49706 21.4971 8.90039 21 8.90039H16C15.5029 8.90039 15.0996 8.49706 15.0996 8V3C15.0996 2.50294 15.5029 2.09961 16 2.09961Z\"\n />\n </symbol>\n</svg>\n";
|
|
4127
4194
|
|
|
4128
4195
|
/**
|
|
4129
4196
|
* Creates a figure-8 (lemniscate / infinity sign) camera animation track.
|
|
@@ -4654,6 +4721,18 @@ class Camera {
|
|
|
4654
4721
|
vecToAngles(this.angles, avec.mulScalar(1.0 / this.distance));
|
|
4655
4722
|
this.fov = math.lerp(a.fov, b.fov, t);
|
|
4656
4723
|
}
|
|
4724
|
+
// Blend position, view angles and distance directly, rather than through the look-at
|
|
4725
|
+
// point as `lerp` does: the view then turns steadily across the move, the heading the
|
|
4726
|
+
// shorter way round, and with the horizon kept level. `turn` is the angles' own progress,
|
|
4727
|
+
// so the view can turn ahead of the travel.
|
|
4728
|
+
lerpAngles(a, b, t, turn = t) {
|
|
4729
|
+
this.position.lerp(a.position, b.position, t);
|
|
4730
|
+
this.angles.x = math.lerp(a.angles.x, b.angles.x, turn);
|
|
4731
|
+
this.angles.y = a.angles.y + (mod(b.angles.y - a.angles.y + 180, 360) - 180) * turn;
|
|
4732
|
+
this.angles.z = math.lerp(a.angles.z, b.angles.z, turn);
|
|
4733
|
+
this.distance = math.lerp(a.distance, b.distance, t);
|
|
4734
|
+
this.fov = math.lerp(a.fov, b.fov, t);
|
|
4735
|
+
}
|
|
4657
4736
|
look(from, to) {
|
|
4658
4737
|
this.position.copy(from);
|
|
4659
4738
|
this.distance = from.distance(to);
|
|
@@ -6016,6 +6095,27 @@ class WalkSource {
|
|
|
6016
6095
|
|
|
6017
6096
|
const tmpCamera = new Camera();
|
|
6018
6097
|
const tmpv = new Vec3();
|
|
6098
|
+
const tmpv2 = new Vec3();
|
|
6099
|
+
// Annotation moves ease in and out, lasting longer the farther the camera travels and turns,
|
|
6100
|
+
// between these bounds in seconds. Every other transition keeps the quick-start easeOut.
|
|
6101
|
+
// The curve does most of its travel in the first half and settles through the second, so
|
|
6102
|
+
// these allow for the settle.
|
|
6103
|
+
const ANNOTATION_MIN_DURATION = 1.2;
|
|
6104
|
+
const ANNOTATION_MAX_DURATION = 2.4;
|
|
6105
|
+
// How hard the annotation move's curve settles: higher gets going sooner and settles longer.
|
|
6106
|
+
const SETTLE_POWER = 5;
|
|
6107
|
+
// The highest starting slope carried into a move. The curve stays monotonic up to
|
|
6108
|
+
// SETTLE_POWER, so this is well inside it.
|
|
6109
|
+
const MAX_START_SLOPE = 3;
|
|
6110
|
+
// The view turns a little ahead of the travel, finishing at this share of the move, the way
|
|
6111
|
+
// a camera operator looks toward where they are going before they arrive.
|
|
6112
|
+
const TURN_LEAD = 0.8;
|
|
6113
|
+
// A curve from 0 to 1 over the move that starts at `slope` (progress per unit time: 0 starts
|
|
6114
|
+
// from rest, 1 at the move's average speed), gets going quickly and settles slowly, like a
|
|
6115
|
+
// hand-held move rather than an even symmetric ramp. It shapes like a critically damped spring,
|
|
6116
|
+
// but it arrives at exactly zero speed with no deceleration left, where a spring scaled to land
|
|
6117
|
+
// in a fixed time still has speed to lose and stops abruptly on a long move.
|
|
6118
|
+
const settleFrom = (slope) => (x) => 1 - Math.pow(1 - x, SETTLE_POWER) * (1 + (SETTLE_POWER - slope) * x);
|
|
6019
6119
|
// Walk mode is only enabled when the scene's horizontal footprint is large
|
|
6020
6120
|
// enough to walk around in. Vertical extent (Y) is irrelevant — a tall but
|
|
6021
6121
|
// narrow scene isn't walkable. Both X and Z ranges must exceed this
|
|
@@ -6120,13 +6220,24 @@ class CameraManager {
|
|
|
6120
6220
|
// enter the initial controller
|
|
6121
6221
|
getController(state.cameraMode).onEnter(this.camera);
|
|
6122
6222
|
// transition state
|
|
6123
|
-
const transitionSpeed = 1.0;
|
|
6124
6223
|
let transitionTimer = 1;
|
|
6224
|
+
let transitionDuration = 1;
|
|
6225
|
+
let transitionEase = easeOut;
|
|
6226
|
+
// annotation moves blend the view angles directly, on their own curve so the turn can
|
|
6227
|
+
// lead the travel; the rest blend through the look-at point
|
|
6228
|
+
let transitionTurnEase = null;
|
|
6125
6229
|
let clearOrbitTargetOnTransitionEnd = false;
|
|
6126
|
-
//
|
|
6127
|
-
|
|
6230
|
+
// the camera's speed over the last frame, so a new annotation move can carry on from
|
|
6231
|
+
// the motion it interrupts rather than restart from rest
|
|
6232
|
+
let cameraSpeed = 0;
|
|
6233
|
+
const lastPosition = this.camera.position.clone();
|
|
6234
|
+
// start a new camera transition from the current pose, over `duration` seconds
|
|
6235
|
+
const startTransition = (duration = 1, ease = easeOut, turnEase = null) => {
|
|
6128
6236
|
from.copy(this.camera);
|
|
6129
6237
|
transitionTimer = 0;
|
|
6238
|
+
transitionDuration = duration;
|
|
6239
|
+
transitionEase = ease;
|
|
6240
|
+
transitionTurnEase = turnEase;
|
|
6130
6241
|
};
|
|
6131
6242
|
this.setCollision = (value) => {
|
|
6132
6243
|
controllers.fly.collision = value;
|
|
@@ -6145,17 +6256,27 @@ class CameraManager {
|
|
|
6145
6256
|
const dt = state.cameraMode === 'anim' && state.animationPaused ? 0 : deltaTime;
|
|
6146
6257
|
// update transition timer
|
|
6147
6258
|
const prevTransitionTimer = transitionTimer;
|
|
6148
|
-
transitionTimer = Math.min(1, transitionTimer + deltaTime
|
|
6259
|
+
transitionTimer = Math.min(1, transitionTimer + deltaTime / transitionDuration);
|
|
6149
6260
|
const controller = getController(state.cameraMode);
|
|
6150
6261
|
sourcesByMode[state.cameraMode]?.update(dt, this.camera, frame);
|
|
6151
6262
|
controller.update(dt, frame, target);
|
|
6152
6263
|
if (transitionTimer < 1) {
|
|
6153
6264
|
// lerp away from previous camera during transition
|
|
6154
|
-
|
|
6265
|
+
const t = transitionEase(transitionTimer);
|
|
6266
|
+
if (transitionTurnEase) {
|
|
6267
|
+
this.camera.lerpAngles(from, target, t, transitionTurnEase(transitionTimer));
|
|
6268
|
+
}
|
|
6269
|
+
else {
|
|
6270
|
+
this.camera.lerp(from, target, t);
|
|
6271
|
+
}
|
|
6155
6272
|
}
|
|
6156
6273
|
else {
|
|
6157
6274
|
this.camera.copy(target);
|
|
6158
6275
|
}
|
|
6276
|
+
if (deltaTime > 0) {
|
|
6277
|
+
cameraSpeed = this.camera.position.distance(lastPosition) / deltaTime;
|
|
6278
|
+
}
|
|
6279
|
+
lastPosition.copy(this.camera.position);
|
|
6159
6280
|
// update animation timeline
|
|
6160
6281
|
if (state.cameraMode === 'anim') {
|
|
6161
6282
|
state.animationTime = controllers.anim.animState.cursor.value;
|
|
@@ -6295,8 +6416,22 @@ class CameraManager {
|
|
|
6295
6416
|
// construct camera
|
|
6296
6417
|
tmpCamera.fov = initial.fov;
|
|
6297
6418
|
tmpCamera.look(new Vec3(initial.position), new Vec3(initial.target));
|
|
6419
|
+
// longer for a longer move: travel relative to the scene's size, plus how far the
|
|
6420
|
+
// view turns
|
|
6421
|
+
const travel = this.camera.position.distance(tmpCamera.position);
|
|
6422
|
+
const sceneSize = Math.max(bbox.halfExtents.length(), 1e-3);
|
|
6423
|
+
this.camera.calcFocusPoint(tmpv);
|
|
6424
|
+
tmpv.sub(this.camera.position).normalize();
|
|
6425
|
+
tmpCamera.calcFocusPoint(tmpv2);
|
|
6426
|
+
tmpv2.sub(tmpCamera.position).normalize();
|
|
6427
|
+
const turn = Math.acos(Math.max(-1, Math.min(1, tmpv.dot(tmpv2)))) / Math.PI;
|
|
6428
|
+
const duration = Math.max(ANNOTATION_MIN_DURATION, Math.min(ANNOTATION_MAX_DURATION, ANNOTATION_MIN_DURATION + (0.8 * travel) / sceneSize + 0.6 * turn));
|
|
6429
|
+
// start at the camera's current speed, as a share of this move's average speed
|
|
6430
|
+
const slope = travel > 1e-6 ? Math.min(MAX_START_SLOPE, (cameraSpeed * duration) / travel) : 0;
|
|
6431
|
+
const travelEase = settleFrom(slope);
|
|
6432
|
+
const turnEase = settleFrom(slope * TURN_LEAD);
|
|
6298
6433
|
controllers.orbit.goto(tmpCamera);
|
|
6299
|
-
startTransition();
|
|
6434
|
+
startTransition(duration, travelEase, (x) => turnEase(Math.min(1, x / TURN_LEAD)));
|
|
6300
6435
|
};
|
|
6301
6436
|
// tap-to-navigate: start auto-driving the active mode toward a picked position
|
|
6302
6437
|
events.on('navigateTo', (position, normal, speedMul = 1) => {
|
|
@@ -6575,7 +6710,6 @@ const STYLES = `
|
|
|
6575
6710
|
font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace;
|
|
6576
6711
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
6577
6712
|
border-radius: 4px;
|
|
6578
|
-
z-index: 1000;
|
|
6579
6713
|
pointer-events: auto;
|
|
6580
6714
|
user-select: none;
|
|
6581
6715
|
min-width: 220px;
|
|
@@ -6997,6 +7131,17 @@ class InputModeTracker {
|
|
|
6997
7131
|
|
|
6998
7132
|
const isCaptureMode$1 = (mode) => mode === 'walk' || mode === 'fly';
|
|
6999
7133
|
const isWasdKey = (event) => event.code === 'KeyW' || event.code === 'KeyA' || event.code === 'KeyS' || event.code === 'KeyD';
|
|
7134
|
+
// The shortcut a key press stands for. A key that types a Latin character keeps using it, so
|
|
7135
|
+
// the shortcuts follow the key labels (Dvorak moves them, as it should). A key that types
|
|
7136
|
+
// anything else, such as Cyrillic or Greek, falls back to its position on a US layout, the way
|
|
7137
|
+
// WASD already works, so the shortcuts still work on every layout the ui is translated for.
|
|
7138
|
+
const shortcutKey = (event) => {
|
|
7139
|
+
if (/^[\x20-\x7e]$/.test(event.key)) {
|
|
7140
|
+
return event.key;
|
|
7141
|
+
}
|
|
7142
|
+
const match = /^(?:Key([A-Z])|Digit(\d))$/.exec(event.code);
|
|
7143
|
+
return match ? (match[1]?.toLowerCase() ?? match[2]) : event.key;
|
|
7144
|
+
};
|
|
7000
7145
|
/**
|
|
7001
7146
|
* Keyboard shortcuts that switch camera mode and toggle UI affordances.
|
|
7002
7147
|
* Listens on `window` so the user can press 1/2/3, V, G, H, F, R, Space,
|
|
@@ -7029,7 +7174,8 @@ class ModeShortcuts {
|
|
|
7029
7174
|
if (event.ctrlKey || event.altKey || event.metaKey) {
|
|
7030
7175
|
return;
|
|
7031
7176
|
}
|
|
7032
|
-
|
|
7177
|
+
const key = shortcutKey(event);
|
|
7178
|
+
switch (key) {
|
|
7033
7179
|
case '1':
|
|
7034
7180
|
state.cameraMode = 'orbit';
|
|
7035
7181
|
break;
|
|
@@ -7047,8 +7193,11 @@ class ModeShortcuts {
|
|
|
7047
7193
|
case 'g':
|
|
7048
7194
|
state.gamingControls = !state.gamingControls;
|
|
7049
7195
|
break;
|
|
7196
|
+
// H the controls panel, Shift+H the info panel. Shift is read from the event, so
|
|
7197
|
+
// caps lock does not swap them
|
|
7050
7198
|
case 'h':
|
|
7051
|
-
|
|
7199
|
+
case 'H':
|
|
7200
|
+
events.fire('inputEvent', event.shiftKey ? 'toggleHelp' : 'toggleControls');
|
|
7052
7201
|
break;
|
|
7053
7202
|
case 'r':
|
|
7054
7203
|
events.fire('inputEvent', 'reset', event);
|
|
@@ -7065,7 +7214,7 @@ class ModeShortcuts {
|
|
|
7065
7214
|
break;
|
|
7066
7215
|
}
|
|
7067
7216
|
if (state.cameraMode !== 'walk') {
|
|
7068
|
-
switch (
|
|
7217
|
+
switch (key) {
|
|
7069
7218
|
case 'f':
|
|
7070
7219
|
events.fire('inputEvent', 'frame', event);
|
|
7071
7220
|
break;
|
|
@@ -8105,7 +8254,7 @@ class InputController {
|
|
|
8105
8254
|
window.addEventListener('blur', this._clearMoveInput);
|
|
8106
8255
|
document.addEventListener('visibilitychange', this._clearMoveInput);
|
|
8107
8256
|
// canvas-level signals: anything that interrupts an animation /
|
|
8108
|
-
// closes the settings panel
|
|
8257
|
+
// closes the settings panel
|
|
8109
8258
|
const listen = (eventName, handler) => {
|
|
8110
8259
|
canvas.addEventListener(eventName, handler);
|
|
8111
8260
|
this._canvasListeners.push([eventName, handler]);
|
|
@@ -8668,8 +8817,11 @@ class NavCursor {
|
|
|
8668
8817
|
this.app = app;
|
|
8669
8818
|
this.svg = document.createElementNS(SVGNS, 'svg');
|
|
8670
8819
|
this.svg.style.cssText =
|
|
8671
|
-
'position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible
|
|
8672
|
-
|
|
8820
|
+
'position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible';
|
|
8821
|
+
// in the scene layer, over the scene and beneath the ui, and first in it so the
|
|
8822
|
+
// annotations draw over the cursor
|
|
8823
|
+
const parent = this.canvas.parentElement;
|
|
8824
|
+
(parent.querySelector(':scope > .sse-sceneLayer') ?? parent).prepend(this.svg);
|
|
8673
8825
|
this.captureMarker = document.createElementNS(SVGNS, 'circle');
|
|
8674
8826
|
this.captureMarker.setAttribute('cx', '50%');
|
|
8675
8827
|
this.captureMarker.setAttribute('cy', '50%');
|
|
@@ -9249,6 +9401,18 @@ const fitPlaneNormal = (points, toCamera, outNormal) => {
|
|
|
9249
9401
|
class Picker {
|
|
9250
9402
|
pick;
|
|
9251
9403
|
pickSurface;
|
|
9404
|
+
/**
|
|
9405
|
+
* Pick several points from one render of the pick pass, for testing many screen positions
|
|
9406
|
+
* at once (the annotation occlusion test). Coordinates are normalised like `pick`'s. Each
|
|
9407
|
+
* result is the world position there with the splats' coverage of the pixel, 0 to 1, or
|
|
9408
|
+
* null where no splat covers it.
|
|
9409
|
+
*/
|
|
9410
|
+
pickMany;
|
|
9411
|
+
/**
|
|
9412
|
+
* Drop the cached pick render, for when the scene has changed under a still camera (finer
|
|
9413
|
+
* detail streamed in), which the camera-based cache cannot see.
|
|
9414
|
+
*/
|
|
9415
|
+
invalidate;
|
|
9252
9416
|
release;
|
|
9253
9417
|
constructor(app, camera) {
|
|
9254
9418
|
const { graphicsDevice } = app;
|
|
@@ -9256,6 +9420,9 @@ class Picker {
|
|
|
9256
9420
|
let accumTarget;
|
|
9257
9421
|
let accumPass;
|
|
9258
9422
|
let chunksPatched = false;
|
|
9423
|
+
// set by release: queued and in-flight picks then resolve to nothing, rather than render
|
|
9424
|
+
// with released resources or reach an app that is being destroyed
|
|
9425
|
+
let released = false;
|
|
9259
9426
|
let pickQueue = Promise.resolve();
|
|
9260
9427
|
let cacheValid = false;
|
|
9261
9428
|
let cacheWidth = 0;
|
|
@@ -9370,6 +9537,9 @@ class Picker {
|
|
|
9370
9537
|
}
|
|
9371
9538
|
};
|
|
9372
9539
|
const prepareSample = (x, y) => {
|
|
9540
|
+
if (released) {
|
|
9541
|
+
return null;
|
|
9542
|
+
}
|
|
9373
9543
|
const width = Math.floor(graphicsDevice.width);
|
|
9374
9544
|
const height = Math.floor(graphicsDevice.height);
|
|
9375
9545
|
// bail out if the device hasn't been sized yet
|
|
@@ -9403,9 +9573,22 @@ class Picker {
|
|
|
9403
9573
|
const position = getWorldPoint(pickCamera, screenX, screenY, width, height, normalizedDepth);
|
|
9404
9574
|
return position ? { position, camera: pickCamera, screenX, screenY, width, height } : null;
|
|
9405
9575
|
};
|
|
9406
|
-
|
|
9576
|
+
// `fallback` is the result for a pick that release overtakes: one queued behind another
|
|
9577
|
+
// pick, or one whose read-back is cut short as the device goes
|
|
9578
|
+
const serializePick = (operation, fallback) => {
|
|
9579
|
+
const guarded = () => {
|
|
9580
|
+
if (released) {
|
|
9581
|
+
return Promise.resolve(fallback);
|
|
9582
|
+
}
|
|
9583
|
+
return operation().catch((error) => {
|
|
9584
|
+
if (released) {
|
|
9585
|
+
return fallback;
|
|
9586
|
+
}
|
|
9587
|
+
throw error;
|
|
9588
|
+
});
|
|
9589
|
+
};
|
|
9407
9590
|
// The render targets are shared by all picks on this instance.
|
|
9408
|
-
const result = pickQueue.then(
|
|
9591
|
+
const result = pickQueue.then(guarded, guarded);
|
|
9409
9592
|
pickQueue = result.then(() => undefined, () => undefined);
|
|
9410
9593
|
return result;
|
|
9411
9594
|
};
|
|
@@ -9468,9 +9651,31 @@ class Picker {
|
|
|
9468
9651
|
normal
|
|
9469
9652
|
};
|
|
9470
9653
|
};
|
|
9471
|
-
this.pick = (x, y) => serializePick(() => pick(x, y));
|
|
9472
|
-
this.pickSurface = (x, y) => serializePick(() => pickSurface(x, y));
|
|
9654
|
+
this.pick = (x, y) => serializePick(() => pick(x, y), null);
|
|
9655
|
+
this.pickSurface = (x, y) => serializePick(() => pickSurface(x, y), null);
|
|
9656
|
+
const pickCoverage = async (x, y) => {
|
|
9657
|
+
const sample = prepareSample(x, y);
|
|
9658
|
+
if (!sample) {
|
|
9659
|
+
return null;
|
|
9660
|
+
}
|
|
9661
|
+
const { width, height, screenX, screenY, pickCamera } = sample;
|
|
9662
|
+
const pixels = await readTexture(accumBuffer, screenX, screenY, accumTarget);
|
|
9663
|
+
const r = half2Float(pixels[0]);
|
|
9664
|
+
const alpha = 1 - half2Float(pixels[3]);
|
|
9665
|
+
if (!Number.isFinite(r) || !Number.isFinite(alpha) || alpha < 1e-6) {
|
|
9666
|
+
return null;
|
|
9667
|
+
}
|
|
9668
|
+
const position = getWorldPoint(pickCamera, screenX, screenY, width, height, r / alpha);
|
|
9669
|
+
return position ? { position, alpha } : null;
|
|
9670
|
+
};
|
|
9671
|
+
// the first sample renders the pass and the rest hit its cache, since the camera cannot
|
|
9672
|
+
// change between these synchronous calls; the reads then run in parallel
|
|
9673
|
+
this.pickMany = (points) => serializePick(() => Promise.all(points.map(({ x, y }) => pickCoverage(x, y))), points.map(() => null));
|
|
9674
|
+
this.invalidate = () => {
|
|
9675
|
+
cacheValid = false;
|
|
9676
|
+
};
|
|
9473
9677
|
this.release = () => {
|
|
9678
|
+
released = true;
|
|
9474
9679
|
if (chunksPatched) {
|
|
9475
9680
|
unregisterPickerShaderPatches(app);
|
|
9476
9681
|
chunksPatched = false;
|
|
@@ -11452,7 +11657,7 @@ const createViewer = async (options) => {
|
|
|
11452
11657
|
destroy: () => viewer.destroy()
|
|
11453
11658
|
};
|
|
11454
11659
|
// The built-in controls use the same handle returned to an embedding host.
|
|
11455
|
-
const disposeUI = config.ui ? initUI(global, handle,
|
|
11660
|
+
const disposeUI = config.ui ? initUI(global, handle, () => viewer.picker) : null;
|
|
11456
11661
|
viewer.onDestroy(() => {
|
|
11457
11662
|
destroyed = true;
|
|
11458
11663
|
});
|