@ringozz/godot 4.7.2-685 → 4.7.2-698

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.
Files changed (1026) hide show
  1. package/README.md +185 -185
  2. package/gen/classes/AESContext.ts +6 -6
  3. package/gen/classes/AStar2D.ts +25 -25
  4. package/gen/classes/AStar3D.ts +25 -25
  5. package/gen/classes/AStarGrid2D.ts +33 -33
  6. package/gen/classes/AcceptDialog.ts +23 -22
  7. package/gen/classes/AccessibilityServer.ts +79 -75
  8. package/gen/classes/AimModifier3D.ts +12 -12
  9. package/gen/classes/AnimatableBody2D.ts +2 -2
  10. package/gen/classes/AnimatableBody3D.ts +2 -2
  11. package/gen/classes/AnimatedSprite2D.ts +37 -37
  12. package/gen/classes/AnimatedSprite3D.ts +29 -29
  13. package/gen/classes/AnimatedTexture.ts +14 -14
  14. package/gen/classes/Animation.ts +102 -86
  15. package/gen/classes/AnimationLibrary.ts +15 -15
  16. package/gen/classes/AnimationMixer.ts +54 -54
  17. package/gen/classes/AnimationNode.ts +27 -27
  18. package/gen/classes/AnimationNodeAnimation.ts +16 -16
  19. package/gen/classes/AnimationNodeBlendSpace1D.ts +37 -27
  20. package/gen/classes/AnimationNodeBlendSpace2D.ts +48 -41
  21. package/gen/classes/AnimationNodeBlendTree.ts +14 -14
  22. package/gen/classes/AnimationNodeExtension.ts +2 -2
  23. package/gen/classes/AnimationNodeObserver.ts +10 -0
  24. package/gen/classes/AnimationNodeObserverBlendSpace.ts +18 -0
  25. package/gen/classes/AnimationNodeObserverOneShot.ts +36 -0
  26. package/gen/classes/AnimationNodeObserverTransition.ts +24 -0
  27. package/gen/classes/AnimationNodeOneShot.ts +34 -22
  28. package/gen/classes/AnimationNodeOutput.ts +2 -2
  29. package/gen/classes/AnimationNodeStateMachine.ts +28 -28
  30. package/gen/classes/AnimationNodeStateMachinePlayback.ts +20 -20
  31. package/gen/classes/AnimationNodeStateMachineTransition.ts +22 -22
  32. package/gen/classes/AnimationNodeSub2.ts +2 -2
  33. package/gen/classes/AnimationNodeSync.ts +4 -4
  34. package/gen/classes/AnimationNodeTimeScale.ts +2 -2
  35. package/gen/classes/AnimationNodeTimeSeek.ts +4 -4
  36. package/gen/classes/AnimationNodeTransition.ts +28 -16
  37. package/gen/classes/AnimationPlayer.ts +67 -60
  38. package/gen/classes/AnimationRootNode.ts +2 -2
  39. package/gen/classes/AnimationTree.ts +12 -12
  40. package/gen/classes/Area2D.ts +55 -55
  41. package/gen/classes/Area3D.ts +69 -69
  42. package/gen/classes/AreaLight3D.ts +13 -13
  43. package/gen/classes/ArrayMesh.ts +28 -28
  44. package/gen/classes/ArrayOccluder3D.ts +7 -7
  45. package/gen/classes/AspectRatioContainer.ts +10 -10
  46. package/gen/classes/AtlasTexture.ts +10 -10
  47. package/gen/classes/AudioBusLayout.ts +2 -2
  48. package/gen/classes/AudioEffect.ts +2 -2
  49. package/gen/classes/AudioEffectAmplify.ts +6 -6
  50. package/gen/classes/AudioEffectBandLimitFilter.ts +2 -2
  51. package/gen/classes/AudioEffectBandPassFilter.ts +2 -2
  52. package/gen/classes/AudioEffectCapture.ts +11 -11
  53. package/gen/classes/AudioEffectChorus.ts +20 -20
  54. package/gen/classes/AudioEffectCompressor.ts +16 -16
  55. package/gen/classes/AudioEffectDelay.ts +28 -28
  56. package/gen/classes/AudioEffectDistortion.ts +12 -12
  57. package/gen/classes/AudioEffectEQ.ts +5 -5
  58. package/gen/classes/AudioEffectEQ10.ts +2 -2
  59. package/gen/classes/AudioEffectEQ21.ts +2 -2
  60. package/gen/classes/AudioEffectEQ6.ts +2 -2
  61. package/gen/classes/AudioEffectFilter.ts +10 -10
  62. package/gen/classes/AudioEffectHardLimiter.ts +8 -8
  63. package/gen/classes/AudioEffectHighPassFilter.ts +2 -2
  64. package/gen/classes/AudioEffectHighShelfFilter.ts +2 -2
  65. package/gen/classes/AudioEffectInstance.ts +2 -2
  66. package/gen/classes/AudioEffectLimiter.ts +10 -10
  67. package/gen/classes/AudioEffectLowPassFilter.ts +2 -2
  68. package/gen/classes/AudioEffectLowShelfFilter.ts +2 -2
  69. package/gen/classes/AudioEffectNotchFilter.ts +2 -2
  70. package/gen/classes/AudioEffectPanner.ts +4 -4
  71. package/gen/classes/AudioEffectPhaser.ts +12 -12
  72. package/gen/classes/AudioEffectPitchShift.ts +8 -8
  73. package/gen/classes/AudioEffectRecord.ts +7 -7
  74. package/gen/classes/AudioEffectReverb.ts +18 -18
  75. package/gen/classes/AudioEffectSpectrumAnalyzer.ts +6 -6
  76. package/gen/classes/AudioEffectSpectrumAnalyzerInstance.ts +2 -2
  77. package/gen/classes/AudioEffectStereoEnhance.ts +8 -8
  78. package/gen/classes/AudioListener2D.ts +5 -5
  79. package/gen/classes/AudioListener3D.ts +8 -8
  80. package/gen/classes/AudioSample.ts +2 -2
  81. package/gen/classes/AudioSamplePlayback.ts +2 -2
  82. package/gen/classes/AudioServer.ts +63 -63
  83. package/gen/classes/AudioStream.ts +10 -10
  84. package/gen/classes/AudioStreamGenerator.ts +8 -8
  85. package/gen/classes/AudioStreamGeneratorPlayback.ts +7 -7
  86. package/gen/classes/AudioStreamInteractive.ts +25 -25
  87. package/gen/classes/AudioStreamMP3.ts +16 -16
  88. package/gen/classes/AudioStreamMicrophone.ts +2 -2
  89. package/gen/classes/AudioStreamOggVorbis.ts +18 -18
  90. package/gen/classes/AudioStreamPlayback.ts +11 -11
  91. package/gen/classes/AudioStreamPlaybackInteractive.ts +4 -4
  92. package/gen/classes/AudioStreamPlaybackOggVorbis.ts +2 -2
  93. package/gen/classes/AudioStreamPlaybackPlaylist.ts +1 -1
  94. package/gen/classes/AudioStreamPlaybackPolyphonic.ts +6 -6
  95. package/gen/classes/AudioStreamPlaybackResampled.ts +3 -3
  96. package/gen/classes/AudioStreamPlaybackSynchronized.ts +1 -1
  97. package/gen/classes/AudioStreamPlayer.ts +32 -32
  98. package/gen/classes/AudioStreamPlayer2D.ts +38 -38
  99. package/gen/classes/AudioStreamPlayer3D.ts +54 -54
  100. package/gen/classes/AudioStreamPlaylist.ts +139 -139
  101. package/gen/classes/AudioStreamPolyphonic.ts +4 -4
  102. package/gen/classes/AudioStreamRandomizer.ts +19 -19
  103. package/gen/classes/AudioStreamSynchronized.ts +8 -8
  104. package/gen/classes/AudioStreamWAV.ts +21 -21
  105. package/gen/classes/AwaitTweener.ts +3 -3
  106. package/gen/classes/BackBufferCopy.ts +6 -6
  107. package/gen/classes/BaseButton.ts +39 -33
  108. package/gen/classes/BaseMaterial3D.ts +283 -268
  109. package/gen/classes/BitMap.ts +17 -17
  110. package/gen/classes/BlitMaterial.ts +8 -4
  111. package/gen/classes/Bone2D.ts +13 -13
  112. package/gen/classes/BoneAttachment3D.ts +14 -14
  113. package/gen/classes/BoneConstraint3D.ts +26 -26
  114. package/gen/classes/BoneMap.ts +11 -11
  115. package/gen/classes/BoneSpaceAdjuster3D.ts +76 -0
  116. package/gen/classes/BoneTwistDisperser3D.ts +36 -36
  117. package/gen/classes/BoxContainer.ts +13 -7
  118. package/gen/classes/BoxMesh.ts +10 -10
  119. package/gen/classes/BoxOccluder3D.ts +4 -4
  120. package/gen/classes/BoxShape3D.ts +4 -4
  121. package/gen/classes/Button.ts +28 -28
  122. package/gen/classes/ButtonGroup.ts +8 -8
  123. package/gen/classes/CCDIK3D.ts +2 -2
  124. package/gen/classes/CPUParticles2D.ts +145 -145
  125. package/gen/classes/CPUParticles3D.ts +162 -162
  126. package/gen/classes/CSGBox3D.ts +6 -6
  127. package/gen/classes/CSGCombiner3D.ts +2 -2
  128. package/gen/classes/CSGCylinder3D.ts +14 -14
  129. package/gen/classes/CSGMesh3D.ts +6 -6
  130. package/gen/classes/CSGPolygon3D.ts +36 -36
  131. package/gen/classes/CSGPrimitive3D.ts +3 -3
  132. package/gen/classes/CSGShape3D.ts +27 -27
  133. package/gen/classes/CSGSphere3D.ts +12 -12
  134. package/gen/classes/CSGTorus3D.ts +14 -14
  135. package/gen/classes/CallbackTweener.ts +3 -3
  136. package/gen/classes/Camera2D.ts +66 -66
  137. package/gen/classes/Camera3D.ts +53 -53
  138. package/gen/classes/CameraAttributes.ts +12 -12
  139. package/gen/classes/CameraAttributesPhysical.ts +21 -21
  140. package/gen/classes/CameraAttributesPractical.ts +20 -20
  141. package/gen/classes/CameraFeed.ts +23 -23
  142. package/gen/classes/CameraServer.ts +15 -15
  143. package/gen/classes/CameraTexture.ts +8 -8
  144. package/gen/classes/CanvasGroup.ts +8 -8
  145. package/gen/classes/CanvasItem.ts +115 -113
  146. package/gen/classes/CanvasItemMaterial.ts +14 -14
  147. package/gen/classes/CanvasLayer.ts +27 -27
  148. package/gen/classes/CanvasModulate.ts +4 -4
  149. package/gen/classes/CanvasTexture.ts +16 -16
  150. package/gen/classes/CapsuleMesh.ts +10 -10
  151. package/gen/classes/CapsuleShape2D.ts +8 -8
  152. package/gen/classes/CapsuleShape3D.ts +8 -8
  153. package/gen/classes/CenterContainer.ts +4 -4
  154. package/gen/classes/ChainIK3D.ts +18 -18
  155. package/gen/classes/CharFXTransform.ts +28 -28
  156. package/gen/classes/CharacterBody2D.ts +50 -50
  157. package/gen/classes/CharacterBody3D.ts +51 -51
  158. package/gen/classes/CheckBox.ts +2 -2
  159. package/gen/classes/CheckButton.ts +2 -2
  160. package/gen/classes/CircleShape2D.ts +4 -4
  161. package/gen/classes/ClassDB.ts +38 -32
  162. package/gen/classes/CodeEdit.ts +126 -126
  163. package/gen/classes/CodeHighlighter.ts +30 -30
  164. package/gen/classes/CollisionObject2D.ts +52 -52
  165. package/gen/classes/CollisionObject3D.ts +44 -44
  166. package/gen/classes/CollisionPolygon2D.ts +14 -14
  167. package/gen/classes/CollisionPolygon3D.ts +14 -14
  168. package/gen/classes/CollisionShape2D.ts +14 -14
  169. package/gen/classes/CollisionShape3D.ts +12 -12
  170. package/gen/classes/ColorPalette.ts +4 -4
  171. package/gen/classes/ColorPicker.ts +38 -38
  172. package/gen/classes/ColorPickerButton.ts +16 -16
  173. package/gen/classes/ColorRect.ts +4 -4
  174. package/gen/classes/Compositor.ts +4 -4
  175. package/gen/classes/CompositorEffect.ts +16 -16
  176. package/gen/classes/CompressedCubemap.ts +2 -2
  177. package/gen/classes/CompressedCubemapArray.ts +2 -2
  178. package/gen/classes/CompressedTexture2D.ts +4 -4
  179. package/gen/classes/CompressedTexture2DArray.ts +2 -2
  180. package/gen/classes/CompressedTexture3D.ts +4 -4
  181. package/gen/classes/CompressedTextureLayered.ts +3 -3
  182. package/gen/classes/ConcavePolygonShape2D.ts +4 -4
  183. package/gen/classes/ConcavePolygonShape3D.ts +6 -6
  184. package/gen/classes/ConeTwistJoint3D.ts +12 -12
  185. package/gen/classes/ConfigFile.ts +19 -19
  186. package/gen/classes/ConfirmationDialog.ts +6 -5
  187. package/gen/classes/Container.ts +10 -10
  188. package/gen/classes/Control.ts +280 -240
  189. package/gen/classes/ConvertTransformModifier3D.ts +42 -29
  190. package/gen/classes/ConvexPolygonShape2D.ts +5 -5
  191. package/gen/classes/ConvexPolygonShape3D.ts +4 -4
  192. package/gen/classes/CopyTransformModifier3D.ts +59 -46
  193. package/gen/classes/Crypto.ts +11 -11
  194. package/gen/classes/CryptoKey.ts +7 -7
  195. package/gen/classes/Cubemap.ts +3 -3
  196. package/gen/classes/CubemapArray.ts +3 -3
  197. package/gen/classes/Curve.ts +38 -38
  198. package/gen/classes/Curve2D.ts +25 -25
  199. package/gen/classes/Curve3D.ts +34 -34
  200. package/gen/classes/CurveTexture.ts +8 -8
  201. package/gen/classes/CurveXYZTexture.ts +10 -10
  202. package/gen/classes/CylinderMesh.ts +16 -16
  203. package/gen/classes/CylinderShape3D.ts +6 -6
  204. package/gen/classes/DPITexture.ts +17 -17
  205. package/gen/classes/DTLSServer.ts +4 -4
  206. package/gen/classes/DampedSpringJoint2D.ts +10 -10
  207. package/gen/classes/Decal.ts +32 -32
  208. package/gen/classes/DirAccess.ts +43 -43
  209. package/gen/classes/DirectionalLight2D.ts +6 -6
  210. package/gen/classes/DirectionalLight3D.ts +24 -24
  211. package/gen/classes/DisplayServer.ts +392 -326
  212. package/gen/classes/DrawableTexture2D.ts +10 -10
  213. package/gen/classes/ENetConnection.ts +20 -20
  214. package/gen/classes/ENetMultiplayerPeer.ts +9 -9
  215. package/gen/classes/ENetPacketPeer.ts +18 -18
  216. package/gen/classes/EncodedObjectAsID.ts +4 -4
  217. package/gen/classes/Engine.ts +43 -43
  218. package/gen/classes/EngineDebugger.ts +25 -25
  219. package/gen/classes/EngineProfiler.ts +2 -2
  220. package/gen/classes/Environment.ts +190 -190
  221. package/gen/classes/Expression.ts +6 -6
  222. package/gen/classes/ExternalTexture.ts +6 -6
  223. package/gen/classes/FABRIK3D.ts +2 -2
  224. package/gen/classes/FBXDocument.ts +2 -2
  225. package/gen/classes/FBXState.ts +4 -4
  226. package/gen/classes/FastNoiseLite.ts +44 -44
  227. package/gen/classes/FileAccess.ts +69 -69
  228. package/gen/classes/FileDialog.ts +113 -79
  229. package/gen/classes/FlowContainer.ts +11 -11
  230. package/gen/classes/FogMaterial.ts +14 -14
  231. package/gen/classes/FogVolume.ts +8 -8
  232. package/gen/classes/FoldableContainer.ts +35 -24
  233. package/gen/classes/FoldableGroup.ts +8 -8
  234. package/gen/classes/Font.ts +38 -38
  235. package/gen/classes/FontFile.ts +113 -113
  236. package/gen/classes/FontVariation.ts +28 -28
  237. package/gen/classes/FramebufferCacheRD.ts +3 -3
  238. package/gen/classes/FuzzySearch.ts +86 -0
  239. package/gen/classes/FuzzySearchMatch.ts +36 -0
  240. package/gen/classes/GDExtension.ts +4 -4
  241. package/gen/classes/GDExtensionManager.ts +15 -15
  242. package/gen/classes/GDScript.ts +3 -3
  243. package/gen/classes/GLTFAccessor.ts +34 -34
  244. package/gen/classes/GLTFAnimation.ts +8 -8
  245. package/gen/classes/GLTFBufferView.ts +17 -17
  246. package/gen/classes/GLTFCamera.ts +16 -16
  247. package/gen/classes/GLTFDocument.ts +27 -27
  248. package/gen/classes/GLTFDocumentExtension.ts +2 -2
  249. package/gen/classes/GLTFDocumentExtensionConvertImporterMesh.ts +2 -2
  250. package/gen/classes/GLTFLight.ts +20 -20
  251. package/gen/classes/GLTFMesh.ts +12 -12
  252. package/gen/classes/GLTFNode.ts +34 -34
  253. package/gen/classes/GLTFObjectModelProperty.ts +20 -20
  254. package/gen/classes/GLTFPhysicsBody.ts +22 -22
  255. package/gen/classes/GLTFPhysicsShape.ts +25 -25
  256. package/gen/classes/GLTFSkeleton.ts +13 -13
  257. package/gen/classes/GLTFSkin.ts +22 -22
  258. package/gen/classes/GLTFSpecGloss.ts +12 -12
  259. package/gen/classes/GLTFState.ts +74 -74
  260. package/gen/classes/GLTFTexture.ts +6 -6
  261. package/gen/classes/GLTFTextureSampler.ts +10 -10
  262. package/gen/classes/GPUParticles2D.ts +63 -62
  263. package/gen/classes/GPUParticles3D.ts +81 -76
  264. package/gen/classes/GPUParticlesAttractor3D.ts +9 -9
  265. package/gen/classes/GPUParticlesAttractorBox3D.ts +4 -4
  266. package/gen/classes/GPUParticlesAttractorSphere3D.ts +4 -4
  267. package/gen/classes/GPUParticlesAttractorVectorField3D.ts +6 -6
  268. package/gen/classes/GPUParticlesCollision3D.ts +3 -3
  269. package/gen/classes/GPUParticlesCollisionBox3D.ts +4 -4
  270. package/gen/classes/GPUParticlesCollisionHeightField3D.ts +14 -14
  271. package/gen/classes/GPUParticlesCollisionSDF3D.ts +14 -14
  272. package/gen/classes/GPUParticlesCollisionSphere3D.ts +4 -4
  273. package/gen/classes/Generic6DOFJoint3D.ts +54 -16
  274. package/gen/classes/Geometry2D.ts +26 -26
  275. package/gen/classes/Geometry3D.ts +17 -17
  276. package/gen/classes/GeometryInstance3D.ts +36 -36
  277. package/gen/classes/GodotInstance.ts +8 -8
  278. package/gen/classes/Gradient.ts +19 -19
  279. package/gen/classes/GradientTexture1D.ts +8 -8
  280. package/gen/classes/GradientTexture2D.ts +18 -18
  281. package/gen/classes/GraphEdit.ts +116 -116
  282. package/gen/classes/GraphElement.ts +30 -30
  283. package/gen/classes/GraphFrame.ts +17 -17
  284. package/gen/classes/GraphNode.ts +48 -48
  285. package/gen/classes/GridContainer.ts +4 -4
  286. package/gen/classes/GridMap.ts +76 -64
  287. package/gen/classes/GrooveJoint2D.ts +6 -6
  288. package/gen/classes/HBoxContainer.ts +2 -2
  289. package/gen/classes/HFlowContainer.ts +2 -2
  290. package/gen/classes/HMACContext.ts +5 -5
  291. package/gen/classes/HScrollBar.ts +2 -2
  292. package/gen/classes/HSeparator.ts +2 -2
  293. package/gen/classes/HSlider.ts +2 -2
  294. package/gen/classes/HSplitContainer.ts +2 -2
  295. package/gen/classes/HTTPClient.ts +25 -25
  296. package/gen/classes/HTTPRequest.ts +42 -28
  297. package/gen/classes/HashingContext.ts +5 -5
  298. package/gen/classes/HeightMapShape3D.ts +12 -12
  299. package/gen/classes/HingeJoint3D.ts +6 -6
  300. package/gen/classes/IKModifier3D.ts +8 -7
  301. package/gen/classes/IP.ts +12 -12
  302. package/gen/classes/Image.ts +124 -88
  303. package/gen/classes/ImageFormatLoader.ts +1 -1
  304. package/gen/classes/ImageFormatLoaderExtension.ts +4 -4
  305. package/gen/classes/ImageTexture.ts +8 -8
  306. package/gen/classes/ImageTexture3D.ts +4 -4
  307. package/gen/classes/ImageTextureLayered.ts +3 -3
  308. package/gen/classes/ImmediateMesh.ts +12 -12
  309. package/gen/classes/ImporterMesh.ts +27 -27
  310. package/gen/classes/ImporterMeshInstance3D.ts +22 -22
  311. package/gen/classes/Input.ts +174 -109
  312. package/gen/classes/InputEvent.ts +17 -17
  313. package/gen/classes/InputEventAction.ts +10 -10
  314. package/gen/classes/InputEventFromWindow.ts +3 -3
  315. package/gen/classes/InputEventGesture.ts +3 -3
  316. package/gen/classes/InputEventJoypadButton.ts +8 -8
  317. package/gen/classes/InputEventJoypadMotion.ts +6 -6
  318. package/gen/classes/InputEventKey.ts +31 -31
  319. package/gen/classes/InputEventMIDI.ts +18 -18
  320. package/gen/classes/InputEventMagnifyGesture.ts +4 -4
  321. package/gen/classes/InputEventMouse.ts +7 -7
  322. package/gen/classes/InputEventMouseButton.ts +12 -12
  323. package/gen/classes/InputEventMouseMotion.ts +16 -16
  324. package/gen/classes/InputEventPanGesture.ts +4 -4
  325. package/gen/classes/InputEventScreenDrag.ts +20 -20
  326. package/gen/classes/InputEventScreenTouch.ts +19 -12
  327. package/gen/classes/InputEventShortcut.ts +4 -4
  328. package/gen/classes/InputEventWithModifiers.ts +13 -13
  329. package/gen/classes/InputMap.ts +18 -18
  330. package/gen/classes/InstancePlaceholder.ts +4 -4
  331. package/gen/classes/IntervalTweener.ts +2 -2
  332. package/gen/classes/ItemList.ts +97 -97
  333. package/gen/classes/IterateIK3D.ts +40 -26
  334. package/gen/classes/JNISingleton.ts +3 -3
  335. package/gen/classes/JSON.ts +17 -17
  336. package/gen/classes/JSONRPC.ts +9 -9
  337. package/gen/classes/JacobianIK3D.ts +2 -2
  338. package/gen/classes/JavaClass.ts +6 -6
  339. package/gen/classes/JavaClassWrapper.ts +6 -6
  340. package/gen/classes/JavaObject.ts +4 -4
  341. package/gen/classes/JavaScriptBridge.ts +14 -14
  342. package/gen/classes/JavaScriptObject.ts +1 -1
  343. package/gen/classes/Joint2D.ts +10 -10
  344. package/gen/classes/Joint3D.ts +14 -12
  345. package/gen/classes/JointLimitation3D.ts +2 -2
  346. package/gen/classes/JointLimitationCone3D.ts +4 -4
  347. package/gen/classes/KinematicCollision2D.ts +15 -15
  348. package/gen/classes/KinematicCollision3D.ts +16 -16
  349. package/gen/classes/Label.ts +74 -51
  350. package/gen/classes/Label3D.ts +69 -69
  351. package/gen/classes/LabelSettings.ts +43 -43
  352. package/gen/classes/Light2D.ts +33 -33
  353. package/gen/classes/Light3D.ts +73 -57
  354. package/gen/classes/LightOccluder2D.ts +8 -8
  355. package/gen/classes/LightmapGI.ts +59 -47
  356. package/gen/classes/LightmapGIData.ts +20 -20
  357. package/gen/classes/LightmapProbe.ts +2 -2
  358. package/gen/classes/Lightmapper.ts +1 -1
  359. package/gen/classes/LightmapperRD.ts +2 -2
  360. package/gen/classes/LimitAngularVelocityModifier3D.ts +19 -19
  361. package/gen/classes/Line2D.ts +36 -36
  362. package/gen/classes/LineBase3D.ts +67 -0
  363. package/gen/classes/LineEdit.ts +108 -108
  364. package/gen/classes/LinkButton.ts +20 -20
  365. package/gen/classes/Logger.ts +2 -2
  366. package/gen/classes/LookAtModifier3D.ts +76 -68
  367. package/gen/classes/MainLoop.ts +4 -4
  368. package/gen/classes/MarginContainer.ts +2 -2
  369. package/gen/classes/Marker2D.ts +5 -5
  370. package/gen/classes/Marker3D.ts +5 -5
  371. package/gen/classes/Marshalls.ts +8 -8
  372. package/gen/classes/Material.ts +8 -8
  373. package/gen/classes/MenuBar.ts +26 -26
  374. package/gen/classes/MenuButton.ts +11 -11
  375. package/gen/classes/Mesh.ts +27 -23
  376. package/gen/classes/MeshConvexDecompositionSettings.ts +28 -28
  377. package/gen/classes/MeshDataTool.ts +40 -40
  378. package/gen/classes/MeshInstance2D.ts +8 -8
  379. package/gen/classes/MeshInstance3D.ts +23 -23
  380. package/gen/classes/MeshLibrary.ts +38 -28
  381. package/gen/classes/MeshTexture.ts +8 -8
  382. package/gen/classes/MethodTweener.ts +5 -5
  383. package/gen/classes/MissingNode.ts +10 -10
  384. package/gen/classes/MissingResource.ts +6 -6
  385. package/gen/classes/MobileVRInterface.ts +22 -22
  386. package/gen/classes/ModifierBoneTarget3D.ts +6 -6
  387. package/gen/classes/MovieWriter.ts +3 -3
  388. package/gen/classes/MultiMesh.ts +40 -40
  389. package/gen/classes/MultiMeshInstance2D.ts +8 -8
  390. package/gen/classes/MultiMeshInstance3D.ts +4 -4
  391. package/gen/classes/MultiplayerAPI.ts +25 -25
  392. package/gen/classes/MultiplayerAPIExtension.ts +2 -2
  393. package/gen/classes/MultiplayerPeer.ts +23 -23
  394. package/gen/classes/MultiplayerPeerExtension.ts +2 -2
  395. package/gen/classes/MultiplayerSpawner.ts +17 -17
  396. package/gen/classes/MultiplayerSynchronizer.ts +25 -25
  397. package/gen/classes/Mutex.ts +5 -5
  398. package/gen/classes/NativeMenu.ts +84 -71
  399. package/gen/classes/NavigationAgent2D.ts +98 -98
  400. package/gen/classes/NavigationAgent3D.ts +104 -104
  401. package/gen/classes/NavigationLink2D.ts +26 -26
  402. package/gen/classes/NavigationLink3D.ts +26 -26
  403. package/gen/classes/NavigationMesh.ts +62 -62
  404. package/gen/classes/NavigationMeshGenerator.ts +6 -6
  405. package/gen/classes/NavigationMeshSourceGeometryData2D.ts +18 -18
  406. package/gen/classes/NavigationMeshSourceGeometryData3D.ts +18 -18
  407. package/gen/classes/NavigationObstacle2D.ts +24 -23
  408. package/gen/classes/NavigationObstacle3D.ts +31 -30
  409. package/gen/classes/NavigationPathQueryParameters2D.ts +34 -34
  410. package/gen/classes/NavigationPathQueryParameters3D.ts +34 -34
  411. package/gen/classes/NavigationPathQueryResult2D.ts +13 -13
  412. package/gen/classes/NavigationPathQueryResult3D.ts +13 -13
  413. package/gen/classes/NavigationPolygon.ts +44 -44
  414. package/gen/classes/NavigationRegion2D.ts +28 -28
  415. package/gen/classes/NavigationRegion3D.ts +28 -28
  416. package/gen/classes/NavigationServer2D.ts +157 -157
  417. package/gen/classes/NavigationServer2DManager.ts +4 -4
  418. package/gen/classes/NavigationServer3D.ts +176 -176
  419. package/gen/classes/NavigationServer3DManager.ts +4 -4
  420. package/gen/classes/NinePatchRect.ts +22 -22
  421. package/gen/classes/Node.ts +145 -145
  422. package/gen/classes/Node2D.ts +37 -37
  423. package/gen/classes/Node3D.ts +75 -75
  424. package/gen/classes/Node3DGizmo.ts +1 -1
  425. package/gen/classes/Noise.ts +10 -10
  426. package/gen/classes/NoiseTexture2D.ts +26 -26
  427. package/gen/classes/NoiseTexture3D.ts +20 -20
  428. package/gen/classes/ORMMaterial3D.ts +2 -2
  429. package/gen/classes/OS.ts +101 -90
  430. package/gen/classes/Object.ts +60 -60
  431. package/gen/classes/Occluder3D.ts +3 -3
  432. package/gen/classes/OccluderInstance3D.ts +10 -10
  433. package/gen/classes/OccluderPolygon2D.ts +8 -8
  434. package/gen/classes/OfflineMultiplayerPeer.ts +2 -2
  435. package/gen/classes/OggPacketSequence.ts +9 -9
  436. package/gen/classes/OggPacketSequencePlayback.ts +2 -2
  437. package/gen/classes/OmniLight3D.ts +8 -8
  438. package/gen/classes/OpenXRAPIExtension.ts +58 -53
  439. package/gen/classes/OpenXRAction.ts +8 -8
  440. package/gen/classes/OpenXRActionBindingModifier.ts +2 -2
  441. package/gen/classes/OpenXRActionMap.ts +17 -17
  442. package/gen/classes/OpenXRActionSet.ts +11 -11
  443. package/gen/classes/OpenXRAnalogThresholdModifier.ts +10 -10
  444. package/gen/classes/OpenXRAnchorTracker.ts +7 -7
  445. package/gen/classes/OpenXRAndroidThreadSettingsExtension.ts +3 -3
  446. package/gen/classes/OpenXRBindingModifier.ts +1 -1
  447. package/gen/classes/OpenXRCompositionLayer.ts +42 -42
  448. package/gen/classes/OpenXRCompositionLayerCylinder.ts +10 -10
  449. package/gen/classes/OpenXRCompositionLayerEquirect.ts +12 -12
  450. package/gen/classes/OpenXRCompositionLayerQuad.ts +4 -4
  451. package/gen/classes/OpenXRDpadBindingModifier.ts +20 -20
  452. package/gen/classes/OpenXRExtensionWrapper.ts +6 -5
  453. package/gen/classes/OpenXRExtensionWrapperExtension.ts +2 -2
  454. package/gen/classes/OpenXRFoveatedInsetViewport.ts +26 -0
  455. package/gen/classes/OpenXRFrameSynthesisExtension.ts +8 -8
  456. package/gen/classes/OpenXRFutureExtension.ts +5 -5
  457. package/gen/classes/OpenXRFutureResult.ts +8 -8
  458. package/gen/classes/OpenXRHand.ts +12 -12
  459. package/gen/classes/OpenXRHapticBase.ts +1 -1
  460. package/gen/classes/OpenXRHapticVibration.ts +8 -8
  461. package/gen/classes/OpenXRIPBinding.ts +16 -16
  462. package/gen/classes/OpenXRIPBindingModifier.ts +2 -2
  463. package/gen/classes/OpenXRInteractionProfile.ts +12 -12
  464. package/gen/classes/OpenXRInteractionProfileMetadata.ts +7 -7
  465. package/gen/classes/OpenXRInterface.ts +100 -63
  466. package/gen/classes/OpenXRMarkerTracker.ts +12 -12
  467. package/gen/classes/OpenXRPlaneTracker.ts +26 -16
  468. package/gen/classes/OpenXRRenderModel.ts +7 -7
  469. package/gen/classes/OpenXRRenderModelExtension.ts +21 -21
  470. package/gen/classes/OpenXRRenderModelManager.ts +10 -10
  471. package/gen/classes/OpenXRSpatialAnchorCapability.ts +15 -15
  472. package/gen/classes/OpenXRSpatialCapabilityConfigurationAnchor.ts +3 -3
  473. package/gen/classes/OpenXRSpatialCapabilityConfigurationAprilTag.ts +5 -5
  474. package/gen/classes/OpenXRSpatialCapabilityConfigurationAruco.ts +23 -23
  475. package/gen/classes/OpenXRSpatialCapabilityConfigurationBaseHeader.ts +4 -4
  476. package/gen/classes/OpenXRSpatialCapabilityConfigurationMicroQrCode.ts +3 -3
  477. package/gen/classes/OpenXRSpatialCapabilityConfigurationPlaneTracking.ts +6 -6
  478. package/gen/classes/OpenXRSpatialCapabilityConfigurationQrCode.ts +3 -3
  479. package/gen/classes/OpenXRSpatialComponentAnchorList.ts +3 -3
  480. package/gen/classes/OpenXRSpatialComponentBounded2DList.ts +4 -4
  481. package/gen/classes/OpenXRSpatialComponentBounded3DList.ts +4 -4
  482. package/gen/classes/OpenXRSpatialComponentData.ts +4 -4
  483. package/gen/classes/OpenXRSpatialComponentMarkerList.ts +7 -7
  484. package/gen/classes/OpenXRSpatialComponentMesh2DList.ts +5 -5
  485. package/gen/classes/OpenXRSpatialComponentMesh3DList.ts +4 -4
  486. package/gen/classes/OpenXRSpatialComponentParentList.ts +3 -3
  487. package/gen/classes/OpenXRSpatialComponentPersistenceList.ts +4 -4
  488. package/gen/classes/OpenXRSpatialComponentPlaneAlignmentList.ts +3 -3
  489. package/gen/classes/OpenXRSpatialComponentPlaneSemanticLabelList.ts +3 -3
  490. package/gen/classes/OpenXRSpatialComponentPolygon2DList.ts +4 -4
  491. package/gen/classes/OpenXRSpatialContainerExtension.ts +92 -0
  492. package/gen/classes/OpenXRSpatialContainerSelfRenderingExtension.ts +19 -0
  493. package/gen/classes/OpenXRSpatialContainerState.ts +43 -0
  494. package/gen/classes/OpenXRSpatialContextPersistenceConfig.ts +5 -5
  495. package/gen/classes/OpenXRSpatialEntityExtension.ts +63 -32
  496. package/gen/classes/OpenXRSpatialEntityTracker.ts +15 -15
  497. package/gen/classes/OpenXRSpatialMarkerTrackingCapability.ts +47 -9
  498. package/gen/classes/OpenXRSpatialPlaneTrackingCapability.ts +20 -4
  499. package/gen/classes/OpenXRSpatialQueryResultData.ts +5 -5
  500. package/gen/classes/OpenXRStructureBase.ts +10 -5
  501. package/gen/classes/OpenXRVisibilityMask.ts +2 -2
  502. package/gen/classes/OptimizedTranslation.ts +3 -3
  503. package/gen/classes/OptionButton.ts +51 -51
  504. package/gen/classes/PCKPacker.ts +7 -7
  505. package/gen/classes/PackedDataContainer.ts +4 -4
  506. package/gen/classes/PackedDataContainerRef.ts +2 -2
  507. package/gen/classes/PackedScene.ts +6 -6
  508. package/gen/classes/PacketPeer.ts +10 -10
  509. package/gen/classes/PacketPeerDTLS.ts +7 -7
  510. package/gen/classes/PacketPeerExtension.ts +2 -2
  511. package/gen/classes/PacketPeerStream.ts +9 -9
  512. package/gen/classes/PacketPeerUDP.ts +16 -16
  513. package/gen/classes/Panel.ts +2 -2
  514. package/gen/classes/PanelContainer.ts +2 -2
  515. package/gen/classes/PanoramaSkyMaterial.ts +8 -8
  516. package/gen/classes/Parallax2D.ts +22 -22
  517. package/gen/classes/ParallaxBackground.ts +14 -14
  518. package/gen/classes/ParallaxLayer.ts +9 -9
  519. package/gen/classes/ParticleProcessMaterial.ts +269 -253
  520. package/gen/classes/Path2D.ts +4 -4
  521. package/gen/classes/Path3D.ts +10 -10
  522. package/gen/classes/PathFollow2D.ts +16 -16
  523. package/gen/classes/PathFollow3D.ts +21 -21
  524. package/gen/classes/Performance.ts +15 -11
  525. package/gen/classes/PhysicalBone2D.ts +14 -14
  526. package/gen/classes/PhysicalBone3D.ts +45 -39
  527. package/gen/classes/PhysicalBoneSimulator3D.ts +7 -7
  528. package/gen/classes/PhysicalSkyMaterial.ts +24 -24
  529. package/gen/classes/PhysicsBody2D.ts +7 -7
  530. package/gen/classes/PhysicsBody3D.ts +19 -19
  531. package/gen/classes/PhysicsCastMotionResult2D.ts +25 -0
  532. package/gen/classes/PhysicsCastMotionResult3D.ts +25 -0
  533. package/gen/classes/PhysicsCollideShapeResult2D.ts +38 -0
  534. package/gen/classes/PhysicsCollideShapeResult3D.ts +38 -0
  535. package/gen/classes/PhysicsDirectBodyState2D.ts +49 -49
  536. package/gen/classes/PhysicsDirectBodyState2DExtension.ts +2 -2
  537. package/gen/classes/PhysicsDirectBodyState3D.ts +51 -51
  538. package/gen/classes/PhysicsDirectBodyState3DExtension.ts +2 -2
  539. package/gen/classes/PhysicsDirectSpaceState2D.ts +61 -14
  540. package/gen/classes/PhysicsDirectSpaceState2DExtension.ts +3 -3
  541. package/gen/classes/PhysicsDirectSpaceState3D.ts +64 -15
  542. package/gen/classes/PhysicsDirectSpaceState3DExtension.ts +3 -3
  543. package/gen/classes/PhysicsGetRestInfoResult2D.ts +48 -0
  544. package/gen/classes/PhysicsGetRestInfoResult3D.ts +48 -0
  545. package/gen/classes/PhysicsIntersectPointResult2D.ts +49 -0
  546. package/gen/classes/PhysicsIntersectPointResult3D.ts +49 -0
  547. package/gen/classes/PhysicsIntersectRayResult2D.ts +49 -0
  548. package/gen/classes/PhysicsIntersectRayResult3D.ts +55 -0
  549. package/gen/classes/PhysicsIntersectShapeResult2D.ts +49 -0
  550. package/gen/classes/PhysicsIntersectShapeResult3D.ts +49 -0
  551. package/gen/classes/PhysicsMaterial.ts +10 -10
  552. package/gen/classes/PhysicsPointQueryParameters2D.ts +15 -14
  553. package/gen/classes/PhysicsPointQueryParameters3D.ts +13 -12
  554. package/gen/classes/PhysicsRayQueryParameters2D.ts +18 -17
  555. package/gen/classes/PhysicsRayQueryParameters3D.ts +20 -19
  556. package/gen/classes/PhysicsServer2D.ts +122 -122
  557. package/gen/classes/PhysicsServer2DExtension.ts +4 -4
  558. package/gen/classes/PhysicsServer2DManager.ts +4 -4
  559. package/gen/classes/PhysicsServer3D.ts +210 -182
  560. package/gen/classes/PhysicsServer3DExtension.ts +5 -5
  561. package/gen/classes/PhysicsServer3DManager.ts +4 -4
  562. package/gen/classes/PhysicsServer3DRenderingServerHandler.ts +5 -5
  563. package/gen/classes/PhysicsShapeQueryParameters2D.ts +21 -20
  564. package/gen/classes/PhysicsShapeQueryParameters3D.ts +21 -20
  565. package/gen/classes/PhysicsTestMotionParameters2D.ts +17 -16
  566. package/gen/classes/PhysicsTestMotionParameters3D.ts +19 -18
  567. package/gen/classes/PhysicsTestMotionResult2D.ts +16 -15
  568. package/gen/classes/PhysicsTestMotionResult3D.ts +17 -16
  569. package/gen/classes/PinJoint2D.ts +14 -14
  570. package/gen/classes/PinJoint3D.ts +4 -4
  571. package/gen/classes/PlaceholderCubemap.ts +2 -2
  572. package/gen/classes/PlaceholderCubemapArray.ts +2 -2
  573. package/gen/classes/PlaceholderMaterial.ts +2 -2
  574. package/gen/classes/PlaceholderMesh.ts +4 -4
  575. package/gen/classes/PlaceholderTexture2D.ts +4 -4
  576. package/gen/classes/PlaceholderTexture2DArray.ts +2 -2
  577. package/gen/classes/PlaceholderTexture3D.ts +4 -4
  578. package/gen/classes/PlaceholderTextureLayered.ts +5 -5
  579. package/gen/classes/PlaneMesh.ts +12 -12
  580. package/gen/classes/PointLight2D.ts +10 -10
  581. package/gen/classes/PointMesh.ts +2 -2
  582. package/gen/classes/Polygon2D.ts +42 -42
  583. package/gen/classes/PolygonOccluder3D.ts +4 -4
  584. package/gen/classes/PolygonPathFinder.ts +12 -12
  585. package/gen/classes/Popup.ts +4 -4
  586. package/gen/classes/PopupMenu.ts +125 -112
  587. package/gen/classes/PopupPanel.ts +2 -2
  588. package/gen/classes/PortableCompressedTexture2D.ts +11 -11
  589. package/gen/classes/PrimitiveMesh.ts +15 -15
  590. package/gen/classes/PrismMesh.ts +12 -12
  591. package/gen/classes/ProceduralSkyMaterial.ts +30 -30
  592. package/gen/classes/ProgressBar.ts +10 -10
  593. package/gen/classes/ProjectSettings.ts +26 -26
  594. package/gen/classes/PropertyTweener.ts +9 -9
  595. package/gen/classes/QuadMesh.ts +2 -2
  596. package/gen/classes/QuadOccluder3D.ts +4 -4
  597. package/gen/classes/RDAccelerationStructureGeometry.ts +20 -20
  598. package/gen/classes/RDAccelerationStructureInstance.ts +14 -14
  599. package/gen/classes/RDAttachmentFormat.ts +8 -8
  600. package/gen/classes/RDFramebufferPass.ts +12 -12
  601. package/gen/classes/RDHitGroup.ts +8 -8
  602. package/gen/classes/RDPipelineColorBlendState.ts +10 -10
  603. package/gen/classes/RDPipelineColorBlendStateAttachment.ts +25 -25
  604. package/gen/classes/RDPipelineDepthStencilState.ts +44 -44
  605. package/gen/classes/RDPipelineMultisampleState.ts +14 -14
  606. package/gen/classes/RDPipelineRasterizationState.ts +25 -25
  607. package/gen/classes/RDPipelineShader.ts +6 -6
  608. package/gen/classes/RDPipelineSpecializationConstant.ts +6 -6
  609. package/gen/classes/RDSamplerState.ts +32 -32
  610. package/gen/classes/RDShaderFile.ts +7 -7
  611. package/gen/classes/RDShaderSPIRV.ts +42 -42
  612. package/gen/classes/RDShaderSource.ts +24 -24
  613. package/gen/classes/RDTextureFormat.ts +26 -26
  614. package/gen/classes/RDTextureView.ts +12 -12
  615. package/gen/classes/RDUniform.ts +9 -9
  616. package/gen/classes/RDVertexAttribute.ts +14 -14
  617. package/gen/classes/RandomNumberGenerator.ts +13 -13
  618. package/gen/classes/Range.ts +29 -29
  619. package/gen/classes/RayCast2D.ts +30 -30
  620. package/gen/classes/RayCast3D.ts +37 -37
  621. package/gen/classes/RectangleShape2D.ts +4 -4
  622. package/gen/classes/RefCounted.ts +6 -6
  623. package/gen/classes/ReferenceRect.ts +8 -8
  624. package/gen/classes/ReflectionProbe.ts +32 -32
  625. package/gen/classes/RegEx.ts +13 -13
  626. package/gen/classes/RegExMatch.ts +9 -9
  627. package/gen/classes/RemoteTransform2D.ts +13 -13
  628. package/gen/classes/RemoteTransform3D.ts +13 -13
  629. package/gen/classes/RenderData.ts +5 -5
  630. package/gen/classes/RenderDataExtension.ts +2 -2
  631. package/gen/classes/RenderDataRD.ts +2 -2
  632. package/gen/classes/RenderSceneBuffers.ts +2 -2
  633. package/gen/classes/RenderSceneBuffersConfiguration.ts +22 -22
  634. package/gen/classes/RenderSceneBuffersExtension.ts +2 -2
  635. package/gen/classes/RenderSceneBuffersRD.ts +29 -29
  636. package/gen/classes/RenderSceneData.ts +7 -7
  637. package/gen/classes/RenderSceneDataExtension.ts +2 -2
  638. package/gen/classes/RenderSceneDataRD.ts +2 -2
  639. package/gen/classes/RenderingDevice.ts +152 -140
  640. package/gen/classes/RenderingServer.ts +603 -550
  641. package/gen/classes/Resource.ts +29 -29
  642. package/gen/classes/ResourceFormatLoader.ts +2 -2
  643. package/gen/classes/ResourceFormatSaver.ts +2 -2
  644. package/gen/classes/ResourceImporter.ts +1 -1
  645. package/gen/classes/ResourceLoader.ts +21 -16
  646. package/gen/classes/ResourcePreloader.ts +10 -10
  647. package/gen/classes/ResourceSaver.ts +8 -8
  648. package/gen/classes/ResourceUID.ts +11 -11
  649. package/gen/classes/RetargetModifier3D.ts +22 -14
  650. package/gen/classes/RibbonTrailMesh.ts +14 -14
  651. package/gen/classes/RichTextEffect.ts +2 -2
  652. package/gen/classes/RichTextLabel.ts +236 -181
  653. package/gen/classes/RigidBody2D.ts +84 -70
  654. package/gen/classes/RigidBody3D.ts +85 -71
  655. package/gen/classes/RootMotionView.ts +12 -12
  656. package/gen/classes/SceneMultiplayer.ts +31 -31
  657. package/gen/classes/SceneReplicationConfig.ts +15 -15
  658. package/gen/classes/SceneState.ts +24 -24
  659. package/gen/classes/SceneTree.ts +67 -68
  660. package/gen/classes/SceneTreeTimer.ts +5 -5
  661. package/gen/classes/Script.ts +21 -20
  662. package/gen/classes/ScriptBacktrace.ts +18 -18
  663. package/gen/classes/ScriptExtension.ts +2 -2
  664. package/gen/classes/ScriptLanguage.ts +16 -1
  665. package/gen/classes/ScriptLanguageExtension.ts +2 -2
  666. package/gen/classes/ScrollBar.ts +5 -5
  667. package/gen/classes/ScrollContainer.ts +58 -34
  668. package/gen/classes/SegmentShape2D.ts +6 -6
  669. package/gen/classes/Semaphore.ts +5 -5
  670. package/gen/classes/SeparationRayShape2D.ts +6 -6
  671. package/gen/classes/SeparationRayShape3D.ts +6 -6
  672. package/gen/classes/Separator.ts +1 -1
  673. package/gen/classes/Shader.ts +14 -9
  674. package/gen/classes/ShaderGlobalsOverride.ts +2 -2
  675. package/gen/classes/ShaderInclude.ts +4 -4
  676. package/gen/classes/ShaderIncludeDB.ts +5 -5
  677. package/gen/classes/ShaderMaterial.ts +6 -6
  678. package/gen/classes/Shape2D.ts +9 -9
  679. package/gen/classes/Shape3D.ts +6 -6
  680. package/gen/classes/ShapeCast2D.ts +38 -38
  681. package/gen/classes/ShapeCast3D.ts +41 -41
  682. package/gen/classes/Shortcut.ts +7 -7
  683. package/gen/classes/Skeleton2D.ts +12 -12
  684. package/gen/classes/Skeleton3D.ts +82 -70
  685. package/gen/classes/SkeletonIK3D.ts +27 -27
  686. package/gen/classes/SkeletonModification2D.ts +12 -12
  687. package/gen/classes/SkeletonModification2DCCDIK.ts +22 -22
  688. package/gen/classes/SkeletonModification2DFABRIK.ts +14 -14
  689. package/gen/classes/SkeletonModification2DJiggle.ts +37 -37
  690. package/gen/classes/SkeletonModification2DLookAt.ts +18 -18
  691. package/gen/classes/SkeletonModification2DPhysicalBones.ts +9 -9
  692. package/gen/classes/SkeletonModification2DStackHolder.ts +4 -4
  693. package/gen/classes/SkeletonModification2DTwoBoneIK.ts +18 -18
  694. package/gen/classes/SkeletonModificationStack2D.ts +18 -18
  695. package/gen/classes/SkeletonModifier3D.ts +9 -9
  696. package/gen/classes/SkeletonProfile.ts +34 -34
  697. package/gen/classes/SkeletonProfileHumanoid.ts +2 -2
  698. package/gen/classes/Skin.ts +49 -13
  699. package/gen/classes/SkinReference.ts +3 -3
  700. package/gen/classes/Sky.ts +8 -8
  701. package/gen/classes/Slider.ts +15 -15
  702. package/gen/classes/SliderJoint3D.ts +4 -4
  703. package/gen/classes/SocketServer.ts +5 -5
  704. package/gen/classes/SoftBody3D.ts +47 -42
  705. package/gen/classes/SphereMesh.ts +12 -12
  706. package/gen/classes/SphereOccluder3D.ts +4 -4
  707. package/gen/classes/SphereShape3D.ts +4 -4
  708. package/gen/classes/SpinBox.ts +50 -27
  709. package/gen/classes/SplineIK3D.ts +12 -12
  710. package/gen/classes/SplitContainer.ts +35 -35
  711. package/gen/classes/SpotLight3D.ts +10 -10
  712. package/gen/classes/SpringArm3D.ts +14 -14
  713. package/gen/classes/SpringBoneCollision3D.ts +11 -11
  714. package/gen/classes/SpringBoneCollisionCapsule3D.ts +10 -10
  715. package/gen/classes/SpringBoneCollisionPlane3D.ts +2 -2
  716. package/gen/classes/SpringBoneCollisionSphere3D.ts +6 -6
  717. package/gen/classes/SpringBoneSimulator3D.ts +86 -86
  718. package/gen/classes/Sprite2D.ts +32 -32
  719. package/gen/classes/Sprite3D.ts +20 -20
  720. package/gen/classes/SpriteBase3D.ts +43 -43
  721. package/gen/classes/SpriteFrames.ts +24 -24
  722. package/gen/classes/StandardMaterial3D.ts +2 -2
  723. package/gen/classes/StaticBody2D.ts +8 -8
  724. package/gen/classes/StaticBody3D.ts +8 -8
  725. package/gen/classes/StatusIndicator.ts +17 -13
  726. package/gen/classes/StreamPeer.ts +37 -37
  727. package/gen/classes/StreamPeerBuffer.ts +10 -10
  728. package/gen/classes/StreamPeerExtension.ts +2 -2
  729. package/gen/classes/StreamPeerGZIP.ts +6 -6
  730. package/gen/classes/StreamPeerSocket.ts +4 -4
  731. package/gen/classes/StreamPeerTCP.ts +9 -9
  732. package/gen/classes/StreamPeerTLS.ts +9 -9
  733. package/gen/classes/StreamPeerUDS.ts +5 -5
  734. package/gen/classes/StreamedTexture2D.ts +34 -0
  735. package/gen/classes/StyleBox.ts +17 -17
  736. package/gen/classes/StyleBoxEmpty.ts +2 -2
  737. package/gen/classes/StyleBoxFlat.ts +52 -52
  738. package/gen/classes/StyleBoxLine.ts +12 -12
  739. package/gen/classes/StyleBoxTexture.ts +32 -32
  740. package/gen/classes/SubViewport.ts +14 -14
  741. package/gen/classes/SubViewportContainer.ts +9 -9
  742. package/gen/classes/SubtweenTweener.ts +3 -3
  743. package/gen/classes/SurfaceTool.ts +35 -35
  744. package/gen/classes/SyntaxHighlighter.ts +30 -6
  745. package/gen/classes/SystemFont.ts +36 -36
  746. package/gen/classes/TCPServer.ts +6 -6
  747. package/gen/classes/TLSOptions.ts +10 -10
  748. package/gen/classes/TabBar.ts +109 -78
  749. package/gen/classes/TabContainer.ts +75 -68
  750. package/gen/classes/TextEdit.ts +275 -269
  751. package/gen/classes/TextLine.ts +41 -41
  752. package/gen/classes/TextMesh.ts +38 -38
  753. package/gen/classes/TextParagraph.ts +64 -64
  754. package/gen/classes/TextServer.ts +250 -245
  755. package/gen/classes/TextServerAdvanced.ts +2 -2
  756. package/gen/classes/TextServerDummy.ts +2 -2
  757. package/gen/classes/TextServerExtension.ts +2 -2
  758. package/gen/classes/TextServerManager.ts +14 -14
  759. package/gen/classes/Texture.ts +2 -2
  760. package/gen/classes/Texture2D.ts +14 -14
  761. package/gen/classes/Texture2DArray.ts +3 -3
  762. package/gen/classes/Texture2DArrayRD.ts +2 -2
  763. package/gen/classes/Texture2DRD.ts +4 -4
  764. package/gen/classes/Texture3D.ts +9 -9
  765. package/gen/classes/Texture3DRD.ts +4 -4
  766. package/gen/classes/TextureButton.ts +22 -22
  767. package/gen/classes/TextureCubemapArrayRD.ts +2 -2
  768. package/gen/classes/TextureCubemapRD.ts +2 -2
  769. package/gen/classes/TextureLayered.ts +9 -9
  770. package/gen/classes/TextureLayeredRD.ts +3 -3
  771. package/gen/classes/TextureProgressBar.ts +34 -34
  772. package/gen/classes/TextureRect.ts +13 -12
  773. package/gen/classes/TextureStreaming.ts +54 -0
  774. package/gen/classes/Theme.ts +116 -73
  775. package/gen/classes/ThemeDB.ts +23 -16
  776. package/gen/classes/Thread.ts +9 -9
  777. package/gen/classes/TileData.ts +58 -58
  778. package/gen/classes/TileMap.ts +65 -65
  779. package/gen/classes/TileMapLayer.ts +60 -60
  780. package/gen/classes/TileMapPattern.ts +12 -12
  781. package/gen/classes/TileSet.ts +93 -93
  782. package/gen/classes/TileSetAtlasSource.ts +43 -43
  783. package/gen/classes/TileSetScenesCollectionSource.ts +13 -13
  784. package/gen/classes/TileSetSource.ts +7 -7
  785. package/gen/classes/Time.ts +23 -23
  786. package/gen/classes/Timer.ts +20 -20
  787. package/gen/classes/TorusMesh.ts +10 -10
  788. package/gen/classes/TouchScreenButton.ts +25 -25
  789. package/gen/classes/Trail3D.ts +173 -0
  790. package/gen/classes/Translation.ts +16 -16
  791. package/gen/classes/TranslationDomain.ts +35 -35
  792. package/gen/classes/TranslationServer.ts +36 -36
  793. package/gen/classes/Tree.ts +104 -104
  794. package/gen/classes/TreeItem.ts +126 -126
  795. package/gen/classes/TriangleMesh.ts +6 -6
  796. package/gen/classes/TubeTrailMesh.ts +18 -18
  797. package/gen/classes/Tween.ts +58 -43
  798. package/gen/classes/Tweener.ts +3 -3
  799. package/gen/classes/TwoBoneIK3D.ts +32 -32
  800. package/gen/classes/UDPServer.ts +11 -11
  801. package/gen/classes/UDSServer.ts +4 -4
  802. package/gen/classes/UPNP.ts +19 -19
  803. package/gen/classes/UPNPDevice.ts +18 -18
  804. package/gen/classes/UndoRedo.ts +28 -28
  805. package/gen/classes/UniformSetCacheRD.ts +3 -3
  806. package/gen/classes/VBoxContainer.ts +2 -2
  807. package/gen/classes/VFlowContainer.ts +2 -2
  808. package/gen/classes/VScrollBar.ts +2 -2
  809. package/gen/classes/VSeparator.ts +2 -2
  810. package/gen/classes/VSlider.ts +2 -2
  811. package/gen/classes/VSplitContainer.ts +2 -2
  812. package/gen/classes/VehicleBody3D.ts +8 -8
  813. package/gen/classes/VehicleWheel3D.ts +36 -36
  814. package/gen/classes/VideoStream.ts +4 -4
  815. package/gen/classes/VideoStreamPlayback.ts +3 -3
  816. package/gen/classes/VideoStreamPlayer.ts +38 -36
  817. package/gen/classes/VideoStreamTheora.ts +2 -2
  818. package/gen/classes/Viewport.ts +148 -148
  819. package/gen/classes/ViewportTexture.ts +5 -13
  820. package/gen/classes/VirtualJoystick.ts +34 -34
  821. package/gen/classes/VisibleOnScreenEnabler2D.ts +6 -6
  822. package/gen/classes/VisibleOnScreenEnabler3D.ts +6 -6
  823. package/gen/classes/VisibleOnScreenNotifier2D.ts +11 -11
  824. package/gen/classes/VisibleOnScreenNotifier3D.ts +9 -9
  825. package/gen/classes/VisualInstance3D.ts +14 -14
  826. package/gen/classes/VisualShader.ts +25 -25
  827. package/gen/classes/VisualShaderGroup.ts +190 -0
  828. package/gen/classes/VisualShaderNode.ts +15 -15
  829. package/gen/classes/VisualShaderNodeBillboard.ts +6 -6
  830. package/gen/classes/VisualShaderNodeBooleanConstant.ts +4 -4
  831. package/gen/classes/VisualShaderNodeBooleanParameter.ts +6 -6
  832. package/gen/classes/VisualShaderNodeClamp.ts +4 -4
  833. package/gen/classes/VisualShaderNodeColorConstant.ts +4 -4
  834. package/gen/classes/VisualShaderNodeColorFunc.ts +4 -4
  835. package/gen/classes/VisualShaderNodeColorOp.ts +4 -4
  836. package/gen/classes/VisualShaderNodeColorParameter.ts +6 -6
  837. package/gen/classes/VisualShaderNodeComment.ts +4 -4
  838. package/gen/classes/VisualShaderNodeCompare.ts +8 -8
  839. package/gen/classes/VisualShaderNodeConstant.ts +1 -1
  840. package/gen/classes/VisualShaderNodeCubemap.ts +8 -8
  841. package/gen/classes/VisualShaderNodeCubemapParameter.ts +2 -2
  842. package/gen/classes/VisualShaderNodeCurveTexture.ts +4 -4
  843. package/gen/classes/VisualShaderNodeCurveXYZTexture.ts +4 -4
  844. package/gen/classes/VisualShaderNodeCustom.ts +7 -7
  845. package/gen/classes/VisualShaderNodeDerivativeFunc.ts +8 -8
  846. package/gen/classes/VisualShaderNodeDeterminant.ts +2 -2
  847. package/gen/classes/VisualShaderNodeDistanceFade.ts +2 -2
  848. package/gen/classes/VisualShaderNodeDotProduct.ts +2 -2
  849. package/gen/classes/VisualShaderNodeExpression.ts +4 -4
  850. package/gen/classes/VisualShaderNodeFaceForward.ts +2 -2
  851. package/gen/classes/VisualShaderNodeFloatConstant.ts +4 -4
  852. package/gen/classes/VisualShaderNodeFloatFunc.ts +4 -4
  853. package/gen/classes/VisualShaderNodeFloatOp.ts +4 -4
  854. package/gen/classes/VisualShaderNodeFloatParameter.ts +14 -14
  855. package/gen/classes/VisualShaderNodeFrame.ts +14 -14
  856. package/gen/classes/VisualShaderNodeFresnel.ts +2 -2
  857. package/gen/classes/VisualShaderNodeGlobalExpression.ts +2 -2
  858. package/gen/classes/VisualShaderNodeGroup.ts +22 -0
  859. package/gen/classes/VisualShaderNodeGroupBase.ts +22 -22
  860. package/gen/classes/VisualShaderNodeGroupInput.ts +14 -0
  861. package/gen/classes/VisualShaderNodeGroupOutput.ts +14 -0
  862. package/gen/classes/VisualShaderNodeIf.ts +2 -2
  863. package/gen/classes/VisualShaderNodeInput.ts +7 -7
  864. package/gen/classes/VisualShaderNodeIntConstant.ts +4 -4
  865. package/gen/classes/VisualShaderNodeIntFunc.ts +4 -4
  866. package/gen/classes/VisualShaderNodeIntOp.ts +4 -4
  867. package/gen/classes/VisualShaderNodeIntParameter.ts +16 -16
  868. package/gen/classes/VisualShaderNodeIs.ts +4 -4
  869. package/gen/classes/VisualShaderNodeLinearSceneDepth.ts +2 -2
  870. package/gen/classes/VisualShaderNodeMix.ts +4 -4
  871. package/gen/classes/VisualShaderNodeMultiplyAdd.ts +4 -4
  872. package/gen/classes/VisualShaderNodeOuterProduct.ts +2 -2
  873. package/gen/classes/VisualShaderNodeOutput.ts +1 -1
  874. package/gen/classes/VisualShaderNodeParameter.ts +7 -7
  875. package/gen/classes/VisualShaderNodeParameterRef.ts +6 -6
  876. package/gen/classes/VisualShaderNodeParticleAccelerator.ts +4 -4
  877. package/gen/classes/VisualShaderNodeParticleBoxEmitter.ts +2 -2
  878. package/gen/classes/VisualShaderNodeParticleConeVelocity.ts +2 -2
  879. package/gen/classes/VisualShaderNodeParticleEmit.ts +5 -5
  880. package/gen/classes/VisualShaderNodeParticleEmitter.ts +3 -3
  881. package/gen/classes/VisualShaderNodeParticleMeshEmitter.ts +8 -8
  882. package/gen/classes/VisualShaderNodeParticleMultiplyByAxisAngle.ts +4 -4
  883. package/gen/classes/VisualShaderNodeParticleOutput.ts +2 -2
  884. package/gen/classes/VisualShaderNodeParticleRandomness.ts +4 -4
  885. package/gen/classes/VisualShaderNodeParticleRingEmitter.ts +2 -2
  886. package/gen/classes/VisualShaderNodeParticleSphereEmitter.ts +2 -2
  887. package/gen/classes/VisualShaderNodeProximityFade.ts +2 -2
  888. package/gen/classes/VisualShaderNodeRandomRange.ts +2 -2
  889. package/gen/classes/VisualShaderNodeRemap.ts +4 -4
  890. package/gen/classes/VisualShaderNodeReroute.ts +4 -4
  891. package/gen/classes/VisualShaderNodeResizableBase.ts +3 -3
  892. package/gen/classes/VisualShaderNodeRotationByAxis.ts +2 -2
  893. package/gen/classes/VisualShaderNodeSDFRaymarch.ts +2 -2
  894. package/gen/classes/VisualShaderNodeSDFToScreenUV.ts +2 -2
  895. package/gen/classes/VisualShaderNodeSample3D.ts +3 -3
  896. package/gen/classes/VisualShaderNodeScreenNormalWorldSpace.ts +2 -2
  897. package/gen/classes/VisualShaderNodeScreenUVToSDF.ts +2 -2
  898. package/gen/classes/VisualShaderNodeSmoothStep.ts +4 -4
  899. package/gen/classes/VisualShaderNodeStep.ts +4 -4
  900. package/gen/classes/VisualShaderNodeSwitch.ts +4 -4
  901. package/gen/classes/VisualShaderNodeTexture.ts +8 -8
  902. package/gen/classes/VisualShaderNodeTexture2DArray.ts +4 -4
  903. package/gen/classes/VisualShaderNodeTexture2DArrayParameter.ts +2 -2
  904. package/gen/classes/VisualShaderNodeTexture2DParameter.ts +2 -2
  905. package/gen/classes/VisualShaderNodeTexture3D.ts +4 -4
  906. package/gen/classes/VisualShaderNodeTexture3DParameter.ts +2 -2
  907. package/gen/classes/VisualShaderNodeTextureParameter.ts +11 -11
  908. package/gen/classes/VisualShaderNodeTextureParameterTriplanar.ts +2 -2
  909. package/gen/classes/VisualShaderNodeTextureSDF.ts +2 -2
  910. package/gen/classes/VisualShaderNodeTextureSDFNormal.ts +2 -2
  911. package/gen/classes/VisualShaderNodeTransformCompose.ts +2 -2
  912. package/gen/classes/VisualShaderNodeTransformConstant.ts +4 -4
  913. package/gen/classes/VisualShaderNodeTransformDecompose.ts +2 -2
  914. package/gen/classes/VisualShaderNodeTransformFunc.ts +4 -4
  915. package/gen/classes/VisualShaderNodeTransformOp.ts +4 -4
  916. package/gen/classes/VisualShaderNodeTransformParameter.ts +6 -6
  917. package/gen/classes/VisualShaderNodeTransformVecMult.ts +4 -4
  918. package/gen/classes/VisualShaderNodeUIntConstant.ts +4 -4
  919. package/gen/classes/VisualShaderNodeUIntFunc.ts +4 -4
  920. package/gen/classes/VisualShaderNodeUIntOp.ts +4 -4
  921. package/gen/classes/VisualShaderNodeUIntParameter.ts +6 -6
  922. package/gen/classes/VisualShaderNodeUVFunc.ts +4 -4
  923. package/gen/classes/VisualShaderNodeUVPolarCoord.ts +2 -2
  924. package/gen/classes/VisualShaderNodeVarying.ts +5 -5
  925. package/gen/classes/VisualShaderNodeVaryingGetter.ts +2 -2
  926. package/gen/classes/VisualShaderNodeVaryingSetter.ts +2 -2
  927. package/gen/classes/VisualShaderNodeVec2Constant.ts +4 -4
  928. package/gen/classes/VisualShaderNodeVec2Parameter.ts +6 -6
  929. package/gen/classes/VisualShaderNodeVec3Constant.ts +4 -4
  930. package/gen/classes/VisualShaderNodeVec3Parameter.ts +6 -6
  931. package/gen/classes/VisualShaderNodeVec4Constant.ts +6 -6
  932. package/gen/classes/VisualShaderNodeVec4Parameter.ts +6 -6
  933. package/gen/classes/VisualShaderNodeVectorBase.ts +3 -3
  934. package/gen/classes/VisualShaderNodeVectorCompose.ts +2 -2
  935. package/gen/classes/VisualShaderNodeVectorDecompose.ts +2 -2
  936. package/gen/classes/VisualShaderNodeVectorDistance.ts +2 -2
  937. package/gen/classes/VisualShaderNodeVectorFunc.ts +4 -4
  938. package/gen/classes/VisualShaderNodeVectorLen.ts +2 -2
  939. package/gen/classes/VisualShaderNodeVectorOp.ts +4 -4
  940. package/gen/classes/VisualShaderNodeVectorRefract.ts +2 -2
  941. package/gen/classes/VisualShaderNodeWorldPositionFromDepth.ts +2 -2
  942. package/gen/classes/VoxelGI.ts +12 -12
  943. package/gen/classes/VoxelGIData.ts +23 -23
  944. package/gen/classes/WeakRef.ts +3 -3
  945. package/gen/classes/WebRTCDataChannel.ts +15 -15
  946. package/gen/classes/WebRTCDataChannelExtension.ts +2 -2
  947. package/gen/classes/WebRTCMultiplayerPeer.ts +12 -12
  948. package/gen/classes/WebRTCPeerConnection.ts +21 -21
  949. package/gen/classes/WebRTCPeerConnectionExtension.ts +2 -2
  950. package/gen/classes/WebSocketMultiplayerPeer.ts +20 -20
  951. package/gen/classes/WebSocketPeer.ts +32 -32
  952. package/gen/classes/WebXRInterface.ts +57 -49
  953. package/gen/classes/Window.ts +245 -202
  954. package/gen/classes/WorkerThreadPool.ts +11 -11
  955. package/gen/classes/World2D.ts +6 -6
  956. package/gen/classes/World3D.ts +12 -12
  957. package/gen/classes/WorldBoundaryShape2D.ts +6 -6
  958. package/gen/classes/WorldBoundaryShape3D.ts +4 -4
  959. package/gen/classes/WorldEnvironment.ts +8 -8
  960. package/gen/classes/X509Certificate.ts +6 -6
  961. package/gen/classes/XMLParser.ts +19 -19
  962. package/gen/classes/XRAnchor3D.ts +4 -4
  963. package/gen/classes/XRBodyModifier3D.ts +8 -8
  964. package/gen/classes/XRBodyTracker.ts +10 -10
  965. package/gen/classes/XRCamera3D.ts +11 -4
  966. package/gen/classes/XRController3D.ts +17 -17
  967. package/gen/classes/XRControllerTracker.ts +2 -2
  968. package/gen/classes/XRFaceModifier3D.ts +6 -6
  969. package/gen/classes/XRFaceTracker.ts +6 -6
  970. package/gen/classes/XRHandModifier3D.ts +6 -6
  971. package/gen/classes/XRHandTracker.ts +16 -16
  972. package/gen/classes/XRInterface.ts +45 -31
  973. package/gen/classes/XRInterfaceExtension.ts +9 -9
  974. package/gen/classes/XRNode3D.ts +14 -14
  975. package/gen/classes/XROrigin3D.ts +6 -6
  976. package/gen/classes/XRPose.ts +15 -15
  977. package/gen/classes/XRPositionalTracker.ts +26 -26
  978. package/gen/classes/XRServer.ts +57 -41
  979. package/gen/classes/XRTracker.ts +7 -7
  980. package/gen/classes/XRVRS.ts +9 -9
  981. package/gen/classes/ZIPPacker.ts +10 -10
  982. package/gen/classes/ZIPReader.ts +8 -8
  983. package/gen/classes/index.ts +31 -0
  984. package/gen/global-enums.ts +7 -3
  985. package/gen/heap-types/GodotArray.ts +65 -65
  986. package/gen/heap-types/GodotDictionary.ts +38 -38
  987. package/gen/heap-types/PackedByteArray.ts +76 -76
  988. package/gen/heap-types/PackedColorArray.ts +27 -27
  989. package/gen/heap-types/PackedFloat32Array.ts +27 -27
  990. package/gen/heap-types/PackedFloat64Array.ts +27 -27
  991. package/gen/heap-types/PackedInt32Array.ts +27 -27
  992. package/gen/heap-types/PackedInt64Array.ts +27 -27
  993. package/gen/heap-types/PackedStringArray.ts +27 -27
  994. package/gen/heap-types/PackedVector2Array.ts +27 -27
  995. package/gen/heap-types/PackedVector3Array.ts +27 -27
  996. package/gen/heap-types/PackedVector4Array.ts +27 -27
  997. package/gen/heap-types/Signal.ts +13 -13
  998. package/gen/utility-functions.ts +116 -116
  999. package/gen/value-types/AABB.ts +25 -25
  1000. package/gen/value-types/Basis.ts +24 -24
  1001. package/gen/value-types/Color.ts +26 -26
  1002. package/gen/value-types/Plane.ts +11 -11
  1003. package/gen/value-types/Projection.ts +26 -26
  1004. package/gen/value-types/Quaternion.ts +21 -21
  1005. package/gen/value-types/Rect2.ts +16 -16
  1006. package/gen/value-types/Rect2i.ts +13 -13
  1007. package/gen/value-types/Transform2D.ts +21 -21
  1008. package/gen/value-types/Transform3D.ts +13 -13
  1009. package/gen/value-types/Vector2.ts +55 -50
  1010. package/gen/value-types/Vector2i.ts +17 -17
  1011. package/gen/value-types/Vector3.ts +52 -51
  1012. package/gen/value-types/Vector3i.ts +16 -16
  1013. package/gen/value-types/Vector4.ts +36 -35
  1014. package/gen/value-types/Vector4i.ts +16 -16
  1015. package/package.json +8 -8
  1016. package/src/assets.d.ts +167 -167
  1017. package/src/boot.ts +1 -0
  1018. package/src/debug.ts +357 -357
  1019. package/src/editor.ts +102 -122
  1020. package/src/export_presets.example.cfg +41 -41
  1021. package/src/index.ts +54 -54
  1022. package/src/load.ts +480 -479
  1023. package/src/preload.ts +164 -164
  1024. package/src/runtime.ts +107 -107
  1025. package/src/serve.ts +67 -67
  1026. package/src/web-image.ts +302 -388
package/src/load.ts CHANGED
@@ -1,479 +1,480 @@
1
- /**********************************************************************
2
- Copyright (c) Vladimir Davidovich. All rights reserved.
3
- ***********************************************************************/
4
-
5
- import { DirAccess } from '../gen/classes/DirAccess.ts';
6
- import { FileAccess } from '../gen/classes/FileAccess.ts';
7
- import { ProjectSettings } from '../gen/classes/ProjectSettings.ts';
8
- import { ResourceLoader, ThreadLoadStatus } from '../gen/classes/ResourceLoader.ts';
9
- import { ResourceUID } from '../gen/classes/ResourceUID.ts';
10
- import type { Resource } from '../gen/classes/Resource.ts';
11
- import { cleanupHooks, stageFile } from './runtime.ts';
12
- import { transcoder } from '@ringozz/godot/transcoder';
13
- import {
14
- FILES_DIR,
15
- PACK_DOC,
16
- mountClosure,
17
- parseDoc,
18
- parseRelease,
19
- pckOf,
20
- resolveEntry,
21
- uidId,
22
- type PackDoc,
23
- type Release,
24
- type ResolvedEntry,
25
- type StagedFile,
26
- type StagedFiles,
27
- } from './pack.ts';
28
- import { decodeCtex } from './web-image.ts';
29
-
30
- /**
31
- * Produces the bytes staged for a `.ctex`: the platform transcoder (resolved
32
- * once by `@ringozz/godot/transcoder`) when it yields a result, otherwise the raw
33
- * RGBA8 browser decode. `path` (the resource path being staged) is forwarded so
34
- * the transcoder can pick a block format from the file name. Never throws — a
35
- * failed transcode degrades to the uncompressed path.
36
- */
37
- async function transcodeCtex(bytes: Uint8Array, path: string): Promise<Uint8Array> {
38
- const encode = await transcoder;
39
- if (encode) {
40
- try {
41
- const out = await encode(bytes, path);
42
- if (out) {
43
- return out;
44
- }
45
- } catch (err) {
46
- console.warn('[godot] texture transcode failed; using raw RGBA8:', err);
47
- }
48
- }
49
- return decodeCtex(bytes);
50
- }
51
-
52
- // Each loaded wrapper is released at shutdown via a `cleanupHooks` entry
53
- // holding a WeakRef: module-scope asset imports (the preload modules' memoized
54
- // load promises) keep their wrappers reachable, so GC alone can't collect them
55
- // before the engine stops. WeakRef keeps the entries from pinning resources
56
- // during the app's lifetime.
57
- function track<T extends Resource>(res: T): T {
58
- const ref = new WeakRef<Resource>(res);
59
- cleanupHooks.add(() => {
60
- const r = ref.deref();
61
- if (r) {
62
- try { r.free(); } catch {}
63
- }
64
- });
65
- return res;
66
- }
67
-
68
- /**
69
- * A Godot `Resource` subclass constructor: its `.name` is the registered class
70
- * name (used as the `ResourceLoader` type hint), and `InstanceType<C>` is the
71
- * loaded resource type.
72
- */
73
- type ResourceConstructor = { new(...args: any[]): Resource } & Function;
74
-
75
- const UID_RE = /uid="(uid:\/\/[\w.]+)"/;
76
-
77
- // Compressed-texture products whose payloads may need decoding/transcoding:
78
- // `.ctex` (CompressedTexture2D) and the layered `.ctexarray` / `.ccube` /
79
- // `.ccubearray` (2D array / cubemap / cubemap array). `.ctex3d` has its own
80
- // layout and is left to the engine.
81
- const COMPRESSED_TEXTURE_RE = /\.(ctex|ctexarray|ccube|ccubearray)$/;
82
-
83
- // Textures the runtime must receive *exactly* as the server served them, so they are decoded to raw RGBA8
84
- // instead of going through the platform transcoder (spark -> BC7/ASTC): the terrain height atlas
85
- // (`<name>.dat/terrain/height.webp`), whose 12-bit packed R/G the vertex shader decodes per texel, so
86
- // block quantisation shows as blocky relief on every slope. Everything else may be compressed — the
87
- // surface arrays, the weight planes and the `_n` tile normal all ship as layered containers the runtime
88
- // only samples (see `docs/godot.md`'s M4 section). The `.ctex` product is named after its source plus an
89
- // md5, which is what the pattern keys on.
90
- const EXACT_TEXTURE_RE = /(^|\/)height\.webp-[0-9a-f]+\.ctex$/;
91
-
92
- // Godot resolves a scene's ext_resource `uid://` references through one process-wide map; these are the
93
- // registrations that fill it (see `uidText`/`uidId` for the numbering).
94
-
95
- /**
96
- * Registers an asset's `uid://` → `res://` path so scene ext_resource references
97
- * resolve it (Godot's `ResourceUID` map) instead of warning and falling back to
98
- * the stored text path. Idempotent; skips unknown/malformed uids.
99
- */
100
- function registerAssetUid(uid: string, resPath: string): void {
101
- const id = uidId(uid);
102
- if (id !== 0n && !ResourceUID.hasId(id as unknown as number)) {
103
- ResourceUID.addId(id as unknown as number, resPath);
104
- }
105
- }
106
-
107
- /**
108
- * Registers a pack document's `uids` — the resources the pack ships. A reference that crosses packs
109
- * (a level's batched meshes live in the assets pack) is in the document of the pack that owns them,
110
- * never in the one that names them, so every mounted document has to be applied here.
111
- */
112
- function registerDocUids(doc: PackDoc): void {
113
- for (const [uid, resPath] of Object.entries(doc.uids ?? {})) {
114
- registerAssetUid(uid, resPath);
115
- }
116
- }
117
-
118
- // res:// paths already staged, or being staged: MEMFS cannot be read back reliably — the engine's
119
- // `res://` lookup and the Emscripten path disagree by a leading slash — so `FileAccess.fileExists`
120
- // cannot answer "is this staged?", and two asset modules needing the same file would fetch and
121
- // allocate it twice. A path is forgotten when its bytes are removed after a load.
122
- const staged = new Map<string, Promise<void>>();
123
-
124
- async function materialize(entry: [string, StagedFile]): Promise<void> {
125
- const [resPath] = entry;
126
- const existing = staged.get(resPath);
127
- if (existing) {
128
- return existing;
129
- }
130
- const p = stage(entry).catch((err) => {
131
- staged.delete(resPath);
132
- throw err;
133
- });
134
- staged.set(resPath, p);
135
- return p;
136
- }
137
-
138
- async function stage([resPath, entry]: [string, StagedFile]): Promise<void> {
139
- if (FileAccess.fileExists(resPath)) {
140
- return;
141
- }
142
- let bytes: Uint8Array;
143
- if (entry.content !== undefined) {
144
- // Sidecars (`.import`) and native text sources carry the asset's `uid=`;
145
- // register it so scenes resolve by uid. `.import` maps to the source path
146
- // (resPath minus the suffix); native files map to themselves.
147
- const uid = entry.content.match(UID_RE)?.[1];
148
- if (uid) {
149
- registerAssetUid(uid, resPath.endsWith('.import') ? resPath.slice(0, -'.import'.length) : resPath);
150
- }
151
- bytes = new TextEncoder().encode(entry.content);
152
- } else if (entry.path) {
153
- const res = await fetch(entry.path);
154
- if (!res.ok) {
155
- return;
156
- }
157
- bytes = new Uint8Array(await res.arrayBuffer());
158
- if (COMPRESSED_TEXTURE_RE.test(resPath)) {
159
- // On web, decode embedded PNG/WebP blobs with the browser before
160
- // staging, so the engine never runs an image codec. A registered
161
- // transcoder (e.g. spark.js) may instead rebuild the container as a
162
- // device-native block-compressed texture by the built-in transcoder —
163
- // except for `EXACT_TEXTURE_RE`'s routes, which must stay raw (see there).
164
- bytes = EXACT_TEXTURE_RE.test(resPath) ? await decodeCtex(bytes) : await transcodeCtex(bytes, resPath);
165
- }
166
- } else {
167
- return;
168
- }
169
- // A staged product may already be there even though `FileAccess.fileExists(resPath)` says
170
- // otherwise — the engine's `res://` lookup and the Emscripten path disagree by the leading
171
- // slash — and the engine's `copyToFS` throws on a file it already has (`FS.createDataFile`
172
- // does not replace). `files` lists overlap, and staged products are removed once their
173
- // resource loads, so this is the normal re-stage, not an error: the bytes are the same file.
174
- try {
175
- stageFile?.(ProjectSettings.globalizePath(resPath), bytes);
176
- } catch (err) {
177
- if (!FileAccess.fileExists(ProjectSettings.globalizePath(resPath).replace(/\/{2,}/g, '/'))) throw err;
178
- }
179
- }
180
-
181
- const nextTick = () => new Promise(requestAnimationFrame);
182
-
183
- /**
184
- * Stages the asset's bundled files before loading: `.import` sidecars as text
185
- * and imported products (`.ctex`) as fetched paths. On web the bytes are written
186
- * straight into Emscripten's MEMFS via Godot's `copyToFS` (JS-heap only, no wasm
187
- * copy); a no-op on desktop where the files already exist.
188
- */
189
- function materializeFiles(files: StagedFiles): Promise<unknown> {
190
- if (stageFile === undefined) {
191
- // Desktop: the files already exist on disk (res:// = cwd) and uids come
192
- // from `.godot/uid_cache.bin`, so there is nothing to stage.
193
- return Promise.resolve();
194
- }
195
- return Promise.all(Object.entries(files).map(materialize));
196
- }
197
-
198
- /**
199
- * Returns a promise resolving to the resource already cached in the engine at
200
- * `path` (`ResourceCache`), or `null` when it isn't loaded yet. Used by
201
- * {@link loadAsset} to skip file staging and the threaded load when a
202
- * re-evaluated module (e.g. web HMR) references an asset that is still cached.
203
- * `getCachedRef` returns the same JS wrapper as `loadThreadedGet` (instance
204
- * binding), so identity is preserved.
205
- */
206
- function cachedResource<C extends ResourceConstructor>(path: string): Promise<InstanceType<C>> | null {
207
- const result = ResourceLoader.getCachedRef(path) as InstanceType<C>;
208
- return result ? Promise.resolve(result) : null;
209
- }
210
-
211
- /**
212
- * Entry point for the generated asset modules (`@ringozz/godot/preload`): checks
213
- * the engine's `ResourceCache` once (`cachedResource`), stages the bundled files
214
- * via `materializeFiles` when needed, then loads via {@link loadResourceAsync},
215
- * memoizing the resulting load promise on `data` (the module's
216
- * `import.meta.hot.data`, carried across HMR re-evaluations; `{}` on desktop
217
- * where modules evaluate once). Memoization keeps `use()` seeing the **same**
218
- * fulfilled promise object across re-evaluations — no Suspense fallback flash on
219
- * hot reload; a rejected load is evicted so the next evaluation retries. Returns
220
- * the `materialize` promise (bundled files staged) and the load promise.
221
- */
222
- export function loadAsset<C extends ResourceConstructor>(
223
- path: string,
224
- cls: C,
225
- files: StagedFiles,
226
- data: Record<string, unknown> = {},
227
- ready?: Promise<unknown>,
228
- ): { materialize: Promise<unknown>; load: Promise<InstanceType<C>> } {
229
- const cached = cachedResource<C>(path);
230
- if (cached) cached.then(track);
231
- // `ready` mounts the pack(s) holding this asset (see `loadAssetPack`);
232
- // staging waits for that so the pack's remaps are in place when the resource
233
- // resolves. A no-op when omitted (desktop / no pack).
234
- const mounted = ready ?? Promise.resolve();
235
- const materialize = cached ? Promise.resolve() : mounted.then(() => materializeFiles(files));
236
- const existing = data[path] as Promise<InstanceType<C>> | undefined;
237
- const load = existing ?? cached ?? materialize.then(() => loadResourceAsync(path, cls, files));
238
- data[path] = load;
239
- load.catch(() => {
240
- if (data[path] === load) delete data[path];
241
- });
242
- return { materialize, load };
243
- }
244
-
245
- /**
246
- * Loads a resource in the background. `cls` supplies both the `ResourceLoader`
247
- * type hint (its registered `.name`) and the return type. On web, call
248
- * {@link materializeFiles} with the asset's bundled files first; on desktop the
249
- * files already exist. Pass the same `files` map to have the staged files
250
- * deleted from MEMFS once the resource is loaded (the resource stays cached in
251
- * the engine, so the bytes are no longer needed).
252
- */
253
- export async function loadResourceAsync<C extends ResourceConstructor>(
254
- path: string,
255
- cls: C,
256
- files?: StagedFiles,
257
- ): Promise<InstanceType<C>> {
258
- const err = ResourceLoader.loadThreadedRequest(path, cls.name);
259
- if (err) {
260
- throw new Error(`loadResourceAsync(${path}): loadThreadedRequest failed (${err})`);
261
- }
262
-
263
- let result: InstanceType<C>;
264
- while (true) {
265
- const status = ResourceLoader.loadThreadedGetStatus(path);
266
- if (status === ThreadLoadStatus.THREAD_LOAD_LOADED) {
267
- result = ResourceLoader.loadThreadedGet(path) as InstanceType<C>;
268
- break;
269
- }
270
- if (status === ThreadLoadStatus.THREAD_LOAD_FAILED || status === ThreadLoadStatus.THREAD_LOAD_INVALID_RESOURCE) {
271
- // Collect the engine's LoadToken so a failed load doesn't leave it
272
- // registered (a bare `RefCounted` leaked at exit). Safe no-op when
273
- // no token exists.
274
- ResourceLoader.loadThreadedGet(path);
275
- throw new Error(`loadResourceAsync(${path}): load failed (status ${status})`);
276
- }
277
- await nextTick();
278
- }
279
- if (files && stageFile !== undefined) {
280
- // Keep `.import` sidecars — they route imported source paths to their
281
- // products (ResourceFormatImporter recognizes a path by its sidecar).
282
- // Delete everything else: the products are read only on a cache miss, and
283
- // the resource stays cached after loading, so the bytes are dead weight.
284
- // Best-effort: a file may already be gone (another module's cleanup or a
285
- // cache-miss re-stage).
286
- for (const resPath of Object.keys(files)) {
287
- if (!resPath.endsWith('.import')) {
288
- DirAccess.removeAbsolute(resPath);
289
- // The bytes are gone, so the memo must forget the path — a later module stages it again.
290
- staged.delete(resPath);
291
- }
292
- }
293
- }
294
- return track(result);
295
- }
296
-
297
- // ── Asset packs ──────────────────────────────────────────────────────────────
298
- // Mounting for Godot `.pck` packs. A pack is fetched, its bytes staged into the
299
- // engine's filesystem (web: MEMFS via `copyToFS`; desktop: nothing — the working
300
- // tree is `res://`), then handed to `ProjectSettings.loadResourcePack`, whose
301
- // remap table resolves a source path (`res://scene.tscn`) to the packed binary.
302
- // Memoized per URL (shared by every module that references it); a failed mount is
303
- // evicted so a later call retries. PackedData is add-only — packs are never unloaded.
304
-
305
- const mounted = new Map<string, Promise<void>>();
306
-
307
- /** Mounts the `.pck` at `url` (fetch + stage + `loadResourcePack`). */
308
- export function loadAssetPack(url: string): Promise<void> {
309
- const existing = mounted.get(url);
310
- if (existing) {
311
- return existing;
312
- }
313
- const p = mount(url);
314
- mounted.set(url, p);
315
- p.catch(() => {
316
- if (mounted.get(url) === p) {
317
- mounted.delete(url);
318
- }
319
- });
320
- return p;
321
- }
322
-
323
- async function mount(url: string): Promise<void> {
324
- if (stageFile === undefined) {
325
- // Desktop: the app's assets exist on disk. External packs (a path) mount directly.
326
- const external = /^([A-Za-z]:[\\/]|\/)/.test(url) || url.startsWith('res://');
327
- if (external && !ProjectSettings.loadResourcePack(url)) {
328
- throw new Error(`loadAssetPack(${url}): loadResourcePack failed`);
329
- }
330
- return;
331
- }
332
- const res = await fetch(url);
333
- if (!res.ok) {
334
- throw new Error(`loadAssetPack(${url}): fetch failed (${res.status})`);
335
- }
336
- const bytes = new Uint8Array(await res.arrayBuffer());
337
- const resPath = `res://.packs/${packName(url)}`;
338
- stageFile(ProjectSettings.globalizePath(resPath), bytes);
339
- if (!ProjectSettings.loadResourcePack(resPath)) {
340
- throw new Error(`loadAssetPack(${url}): loadResourcePack failed for ${resPath}`);
341
- }
342
- }
343
-
344
- /** A filesystem-safe pack name derived from the URL (basename, query stripped). */
345
- function packName(url: string): string {
346
- const base = url.split('?')[0].split('/').pop() ?? 'pack.pck';
347
- return base.replace(/[^A-Za-z0-9._-]/g, '_') || 'pack.pck';
348
- }
349
-
350
- // ── Content packs ───────────────────────────────────────────────────────────
351
- // A content pack is deployed apart from the app, so a client is told where a release-relative path can
352
- // be read (`at`) and everything else follows: the release graph, each mounted pack's manifest and
353
- // `.pck`, and the loose files the entry needs. The bake also hands over the boot pack's own config —
354
- // its `.pck` and a bundled URL per loose product, the one thing only the app can provide, since those
355
- // bytes ship beside it. The runtime only ever sees URLs, all of them version-addressed and immutable.
356
-
357
- /**
358
- * A pack the runtime has at hand: its `.pck`, its document, and where its staged products are read. The
359
- * app's own pack is one of these — its bytes ship beside it, so its URLs are the host's, not a
360
- * version-addressed path — and it is what `configurePacks({ boot })` hands over.
361
- */
362
- export interface MountedPack {
363
- /** The `.pck` to mount (`loadAssetPack`). */
364
- pck: string;
365
- doc: PackDoc;
366
- /** The URL of one of this pack's products, by the file name `doc.stage` gives it. */
367
- url: (file: string) => string;
368
- }
369
-
370
- /**
371
- * How the runtime reads content packs: a URL per file, and the release that names the packs (or where
372
- * to read one). The host owns its base and the way a version is encoded in it, so the protocol never
373
- * builds a release-relative path — it knows a pack's name and its files (`pack.json`, `<name>.pck`,
374
- * `files/<product>`), and asks.
375
- */
376
- export interface PackSource {
377
- /** A pack's file, as a fetchable URL or a local path — how the host addresses a version is its own. */
378
- at?: (pack: string, version: string, file: string) => string;
379
- /** The app's own pack, configured by the bake's own code: always mounted, its bytes bundled. */
380
- boot?: MountedPack;
381
- /**
382
- * The packs to mount. The app's own dependencies (pinned by its lockfile) are one way: there is no
383
- * release document to fetch, and the versions the app was built and tested with are the ones it
384
- * mounts. A URL is the other: mount what a release document names — a bake's `release.json`, a CDN's.
385
- */
386
- release?: Release | string;
387
- }
388
-
389
- let packSource: PackSource = {};
390
-
391
- /**
392
- * Points the runtime at a pack source. Merges, so the bake's boot config and the app's `at` may land in
393
- * either order — the boot config rides on the app's own asset imports.
394
- */
395
- export function configurePacks(source: PackSource): void {
396
- packSource = { ...packSource, ...source };
397
- }
398
-
399
- /** Reads a document: a URL over the network, anything else off the filesystem. */
400
- async function readText(url: string): Promise<string> {
401
- if (/^https?:/i.test(url)) {
402
- const res = await fetch(url);
403
- if (!res.ok) throw new Error(`godot-assets: ${url} (${res.status})`);
404
- return res.text();
405
- }
406
- // Desktop and a dev bundle hand over a local path, and `res://` is the working tree there.
407
- const text = FileAccess.getFileAsString(url.startsWith('res://') ? url : ProjectSettings.globalizePath(url));
408
- if (!text) throw new Error(`godot-assets: cannot read ${url}`);
409
- return text;
410
- }
411
-
412
- /** The release to mount: the packs the app pinned, or the document `configurePacks` was pointed at. */
413
- async function mountedRelease(): Promise<Release> {
414
- const pinned = packSource.release;
415
- if (!pinned) throw new Error('godot-assets: no release — configurePacks({ release }) with the packs to mount or its URL.');
416
- return typeof pinned === 'string' ? parseRelease(await readText(pinned)) : pinned;
417
- }
418
-
419
- /**
420
- * A resolved entry's files, as the loader stages them: the app's own pack addresses a product from its
421
- * bundled URLs, a mounted pack from the host's addressing. This is the addressing the protocol
422
- * deliberately does not know — which is why a resolution returns packs and file names, not URLs.
423
- */
424
- function stagedFiles(
425
- plan: ResolvedEntry,
426
- boot: MountedPack | undefined,
427
- fileUrl: (pack: string, file: string) => string,
428
- ): StagedFiles {
429
- const files: StagedFiles = {};
430
- for (const { sidecar, content, product, pack, file } of plan.files) {
431
- files[sidecar] = { content };
432
- files[product] = { path: pack === null ? boot!.url(file) : fileUrl(pack, `${FILES_DIR}/${file}`) };
433
- }
434
- return files;
435
- }
436
-
437
- /**
438
- * Loads one declared entry of a content pack: the release, then the packs the entry reaches and the
439
- * loose files they stage, then the `res://` path the entry names. Nothing about a pack is baked into
440
- * the app, so it can be republished without one.
441
- */
442
- export async function loadPackEntry<C extends ResourceConstructor>(
443
- pack: string,
444
- entry: string,
445
- cls: C,
446
- ): Promise<InstanceType<C>> {
447
- const at = packSource.at;
448
- if (!at) throw new Error('godot-assets: no pack source — call configurePacks({ at }) first.');
449
- const release = await mountedRelease();
450
- // Mounting needs only the release — a pack's `.pck` is `<name>.pck` by convention — so the closure's
451
- // packs are mounted while their documents are read, and only staging waits on those.
452
- const names = mountClosure(release, pack);
453
- const url = (name: string, file: string) => at(name, release[name].version, file);
454
- const boot = packSource.boot;
455
- const mounts = [...(boot ? [boot.pck] : []), ...names.map((name) => url(name, pckOf(name)))].map((pck) =>
456
- loadAssetPack(pck),
457
- );
458
- const docs = Object.fromEntries(
459
- await Promise.all(
460
- names.map(async (name): Promise<[string, PackDoc]> => {
461
- const doc = parseDoc(await readText(url(name, PACK_DOC)));
462
- // The pack's own uids, before its entry loads: a scene it carries may name a resource
463
- // that another mounted pack ships (a level's meshes live in the assets pack).
464
- registerDocUids(doc);
465
- // A base that serves a version it wasn't asked for is the one thing a client cannot see:
466
- // production's URLs are immutable, and a dev server pointed at a local bake serves content
467
- // at another version on purpose. Say so; the load still works.
468
- if (doc.version !== release[name].version) {
469
- console.warn(`godot-assets: ${name} ${release[name].version} asked, ${doc.version ?? 'no version'} served`);
470
- }
471
- return [name, doc];
472
- }),
473
- ),
474
- );
475
- const plan = resolveEntry(release, docs, pack, entry, boot?.doc);
476
- // The boot is a mounted pack like any other, so an entry borrows its loose files too.
477
- await Promise.all(mounts);
478
- return loadAsset(plan.res, cls, stagedFiles(plan, boot, url)).load;
479
- }
1
+ /**********************************************************************
2
+ Copyright (c) Vladimir Davidovich. All rights reserved.
3
+ ***********************************************************************/
4
+
5
+ import { DirAccess } from '../gen/classes/DirAccess.ts';
6
+ import { FileAccess } from '../gen/classes/FileAccess.ts';
7
+ import { ProjectSettings } from '../gen/classes/ProjectSettings.ts';
8
+ import { ResourceLoader, ThreadLoadStatus } from '../gen/classes/ResourceLoader.ts';
9
+ import { ResourceUID } from '../gen/classes/ResourceUID.ts';
10
+ import type { Resource } from '../gen/classes/Resource.ts';
11
+ import { cleanupHooks, stageFile } from './runtime.ts';
12
+ import { transcoder } from '@ringozz/godot/transcoder';
13
+ import {
14
+ FILES_DIR,
15
+ PACK_DOC,
16
+ mountClosure,
17
+ parseDoc,
18
+ parseRelease,
19
+ pckOf,
20
+ resolveEntry,
21
+ uidId,
22
+ type PackDoc,
23
+ type Release,
24
+ type ResolvedEntry,
25
+ type StagedFile,
26
+ type StagedFiles,
27
+ } from './pack.ts';
28
+ import { decodeCtex } from './web-image.ts';
29
+
30
+ /**
31
+ * Produces the bytes staged for a `.ctex`: the platform transcoder (resolved
32
+ * once by `@ringozz/godot/transcoder`) when it yields a result, otherwise the raw
33
+ * RGBA8 browser decode. `path` (the resource path being staged) is forwarded so
34
+ * the transcoder can pick a block format from the file name. Never throws — a
35
+ * failed transcode degrades to the uncompressed path.
36
+ */
37
+ async function transcodeCtex(bytes: Uint8Array, path: string): Promise<Uint8Array> {
38
+ const encode = await transcoder;
39
+ if (encode) {
40
+ try {
41
+ const out = await encode(bytes, path);
42
+ if (out) {
43
+ return out;
44
+ }
45
+ } catch (err) {
46
+ console.warn('[godot] texture transcode failed; using raw RGBA8:', err);
47
+ }
48
+ }
49
+ return decodeCtex(bytes);
50
+ }
51
+
52
+ // Each loaded wrapper is released at shutdown via a `cleanupHooks` entry
53
+ // holding a WeakRef: module-scope asset imports (the preload modules' memoized
54
+ // load promises) keep their wrappers reachable, so GC alone can't collect them
55
+ // before the engine stops. WeakRef keeps the entries from pinning resources
56
+ // during the app's lifetime.
57
+ function track<T extends Resource>(res: T): T {
58
+ const ref = new WeakRef<Resource>(res);
59
+ cleanupHooks.add(() => {
60
+ const r = ref.deref();
61
+ if (r) {
62
+ try { r.free(); } catch {}
63
+ }
64
+ });
65
+ return res;
66
+ }
67
+
68
+ /**
69
+ * A Godot `Resource` subclass constructor: its `.name` is the registered class
70
+ * name (used as the `ResourceLoader` type hint), and `InstanceType<C>` is the
71
+ * loaded resource type.
72
+ */
73
+ type ResourceConstructor = { new(...args: any[]): Resource } & Function;
74
+
75
+ const UID_RE = /uid="(uid:\/\/[\w.]+)"/;
76
+
77
+ // Compressed-texture products whose payloads may need decoding/transcoding:
78
+ // `.ctex` (CompressedTexture2D) and the layered `.ctexarray` / `.ccube` /
79
+ // `.ccubearray` (2D array / cubemap / cubemap array). `.ctex3d` has its own
80
+ // layout and is left to the engine.
81
+ const COMPRESSED_TEXTURE_RE = /\.(ctex|ctexarray|ccube|ccubearray)$/;
82
+
83
+ // Textures the runtime must receive *exactly* as the server served them, so they are decoded to raw RGBA8
84
+ // instead of going through the platform transcoder (spark -> BC7/ASTC): the terrain height atlas and
85
+ // passmap (`<name>.dat/terrain/{height,passmap}.webp`), whose packed bytes scripts read back on the CPU
86
+ // and the vertex shader decodes per texel, so block quantisation shows as blocky relief on every slope.
87
+ // Everything else may be compressed — the
88
+ // surface arrays, the weight planes and the `_n` tile normal all ship as layered containers the runtime
89
+ // only samples (see `docs/godot.md`'s M4 section). The `.ctex` product is named after its source plus an
90
+ // md5, which is what the pattern keys on.
91
+ const EXACT_TEXTURE_RE = /(^|\/)(height|passmap)\.webp-[0-9a-f]+\.ctex$/;
92
+
93
+ // Godot resolves a scene's ext_resource `uid://` references through one process-wide map; these are the
94
+ // registrations that fill it (see `uidText`/`uidId` for the numbering).
95
+
96
+ /**
97
+ * Registers an asset's `uid://` → `res://` path so scene ext_resource references
98
+ * resolve it (Godot's `ResourceUID` map) instead of warning and falling back to
99
+ * the stored text path. Idempotent; skips unknown/malformed uids.
100
+ */
101
+ function registerAssetUid(uid: string, resPath: string): void {
102
+ const id = uidId(uid);
103
+ if (id !== 0n && !ResourceUID.hasId(id as unknown as number)) {
104
+ ResourceUID.addId(id as unknown as number, resPath);
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Registers a pack document's `uids` — the resources the pack ships. A reference that crosses packs
110
+ * (a level's batched meshes live in the assets pack) is in the document of the pack that owns them,
111
+ * never in the one that names them, so every mounted document has to be applied here.
112
+ */
113
+ function registerDocUids(doc: PackDoc): void {
114
+ for (const [uid, resPath] of Object.entries(doc.uids ?? {})) {
115
+ registerAssetUid(uid, resPath);
116
+ }
117
+ }
118
+
119
+ // res:// paths already staged, or being staged: MEMFS cannot be read back reliably — the engine's
120
+ // `res://` lookup and the Emscripten path disagree by a leading slash — so `FileAccess.fileExists`
121
+ // cannot answer "is this staged?", and two asset modules needing the same file would fetch and
122
+ // allocate it twice. A path is forgotten when its bytes are removed after a load.
123
+ const staged = new Map<string, Promise<void>>();
124
+
125
+ async function materialize(entry: [string, StagedFile]): Promise<void> {
126
+ const [resPath] = entry;
127
+ const existing = staged.get(resPath);
128
+ if (existing) {
129
+ return existing;
130
+ }
131
+ const p = stage(entry).catch((err) => {
132
+ staged.delete(resPath);
133
+ throw err;
134
+ });
135
+ staged.set(resPath, p);
136
+ return p;
137
+ }
138
+
139
+ async function stage([resPath, entry]: [string, StagedFile]): Promise<void> {
140
+ if (FileAccess.fileExists(resPath)) {
141
+ return;
142
+ }
143
+ let bytes: Uint8Array;
144
+ if (entry.content !== undefined) {
145
+ // Sidecars (`.import`) and native text sources carry the asset's `uid=`;
146
+ // register it so scenes resolve by uid. `.import` maps to the source path
147
+ // (resPath minus the suffix); native files map to themselves.
148
+ const uid = entry.content.match(UID_RE)?.[1];
149
+ if (uid) {
150
+ registerAssetUid(uid, resPath.endsWith('.import') ? resPath.slice(0, -'.import'.length) : resPath);
151
+ }
152
+ bytes = new TextEncoder().encode(entry.content);
153
+ } else if (entry.path) {
154
+ const res = await fetch(entry.path);
155
+ if (!res.ok) {
156
+ return;
157
+ }
158
+ bytes = new Uint8Array(await res.arrayBuffer());
159
+ if (COMPRESSED_TEXTURE_RE.test(resPath)) {
160
+ // On web, decode embedded PNG/WebP blobs with the browser before
161
+ // staging, so the engine never runs an image codec. A registered
162
+ // transcoder (e.g. spark.js) may instead rebuild the container as a
163
+ // device-native block-compressed texture by the built-in transcoder —
164
+ // except for `EXACT_TEXTURE_RE`'s routes, which must stay raw (see there).
165
+ bytes = EXACT_TEXTURE_RE.test(resPath) ? await decodeCtex(bytes) : await transcodeCtex(bytes, resPath);
166
+ }
167
+ } else {
168
+ return;
169
+ }
170
+ // A staged product may already be there even though `FileAccess.fileExists(resPath)` says
171
+ // otherwise — the engine's `res://` lookup and the Emscripten path disagree by the leading
172
+ // slash — and the engine's `copyToFS` throws on a file it already has (`FS.createDataFile`
173
+ // does not replace). `files` lists overlap, and staged products are removed once their
174
+ // resource loads, so this is the normal re-stage, not an error: the bytes are the same file.
175
+ try {
176
+ stageFile?.(ProjectSettings.globalizePath(resPath), bytes);
177
+ } catch (err) {
178
+ if (!FileAccess.fileExists(ProjectSettings.globalizePath(resPath).replace(/\/{2,}/g, '/'))) throw err;
179
+ }
180
+ }
181
+
182
+ const nextTick = () => new Promise(requestAnimationFrame);
183
+
184
+ /**
185
+ * Stages the asset's bundled files before loading: `.import` sidecars as text
186
+ * and imported products (`.ctex`) as fetched paths. On web the bytes are written
187
+ * straight into Emscripten's MEMFS via Godot's `copyToFS` (JS-heap only, no wasm
188
+ * copy); a no-op on desktop where the files already exist.
189
+ */
190
+ function materializeFiles(files: StagedFiles): Promise<unknown> {
191
+ if (stageFile === undefined) {
192
+ // Desktop: the files already exist on disk (res:// = cwd) and uids come
193
+ // from `.godot/uid_cache.bin`, so there is nothing to stage.
194
+ return Promise.resolve();
195
+ }
196
+ return Promise.all(Object.entries(files).map(materialize));
197
+ }
198
+
199
+ /**
200
+ * Returns a promise resolving to the resource already cached in the engine at
201
+ * `path` (`ResourceCache`), or `null` when it isn't loaded yet. Used by
202
+ * {@link loadAsset} to skip file staging and the threaded load when a
203
+ * re-evaluated module (e.g. web HMR) references an asset that is still cached.
204
+ * `getCachedRef` returns the same JS wrapper as `loadThreadedGet` (instance
205
+ * binding), so identity is preserved.
206
+ */
207
+ function cachedResource<C extends ResourceConstructor>(path: string): Promise<InstanceType<C>> | null {
208
+ const result = ResourceLoader.getCachedRef(path) as InstanceType<C>;
209
+ return result ? Promise.resolve(result) : null;
210
+ }
211
+
212
+ /**
213
+ * Entry point for the generated asset modules (`@ringozz/godot/preload`): checks
214
+ * the engine's `ResourceCache` once (`cachedResource`), stages the bundled files
215
+ * via `materializeFiles` when needed, then loads via {@link loadResourceAsync},
216
+ * memoizing the resulting load promise on `data` (the module's
217
+ * `import.meta.hot.data`, carried across HMR re-evaluations; `{}` on desktop
218
+ * where modules evaluate once). Memoization keeps `use()` seeing the **same**
219
+ * fulfilled promise object across re-evaluations — no Suspense fallback flash on
220
+ * hot reload; a rejected load is evicted so the next evaluation retries. Returns
221
+ * the `materialize` promise (bundled files staged) and the load promise.
222
+ */
223
+ export function loadAsset<C extends ResourceConstructor>(
224
+ path: string,
225
+ cls: C,
226
+ files: StagedFiles,
227
+ data: Record<string, unknown> = {},
228
+ ready?: Promise<unknown>,
229
+ ): { materialize: Promise<unknown>; load: Promise<InstanceType<C>> } {
230
+ const cached = cachedResource<C>(path);
231
+ if (cached) cached.then(track);
232
+ // `ready` mounts the pack(s) holding this asset (see `loadAssetPack`);
233
+ // staging waits for that so the pack's remaps are in place when the resource
234
+ // resolves. A no-op when omitted (desktop / no pack).
235
+ const mounted = ready ?? Promise.resolve();
236
+ const materialize = cached ? Promise.resolve() : mounted.then(() => materializeFiles(files));
237
+ const existing = data[path] as Promise<InstanceType<C>> | undefined;
238
+ const load = existing ?? cached ?? materialize.then(() => loadResourceAsync(path, cls, files));
239
+ data[path] = load;
240
+ load.catch(() => {
241
+ if (data[path] === load) delete data[path];
242
+ });
243
+ return { materialize, load };
244
+ }
245
+
246
+ /**
247
+ * Loads a resource in the background. `cls` supplies both the `ResourceLoader`
248
+ * type hint (its registered `.name`) and the return type. On web, call
249
+ * {@link materializeFiles} with the asset's bundled files first; on desktop the
250
+ * files already exist. Pass the same `files` map to have the staged files
251
+ * deleted from MEMFS once the resource is loaded (the resource stays cached in
252
+ * the engine, so the bytes are no longer needed).
253
+ */
254
+ export async function loadResourceAsync<C extends ResourceConstructor>(
255
+ path: string,
256
+ cls: C,
257
+ files?: StagedFiles,
258
+ ): Promise<InstanceType<C>> {
259
+ const err = ResourceLoader.loadThreadedRequest(path, cls.name);
260
+ if (err) {
261
+ throw new Error(`loadResourceAsync(${path}): loadThreadedRequest failed (${err})`);
262
+ }
263
+
264
+ let result: InstanceType<C>;
265
+ while (true) {
266
+ const status = ResourceLoader.loadThreadedGetStatus(path);
267
+ if (status === ThreadLoadStatus.THREAD_LOAD_LOADED) {
268
+ result = ResourceLoader.loadThreadedGet(path) as InstanceType<C>;
269
+ break;
270
+ }
271
+ if (status === ThreadLoadStatus.THREAD_LOAD_FAILED || status === ThreadLoadStatus.THREAD_LOAD_INVALID_RESOURCE) {
272
+ // Collect the engine's LoadToken so a failed load doesn't leave it
273
+ // registered (a bare `RefCounted` leaked at exit). Safe no-op when
274
+ // no token exists.
275
+ ResourceLoader.loadThreadedGet(path);
276
+ throw new Error(`loadResourceAsync(${path}): load failed (status ${status})`);
277
+ }
278
+ await nextTick();
279
+ }
280
+ if (files && stageFile !== undefined) {
281
+ // Keep `.import` sidecars — they route imported source paths to their
282
+ // products (ResourceFormatImporter recognizes a path by its sidecar).
283
+ // Delete everything else: the products are read only on a cache miss, and
284
+ // the resource stays cached after loading, so the bytes are dead weight.
285
+ // Best-effort: a file may already be gone (another module's cleanup or a
286
+ // cache-miss re-stage).
287
+ for (const resPath of Object.keys(files)) {
288
+ if (!resPath.endsWith('.import')) {
289
+ DirAccess.removeAbsolute(resPath);
290
+ // The bytes are gone, so the memo must forget the path — a later module stages it again.
291
+ staged.delete(resPath);
292
+ }
293
+ }
294
+ }
295
+ return track(result);
296
+ }
297
+
298
+ // ── Asset packs ──────────────────────────────────────────────────────────────
299
+ // Mounting for Godot `.pck` packs. A pack is fetched, its bytes staged into the
300
+ // engine's filesystem (web: MEMFS via `copyToFS`; desktop: nothing — the working
301
+ // tree is `res://`), then handed to `ProjectSettings.loadResourcePack`, whose
302
+ // remap table resolves a source path (`res://scene.tscn`) to the packed binary.
303
+ // Memoized per URL (shared by every module that references it); a failed mount is
304
+ // evicted so a later call retries. PackedData is add-only — packs are never unloaded.
305
+
306
+ const mounted = new Map<string, Promise<void>>();
307
+
308
+ /** Mounts the `.pck` at `url` (fetch + stage + `loadResourcePack`). */
309
+ export function loadAssetPack(url: string): Promise<void> {
310
+ const existing = mounted.get(url);
311
+ if (existing) {
312
+ return existing;
313
+ }
314
+ const p = mount(url);
315
+ mounted.set(url, p);
316
+ p.catch(() => {
317
+ if (mounted.get(url) === p) {
318
+ mounted.delete(url);
319
+ }
320
+ });
321
+ return p;
322
+ }
323
+
324
+ async function mount(url: string): Promise<void> {
325
+ if (stageFile === undefined) {
326
+ // Desktop: the app's assets exist on disk. External packs (a path) mount directly.
327
+ const external = /^([A-Za-z]:[\\/]|\/)/.test(url) || url.startsWith('res://');
328
+ if (external && !ProjectSettings.loadResourcePack(url)) {
329
+ throw new Error(`loadAssetPack(${url}): loadResourcePack failed`);
330
+ }
331
+ return;
332
+ }
333
+ const res = await fetch(url);
334
+ if (!res.ok) {
335
+ throw new Error(`loadAssetPack(${url}): fetch failed (${res.status})`);
336
+ }
337
+ const bytes = new Uint8Array(await res.arrayBuffer());
338
+ const resPath = `res://.packs/${packName(url)}`;
339
+ stageFile(ProjectSettings.globalizePath(resPath), bytes);
340
+ if (!ProjectSettings.loadResourcePack(resPath)) {
341
+ throw new Error(`loadAssetPack(${url}): loadResourcePack failed for ${resPath}`);
342
+ }
343
+ }
344
+
345
+ /** A filesystem-safe pack name derived from the URL (basename, query stripped). */
346
+ function packName(url: string): string {
347
+ const base = url.split('?')[0].split('/').pop() ?? 'pack.pck';
348
+ return base.replace(/[^A-Za-z0-9._-]/g, '_') || 'pack.pck';
349
+ }
350
+
351
+ // ── Content packs ───────────────────────────────────────────────────────────
352
+ // A content pack is deployed apart from the app, so a client is told where a release-relative path can
353
+ // be read (`at`) and everything else follows: the release graph, each mounted pack's manifest and
354
+ // `.pck`, and the loose files the entry needs. The bake also hands over the boot pack's own config —
355
+ // its `.pck` and a bundled URL per loose product, the one thing only the app can provide, since those
356
+ // bytes ship beside it. The runtime only ever sees URLs, all of them version-addressed and immutable.
357
+
358
+ /**
359
+ * A pack the runtime has at hand: its `.pck`, its document, and where its staged products are read. The
360
+ * app's own pack is one of these — its bytes ship beside it, so its URLs are the host's, not a
361
+ * version-addressed path — and it is what `configurePacks({ boot })` hands over.
362
+ */
363
+ export interface MountedPack {
364
+ /** The `.pck` to mount (`loadAssetPack`). */
365
+ pck: string;
366
+ doc: PackDoc;
367
+ /** The URL of one of this pack's products, by the file name `doc.stage` gives it. */
368
+ url: (file: string) => string;
369
+ }
370
+
371
+ /**
372
+ * How the runtime reads content packs: a URL per file, and the release that names the packs (or where
373
+ * to read one). The host owns its base and the way a version is encoded in it, so the protocol never
374
+ * builds a release-relative path — it knows a pack's name and its files (`pack.json`, `<name>.pck`,
375
+ * `files/<product>`), and asks.
376
+ */
377
+ export interface PackSource {
378
+ /** A pack's file, as a fetchable URL or a local path — how the host addresses a version is its own. */
379
+ at?: (pack: string, version: string, file: string) => string;
380
+ /** The app's own pack, configured by the bake's own code: always mounted, its bytes bundled. */
381
+ boot?: MountedPack;
382
+ /**
383
+ * The packs to mount. The app's own dependencies (pinned by its lockfile) are one way: there is no
384
+ * release document to fetch, and the versions the app was built and tested with are the ones it
385
+ * mounts. A URL is the other: mount what a release document names — a bake's `release.json`, a CDN's.
386
+ */
387
+ release?: Release | string;
388
+ }
389
+
390
+ let packSource: PackSource = {};
391
+
392
+ /**
393
+ * Points the runtime at a pack source. Merges, so the bake's boot config and the app's `at` may land in
394
+ * either order — the boot config rides on the app's own asset imports.
395
+ */
396
+ export function configurePacks(source: PackSource): void {
397
+ packSource = { ...packSource, ...source };
398
+ }
399
+
400
+ /** Reads a document: a URL over the network, anything else off the filesystem. */
401
+ async function readText(url: string): Promise<string> {
402
+ if (/^https?:/i.test(url)) {
403
+ const res = await fetch(url);
404
+ if (!res.ok) throw new Error(`godot-assets: ${url} (${res.status})`);
405
+ return res.text();
406
+ }
407
+ // Desktop and a dev bundle hand over a local path, and `res://` is the working tree there.
408
+ const text = FileAccess.getFileAsString(url.startsWith('res://') ? url : ProjectSettings.globalizePath(url));
409
+ if (!text) throw new Error(`godot-assets: cannot read ${url}`);
410
+ return text;
411
+ }
412
+
413
+ /** The release to mount: the packs the app pinned, or the document `configurePacks` was pointed at. */
414
+ async function mountedRelease(): Promise<Release> {
415
+ const pinned = packSource.release;
416
+ if (!pinned) throw new Error('godot-assets: no release — configurePacks({ release }) with the packs to mount or its URL.');
417
+ return typeof pinned === 'string' ? parseRelease(await readText(pinned)) : pinned;
418
+ }
419
+
420
+ /**
421
+ * A resolved entry's files, as the loader stages them: the app's own pack addresses a product from its
422
+ * bundled URLs, a mounted pack from the host's addressing. This is the addressing the protocol
423
+ * deliberately does not know — which is why a resolution returns packs and file names, not URLs.
424
+ */
425
+ function stagedFiles(
426
+ plan: ResolvedEntry,
427
+ boot: MountedPack | undefined,
428
+ fileUrl: (pack: string, file: string) => string,
429
+ ): StagedFiles {
430
+ const files: StagedFiles = {};
431
+ for (const { sidecar, content, product, pack, file } of plan.files) {
432
+ files[sidecar] = { content };
433
+ files[product] = { path: pack === null ? boot!.url(file) : fileUrl(pack, `${FILES_DIR}/${file}`) };
434
+ }
435
+ return files;
436
+ }
437
+
438
+ /**
439
+ * Loads one declared entry of a content pack: the release, then the packs the entry reaches and the
440
+ * loose files they stage, then the `res://` path the entry names. Nothing about a pack is baked into
441
+ * the app, so it can be republished without one.
442
+ */
443
+ export async function loadPackEntry<C extends ResourceConstructor>(
444
+ pack: string,
445
+ entry: string,
446
+ cls: C,
447
+ ): Promise<InstanceType<C>> {
448
+ const at = packSource.at;
449
+ if (!at) throw new Error('godot-assets: no pack source — call configurePacks({ at }) first.');
450
+ const release = await mountedRelease();
451
+ // Mounting needs only the release — a pack's `.pck` is `<name>.pck` by convention — so the closure's
452
+ // packs are mounted while their documents are read, and only staging waits on those.
453
+ const names = mountClosure(release, pack);
454
+ const url = (name: string, file: string) => at(name, release[name].version, file);
455
+ const boot = packSource.boot;
456
+ const mounts = [...(boot ? [boot.pck] : []), ...names.map((name) => url(name, pckOf(name)))].map((pck) =>
457
+ loadAssetPack(pck),
458
+ );
459
+ const docs = Object.fromEntries(
460
+ await Promise.all(
461
+ names.map(async (name): Promise<[string, PackDoc]> => {
462
+ const doc = parseDoc(await readText(url(name, PACK_DOC)));
463
+ // The pack's own uids, before its entry loads: a scene it carries may name a resource
464
+ // that another mounted pack ships (a level's meshes live in the assets pack).
465
+ registerDocUids(doc);
466
+ // A base that serves a version it wasn't asked for is the one thing a client cannot see:
467
+ // production's URLs are immutable, and a dev server pointed at a local bake serves content
468
+ // at another version on purpose. Say so; the load still works.
469
+ if (doc.version !== release[name].version) {
470
+ console.warn(`godot-assets: ${name} ${release[name].version} asked, ${doc.version ?? 'no version'} served`);
471
+ }
472
+ return [name, doc];
473
+ }),
474
+ ),
475
+ );
476
+ const plan = resolveEntry(release, docs, pack, entry, boot?.doc);
477
+ // The boot is a mounted pack like any other, so an entry borrows its loose files too.
478
+ await Promise.all(mounts);
479
+ return loadAsset(plan.res, cls, stagedFiles(plan, boot, url)).load;
480
+ }