@playcanvas/supersplat-viewer 1.34.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 +201 -40
- package/dist/viewer.js +454 -591
- package/dist/viewer.js.map +1 -1
- package/docs/api.md +2 -2
- package/package.json +1 -1
- package/public/index.css +201 -40
- package/public/index.js +452 -589
- 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,7 +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-
|
|
1652
|
+
"settings.show-collision": "Kollision anzeigen",
|
|
1653
1653
|
"settings.frame": "Einpassen",
|
|
1654
1654
|
"settings.reset": "Zurücksetzen",
|
|
1655
1655
|
"tooltip.play": "Wiedergabe",
|
|
@@ -1659,11 +1659,9 @@ var deJson = {
|
|
|
1659
1659
|
"tooltip.walk-mode": "Gehmodus",
|
|
1660
1660
|
"tooltip.reset-camera": "Kamera zurücksetzen",
|
|
1661
1661
|
"tooltip.frame-scene": "Szene einpassen",
|
|
1662
|
-
"tooltip.show-collision": "Kollision anzeigen",
|
|
1663
1662
|
"tooltip.settings": "Einstellungen",
|
|
1664
1663
|
"tooltip.help": "Info",
|
|
1665
|
-
"tooltip.
|
|
1666
|
-
"tooltip.hide-hints": "Steuerungshinweise ausblenden",
|
|
1664
|
+
"tooltip.controls": "Steuerung",
|
|
1667
1665
|
"tooltip.enter-ar": "AR starten",
|
|
1668
1666
|
"tooltip.enter-vr": "VR starten",
|
|
1669
1667
|
"tooltip.fullscreen": "Vollbild",
|
|
@@ -1693,6 +1691,7 @@ var deJson = {
|
|
|
1693
1691
|
"help.action.toggle-gaming": "Gaming-Steuerung umschalten",
|
|
1694
1692
|
"help.action.show-collision": "Kollision anzeigen",
|
|
1695
1693
|
"help.action.play-pause": "Wiedergabe / Pause",
|
|
1694
|
+
"help.action.toggle-controls": "Steuerung umschalten",
|
|
1696
1695
|
"help.action.toggle-help": "Info umschalten",
|
|
1697
1696
|
"help.action.exit-cancel": "Beenden / Abbrechen",
|
|
1698
1697
|
"help.action.release-mouse": "Maus freigeben",
|
|
@@ -1717,7 +1716,7 @@ var enJson = {
|
|
|
1717
1716
|
"settings.performance-mode": "Performance Mode",
|
|
1718
1717
|
"settings.gaming-controls": "Gaming Controls",
|
|
1719
1718
|
"settings.show-annotations": "Show Annotations",
|
|
1720
|
-
"settings.show-
|
|
1719
|
+
"settings.show-collision": "Show Collision",
|
|
1721
1720
|
"settings.frame": "Frame",
|
|
1722
1721
|
"settings.reset": "Reset",
|
|
1723
1722
|
"tooltip.play": "Play",
|
|
@@ -1727,11 +1726,9 @@ var enJson = {
|
|
|
1727
1726
|
"tooltip.walk-mode": "Walk Mode",
|
|
1728
1727
|
"tooltip.reset-camera": "Reset Camera",
|
|
1729
1728
|
"tooltip.frame-scene": "Frame Scene",
|
|
1730
|
-
"tooltip.show-collision": "Show Collision",
|
|
1731
1729
|
"tooltip.settings": "Settings",
|
|
1732
1730
|
"tooltip.help": "Info",
|
|
1733
|
-
"tooltip.
|
|
1734
|
-
"tooltip.hide-hints": "Hide Control Hints",
|
|
1731
|
+
"tooltip.controls": "Controls",
|
|
1735
1732
|
"tooltip.enter-ar": "Enter AR",
|
|
1736
1733
|
"tooltip.enter-vr": "Enter VR",
|
|
1737
1734
|
"tooltip.fullscreen": "Fullscreen",
|
|
@@ -1761,6 +1758,7 @@ var enJson = {
|
|
|
1761
1758
|
"help.action.toggle-gaming": "Toggle Gaming Controls",
|
|
1762
1759
|
"help.action.show-collision": "Show Collision",
|
|
1763
1760
|
"help.action.play-pause": "Play / Pause",
|
|
1761
|
+
"help.action.toggle-controls": "Toggle Controls",
|
|
1764
1762
|
"help.action.toggle-help": "Toggle Info",
|
|
1765
1763
|
"help.action.exit-cancel": "Exit / Cancel",
|
|
1766
1764
|
"help.action.release-mouse": "Release Mouse",
|
|
@@ -1785,7 +1783,7 @@ var esJson = {
|
|
|
1785
1783
|
"settings.performance-mode": "Modo rendimiento",
|
|
1786
1784
|
"settings.gaming-controls": "Controles de juego",
|
|
1787
1785
|
"settings.show-annotations": "Mostrar anotaciones",
|
|
1788
|
-
"settings.show-
|
|
1786
|
+
"settings.show-collision": "Mostrar colisión",
|
|
1789
1787
|
"settings.frame": "Encuadrar",
|
|
1790
1788
|
"settings.reset": "Restablecer",
|
|
1791
1789
|
"tooltip.play": "Reproducir",
|
|
@@ -1795,11 +1793,9 @@ var esJson = {
|
|
|
1795
1793
|
"tooltip.walk-mode": "Modo caminar",
|
|
1796
1794
|
"tooltip.reset-camera": "Restablecer cámara",
|
|
1797
1795
|
"tooltip.frame-scene": "Encuadrar escena",
|
|
1798
|
-
"tooltip.show-collision": "Mostrar colisión",
|
|
1799
1796
|
"tooltip.settings": "Ajustes",
|
|
1800
1797
|
"tooltip.help": "Información",
|
|
1801
|
-
"tooltip.
|
|
1802
|
-
"tooltip.hide-hints": "Ocultar ayuda de controles",
|
|
1798
|
+
"tooltip.controls": "Controles",
|
|
1803
1799
|
"tooltip.enter-ar": "Entrar en AR",
|
|
1804
1800
|
"tooltip.enter-vr": "Entrar en VR",
|
|
1805
1801
|
"tooltip.fullscreen": "Pantalla completa",
|
|
@@ -1829,6 +1825,7 @@ var esJson = {
|
|
|
1829
1825
|
"help.action.toggle-gaming": "Alternar controles de juego",
|
|
1830
1826
|
"help.action.show-collision": "Mostrar colisión",
|
|
1831
1827
|
"help.action.play-pause": "Reproducir / Pausar",
|
|
1828
|
+
"help.action.toggle-controls": "Alternar controles",
|
|
1832
1829
|
"help.action.toggle-help": "Alternar información",
|
|
1833
1830
|
"help.action.exit-cancel": "Salir / Cancelar",
|
|
1834
1831
|
"help.action.release-mouse": "Liberar ratón",
|
|
@@ -1853,7 +1850,7 @@ var frJson = {
|
|
|
1853
1850
|
"settings.performance-mode": "Mode performance",
|
|
1854
1851
|
"settings.gaming-controls": "Commandes de jeu",
|
|
1855
1852
|
"settings.show-annotations": "Afficher les annotations",
|
|
1856
|
-
"settings.show-
|
|
1853
|
+
"settings.show-collision": "Afficher les collisions",
|
|
1857
1854
|
"settings.frame": "Cadrer",
|
|
1858
1855
|
"settings.reset": "Réinitialiser",
|
|
1859
1856
|
"tooltip.play": "Lecture",
|
|
@@ -1863,11 +1860,9 @@ var frJson = {
|
|
|
1863
1860
|
"tooltip.walk-mode": "Mode marche",
|
|
1864
1861
|
"tooltip.reset-camera": "Réinitialiser la caméra",
|
|
1865
1862
|
"tooltip.frame-scene": "Cadrer la scène",
|
|
1866
|
-
"tooltip.show-collision": "Afficher les collisions",
|
|
1867
1863
|
"tooltip.settings": "Paramètres",
|
|
1868
1864
|
"tooltip.help": "Infos",
|
|
1869
|
-
"tooltip.
|
|
1870
|
-
"tooltip.hide-hints": "Masquer l'aide des commandes",
|
|
1865
|
+
"tooltip.controls": "Commandes",
|
|
1871
1866
|
"tooltip.enter-ar": "Entrer en AR",
|
|
1872
1867
|
"tooltip.enter-vr": "Entrer en VR",
|
|
1873
1868
|
"tooltip.fullscreen": "Plein écran",
|
|
@@ -1897,6 +1892,7 @@ var frJson = {
|
|
|
1897
1892
|
"help.action.toggle-gaming": "Basculer les commandes de jeu",
|
|
1898
1893
|
"help.action.show-collision": "Afficher les collisions",
|
|
1899
1894
|
"help.action.play-pause": "Lecture / Pause",
|
|
1895
|
+
"help.action.toggle-controls": "Basculer les commandes",
|
|
1900
1896
|
"help.action.toggle-help": "Basculer les infos",
|
|
1901
1897
|
"help.action.exit-cancel": "Quitter / Annuler",
|
|
1902
1898
|
"help.action.release-mouse": "Libérer la souris",
|
|
@@ -1921,7 +1917,7 @@ var jaJson = {
|
|
|
1921
1917
|
"settings.performance-mode": "パフォーマンスモード",
|
|
1922
1918
|
"settings.gaming-controls": "ゲームコントロール",
|
|
1923
1919
|
"settings.show-annotations": "注釈を表示",
|
|
1924
|
-
"settings.show-
|
|
1920
|
+
"settings.show-collision": "コリジョンを表示",
|
|
1925
1921
|
"settings.frame": "フィット",
|
|
1926
1922
|
"settings.reset": "リセット",
|
|
1927
1923
|
"tooltip.play": "再生",
|
|
@@ -1931,11 +1927,9 @@ var jaJson = {
|
|
|
1931
1927
|
"tooltip.walk-mode": "ウォークモード",
|
|
1932
1928
|
"tooltip.reset-camera": "カメラをリセット",
|
|
1933
1929
|
"tooltip.frame-scene": "シーンにフィット",
|
|
1934
|
-
"tooltip.show-collision": "コリジョンを表示",
|
|
1935
1930
|
"tooltip.settings": "設定",
|
|
1936
1931
|
"tooltip.help": "情報",
|
|
1937
|
-
"tooltip.
|
|
1938
|
-
"tooltip.hide-hints": "操作ヒントを非表示",
|
|
1932
|
+
"tooltip.controls": "操作",
|
|
1939
1933
|
"tooltip.enter-ar": "ARを開始",
|
|
1940
1934
|
"tooltip.enter-vr": "VRを開始",
|
|
1941
1935
|
"tooltip.fullscreen": "全画面表示",
|
|
@@ -1965,6 +1959,7 @@ var jaJson = {
|
|
|
1965
1959
|
"help.action.toggle-gaming": "ゲームコントロールを切り替え",
|
|
1966
1960
|
"help.action.show-collision": "コリジョンを表示",
|
|
1967
1961
|
"help.action.play-pause": "再生 / 一時停止",
|
|
1962
|
+
"help.action.toggle-controls": "操作の切り替え",
|
|
1968
1963
|
"help.action.toggle-help": "情報を切り替え",
|
|
1969
1964
|
"help.action.exit-cancel": "終了 / キャンセル",
|
|
1970
1965
|
"help.action.release-mouse": "マウスを解放",
|
|
@@ -1989,7 +1984,7 @@ var koJson = {
|
|
|
1989
1984
|
"settings.performance-mode": "성능 모드",
|
|
1990
1985
|
"settings.gaming-controls": "게임 컨트롤",
|
|
1991
1986
|
"settings.show-annotations": "주석 표시",
|
|
1992
|
-
"settings.show-
|
|
1987
|
+
"settings.show-collision": "충돌 표시",
|
|
1993
1988
|
"settings.frame": "맞춤",
|
|
1994
1989
|
"settings.reset": "재설정",
|
|
1995
1990
|
"tooltip.play": "재생",
|
|
@@ -1999,11 +1994,9 @@ var koJson = {
|
|
|
1999
1994
|
"tooltip.walk-mode": "워크 모드",
|
|
2000
1995
|
"tooltip.reset-camera": "카메라 재설정",
|
|
2001
1996
|
"tooltip.frame-scene": "씬에 맞춤",
|
|
2002
|
-
"tooltip.show-collision": "충돌 표시",
|
|
2003
1997
|
"tooltip.settings": "설정",
|
|
2004
1998
|
"tooltip.help": "정보",
|
|
2005
|
-
"tooltip.
|
|
2006
|
-
"tooltip.hide-hints": "조작 힌트 숨기기",
|
|
1999
|
+
"tooltip.controls": "조작",
|
|
2007
2000
|
"tooltip.enter-ar": "AR 시작",
|
|
2008
2001
|
"tooltip.enter-vr": "VR 시작",
|
|
2009
2002
|
"tooltip.fullscreen": "전체 화면",
|
|
@@ -2033,6 +2026,7 @@ var koJson = {
|
|
|
2033
2026
|
"help.action.toggle-gaming": "게임 컨트롤 전환",
|
|
2034
2027
|
"help.action.show-collision": "충돌 표시",
|
|
2035
2028
|
"help.action.play-pause": "재생 / 일시 정지",
|
|
2029
|
+
"help.action.toggle-controls": "조작 전환",
|
|
2036
2030
|
"help.action.toggle-help": "정보 전환",
|
|
2037
2031
|
"help.action.exit-cancel": "나가기 / 취소",
|
|
2038
2032
|
"help.action.release-mouse": "마우스 해제",
|
|
@@ -2057,7 +2051,7 @@ var ptBRJson = {
|
|
|
2057
2051
|
"settings.performance-mode": "Modo de desempenho",
|
|
2058
2052
|
"settings.gaming-controls": "Controles de jogo",
|
|
2059
2053
|
"settings.show-annotations": "Mostrar anotações",
|
|
2060
|
-
"settings.show-
|
|
2054
|
+
"settings.show-collision": "Mostrar colisão",
|
|
2061
2055
|
"settings.frame": "Enquadrar",
|
|
2062
2056
|
"settings.reset": "Redefinir",
|
|
2063
2057
|
"tooltip.play": "Reproduzir",
|
|
@@ -2067,11 +2061,9 @@ var ptBRJson = {
|
|
|
2067
2061
|
"tooltip.walk-mode": "Modo caminhar",
|
|
2068
2062
|
"tooltip.reset-camera": "Redefinir câmera",
|
|
2069
2063
|
"tooltip.frame-scene": "Enquadrar cena",
|
|
2070
|
-
"tooltip.show-collision": "Mostrar colisão",
|
|
2071
2064
|
"tooltip.settings": "Configurações",
|
|
2072
2065
|
"tooltip.help": "Informações",
|
|
2073
|
-
"tooltip.
|
|
2074
|
-
"tooltip.hide-hints": "Ocultar dicas de controle",
|
|
2066
|
+
"tooltip.controls": "Controles",
|
|
2075
2067
|
"tooltip.enter-ar": "Entrar em AR",
|
|
2076
2068
|
"tooltip.enter-vr": "Entrar em VR",
|
|
2077
2069
|
"tooltip.fullscreen": "Tela cheia",
|
|
@@ -2101,6 +2093,7 @@ var ptBRJson = {
|
|
|
2101
2093
|
"help.action.toggle-gaming": "Alternar controles de jogo",
|
|
2102
2094
|
"help.action.show-collision": "Mostrar colisão",
|
|
2103
2095
|
"help.action.play-pause": "Reproduzir / Pausar",
|
|
2096
|
+
"help.action.toggle-controls": "Alternar controles",
|
|
2104
2097
|
"help.action.toggle-help": "Alternar informações",
|
|
2105
2098
|
"help.action.exit-cancel": "Sair / Cancelar",
|
|
2106
2099
|
"help.action.release-mouse": "Liberar mouse",
|
|
@@ -2125,7 +2118,7 @@ var ruJson = {
|
|
|
2125
2118
|
"settings.performance-mode": "Режим производительности",
|
|
2126
2119
|
"settings.gaming-controls": "Игровое управление",
|
|
2127
2120
|
"settings.show-annotations": "Показать аннотации",
|
|
2128
|
-
"settings.show-
|
|
2121
|
+
"settings.show-collision": "Показать коллизию",
|
|
2129
2122
|
"settings.frame": "Кадрировать",
|
|
2130
2123
|
"settings.reset": "Сбросить",
|
|
2131
2124
|
"tooltip.play": "Воспроизвести",
|
|
@@ -2135,11 +2128,9 @@ var ruJson = {
|
|
|
2135
2128
|
"tooltip.walk-mode": "Режим ходьбы",
|
|
2136
2129
|
"tooltip.reset-camera": "Сбросить камеру",
|
|
2137
2130
|
"tooltip.frame-scene": "Кадрировать сцену",
|
|
2138
|
-
"tooltip.show-collision": "Показать коллизию",
|
|
2139
2131
|
"tooltip.settings": "Настройки",
|
|
2140
2132
|
"tooltip.help": "Информация",
|
|
2141
|
-
"tooltip.
|
|
2142
|
-
"tooltip.hide-hints": "Скрыть подсказки управления",
|
|
2133
|
+
"tooltip.controls": "Управление",
|
|
2143
2134
|
"tooltip.enter-ar": "Войти в AR",
|
|
2144
2135
|
"tooltip.enter-vr": "Войти в VR",
|
|
2145
2136
|
"tooltip.fullscreen": "Полный экран",
|
|
@@ -2169,6 +2160,7 @@ var ruJson = {
|
|
|
2169
2160
|
"help.action.toggle-gaming": "Переключить игровое управление",
|
|
2170
2161
|
"help.action.show-collision": "Показать коллизию",
|
|
2171
2162
|
"help.action.play-pause": "Воспроизведение / Пауза",
|
|
2163
|
+
"help.action.toggle-controls": "Переключить управление",
|
|
2172
2164
|
"help.action.toggle-help": "Переключить информацию",
|
|
2173
2165
|
"help.action.exit-cancel": "Выход / Отмена",
|
|
2174
2166
|
"help.action.release-mouse": "Освободить мышь",
|
|
@@ -2193,7 +2185,7 @@ var zhCNJson = {
|
|
|
2193
2185
|
"settings.performance-mode": "性能模式",
|
|
2194
2186
|
"settings.gaming-controls": "游戏控制",
|
|
2195
2187
|
"settings.show-annotations": "显示注释",
|
|
2196
|
-
"settings.show-
|
|
2188
|
+
"settings.show-collision": "显示碰撞",
|
|
2197
2189
|
"settings.frame": "适应",
|
|
2198
2190
|
"settings.reset": "重置",
|
|
2199
2191
|
"tooltip.play": "播放",
|
|
@@ -2203,11 +2195,9 @@ var zhCNJson = {
|
|
|
2203
2195
|
"tooltip.walk-mode": "行走模式",
|
|
2204
2196
|
"tooltip.reset-camera": "重置相机",
|
|
2205
2197
|
"tooltip.frame-scene": "适应场景",
|
|
2206
|
-
"tooltip.show-collision": "显示碰撞",
|
|
2207
2198
|
"tooltip.settings": "设置",
|
|
2208
2199
|
"tooltip.help": "信息",
|
|
2209
|
-
"tooltip.
|
|
2210
|
-
"tooltip.hide-hints": "隐藏操作提示",
|
|
2200
|
+
"tooltip.controls": "操作",
|
|
2211
2201
|
"tooltip.enter-ar": "进入 AR",
|
|
2212
2202
|
"tooltip.enter-vr": "进入 VR",
|
|
2213
2203
|
"tooltip.fullscreen": "全屏",
|
|
@@ -2237,6 +2227,7 @@ var zhCNJson = {
|
|
|
2237
2227
|
"help.action.toggle-gaming": "切换游戏控制",
|
|
2238
2228
|
"help.action.show-collision": "显示碰撞",
|
|
2239
2229
|
"help.action.play-pause": "播放 / 暂停",
|
|
2230
|
+
"help.action.toggle-controls": "切换操作",
|
|
2240
2231
|
"help.action.toggle-help": "切换信息",
|
|
2241
2232
|
"help.action.exit-cancel": "退出 / 取消",
|
|
2242
2233
|
"help.action.release-mouse": "释放鼠标",
|
|
@@ -2567,7 +2558,7 @@ const importSettings = (settings) => {
|
|
|
2567
2558
|
return result;
|
|
2568
2559
|
};
|
|
2569
2560
|
|
|
2570
|
-
var version = "1.
|
|
2561
|
+
var version = "1.35.0";
|
|
2571
2562
|
|
|
2572
2563
|
class Tooltip {
|
|
2573
2564
|
register;
|
|
@@ -2667,17 +2658,23 @@ class Tooltip {
|
|
|
2667
2658
|
const initAnnotationControls = (viewer, root) => {
|
|
2668
2659
|
const { state, events, annotations } = viewer;
|
|
2669
2660
|
const nav = root.querySelector('.sse-annotationNav');
|
|
2661
|
+
const info = root.querySelector('.sse-annotationInfo');
|
|
2662
|
+
const number = root.querySelector('.sse-annotationNavNumber');
|
|
2670
2663
|
const title = root.querySelector('.sse-annotationNavTitle');
|
|
2671
2664
|
const prev = root.querySelector('.sse-annotationPrev');
|
|
2672
2665
|
const next = root.querySelector('.sse-annotationNext');
|
|
2673
2666
|
const row = root.querySelector('.sse-annotationsRow');
|
|
2674
2667
|
const check = root.querySelector('.sse-annotationsCheck');
|
|
2675
|
-
// 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.
|
|
2676
2670
|
let currentIndex = state.selectedAnnotation ?? 0;
|
|
2677
2671
|
const update = () => {
|
|
2678
2672
|
currentIndex = state.selectedAnnotation ?? currentIndex;
|
|
2673
|
+
// the number its hotspot shows in the scene
|
|
2674
|
+
number.textContent = annotations[currentIndex] ? String(currentIndex + 1) : '';
|
|
2679
2675
|
title.textContent = annotations[currentIndex]?.title ?? '';
|
|
2680
2676
|
nav.classList.toggle('sse-hidden', !state.loaded || !state.showAnnotations || annotations.length < 2);
|
|
2677
|
+
nav.classList.toggle('sse-unselected', state.selectedAnnotation === null);
|
|
2681
2678
|
nav.classList.toggle('sse-desktop', state.inputMode === 'desktop');
|
|
2682
2679
|
nav.classList.toggle('sse-touch', state.inputMode === 'touch');
|
|
2683
2680
|
nav.classList.toggle('sse-faded-in', !state.controlsHidden);
|
|
@@ -2694,12 +2691,19 @@ const initAnnotationControls = (viewer, root) => {
|
|
|
2694
2691
|
event.stopPropagation();
|
|
2695
2692
|
viewer.selectAnnotation((currentIndex + 1) % annotations.length);
|
|
2696
2693
|
};
|
|
2694
|
+
const onInfo = (event) => {
|
|
2695
|
+
event.stopPropagation();
|
|
2696
|
+
if (state.loaded && state.selectedAnnotation === null && annotations[currentIndex]) {
|
|
2697
|
+
viewer.selectAnnotation(currentIndex);
|
|
2698
|
+
}
|
|
2699
|
+
};
|
|
2697
2700
|
const onVisibility = (event) => {
|
|
2698
2701
|
event.stopPropagation();
|
|
2699
2702
|
state.showAnnotations = !state.showAnnotations;
|
|
2700
2703
|
};
|
|
2701
2704
|
prev.addEventListener('click', onPrev);
|
|
2702
2705
|
next.addEventListener('click', onNext);
|
|
2706
|
+
info.addEventListener('click', onInfo);
|
|
2703
2707
|
row.addEventListener('click', onVisibility);
|
|
2704
2708
|
const subscriptions = [
|
|
2705
2709
|
events.on('loaded:changed', update),
|
|
@@ -2714,38 +2718,21 @@ const initAnnotationControls = (viewer, root) => {
|
|
|
2714
2718
|
subscription.off();
|
|
2715
2719
|
prev.removeEventListener('click', onPrev);
|
|
2716
2720
|
next.removeEventListener('click', onNext);
|
|
2721
|
+
info.removeEventListener('click', onInfo);
|
|
2717
2722
|
row.removeEventListener('click', onVisibility);
|
|
2718
2723
|
};
|
|
2719
2724
|
};
|
|
2720
2725
|
|
|
2721
|
-
// clamp the vertices of the hotspot so it is never clipped by the near or far plane
|
|
2722
|
-
const depthClampGlsl = `
|
|
2723
|
-
float f = gl_Position.z / gl_Position.w;
|
|
2724
|
-
if (f > 1.0) {
|
|
2725
|
-
gl_Position.z = gl_Position.w;
|
|
2726
|
-
} else if (f < -1.0) {
|
|
2727
|
-
gl_Position.z = -gl_Position.w;
|
|
2728
|
-
}
|
|
2729
|
-
`;
|
|
2730
|
-
const depthClampWgsl = `
|
|
2731
|
-
let f = output.position.z / output.position.w;
|
|
2732
|
-
if (f > 1.0) {
|
|
2733
|
-
output.position.z = output.position.w;
|
|
2734
|
-
} else if (f < -1.0) {
|
|
2735
|
-
output.position.z = -output.position.w;
|
|
2736
|
-
}
|
|
2737
|
-
`;
|
|
2738
2726
|
const vec$1 = new Vec3();
|
|
2739
|
-
const HOTSPOT_SIZE = 25;
|
|
2740
|
-
const HOTSPOT_COLOR = new Color(0.8, 0.8, 0.8);
|
|
2741
|
-
const HOVER_COLOR = new Color(1.0, 0.4, 0.0);
|
|
2742
2727
|
/**
|
|
2743
2728
|
* A script for creating interactive 3D annotations in a scene. Each annotation consists of:
|
|
2744
2729
|
*
|
|
2745
|
-
* - A
|
|
2746
|
-
*
|
|
2747
|
-
*
|
|
2748
|
-
* - 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`.
|
|
2749
2736
|
*/
|
|
2750
2737
|
class Annotation extends Script {
|
|
2751
2738
|
static scriptName = 'annotation';
|
|
@@ -2771,247 +2758,28 @@ class Annotation extends Script {
|
|
|
2771
2758
|
*/
|
|
2772
2759
|
hotspotDom = null;
|
|
2773
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.
|
|
2774
2763
|
* @private
|
|
2775
2764
|
*/
|
|
2776
|
-
|
|
2777
|
-
/**
|
|
2778
|
-
* @private
|
|
2779
|
-
*/
|
|
2780
|
-
materials = [];
|
|
2765
|
+
screen = null;
|
|
2781
2766
|
/**
|
|
2782
2767
|
* Set once the entity is destroyed, so a prerender still queued for this frame does not
|
|
2783
2768
|
* touch torn-down state.
|
|
2784
2769
|
* @private
|
|
2785
2770
|
*/
|
|
2786
2771
|
destroyed = false;
|
|
2787
|
-
/**
|
|
2788
|
-
* Creates the stylesheet the annotation dom needs.
|
|
2789
|
-
* @param {number} size - The size of the hotspot in screen pixels.
|
|
2790
|
-
* @returns {HTMLStyleElement} The style element, not yet attached.
|
|
2791
|
-
* @private
|
|
2792
|
-
*/
|
|
2793
|
-
static _createStyleSheet(size) {
|
|
2794
|
-
const css = `
|
|
2795
|
-
.sse-annotation {
|
|
2796
|
-
display: block;
|
|
2797
|
-
position: absolute;
|
|
2798
|
-
background-color: rgba(0, 0, 0, 0.8);
|
|
2799
|
-
color: white;
|
|
2800
|
-
padding: 8px;
|
|
2801
|
-
border-radius: 4px;
|
|
2802
|
-
font-size: 14px;
|
|
2803
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
|
2804
|
-
pointer-events: none;
|
|
2805
|
-
max-width: 200px;
|
|
2806
|
-
word-wrap: break-word;
|
|
2807
|
-
overflow-x: visible;
|
|
2808
|
-
white-space: normal;
|
|
2809
|
-
width: fit-content;
|
|
2810
|
-
opacity: 0;
|
|
2811
|
-
transition: opacity 0.2s ease-in-out;
|
|
2812
|
-
visibility: hidden;
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2815
|
-
.sse-annotation-title {
|
|
2816
|
-
font-weight: bold;
|
|
2817
|
-
margin-bottom: 4px;
|
|
2818
|
-
}
|
|
2819
|
-
|
|
2820
|
-
/* Tooltip arrow */
|
|
2821
|
-
.sse-annotation.sse-arrow-right::before,
|
|
2822
|
-
.sse-annotation.sse-arrow-left::before {
|
|
2823
|
-
content: "";
|
|
2824
|
-
position: absolute;
|
|
2825
|
-
top: var(--arrow-top, 50%);
|
|
2826
|
-
transform: translateY(-50%);
|
|
2827
|
-
border-top: 8px solid transparent;
|
|
2828
|
-
border-bottom: 8px solid transparent;
|
|
2829
|
-
}
|
|
2830
|
-
|
|
2831
|
-
.sse-annotation.sse-arrow-right::before {
|
|
2832
|
-
left: -8px;
|
|
2833
|
-
border-right: 8px solid rgba(0, 0, 0, 0.8);
|
|
2834
|
-
}
|
|
2835
|
-
|
|
2836
|
-
.sse-annotation.sse-arrow-left::before {
|
|
2837
|
-
right: -8px;
|
|
2838
|
-
border-left: 8px solid rgba(0, 0, 0, 0.8);
|
|
2839
|
-
}
|
|
2840
|
-
|
|
2841
|
-
.sse-annotation-hotspot {
|
|
2842
|
-
display: none;
|
|
2843
|
-
position: absolute;
|
|
2844
|
-
width: ${size + 5}px;
|
|
2845
|
-
height: ${size + 5}px;
|
|
2846
|
-
opacity: 0;
|
|
2847
|
-
cursor: pointer;
|
|
2848
|
-
transform: translate(-50%, -50%);
|
|
2849
|
-
}
|
|
2850
|
-
`;
|
|
2851
|
-
const style = document.createElement('style');
|
|
2852
|
-
style.textContent = css;
|
|
2853
|
-
return style;
|
|
2854
|
-
}
|
|
2855
|
-
/**
|
|
2856
|
-
* Creates a circular hotspot texture.
|
|
2857
|
-
* @param {AppBase} app - The PlayCanvas AppBase
|
|
2858
|
-
* @param {string} label - Label text to draw on the hotspot
|
|
2859
|
-
* @param {number} [size] - The texture size (should be power of 2)
|
|
2860
|
-
* @param {number} [borderWidth] - The border width in pixels
|
|
2861
|
-
* @returns {Texture} The hotspot texture
|
|
2862
|
-
* @private
|
|
2863
|
-
*/
|
|
2864
|
-
static _createHotspotTexture(app, label, size = 64, borderWidth = 6) {
|
|
2865
|
-
// Create canvas for hotspot texture
|
|
2866
|
-
const canvas = document.createElement('canvas');
|
|
2867
|
-
canvas.width = size;
|
|
2868
|
-
canvas.height = size;
|
|
2869
|
-
const ctx = canvas.getContext('2d');
|
|
2870
|
-
// First clear with stroke color at zero alpha
|
|
2871
|
-
ctx.fillStyle = 'white';
|
|
2872
|
-
ctx.globalAlpha = 0;
|
|
2873
|
-
ctx.fillRect(0, 0, size, size);
|
|
2874
|
-
ctx.globalAlpha = 1.0;
|
|
2875
|
-
// Draw dark circle with light border
|
|
2876
|
-
const centerX = size / 2;
|
|
2877
|
-
const centerY = size / 2;
|
|
2878
|
-
const radius = size / 2 - 4; // Leave space for border
|
|
2879
|
-
// Draw main circle
|
|
2880
|
-
ctx.beginPath();
|
|
2881
|
-
ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
|
|
2882
|
-
ctx.fillStyle = 'black';
|
|
2883
|
-
ctx.fill();
|
|
2884
|
-
// Draw border
|
|
2885
|
-
ctx.beginPath();
|
|
2886
|
-
ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);
|
|
2887
|
-
ctx.lineWidth = borderWidth;
|
|
2888
|
-
ctx.strokeStyle = 'white';
|
|
2889
|
-
ctx.stroke();
|
|
2890
|
-
// Draw text
|
|
2891
|
-
ctx.font = 'bold 32px Arial';
|
|
2892
|
-
ctx.textAlign = 'center';
|
|
2893
|
-
ctx.textBaseline = 'middle';
|
|
2894
|
-
ctx.fillStyle = 'white';
|
|
2895
|
-
ctx.fillText(label, Math.floor(canvas.width / 2), Math.floor(canvas.height / 2) + 1);
|
|
2896
|
-
// get pixel data
|
|
2897
|
-
const imageData = ctx.getImageData(0, 0, size, size);
|
|
2898
|
-
const data = imageData.data;
|
|
2899
|
-
// set the color channel of semitransparent pixels to white so the blending at
|
|
2900
|
-
// the edges is correct
|
|
2901
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
2902
|
-
const a = data[i + 3];
|
|
2903
|
-
if (a < 255) {
|
|
2904
|
-
data[i] = 255;
|
|
2905
|
-
data[i + 1] = 255;
|
|
2906
|
-
data[i + 2] = 255;
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
const texture = new Texture(app.graphicsDevice, {
|
|
2910
|
-
width: size,
|
|
2911
|
-
height: size,
|
|
2912
|
-
format: PIXELFORMAT_RGBA8,
|
|
2913
|
-
magFilter: FILTER_LINEAR,
|
|
2914
|
-
minFilter: FILTER_LINEAR,
|
|
2915
|
-
mipmaps: false,
|
|
2916
|
-
levels: [new Uint8Array(data.buffer)]
|
|
2917
|
-
});
|
|
2918
|
-
return texture;
|
|
2919
|
-
}
|
|
2920
|
-
/**
|
|
2921
|
-
* Creates a material for hotspot rendering.
|
|
2922
|
-
* @param {Texture} texture - The texture to use for emissive and opacity
|
|
2923
|
-
* @param {Color} color - The emissive colour
|
|
2924
|
-
* @param {object} [options] - Material options
|
|
2925
|
-
* @param {number} [options.opacity] - Base opacity multiplier
|
|
2926
|
-
* @param {boolean} [options.depthTest] - Whether to perform depth testing
|
|
2927
|
-
* @param {boolean} [options.depthWrite] - Whether to write to depth buffer
|
|
2928
|
-
* @returns {StandardMaterial} The configured material
|
|
2929
|
-
* @private
|
|
2930
|
-
*/
|
|
2931
|
-
static _createHotspotMaterial(texture, color, { opacity = 1, depthTest = true, depthWrite = true } = {}) {
|
|
2932
|
-
const material = new StandardMaterial();
|
|
2933
|
-
// Base properties
|
|
2934
|
-
material.diffuse = Color.BLACK;
|
|
2935
|
-
material.emissive.copy(color);
|
|
2936
|
-
material.emissiveMap = texture;
|
|
2937
|
-
material.opacityMap = texture;
|
|
2938
|
-
// Alpha properties
|
|
2939
|
-
material.opacity = opacity;
|
|
2940
|
-
material.alphaTest = 0.01;
|
|
2941
|
-
material.blendState = new BlendState(true, BLENDEQUATION_ADD, BLENDMODE_SRC_ALPHA, BLENDMODE_ONE_MINUS_SRC_ALPHA, BLENDEQUATION_ADD, BLENDMODE_ONE, BLENDMODE_ONE);
|
|
2942
|
-
// Depth properties
|
|
2943
|
-
material.depthTest = depthTest;
|
|
2944
|
-
material.depthWrite = depthWrite;
|
|
2945
|
-
// Rendering properties
|
|
2946
|
-
material.cull = CULLFACE_NONE;
|
|
2947
|
-
material.useLighting = false;
|
|
2948
|
-
material.shaderChunks.glsl.add({
|
|
2949
|
-
litUserMainEndVS: depthClampGlsl
|
|
2950
|
-
});
|
|
2951
|
-
material.shaderChunks.wgsl.add({
|
|
2952
|
-
litUserMainEndVS: depthClampWgsl
|
|
2953
|
-
});
|
|
2954
|
-
material.update();
|
|
2955
|
-
return material;
|
|
2956
|
-
}
|
|
2957
2772
|
initialize() {
|
|
2958
2773
|
const ctx = this.context;
|
|
2959
|
-
// Create texture
|
|
2960
|
-
this.texture = Annotation._createHotspotTexture(this.app, this.label);
|
|
2961
|
-
// Create material the base and overlay material
|
|
2962
|
-
this.materials = [
|
|
2963
|
-
Annotation._createHotspotMaterial(this.texture, ctx.hotspotColor, {
|
|
2964
|
-
opacity: 1,
|
|
2965
|
-
depthTest: true,
|
|
2966
|
-
depthWrite: true
|
|
2967
|
-
}),
|
|
2968
|
-
Annotation._createHotspotMaterial(this.texture, ctx.hotspotColor, {
|
|
2969
|
-
opacity: 0.25,
|
|
2970
|
-
depthTest: false,
|
|
2971
|
-
depthWrite: false
|
|
2972
|
-
})
|
|
2973
|
-
];
|
|
2974
|
-
const base = new Entity('base', this.app);
|
|
2975
|
-
const baseMi = new MeshInstance(ctx.mesh, this.materials[0]);
|
|
2976
|
-
baseMi.cull = false;
|
|
2977
|
-
base.addComponent('render', {
|
|
2978
|
-
layers: [ctx.layers[0].id],
|
|
2979
|
-
meshInstances: [baseMi]
|
|
2980
|
-
});
|
|
2981
|
-
const overlay = new Entity('overlay', this.app);
|
|
2982
|
-
const overlayMi = new MeshInstance(ctx.mesh, this.materials[1]);
|
|
2983
|
-
overlayMi.cull = false;
|
|
2984
|
-
overlay.addComponent('render', {
|
|
2985
|
-
layers: [ctx.layers[1].id],
|
|
2986
|
-
meshInstances: [overlayMi]
|
|
2987
|
-
});
|
|
2988
|
-
this.entity.addChild(base);
|
|
2989
|
-
this.entity.addChild(overlay);
|
|
2990
|
-
// Create hotspot dom
|
|
2991
2774
|
this.hotspotDom = document.createElement('div');
|
|
2992
2775
|
this.hotspotDom.className = 'sse-annotation-hotspot';
|
|
2993
|
-
|
|
2776
|
+
this.hotspotDom.textContent = this.label;
|
|
2994
2777
|
const onClick = (e) => {
|
|
2995
2778
|
e.stopPropagation();
|
|
2996
2779
|
this.fire('select');
|
|
2997
2780
|
};
|
|
2998
2781
|
this.hotspotDom.addEventListener('click', onClick);
|
|
2999
|
-
|
|
3000
|
-
if (ctx.hoverAnnotation === this) {
|
|
3001
|
-
ctx.hoverAnnotation = null;
|
|
3002
|
-
this.setHover(false);
|
|
3003
|
-
}
|
|
3004
|
-
};
|
|
3005
|
-
const enter = () => {
|
|
3006
|
-
if (ctx.hoverAnnotation !== null) {
|
|
3007
|
-
ctx.hoverAnnotation.setHover(false);
|
|
3008
|
-
}
|
|
3009
|
-
ctx.hoverAnnotation = this;
|
|
3010
|
-
this.setHover(true);
|
|
3011
|
-
};
|
|
3012
|
-
this.hotspotDom.addEventListener('pointerenter', enter);
|
|
3013
|
-
this.hotspotDom.addEventListener('pointerleave', leave);
|
|
3014
|
-
ctx.parentDom.appendChild(this.hotspotDom);
|
|
2782
|
+
ctx.hotspotsDom.appendChild(this.hotspotDom);
|
|
3015
2783
|
const onPrerender = () => this._update();
|
|
3016
2784
|
this.app.on('prerender', onPrerender);
|
|
3017
2785
|
// Clean up on entity destruction
|
|
@@ -3019,23 +2787,14 @@ class Annotation extends Script {
|
|
|
3019
2787
|
this.destroyed = true;
|
|
3020
2788
|
this.app.off('prerender', onPrerender);
|
|
3021
2789
|
this.hotspotDom.removeEventListener('click', onClick);
|
|
3022
|
-
this.hotspotDom.removeEventListener('pointerenter', enter);
|
|
3023
|
-
this.hotspotDom.removeEventListener('pointerleave', leave);
|
|
3024
2790
|
this.hotspotDom.remove();
|
|
3025
|
-
if (ctx.hoverAnnotation === this) {
|
|
3026
|
-
ctx.hoverAnnotation = null;
|
|
3027
|
-
}
|
|
3028
2791
|
if (ctx.activeAnnotation === this) {
|
|
3029
2792
|
this.hideTooltip();
|
|
3030
2793
|
}
|
|
3031
|
-
this.materials.forEach((mat) => mat.destroy());
|
|
3032
|
-
this.materials = [];
|
|
3033
|
-
this.texture.destroy();
|
|
3034
|
-
this.texture = null;
|
|
3035
2794
|
});
|
|
3036
2795
|
}
|
|
3037
2796
|
/**
|
|
3038
|
-
* Update screen-space elements
|
|
2797
|
+
* Update the screen-space elements for this annotation. Called each frame from the
|
|
3039
2798
|
* prerender callback, and also directly from showTooltip to ensure the tooltip is positioned
|
|
3040
2799
|
* correctly even when the camera hasn't moved (e.g. annotations sharing the same camera pose).
|
|
3041
2800
|
* @private
|
|
@@ -3045,47 +2804,35 @@ class Annotation extends Script {
|
|
|
3045
2804
|
return;
|
|
3046
2805
|
const { camera } = this.context;
|
|
3047
2806
|
const position = this.entity.getPosition();
|
|
3048
|
-
|
|
3049
|
-
const { viewMatrix } = camera.camera;
|
|
3050
|
-
viewMatrix.transformPoint(position, vec$1);
|
|
2807
|
+
camera.camera.viewMatrix.transformPoint(position, vec$1);
|
|
3051
2808
|
if (vec$1.z >= 0) {
|
|
2809
|
+
this.screen = null;
|
|
3052
2810
|
this._hideElements();
|
|
3053
2811
|
return;
|
|
3054
2812
|
}
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
const { opacity } = this.context;
|
|
3060
|
-
this.materials[0].opacity = opacity;
|
|
3061
|
-
this.materials[1].opacity = 0.25 * opacity;
|
|
3062
|
-
this.materials[0].setParameter('material_opacity', opacity);
|
|
3063
|
-
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);
|
|
3064
2817
|
}
|
|
3065
2818
|
/**
|
|
3066
|
-
*
|
|
3067
|
-
* @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.
|
|
3068
2821
|
* @private
|
|
3069
2822
|
*/
|
|
3070
|
-
|
|
3071
|
-
this.
|
|
3072
|
-
material.emissive.copy(hover ? this.context.hoverColor : this.context.hotspotColor);
|
|
3073
|
-
material.update();
|
|
3074
|
-
});
|
|
3075
|
-
this.fire('hover', hover);
|
|
2823
|
+
setOccluded(occluded) {
|
|
2824
|
+
this.hotspotDom.classList.toggle('sse-occluded', occluded);
|
|
3076
2825
|
}
|
|
3077
2826
|
/**
|
|
3078
2827
|
* @private
|
|
3079
2828
|
*/
|
|
3080
2829
|
showTooltip() {
|
|
3081
2830
|
const ctx = this.context;
|
|
3082
|
-
clearTimeout(ctx.hideTimeout);
|
|
3083
|
-
ctx.hideTimeout = null;
|
|
3084
2831
|
ctx.activeAnnotation = this;
|
|
3085
|
-
ctx.tooltipDom.style.visibility = 'visible';
|
|
3086
|
-
ctx.tooltipDom.style.opacity = '1';
|
|
3087
2832
|
ctx.titleDom.textContent = this.title;
|
|
3088
2833
|
ctx.textDom.textContent = this.text;
|
|
2834
|
+
ctx.tooltipDom.classList.add('sse-visible');
|
|
2835
|
+
this.hotspotDom.classList.add('sse-active');
|
|
3089
2836
|
// Immediately update incase the camera doesn't move
|
|
3090
2837
|
this._update();
|
|
3091
2838
|
}
|
|
@@ -3094,17 +2841,9 @@ class Annotation extends Script {
|
|
|
3094
2841
|
*/
|
|
3095
2842
|
hideTooltip() {
|
|
3096
2843
|
const ctx = this.context;
|
|
3097
|
-
const { tooltipDom } = ctx;
|
|
3098
2844
|
ctx.activeAnnotation = null;
|
|
3099
|
-
tooltipDom.
|
|
3100
|
-
|
|
3101
|
-
clearTimeout(ctx.hideTimeout);
|
|
3102
|
-
ctx.hideTimeout = setTimeout(() => {
|
|
3103
|
-
ctx.hideTimeout = null;
|
|
3104
|
-
if (tooltipDom.style.opacity === '0') {
|
|
3105
|
-
tooltipDom.style.visibility = 'hidden';
|
|
3106
|
-
}
|
|
3107
|
-
}, 200); // Match the transition duration
|
|
2845
|
+
ctx.tooltipDom.classList.remove('sse-visible');
|
|
2846
|
+
this.hotspotDom.classList.remove('sse-active');
|
|
3108
2847
|
}
|
|
3109
2848
|
/**
|
|
3110
2849
|
* Hide all elements when annotation is behind camera.
|
|
@@ -3113,173 +2852,118 @@ class Annotation extends Script {
|
|
|
3113
2852
|
_hideElements() {
|
|
3114
2853
|
this.hotspotDom.style.display = 'none';
|
|
3115
2854
|
if (this.context.activeAnnotation === this) {
|
|
3116
|
-
this.context.tooltipDom.
|
|
3117
|
-
this.context.tooltipDom.style.opacity = '0';
|
|
2855
|
+
this.context.tooltipDom.classList.remove('sse-visible');
|
|
3118
2856
|
}
|
|
3119
2857
|
}
|
|
3120
2858
|
/**
|
|
3121
2859
|
* Update screen-space positions of HTML elements.
|
|
3122
2860
|
* @param {Vec3} screenPos - Screen coordinate
|
|
2861
|
+
* @param {number} distance - Distance from the camera, which orders overlapping hotspots
|
|
3123
2862
|
* @private
|
|
3124
2863
|
*/
|
|
3125
|
-
_updatePositions(screenPos) {
|
|
3126
|
-
// Show and position hotspot
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
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)));
|
|
3130
2872
|
const ctx = this.context;
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
ctx.tooltipDom.style.visibility = 'visible';
|
|
3134
|
-
ctx.tooltipDom.style.opacity = '1';
|
|
2873
|
+
if (ctx.activeAnnotation !== this) {
|
|
2874
|
+
return;
|
|
3135
2875
|
}
|
|
2876
|
+
// Re-show tooltip if it was hidden while behind camera
|
|
2877
|
+
const tooltip = ctx.tooltipDom;
|
|
2878
|
+
tooltip.classList.add('sse-visible');
|
|
3136
2879
|
// Position tooltip, clamped to the canvas (screenPos is in canvas pixels)
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
tooltip.style.transform = 'none';
|
|
3164
|
-
tooltip.style.left = `${left}px`;
|
|
3165
|
-
tooltip.style.top = `${top}px`;
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
3168
|
-
/**
|
|
3169
|
-
* Update 3D rotation and scale of hotspot planes.
|
|
3170
|
-
* @param {number} viewDepth - The view-space depth (positive distance along the camera's forward direction)
|
|
3171
|
-
* @private
|
|
3172
|
-
*/
|
|
3173
|
-
_updateRotationAndScale(viewDepth) {
|
|
3174
|
-
// Copy camera rotation to align with view plane
|
|
3175
|
-
const cameraRotation = this.context.camera.getRotation();
|
|
3176
|
-
this._updateHotspotTransform(this.entity, cameraRotation);
|
|
3177
|
-
// Calculate scale based on view depth to maintain constant screen size
|
|
3178
|
-
const scale = this._calculateScreenSpaceScale(viewDepth);
|
|
3179
|
-
this.entity.setLocalScale(scale, scale, scale);
|
|
3180
|
-
}
|
|
3181
|
-
/**
|
|
3182
|
-
* Update rotation of a single hotspot entity.
|
|
3183
|
-
* @param {Entity} hotspot - The hotspot entity to update
|
|
3184
|
-
* @param {Quat} cameraRotation - The camera's current rotation
|
|
3185
|
-
* @private
|
|
3186
|
-
*/
|
|
3187
|
-
_updateHotspotTransform(hotspot, cameraRotation) {
|
|
3188
|
-
hotspot.setRotation(cameraRotation);
|
|
3189
|
-
hotspot.rotateLocal(90, 0, 0);
|
|
3190
|
-
}
|
|
3191
|
-
/**
|
|
3192
|
-
* Calculate scale factor to maintain constant screen-space size.
|
|
3193
|
-
* @param {number} viewDepth - The view-space depth (positive distance along the camera's forward direction)
|
|
3194
|
-
* @returns {number} The scale to apply to hotspot entities
|
|
3195
|
-
* @private
|
|
3196
|
-
*/
|
|
3197
|
-
_calculateScreenSpaceScale(viewDepth) {
|
|
3198
|
-
// Use the canvas's CSS/client height instead of graphics device height
|
|
3199
|
-
const canvas = this.app.graphicsDevice.canvas;
|
|
3200
|
-
const screenHeight = canvas.clientHeight;
|
|
3201
|
-
// Use view-space depth (not Euclidean distance) to match the projection matrix
|
|
3202
|
-
const projMatrix = this.context.camera.camera.projectionMatrix;
|
|
3203
|
-
const worldSize = (HOTSPOT_SIZE / screenHeight) * ((2 * viewDepth) / projMatrix.data[5]);
|
|
3204
|
-
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`;
|
|
3205
2906
|
}
|
|
3206
2907
|
}
|
|
3207
2908
|
/**
|
|
3208
|
-
* Everything the annotations of one viewer share: the dom they live in
|
|
3209
|
-
*
|
|
3210
|
-
*
|
|
3211
|
-
* Owned by `Annotations`, which removes `parentDom` on destroy; the mesh is released through
|
|
3212
|
-
* 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.
|
|
3213
2912
|
*/
|
|
3214
2913
|
class AnnotationContext {
|
|
3215
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;
|
|
3216
2918
|
canvas;
|
|
3217
2919
|
camera;
|
|
3218
|
-
layers;
|
|
3219
|
-
mesh;
|
|
3220
2920
|
tooltipDom;
|
|
3221
2921
|
titleDom;
|
|
3222
2922
|
textDom;
|
|
3223
|
-
// Mutable copies: `Annotations` converts them to gamma space when post effects are active.
|
|
3224
|
-
hotspotColor = HOTSPOT_COLOR.clone();
|
|
3225
|
-
hoverColor = HOVER_COLOR.clone();
|
|
3226
2923
|
activeAnnotation = null;
|
|
3227
|
-
|
|
3228
|
-
opacity = 1.0;
|
|
3229
|
-
hideTimeout = null;
|
|
3230
|
-
constructor(app, camera, parentDom) {
|
|
2924
|
+
constructor(canvas, camera, parentDom) {
|
|
3231
2925
|
this.parentDom = parentDom;
|
|
3232
|
-
this.canvas =
|
|
2926
|
+
this.canvas = canvas;
|
|
3233
2927
|
this.camera = camera;
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
const idx = semitrans ? layers.getTransparentIndex(worldLayer) : layers.getOpaqueIndex(worldLayer);
|
|
3240
|
-
layers.insert(layer, idx + 1);
|
|
3241
|
-
return layer;
|
|
3242
|
-
};
|
|
3243
|
-
this.layers = [createLayer('HotspotBase', false), createLayer('HotspotOverlay', true)];
|
|
3244
|
-
camera.camera.layers = [...camera.camera.layers, ...this.layers.map((layer) => layer.id)];
|
|
3245
|
-
this.mesh = Mesh.fromGeometry(app.graphicsDevice, new PlaneGeometry({
|
|
3246
|
-
widthSegments: 1,
|
|
3247
|
-
lengthSegments: 1
|
|
3248
|
-
}));
|
|
3249
|
-
// 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
|
|
3250
2933
|
this.tooltipDom = document.createElement('div');
|
|
3251
2934
|
this.tooltipDom.className = 'sse-annotation';
|
|
3252
2935
|
this.titleDom = document.createElement('div');
|
|
3253
2936
|
this.titleDom.className = 'sse-annotation-title';
|
|
3254
|
-
this.tooltipDom.appendChild(this.titleDom);
|
|
3255
2937
|
this.textDom = document.createElement('div');
|
|
3256
2938
|
this.textDom.className = 'sse-annotation-text';
|
|
3257
|
-
this.tooltipDom.
|
|
2939
|
+
this.tooltipDom.append(this.titleDom, this.textDom);
|
|
3258
2940
|
parentDom.appendChild(this.tooltipDom);
|
|
3259
2941
|
}
|
|
3260
2942
|
}
|
|
3261
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;
|
|
3262
2951
|
// Built-in hotspot and panel presentation. Selection and camera navigation belong to the viewer.
|
|
3263
2952
|
class Annotations {
|
|
3264
|
-
app;
|
|
3265
2953
|
parentDom;
|
|
3266
2954
|
parent;
|
|
3267
|
-
context;
|
|
3268
2955
|
subscriptions;
|
|
3269
2956
|
removeClick;
|
|
3270
|
-
|
|
2957
|
+
removeOcclusion;
|
|
2958
|
+
constructor(viewer, root, camera, getPicker) {
|
|
3271
2959
|
const { app, state, events, annotations } = viewer;
|
|
3272
|
-
this.app = app;
|
|
3273
2960
|
const parentDom = document.createElement('div');
|
|
3274
2961
|
parentDom.className = 'sse-annotations';
|
|
3275
|
-
|
|
2962
|
+
// over the scene, beneath the ui
|
|
2963
|
+
root.querySelector('.sse-sceneLayer').appendChild(parentDom);
|
|
3276
2964
|
this.parentDom = parentDom;
|
|
3277
|
-
const
|
|
3278
|
-
|
|
3279
|
-
if (hasCameraFrame) {
|
|
3280
|
-
context.hotspotColor.gamma();
|
|
3281
|
-
context.hoverColor.gamma();
|
|
3282
|
-
}
|
|
2965
|
+
const canvas = app.graphicsDevice.canvas;
|
|
2966
|
+
const context = new AnnotationContext(canvas, camera, parentDom);
|
|
3283
2967
|
const parent = new Entity('annotations', app);
|
|
3284
2968
|
app.root.addChild(parent);
|
|
3285
2969
|
this.parent = parent;
|
|
@@ -3298,15 +2982,99 @@ class Annotations {
|
|
|
3298
2982
|
parent.addChild(entity);
|
|
3299
2983
|
scripts.push(script);
|
|
3300
2984
|
script.on('select', () => viewer.selectAnnotation(i));
|
|
3301
|
-
script.on('hover', () => {
|
|
3302
|
-
app.renderNextFrame = true;
|
|
3303
|
-
});
|
|
3304
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
|
+
};
|
|
3305
3070
|
const update = () => {
|
|
3306
3071
|
const firstPersonGamingControls = (state.cameraMode === 'walk' || state.cameraMode === 'fly') && state.gamingControls;
|
|
3307
3072
|
const hidden = !state.loaded || !state.showAnnotations || state.controlsHidden || firstPersonGamingControls;
|
|
3073
|
+
const wasHidden = parentDom.style.display === 'none';
|
|
3308
3074
|
parentDom.style.display = hidden ? 'none' : 'block';
|
|
3309
|
-
|
|
3075
|
+
// hotspots coming back may have been covered or uncovered while hidden
|
|
3076
|
+
if (wasHidden && !hidden)
|
|
3077
|
+
scheduleOcclusion();
|
|
3310
3078
|
const selected = hidden || state.selectedAnnotation === null ? null : scripts[state.selectedAnnotation];
|
|
3311
3079
|
if (selected !== context.activeAnnotation) {
|
|
3312
3080
|
context.activeAnnotation?.hideTooltip();
|
|
@@ -3334,12 +3102,8 @@ class Annotations {
|
|
|
3334
3102
|
for (const subscription of this.subscriptions)
|
|
3335
3103
|
subscription.off();
|
|
3336
3104
|
this.removeClick();
|
|
3105
|
+
this.removeOcclusion();
|
|
3337
3106
|
this.parent.destroy();
|
|
3338
|
-
clearTimeout(this.context.hideTimeout);
|
|
3339
|
-
const { camera, layers } = this.context;
|
|
3340
|
-
camera.camera.layers = camera.camera.layers.filter((id) => !layers.some((layer) => layer.id === id));
|
|
3341
|
-
for (const layer of layers)
|
|
3342
|
-
this.app.scene.layers.remove(layer);
|
|
3343
3107
|
this.parentDom.remove();
|
|
3344
3108
|
}
|
|
3345
3109
|
}
|
|
@@ -3393,23 +3157,20 @@ const initCameraControls = (viewer, root) => {
|
|
|
3393
3157
|
};
|
|
3394
3158
|
};
|
|
3395
3159
|
|
|
3396
|
-
//
|
|
3397
|
-
const
|
|
3398
|
-
const
|
|
3399
|
-
const STORAGE_KEY = 'controlsHint';
|
|
3400
|
-
const readPreference = () => {
|
|
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 = () => {
|
|
3401
3163
|
try {
|
|
3402
|
-
|
|
3403
|
-
return value === 'pinned' || value === 'off' ? value : 'auto';
|
|
3164
|
+
return localStorage.getItem(OPEN_KEY) !== 'false';
|
|
3404
3165
|
}
|
|
3405
3166
|
catch {
|
|
3406
3167
|
// Embedded documents can be denied storage.
|
|
3407
|
-
return
|
|
3168
|
+
return true;
|
|
3408
3169
|
}
|
|
3409
3170
|
};
|
|
3410
|
-
const
|
|
3171
|
+
const writeOpen = (open) => {
|
|
3411
3172
|
try {
|
|
3412
|
-
localStorage.setItem(
|
|
3173
|
+
localStorage.setItem(OPEN_KEY, String(open));
|
|
3413
3174
|
}
|
|
3414
3175
|
catch {
|
|
3415
3176
|
// Storage may be blocked or full; the choice still holds for this viewer.
|
|
@@ -3449,8 +3210,8 @@ const icons = {
|
|
|
3449
3210
|
};
|
|
3450
3211
|
// gaming controls (mouse capture on desktop, the joystick on touch) only apply to fly and walk
|
|
3451
3212
|
const isGaming = (state) => state.gamingControls && (state.cameraMode === 'fly' || state.cameraMode === 'walk');
|
|
3452
|
-
// the controls for the viewer's current camera mode, input mode and gaming controls
|
|
3453
|
-
// where there is nothing to
|
|
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
|
|
3454
3215
|
const describe = (state, localize) => {
|
|
3455
3216
|
const { cameraMode } = state;
|
|
3456
3217
|
const gaming = isGaming(state);
|
|
@@ -3522,7 +3283,7 @@ const describe = (state, localize) => {
|
|
|
3522
3283
|
}
|
|
3523
3284
|
// not while the mouse is captured, where the ui closes the info box as soon as it opens
|
|
3524
3285
|
if (!gaming) {
|
|
3525
|
-
rows.push(null, ['toggle-help', key('H')]);
|
|
3286
|
+
rows.push(null, ['toggle-controls', key('H')], ['toggle-help', key('Shift'), key('H')]);
|
|
3526
3287
|
}
|
|
3527
3288
|
}
|
|
3528
3289
|
else {
|
|
@@ -3564,7 +3325,8 @@ const describe = (state, localize) => {
|
|
|
3564
3325
|
break;
|
|
3565
3326
|
case 'anim':
|
|
3566
3327
|
// the animation has no touch controls of its own: any touch takes over
|
|
3567
|
-
|
|
3328
|
+
rows = [];
|
|
3329
|
+
break;
|
|
3568
3330
|
}
|
|
3569
3331
|
}
|
|
3570
3332
|
return {
|
|
@@ -3607,41 +3369,17 @@ const renderToken = (token) => {
|
|
|
3607
3369
|
}
|
|
3608
3370
|
};
|
|
3609
3371
|
/**
|
|
3610
|
-
*
|
|
3611
|
-
*
|
|
3612
|
-
*
|
|
3613
|
-
* the settings panel switches it back on; the choice persists in local storage.
|
|
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.
|
|
3614
3375
|
*/
|
|
3615
3376
|
const initControlsHint = (viewer, root, localize) => {
|
|
3616
3377
|
const { state, events } = viewer;
|
|
3617
|
-
const panel = root.querySelector('.sse-controlsHint');
|
|
3618
3378
|
const icon = root.querySelector('.sse-controlsHintIcon > use');
|
|
3619
3379
|
const title = root.querySelector('.sse-controlsHintTitle');
|
|
3620
3380
|
const subtitle = root.querySelector('.sse-controlsHintSubtitle');
|
|
3621
3381
|
const rowsElement = root.querySelector('.sse-controlsHintRows');
|
|
3622
|
-
const pin = root.querySelector('.sse-controlsHintPin');
|
|
3623
|
-
const close = root.querySelector('.sse-controlsHintClose');
|
|
3624
|
-
const settingsRow = root.querySelector('.sse-showHintsRow');
|
|
3625
|
-
const settingsCheck = root.querySelector('.sse-showHintsCheck');
|
|
3626
|
-
let preference = readPreference();
|
|
3627
|
-
let timer = null;
|
|
3628
3382
|
let rendered = '';
|
|
3629
|
-
const clearTimer = () => {
|
|
3630
|
-
if (timer) {
|
|
3631
|
-
clearTimeout(timer);
|
|
3632
|
-
timer = null;
|
|
3633
|
-
}
|
|
3634
|
-
};
|
|
3635
|
-
const hide = () => {
|
|
3636
|
-
clearTimer();
|
|
3637
|
-
panel.classList.remove('sse-visible');
|
|
3638
|
-
};
|
|
3639
|
-
const hideAfter = (ms) => {
|
|
3640
|
-
clearTimer();
|
|
3641
|
-
if (preference === 'auto') {
|
|
3642
|
-
timer = setTimeout(hide, ms);
|
|
3643
|
-
}
|
|
3644
|
-
};
|
|
3645
3383
|
const render = (hint) => {
|
|
3646
3384
|
icon.setAttribute('href', hint.icon);
|
|
3647
3385
|
title.textContent = hint.title;
|
|
@@ -3664,65 +3402,22 @@ const initControlsHint = (viewer, root, localize) => {
|
|
|
3664
3402
|
return element;
|
|
3665
3403
|
}));
|
|
3666
3404
|
};
|
|
3667
|
-
// re-render
|
|
3668
|
-
//
|
|
3669
|
-
const update = (
|
|
3670
|
-
const hint = describe(state, localize);
|
|
3671
|
-
if (!state.loaded || state.xrMode || !hint || preference === 'off') {
|
|
3672
|
-
hide();
|
|
3673
|
-
return;
|
|
3674
|
-
}
|
|
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 = () => {
|
|
3675
3408
|
const signature = `${state.cameraMode}:${state.inputMode}:${isGaming(state)}`;
|
|
3676
|
-
|
|
3677
|
-
if (changed) {
|
|
3409
|
+
if (signature !== rendered) {
|
|
3678
3410
|
rendered = signature;
|
|
3679
|
-
render(
|
|
3680
|
-
}
|
|
3681
|
-
if (preference === 'pinned' || force || changed) {
|
|
3682
|
-
panel.classList.add('sse-visible');
|
|
3683
|
-
hideAfter(SHOW_MS);
|
|
3411
|
+
render(describe(state, localize));
|
|
3684
3412
|
}
|
|
3685
3413
|
};
|
|
3686
|
-
const updateButtons = () => {
|
|
3687
|
-
pin.classList.toggle('sse-active', preference === 'pinned');
|
|
3688
|
-
settingsCheck.classList.toggle('sse-active', preference !== 'off');
|
|
3689
|
-
};
|
|
3690
|
-
// write changes only, so creating a viewer does not persist the default
|
|
3691
|
-
const setPreference = (value) => {
|
|
3692
|
-
preference = value;
|
|
3693
|
-
writePreference(value);
|
|
3694
|
-
updateButtons();
|
|
3695
|
-
};
|
|
3696
|
-
pin.addEventListener('click', () => {
|
|
3697
|
-
setPreference(preference === 'pinned' ? 'auto' : 'pinned');
|
|
3698
|
-
update(true);
|
|
3699
|
-
});
|
|
3700
|
-
close.addEventListener('click', () => {
|
|
3701
|
-
setPreference('off');
|
|
3702
|
-
hide();
|
|
3703
|
-
});
|
|
3704
|
-
settingsRow.addEventListener('click', () => {
|
|
3705
|
-
setPreference(preference === 'off' ? 'auto' : 'off');
|
|
3706
|
-
update(true);
|
|
3707
|
-
});
|
|
3708
|
-
// hold the panel up while the pointer is over it
|
|
3709
|
-
panel.addEventListener('pointerenter', clearTimer);
|
|
3710
|
-
panel.addEventListener('pointerleave', () => {
|
|
3711
|
-
if (panel.classList.contains('sse-visible'))
|
|
3712
|
-
hideAfter(LINGER_MS);
|
|
3713
|
-
});
|
|
3714
|
-
updateButtons();
|
|
3715
|
-
const onChange = () => update(false);
|
|
3716
3414
|
const subscriptions = [
|
|
3717
|
-
events.on('
|
|
3718
|
-
events.on('
|
|
3719
|
-
events.on('
|
|
3720
|
-
events.on('gamingControls:changed', onChange),
|
|
3721
|
-
events.on('xrMode:changed', onChange)
|
|
3415
|
+
events.on('cameraMode:changed', update),
|
|
3416
|
+
events.on('inputMode:changed', update),
|
|
3417
|
+
events.on('gamingControls:changed', update)
|
|
3722
3418
|
];
|
|
3723
|
-
update(
|
|
3419
|
+
update();
|
|
3724
3420
|
return () => {
|
|
3725
|
-
clearTimer();
|
|
3726
3421
|
for (const subscription of subscriptions)
|
|
3727
3422
|
subscription.off();
|
|
3728
3423
|
};
|
|
@@ -4085,7 +3780,9 @@ const getGpuName = (device) => {
|
|
|
4085
3780
|
// Returns a function that removes the listeners added outside the ui subtree (window,
|
|
4086
3781
|
// document, screen) and cancels pending timers. Listeners on the subtree's own elements are
|
|
4087
3782
|
// released with the elements.
|
|
4088
|
-
|
|
3783
|
+
// `getPicker` returns the viewer's picker once the scene has loaded, for the annotation
|
|
3784
|
+
// occlusion test
|
|
3785
|
+
const initUI = (global, viewer, getPicker) => {
|
|
4089
3786
|
const { root, localize } = global;
|
|
4090
3787
|
const { events, state } = viewer;
|
|
4091
3788
|
const disposers = [];
|
|
@@ -4096,6 +3793,7 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4096
3793
|
// Acquire Elements
|
|
4097
3794
|
const dom = [
|
|
4098
3795
|
'ui',
|
|
3796
|
+
'sceneLayer',
|
|
4099
3797
|
'controlsWrap',
|
|
4100
3798
|
'annotationNav',
|
|
4101
3799
|
'arMode',
|
|
@@ -4120,18 +3818,19 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4120
3818
|
'performanceModeRow',
|
|
4121
3819
|
'performanceModeCheck',
|
|
4122
3820
|
'performanceModeOption',
|
|
4123
|
-
'gamingControlsDivider',
|
|
4124
3821
|
'gamingControlsRow',
|
|
4125
3822
|
'gamingControlsCheck',
|
|
4126
3823
|
'gamingControlsOption',
|
|
4127
|
-
'
|
|
3824
|
+
'controlsButton',
|
|
3825
|
+
'controlsHint',
|
|
4128
3826
|
'controlsHintClose',
|
|
4129
3827
|
'reset',
|
|
4130
3828
|
'frame',
|
|
4131
3829
|
'loadingWrap',
|
|
4132
3830
|
'loadingText',
|
|
4133
3831
|
'loadingBar',
|
|
4134
|
-
'
|
|
3832
|
+
'showCollisionRow',
|
|
3833
|
+
'showCollisionCheck',
|
|
4135
3834
|
'showCollisionShortcut',
|
|
4136
3835
|
'walkShortcut',
|
|
4137
3836
|
'playShortcut',
|
|
@@ -4152,13 +3851,14 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4152
3851
|
document.activeElement?.blur();
|
|
4153
3852
|
});
|
|
4154
3853
|
// Forward wheel events from UI overlays to the canvas so the camera zooms
|
|
4155
|
-
// 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.
|
|
4156
3856
|
// The non-standard wheelDelta{X,Y} properties aren't part of WheelEventInit,
|
|
4157
3857
|
// so they get dropped by `new WheelEvent(type, init)`. We re-attach them so
|
|
4158
3858
|
// the trackpad-vs-mouse classifier in input-controller.ts behaves the same
|
|
4159
3859
|
// whether the event originated on the canvas or was forwarded from the UI.
|
|
4160
3860
|
const canvas = global.app.graphicsDevice.canvas;
|
|
4161
|
-
|
|
3861
|
+
const forwardWheel = (event) => {
|
|
4162
3862
|
event.preventDefault();
|
|
4163
3863
|
const forwarded = new WheelEvent(event.type, event);
|
|
4164
3864
|
const src = event;
|
|
@@ -4168,7 +3868,11 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4168
3868
|
}
|
|
4169
3869
|
}
|
|
4170
3870
|
canvas.dispatchEvent(forwarded);
|
|
4171
|
-
}
|
|
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
|
+
}
|
|
4172
3876
|
// Handle loading progress updates
|
|
4173
3877
|
const updateLoadingProgress = (progress) => {
|
|
4174
3878
|
dom.loadingText.textContent = `${progress}%`;
|
|
@@ -4200,7 +3904,6 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4200
3904
|
});
|
|
4201
3905
|
const updateGamingSettingsVisibility = () => {
|
|
4202
3906
|
const isDesktop = state.inputMode === 'desktop';
|
|
4203
|
-
dom.gamingControlsDivider.classList.toggle('sse-hidden', isDesktop);
|
|
4204
3907
|
dom.gamingControlsRow.classList.toggle('sse-hidden', isDesktop);
|
|
4205
3908
|
};
|
|
4206
3909
|
on('inputMode:changed', updateGamingSettingsVisibility);
|
|
@@ -4210,13 +3913,45 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4210
3913
|
};
|
|
4211
3914
|
on('gamingControls:changed', updateGamingControls);
|
|
4212
3915
|
updateGamingControls();
|
|
4213
|
-
// The settings and info buttons are toggles: each shows active while its panel is
|
|
4214
|
-
// Every open and close goes through these so the two cannot disagree.
|
|
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.
|
|
4215
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
|
+
};
|
|
4216
3929
|
const showSettings = (visible) => {
|
|
4217
3930
|
dom.settingsPanel.classList.toggle('sse-hidden', !visible);
|
|
4218
3931
|
dom.settings.classList.toggle('sse-active', visible);
|
|
3932
|
+
applyControls();
|
|
4219
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();
|
|
3942
|
+
};
|
|
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();
|
|
3950
|
+
});
|
|
3951
|
+
dom.controlsHintClose.addEventListener('click', () => {
|
|
3952
|
+
showControls(false);
|
|
3953
|
+
showUI();
|
|
3954
|
+
});
|
|
4220
3955
|
const showInfo = (visible) => {
|
|
4221
3956
|
// the shortcuts are keyboard shortcuts, and list only what this scene offers, as the
|
|
4222
3957
|
// toolbar does: walk needs collision, play needs an animation
|
|
@@ -4246,6 +3981,9 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4246
3981
|
if (event === 'toggleHelp') {
|
|
4247
3982
|
toggleHelp();
|
|
4248
3983
|
}
|
|
3984
|
+
else if (event === 'toggleControls') {
|
|
3985
|
+
toggleControls();
|
|
3986
|
+
}
|
|
4249
3987
|
else if (event === 'cancel') {
|
|
4250
3988
|
// close info panel on cancel
|
|
4251
3989
|
showInfo(false);
|
|
@@ -4342,7 +4080,7 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4342
4080
|
uiTimeout = null;
|
|
4343
4081
|
// the controls stay while a panel is open or the pointer is over them; closing the
|
|
4344
4082
|
// panel or leaving restarts this timer
|
|
4345
|
-
if (hovering || isVisible(dom.settingsPanel) || isVisible(dom.infoPanel)) {
|
|
4083
|
+
if (hovering || isVisible(dom.settingsPanel) || isVisible(dom.infoPanel) || isVisible(dom.controlsHint)) {
|
|
4346
4084
|
return;
|
|
4347
4085
|
}
|
|
4348
4086
|
if (state.selectedAnnotation === null || !state.showAnnotations) {
|
|
@@ -4388,16 +4126,17 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4388
4126
|
disposers.push(initControlsHint(viewer, root, localize));
|
|
4389
4127
|
disposers.push(initFullscreenControls(viewer, root));
|
|
4390
4128
|
disposers.push(initXrControls(viewer, root));
|
|
4391
|
-
// Collision overlay
|
|
4129
|
+
// Collision overlay: a settings row and the matching info-panel shortcut, shown only when
|
|
4130
|
+
// the scene ships an overlay
|
|
4392
4131
|
on('hasCollisionOverlay:changed', (value) => {
|
|
4393
|
-
dom.
|
|
4132
|
+
dom.showCollisionRow.classList.toggle('sse-hidden', !value);
|
|
4394
4133
|
dom.showCollisionShortcut.classList.toggle('sse-hidden', !value);
|
|
4395
4134
|
});
|
|
4396
|
-
dom.
|
|
4135
|
+
dom.showCollisionRow.addEventListener('click', () => {
|
|
4397
4136
|
state.collisionOverlayEnabled = !state.collisionOverlayEnabled;
|
|
4398
4137
|
});
|
|
4399
4138
|
on('collisionOverlayEnabled:changed', (value) => {
|
|
4400
|
-
dom.
|
|
4139
|
+
dom.showCollisionCheck.classList.toggle('sse-active', value);
|
|
4401
4140
|
});
|
|
4402
4141
|
dom.settings.addEventListener('click', () => {
|
|
4403
4142
|
showSettings(!isVisible(dom.settingsPanel));
|
|
@@ -4407,7 +4146,7 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4407
4146
|
disposers.push(initJoystick(viewer, root));
|
|
4408
4147
|
disposers.push(initAnnotationControls(viewer, root));
|
|
4409
4148
|
if (viewer.annotations.length > 0) {
|
|
4410
|
-
const annotations = new Annotations(viewer, root, global.camera,
|
|
4149
|
+
const annotations = new Annotations(viewer, root, global.camera, getPicker);
|
|
4411
4150
|
disposers.push(() => annotations.destroy());
|
|
4412
4151
|
}
|
|
4413
4152
|
// tooltips
|
|
@@ -4420,11 +4159,9 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4420
4159
|
tooltip.register(dom.fpsCamera, localize('tooltip.walk-mode'), 'top');
|
|
4421
4160
|
tooltip.register(dom.reset, localize('tooltip.reset-camera'), 'bottom');
|
|
4422
4161
|
tooltip.register(dom.frame, localize('tooltip.frame-scene'), 'bottom');
|
|
4423
|
-
tooltip.register(dom.showCollision, localize('tooltip.show-collision'), 'top');
|
|
4424
4162
|
tooltip.register(dom.settings, localize('tooltip.settings'), 'top');
|
|
4425
4163
|
tooltip.register(dom.info, localize('tooltip.help'), 'top');
|
|
4426
|
-
tooltip.register(dom.
|
|
4427
|
-
tooltip.register(dom.controlsHintClose, localize('tooltip.hide-hints'), 'bottom');
|
|
4164
|
+
tooltip.register(dom.controlsButton, localize('tooltip.controls'), 'top');
|
|
4428
4165
|
tooltip.register(dom.arMode, localize('tooltip.enter-ar'), 'top');
|
|
4429
4166
|
tooltip.register(dom.vrMode, localize('tooltip.enter-vr'), 'top');
|
|
4430
4167
|
tooltip.register(dom.enterFullscreen, localize('tooltip.fullscreen'), 'top');
|
|
@@ -4453,7 +4190,7 @@ const initUI = (global, viewer, hasCameraFrame) => {
|
|
|
4453
4190
|
};
|
|
4454
4191
|
};
|
|
4455
4192
|
|
|
4456
|
-
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 \n <div class=\"sse-controlsHint\">\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-controlsHintPin sse-panelButton\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"><use href=\"#pinIcon\" /></svg>\n </button>\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 <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-showHintsRow sse-settingsRow\">\n <div class=\"sse-showHintsOption\" data-i18n=\"settings.show-hints\">Show Control Hints</div>\n <div class=\"sse-showHintsCheck 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 <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-help\">Toggle Info</span>\n <kbd class=\"sse-key\">H</kbd>\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-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=\"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=\"pinIcon\" viewBox=\"0 0 24 24\">\n <path d=\"M9 3h6M10 3v6l-3 4h10l-3-4V3M12 13v8\" />\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=\"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";
|
|
4457
4194
|
|
|
4458
4195
|
/**
|
|
4459
4196
|
* Creates a figure-8 (lemniscate / infinity sign) camera animation track.
|
|
@@ -4984,6 +4721,18 @@ class Camera {
|
|
|
4984
4721
|
vecToAngles(this.angles, avec.mulScalar(1.0 / this.distance));
|
|
4985
4722
|
this.fov = math.lerp(a.fov, b.fov, t);
|
|
4986
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
|
+
}
|
|
4987
4736
|
look(from, to) {
|
|
4988
4737
|
this.position.copy(from);
|
|
4989
4738
|
this.distance = from.distance(to);
|
|
@@ -6346,6 +6095,27 @@ class WalkSource {
|
|
|
6346
6095
|
|
|
6347
6096
|
const tmpCamera = new Camera();
|
|
6348
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);
|
|
6349
6119
|
// Walk mode is only enabled when the scene's horizontal footprint is large
|
|
6350
6120
|
// enough to walk around in. Vertical extent (Y) is irrelevant — a tall but
|
|
6351
6121
|
// narrow scene isn't walkable. Both X and Z ranges must exceed this
|
|
@@ -6450,13 +6220,24 @@ class CameraManager {
|
|
|
6450
6220
|
// enter the initial controller
|
|
6451
6221
|
getController(state.cameraMode).onEnter(this.camera);
|
|
6452
6222
|
// transition state
|
|
6453
|
-
const transitionSpeed = 1.0;
|
|
6454
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;
|
|
6455
6229
|
let clearOrbitTargetOnTransitionEnd = false;
|
|
6456
|
-
//
|
|
6457
|
-
|
|
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) => {
|
|
6458
6236
|
from.copy(this.camera);
|
|
6459
6237
|
transitionTimer = 0;
|
|
6238
|
+
transitionDuration = duration;
|
|
6239
|
+
transitionEase = ease;
|
|
6240
|
+
transitionTurnEase = turnEase;
|
|
6460
6241
|
};
|
|
6461
6242
|
this.setCollision = (value) => {
|
|
6462
6243
|
controllers.fly.collision = value;
|
|
@@ -6475,17 +6256,27 @@ class CameraManager {
|
|
|
6475
6256
|
const dt = state.cameraMode === 'anim' && state.animationPaused ? 0 : deltaTime;
|
|
6476
6257
|
// update transition timer
|
|
6477
6258
|
const prevTransitionTimer = transitionTimer;
|
|
6478
|
-
transitionTimer = Math.min(1, transitionTimer + deltaTime
|
|
6259
|
+
transitionTimer = Math.min(1, transitionTimer + deltaTime / transitionDuration);
|
|
6479
6260
|
const controller = getController(state.cameraMode);
|
|
6480
6261
|
sourcesByMode[state.cameraMode]?.update(dt, this.camera, frame);
|
|
6481
6262
|
controller.update(dt, frame, target);
|
|
6482
6263
|
if (transitionTimer < 1) {
|
|
6483
6264
|
// lerp away from previous camera during transition
|
|
6484
|
-
|
|
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
|
+
}
|
|
6485
6272
|
}
|
|
6486
6273
|
else {
|
|
6487
6274
|
this.camera.copy(target);
|
|
6488
6275
|
}
|
|
6276
|
+
if (deltaTime > 0) {
|
|
6277
|
+
cameraSpeed = this.camera.position.distance(lastPosition) / deltaTime;
|
|
6278
|
+
}
|
|
6279
|
+
lastPosition.copy(this.camera.position);
|
|
6489
6280
|
// update animation timeline
|
|
6490
6281
|
if (state.cameraMode === 'anim') {
|
|
6491
6282
|
state.animationTime = controllers.anim.animState.cursor.value;
|
|
@@ -6625,8 +6416,22 @@ class CameraManager {
|
|
|
6625
6416
|
// construct camera
|
|
6626
6417
|
tmpCamera.fov = initial.fov;
|
|
6627
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);
|
|
6628
6433
|
controllers.orbit.goto(tmpCamera);
|
|
6629
|
-
startTransition();
|
|
6434
|
+
startTransition(duration, travelEase, (x) => turnEase(Math.min(1, x / TURN_LEAD)));
|
|
6630
6435
|
};
|
|
6631
6436
|
// tap-to-navigate: start auto-driving the active mode toward a picked position
|
|
6632
6437
|
events.on('navigateTo', (position, normal, speedMul = 1) => {
|
|
@@ -6905,7 +6710,6 @@ const STYLES = `
|
|
|
6905
6710
|
font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace;
|
|
6906
6711
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
6907
6712
|
border-radius: 4px;
|
|
6908
|
-
z-index: 1000;
|
|
6909
6713
|
pointer-events: auto;
|
|
6910
6714
|
user-select: none;
|
|
6911
6715
|
min-width: 220px;
|
|
@@ -7389,8 +7193,11 @@ class ModeShortcuts {
|
|
|
7389
7193
|
case 'g':
|
|
7390
7194
|
state.gamingControls = !state.gamingControls;
|
|
7391
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
|
|
7392
7198
|
case 'h':
|
|
7393
|
-
|
|
7199
|
+
case 'H':
|
|
7200
|
+
events.fire('inputEvent', event.shiftKey ? 'toggleHelp' : 'toggleControls');
|
|
7394
7201
|
break;
|
|
7395
7202
|
case 'r':
|
|
7396
7203
|
events.fire('inputEvent', 'reset', event);
|
|
@@ -9010,8 +8817,11 @@ class NavCursor {
|
|
|
9010
8817
|
this.app = app;
|
|
9011
8818
|
this.svg = document.createElementNS(SVGNS, 'svg');
|
|
9012
8819
|
this.svg.style.cssText =
|
|
9013
|
-
'position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible
|
|
9014
|
-
|
|
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);
|
|
9015
8825
|
this.captureMarker = document.createElementNS(SVGNS, 'circle');
|
|
9016
8826
|
this.captureMarker.setAttribute('cx', '50%');
|
|
9017
8827
|
this.captureMarker.setAttribute('cy', '50%');
|
|
@@ -9591,6 +9401,18 @@ const fitPlaneNormal = (points, toCamera, outNormal) => {
|
|
|
9591
9401
|
class Picker {
|
|
9592
9402
|
pick;
|
|
9593
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;
|
|
9594
9416
|
release;
|
|
9595
9417
|
constructor(app, camera) {
|
|
9596
9418
|
const { graphicsDevice } = app;
|
|
@@ -9598,6 +9420,9 @@ class Picker {
|
|
|
9598
9420
|
let accumTarget;
|
|
9599
9421
|
let accumPass;
|
|
9600
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;
|
|
9601
9426
|
let pickQueue = Promise.resolve();
|
|
9602
9427
|
let cacheValid = false;
|
|
9603
9428
|
let cacheWidth = 0;
|
|
@@ -9712,6 +9537,9 @@ class Picker {
|
|
|
9712
9537
|
}
|
|
9713
9538
|
};
|
|
9714
9539
|
const prepareSample = (x, y) => {
|
|
9540
|
+
if (released) {
|
|
9541
|
+
return null;
|
|
9542
|
+
}
|
|
9715
9543
|
const width = Math.floor(graphicsDevice.width);
|
|
9716
9544
|
const height = Math.floor(graphicsDevice.height);
|
|
9717
9545
|
// bail out if the device hasn't been sized yet
|
|
@@ -9745,9 +9573,22 @@ class Picker {
|
|
|
9745
9573
|
const position = getWorldPoint(pickCamera, screenX, screenY, width, height, normalizedDepth);
|
|
9746
9574
|
return position ? { position, camera: pickCamera, screenX, screenY, width, height } : null;
|
|
9747
9575
|
};
|
|
9748
|
-
|
|
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
|
+
};
|
|
9749
9590
|
// The render targets are shared by all picks on this instance.
|
|
9750
|
-
const result = pickQueue.then(
|
|
9591
|
+
const result = pickQueue.then(guarded, guarded);
|
|
9751
9592
|
pickQueue = result.then(() => undefined, () => undefined);
|
|
9752
9593
|
return result;
|
|
9753
9594
|
};
|
|
@@ -9810,9 +9651,31 @@ class Picker {
|
|
|
9810
9651
|
normal
|
|
9811
9652
|
};
|
|
9812
9653
|
};
|
|
9813
|
-
this.pick = (x, y) => serializePick(() => pick(x, y));
|
|
9814
|
-
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
|
+
};
|
|
9815
9677
|
this.release = () => {
|
|
9678
|
+
released = true;
|
|
9816
9679
|
if (chunksPatched) {
|
|
9817
9680
|
unregisterPickerShaderPatches(app);
|
|
9818
9681
|
chunksPatched = false;
|
|
@@ -11794,7 +11657,7 @@ const createViewer = async (options) => {
|
|
|
11794
11657
|
destroy: () => viewer.destroy()
|
|
11795
11658
|
};
|
|
11796
11659
|
// The built-in controls use the same handle returned to an embedding host.
|
|
11797
|
-
const disposeUI = config.ui ? initUI(global, handle,
|
|
11660
|
+
const disposeUI = config.ui ? initUI(global, handle, () => viewer.picker) : null;
|
|
11798
11661
|
viewer.onDestroy(() => {
|
|
11799
11662
|
destroyed = true;
|
|
11800
11663
|
});
|