@nova-lab/core 1.0.0-dev.19 → 1.1.0-dev.229

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 (501) hide show
  1. package/README.md +1035 -10
  2. package/THIRD_PARTY_NOTICES.md +26 -0
  3. package/dist/2d/accessibility.d.ts +2 -0
  4. package/dist/2d/accessibility.js +171 -0
  5. package/dist/2d/commands.d.ts +2 -0
  6. package/dist/2d/commands.js +80 -0
  7. package/dist/2d/effects.d.ts +10 -0
  8. package/dist/2d/effects.js +566 -0
  9. package/dist/2d/ktx2.d.ts +5 -0
  10. package/dist/2d/ktx2.js +542 -0
  11. package/dist/2d/lighting.d.ts +3 -0
  12. package/dist/2d/lighting.js +495 -0
  13. package/dist/2d/lottie.d.ts +3 -0
  14. package/dist/2d/lottie.js +254 -0
  15. package/dist/2d/meshes.d.ts +4 -0
  16. package/dist/2d/meshes.js +451 -0
  17. package/dist/2d/primitives.d.ts +3 -0
  18. package/dist/2d/primitives.js +85 -0
  19. package/dist/2d/render-textures.d.ts +3 -0
  20. package/dist/2d/render-textures.js +539 -0
  21. package/dist/2d/svg/documents.d.ts +5 -0
  22. package/dist/2d/svg/documents.js +7 -0
  23. package/dist/2d/svg/renderer.d.ts +3 -0
  24. package/dist/2d/svg/renderer.js +222 -0
  25. package/dist/2d/svg.d.ts +3 -0
  26. package/dist/2d/svg.js +4 -0
  27. package/dist/2d/tools.d.ts +2 -0
  28. package/dist/2d/tools.js +100 -0
  29. package/dist/2d/video.d.ts +5 -0
  30. package/dist/2d/video.js +90 -0
  31. package/dist/2d.d.ts +2 -0
  32. package/dist/2d.js +220 -0
  33. package/dist/3d/animation.d.ts +8 -0
  34. package/dist/3d/animation.js +1396 -0
  35. package/dist/3d/area-lights.d.ts +2 -0
  36. package/dist/3d/area-lights.js +19 -0
  37. package/dist/3d/audio.d.ts +4 -0
  38. package/dist/3d/audio.js +500 -0
  39. package/dist/3d/character.d.ts +2 -0
  40. package/dist/3d/character.js +136 -0
  41. package/dist/3d/collision.d.ts +3 -0
  42. package/dist/3d/collision.js +387 -0
  43. package/dist/3d/commands.d.ts +2 -0
  44. package/dist/3d/commands.js +108 -0
  45. package/dist/3d/controls.d.ts +8 -0
  46. package/dist/3d/controls.js +1041 -0
  47. package/dist/3d/documents.d.ts +5 -0
  48. package/dist/3d/documents.js +227 -0
  49. package/dist/3d/effects.d.ts +5 -0
  50. package/dist/3d/effects.js +1986 -0
  51. package/dist/3d/export.d.ts +4 -0
  52. package/dist/3d/export.js +347 -0
  53. package/dist/3d/fbx.d.ts +2 -0
  54. package/dist/3d/fbx.js +784 -0
  55. package/dist/3d/gltf.d.ts +2 -0
  56. package/dist/3d/gltf.js +5 -0
  57. package/dist/3d/helpers.d.ts +5 -0
  58. package/dist/3d/helpers.js +191 -0
  59. package/dist/3d/ik.d.ts +9 -0
  60. package/dist/3d/ik.js +777 -0
  61. package/dist/3d/loaders.d.ts +17 -0
  62. package/dist/3d/loaders.js +1406 -0
  63. package/dist/3d/nodes.d.ts +8 -0
  64. package/dist/3d/nodes.js +49 -0
  65. package/dist/3d/particles.d.ts +5 -0
  66. package/dist/3d/particles.js +1574 -0
  67. package/dist/3d/physics/backend.d.ts +7 -0
  68. package/dist/3d/physics/backend.js +1 -0
  69. package/dist/3d/physics/rapier.d.ts +3 -0
  70. package/dist/3d/physics/rapier.js +765 -0
  71. package/dist/3d/physics.d.ts +5 -0
  72. package/dist/3d/physics.js +3346 -0
  73. package/dist/3d/splats.d.ts +7 -0
  74. package/dist/3d/splats.js +862 -0
  75. package/dist/3d/text.d.ts +5 -0
  76. package/dist/3d/text.js +1043 -0
  77. package/dist/3d/tiles.d.ts +24 -0
  78. package/dist/3d/tiles.js +1705 -0
  79. package/dist/3d/tools.d.ts +12 -0
  80. package/dist/3d/tools.js +338 -0
  81. package/dist/3d/usdz.d.ts +2 -0
  82. package/dist/3d/usdz.js +634 -0
  83. package/dist/3d/xr.d.ts +2 -0
  84. package/dist/3d/xr.js +202 -0
  85. package/dist/3d-B4jWF8Qb.js +5591 -0
  86. package/dist/3d.d.ts +40 -0
  87. package/dist/3d.js +44 -0
  88. package/dist/Capsule-BFVpZfvc.js +44 -0
  89. package/dist/Clip-CAN7t03k.js +204 -0
  90. package/dist/Color-vuv9UnoY.js +34 -0
  91. package/dist/DeformedMesh-CPi0P_vc.js +280 -0
  92. package/dist/Document-DCVEZSvM.js +415 -0
  93. package/dist/Errors-B2ekO9bZ.js +30 -0
  94. package/dist/Features-BsjmePtc.js +557 -0
  95. package/dist/GLTFResourceIO-CYJyCUTt.js +124 -0
  96. package/dist/GPUParticleState-CQlNpoDa.js +545 -0
  97. package/dist/Geometry-DytO490z.js +227 -0
  98. package/dist/Inflate-DWw0V-Up.js +42 -0
  99. package/dist/InstancedMesh-DPrgrw5z.js +527 -0
  100. package/dist/Limits-Bw5XQdFr.js +20 -0
  101. package/dist/LineHelper-Ad0z9uDi.js +131 -0
  102. package/dist/LoaderIO-BwrM84OM.js +114 -0
  103. package/dist/Material-BpfLPmK9.js +777 -0
  104. package/dist/Mesh-BaRxAAJq.js +209 -0
  105. package/dist/Node-QfgAE2_v.js +877 -0
  106. package/dist/NovaAssetRegistry-p2QlCwvT.js +1168 -0
  107. package/dist/NovaNode-CBZ-Ol-W.js +2016 -0
  108. package/dist/NovaRenderCommandWriter-CWQRa42y.js +1949 -0
  109. package/dist/NovaTextSelectionService-CipuujCT.js +18526 -0
  110. package/dist/NovaWebGLProgram-BO250QNF.js +97 -0
  111. package/dist/Options-CajE7LLJ.js +15 -0
  112. package/dist/PolygonMesh-D4PnnfIo.js +657 -0
  113. package/dist/Ready-BzyhRtjD.js +21 -0
  114. package/dist/Scene-CDfNgf9I.js +911 -0
  115. package/dist/Shader-b6_HDndT.js +48 -0
  116. package/dist/SplatShader-wJ6GJ3vo.js +130 -0
  117. package/dist/Texture-dTKMlTpK.js +267 -0
  118. package/dist/TextureLoader-CfDzdy2m.js +411 -0
  119. package/dist/Textures-CGL4Kf-8.js +651 -0
  120. package/dist/ToneMapping-D9IWvN0u.js +46 -0
  121. package/dist/WebGPURenderer-DjD0IxVC.js +4921 -0
  122. package/dist/ZipReader-C-MSEsSr.js +84 -0
  123. package/dist/core.js +218 -24024
  124. package/dist/domain/types/base.types.d.ts +18 -9
  125. package/dist/domain/types/component.types.d.ts +5 -5
  126. package/dist/domain/types/cursor.types.d.ts +1 -1
  127. package/dist/domain/types/diagnostics.types.d.ts +2 -0
  128. package/dist/domain/types/export.types.d.ts +2 -2
  129. package/dist/domain/types/hit-test.types.d.ts +1 -1
  130. package/dist/domain/types/motion.types.d.ts +2 -2
  131. package/dist/domain/types/renderer.types.d.ts +88 -4
  132. package/dist/domain/types/rendering/index.d.ts +29 -4
  133. package/dist/domain/types/sound.types.d.ts +1 -1
  134. package/dist/domain/types/theme.types.d.ts +1 -1
  135. package/dist/domain/utils/bounds.d.ts +1 -1
  136. package/dist/domain/utils/nova-text.d.ts +9 -0
  137. package/dist/domain/utils/schemaBounds.d.ts +2 -2
  138. package/dist/export-svg-document-ChaNXMaG.js +668 -0
  139. package/dist/features/3d/Errors.d.ts +57 -0
  140. package/dist/features/3d/Nova3DApp.d.ts +429 -0
  141. package/dist/features/3d/animation/Animator.d.ts +260 -0
  142. package/dist/features/3d/animation/Clip.d.ts +74 -0
  143. package/dist/features/3d/animation/Graph.d.ts +158 -0
  144. package/dist/features/3d/animation/Mask.d.ts +40 -0
  145. package/dist/features/3d/audio/Audio.d.ts +114 -0
  146. package/dist/features/3d/audio/Sound.d.ts +133 -0
  147. package/dist/features/3d/character/CharacterController.d.ts +61 -0
  148. package/dist/features/3d/collision/Capsule.d.ts +25 -0
  149. package/dist/features/3d/collision/Octree.d.ts +94 -0
  150. package/dist/features/3d/controls/CameraMotionControls.d.ts +154 -0
  151. package/dist/features/3d/controls/CameraOrientation.d.ts +47 -0
  152. package/dist/features/3d/controls/OrbitControls.d.ts +73 -0
  153. package/dist/features/3d/controls/PointerGesture.d.ts +25 -0
  154. package/dist/features/3d/controls/PointerLock.d.ts +36 -0
  155. package/dist/features/3d/controls/Snapping.d.ts +32 -0
  156. package/dist/features/3d/controls/TransformGizmo.d.ts +79 -0
  157. package/dist/features/3d/deformation/DeformationGPU.d.ts +52 -0
  158. package/dist/features/3d/deformation/DeformationShader.d.ts +2 -0
  159. package/dist/features/3d/deformation/DeformedMesh.d.ts +36 -0
  160. package/dist/features/3d/deformation/GeometryDeformation.d.ts +25 -0
  161. package/dist/features/3d/documents/Document.d.ts +59 -0
  162. package/dist/features/3d/documents/DocumentCommands.d.ts +45 -0
  163. package/dist/features/3d/documents/DocumentSchema.d.ts +18 -0
  164. package/dist/features/3d/documents/DocumentTransform.d.ts +4 -0
  165. package/dist/features/3d/documents/DocumentTypes.d.ts +182 -0
  166. package/dist/features/3d/documents/DocumentValidation.d.ts +18 -0
  167. package/dist/features/3d/documents/Projection.d.ts +65 -0
  168. package/dist/features/3d/effects/CubeLUT.d.ts +24 -0
  169. package/dist/features/3d/effects/Effects.d.ts +32 -0
  170. package/dist/features/3d/effects/EffectsGPU.d.ts +80 -0
  171. package/dist/features/3d/effects/EffectsPlan.d.ts +268 -0
  172. package/dist/features/3d/effects/EffectsShaders.d.ts +35 -0
  173. package/dist/features/3d/export/GLTFExporter.d.ts +49 -0
  174. package/dist/features/3d/export/ThreeMFExporter.d.ts +19 -0
  175. package/dist/features/3d/export/ZipWriter.d.ts +9 -0
  176. package/dist/features/3d/fbx/FBXLoader.d.ts +26 -0
  177. package/dist/features/3d/fbx/FBXParser.d.ts +35 -0
  178. package/dist/features/3d/fbx/FBXScene.d.ts +20 -0
  179. package/dist/features/3d/gltf/GLTFLoader.d.ts +16 -0
  180. package/dist/features/3d/gltf/GLTFTypes.d.ts +64 -0
  181. package/dist/features/3d/gltf/services/GLTFBinary.d.ts +21 -0
  182. package/dist/features/3d/gltf/services/GLTFGeometry.d.ts +14 -0
  183. package/dist/features/3d/gltf/services/GLTFResourceIO.d.ts +64 -0
  184. package/dist/features/3d/helpers/LineHelper.d.ts +51 -0
  185. package/dist/features/3d/helpers/StaticHelpers.d.ts +47 -0
  186. package/dist/features/3d/helpers/TrackedHelpers.d.ts +84 -0
  187. package/dist/features/3d/ik/ChainIK.d.ts +44 -0
  188. package/dist/features/3d/ik/IKChain.d.ts +92 -0
  189. package/dist/features/3d/ik/IKMath.d.ts +49 -0
  190. package/dist/features/3d/ik/IKSolver.d.ts +97 -0
  191. package/dist/features/3d/ik/LookAtIK.d.ts +58 -0
  192. package/dist/features/3d/ik/TwoBoneIK.d.ts +57 -0
  193. package/dist/features/3d/import/ImportAnimation.d.ts +20 -0
  194. package/dist/features/3d/import/ImportMath.d.ts +42 -0
  195. package/dist/features/3d/import/ImportedModel.d.ts +135 -0
  196. package/dist/features/3d/import/Inflate.d.ts +5 -0
  197. package/dist/features/3d/import/ModelAsset.d.ts +149 -0
  198. package/dist/features/3d/import/PolygonMesh.d.ts +54 -0
  199. package/dist/features/3d/lights/AreaLightTables.d.ts +8 -0
  200. package/dist/features/3d/lights/AreaLights.d.ts +11 -0
  201. package/dist/features/3d/loaders/EXRCompression.d.ts +13 -0
  202. package/dist/features/3d/loaders/EXRLoader.d.ts +39 -0
  203. package/dist/features/3d/loaders/HDRLoader.d.ts +26 -0
  204. package/dist/features/3d/loaders/Limits.d.ts +70 -0
  205. package/dist/features/3d/loaders/LoaderBuffers.d.ts +42 -0
  206. package/dist/features/3d/loaders/LoaderIO.d.ts +81 -0
  207. package/dist/features/3d/loaders/LoaderModel.d.ts +80 -0
  208. package/dist/features/3d/loaders/LoaderText.d.ts +27 -0
  209. package/dist/features/3d/loaders/MTLLoader.d.ts +105 -0
  210. package/dist/features/3d/loaders/OBJLoader.d.ts +70 -0
  211. package/dist/features/3d/loaders/PLYLoader.d.ts +47 -0
  212. package/dist/features/3d/loaders/STLLoader.d.ts +27 -0
  213. package/dist/features/3d/model/Camera.d.ts +33 -0
  214. package/dist/features/3d/model/Environment.d.ts +31 -0
  215. package/dist/features/3d/model/Geometry.d.ts +59 -0
  216. package/dist/features/3d/model/InstancedMesh.d.ts +134 -0
  217. package/dist/features/3d/model/LOD.d.ts +31 -0
  218. package/dist/features/3d/model/Light.d.ts +200 -0
  219. package/dist/features/3d/model/Material.d.ts +308 -0
  220. package/dist/features/3d/model/MaterialExtensions.d.ts +200 -0
  221. package/dist/features/3d/model/Mesh.d.ts +92 -0
  222. package/dist/features/3d/model/Node.d.ts +87 -0
  223. package/dist/features/3d/model/ReflectionProbe.d.ts +45 -0
  224. package/dist/features/3d/model/RenderTarget.d.ts +41 -0
  225. package/dist/features/3d/model/Scene.d.ts +173 -0
  226. package/dist/features/3d/model/Texture.d.ts +143 -0
  227. package/dist/features/3d/nodes/Nodes.d.ts +8 -0
  228. package/dist/features/3d/nodes/ShaderNode.d.ts +240 -0
  229. package/dist/features/3d/particles/GPUParticleSchedule.d.ts +67 -0
  230. package/dist/features/3d/particles/GPUParticleShaders.d.ts +19 -0
  231. package/dist/features/3d/particles/GPUParticleState.d.ts +106 -0
  232. package/dist/features/3d/particles/GPUParticleSystem.d.ts +192 -0
  233. package/dist/features/3d/particles/ParticleCurves.d.ts +34 -0
  234. package/dist/features/3d/particles/ParticleOptions.d.ts +78 -0
  235. package/dist/features/3d/particles/ParticleSystem.d.ts +368 -0
  236. package/dist/features/3d/physics/PhysicsBackend.d.ts +352 -0
  237. package/dist/features/3d/physics/PhysicsDebug.d.ts +24 -0
  238. package/dist/features/3d/physics/PhysicsWorld.d.ts +352 -0
  239. package/dist/features/3d/physics/basic/BasicCollision.d.ts +75 -0
  240. package/dist/features/3d/physics/basic/BasicPhysics.d.ts +24 -0
  241. package/dist/features/3d/physics/basic/BasicShapes.d.ts +103 -0
  242. package/dist/features/3d/physics/rapier/ContactBuffer.d.ts +32 -0
  243. package/dist/features/3d/physics/rapier/RapierBackend.d.ts +17 -0
  244. package/dist/features/3d/physics/rapier/RapierShapes.d.ts +4 -0
  245. package/dist/features/3d/physics/rapier/RapierWorld.d.ts +198 -0
  246. package/dist/features/3d/physics/rapier/Validation.d.ts +8 -0
  247. package/dist/features/3d/services/Background.d.ts +22 -0
  248. package/dist/features/3d/services/BasicShader.d.ts +55 -0
  249. package/dist/features/3d/services/ClusteredLights.d.ts +69 -0
  250. package/dist/features/3d/services/DrawOrder.d.ts +37 -0
  251. package/dist/features/3d/services/EffectsProcessor.d.ts +38 -0
  252. package/dist/features/3d/services/EnvironmentBRDF.d.ts +35 -0
  253. package/dist/features/3d/services/EnvironmentMaps.d.ts +55 -0
  254. package/dist/features/3d/services/FogShader.d.ts +6 -0
  255. package/dist/features/3d/services/Frustum.d.ts +7 -0
  256. package/dist/features/3d/services/GLState.d.ts +86 -0
  257. package/dist/features/3d/services/GPUPicker.d.ts +31 -0
  258. package/dist/features/3d/services/InstanceShader.d.ts +3 -0
  259. package/dist/features/3d/services/LineProgram.d.ts +32 -0
  260. package/dist/features/3d/services/PBRProgram.d.ts +115 -0
  261. package/dist/features/3d/services/Renderer.d.ts +50 -0
  262. package/dist/features/3d/services/Shader.d.ts +22 -0
  263. package/dist/features/3d/services/ShaderProgram.d.ts +38 -0
  264. package/dist/features/3d/services/ShadowMaps.d.ts +97 -0
  265. package/dist/features/3d/services/SpatialIndex.d.ts +16 -0
  266. package/dist/features/3d/services/TextureLoader.d.ts +40 -0
  267. package/dist/features/3d/services/TextureMipmaps.d.ts +42 -0
  268. package/dist/features/3d/services/ToneMapping.d.ts +12 -0
  269. package/dist/features/3d/services/WebGLRenderer.d.ts +261 -0
  270. package/dist/features/3d/splats/SplatData.d.ts +136 -0
  271. package/dist/features/3d/splats/SplatLoaders.d.ts +64 -0
  272. package/dist/features/3d/splats/SplatShader.d.ts +14 -0
  273. package/dist/features/3d/splats/SplatSort.d.ts +69 -0
  274. package/dist/features/3d/splats/Splats.d.ts +116 -0
  275. package/dist/features/3d/text/FontAtlas.d.ts +246 -0
  276. package/dist/features/3d/text/SDF.d.ts +28 -0
  277. package/dist/features/3d/text/Text.d.ts +179 -0
  278. package/dist/features/3d/text/TextLayout.d.ts +73 -0
  279. package/dist/features/3d/text/TextShader.d.ts +12 -0
  280. package/dist/features/3d/tiles/BoundingVolume.d.ts +43 -0
  281. package/dist/features/3d/tiles/Geodesy.d.ts +106 -0
  282. package/dist/features/3d/tiles/GlobeControls.d.ts +147 -0
  283. package/dist/features/3d/tiles/TileContent.d.ts +35 -0
  284. package/dist/features/3d/tiles/TileFormats.d.ts +77 -0
  285. package/dist/features/3d/tiles/Tiles3D.d.ts +236 -0
  286. package/dist/features/3d/tiles/Tileset.d.ts +81 -0
  287. package/dist/features/3d/tools/BatchedMesh.d.ts +74 -0
  288. package/dist/features/3d/tools/CanvasSurface.d.ts +81 -0
  289. package/dist/features/3d/tools/Color.d.ts +11 -0
  290. package/dist/features/3d/tools/MergeGeometries.d.ts +22 -0
  291. package/dist/features/3d/tools/Options.d.ts +15 -0
  292. package/dist/features/3d/tools/Polyhedra.d.ts +30 -0
  293. package/dist/features/3d/tools/PrimitiveBuffers.d.ts +42 -0
  294. package/dist/features/3d/tools/Primitives.d.ts +164 -0
  295. package/dist/features/3d/tools/Ready.d.ts +12 -0
  296. package/dist/features/3d/tools/SpatialMath.d.ts +57 -0
  297. package/dist/features/3d/tools/SphericalHarmonics.d.ts +9 -0
  298. package/dist/features/3d/tools/math/mat3.d.ts +7 -0
  299. package/dist/features/3d/tools/math/mat4.d.ts +19 -0
  300. package/dist/features/3d/tools/math/quat.d.ts +6 -0
  301. package/dist/features/3d/tools/math/vec3.d.ts +16 -0
  302. package/dist/features/3d/tools/math/vec4.d.ts +5 -0
  303. package/dist/features/3d/types.d.ts +359 -0
  304. package/dist/features/3d/usdz/USDAParser.d.ts +50 -0
  305. package/dist/features/3d/usdz/USDScene.d.ts +20 -0
  306. package/dist/features/3d/usdz/USDZLoader.d.ts +27 -0
  307. package/dist/features/3d/usdz/ZipReader.d.ts +16 -0
  308. package/dist/features/3d/webgpu/Backend.d.ts +40 -0
  309. package/dist/features/3d/webgpu/BasicShader.d.ts +10 -0
  310. package/dist/features/3d/webgpu/Constants.d.ts +32 -0
  311. package/dist/features/3d/webgpu/Deformation.d.ts +71 -0
  312. package/dist/features/3d/webgpu/Environment.d.ts +66 -0
  313. package/dist/features/3d/webgpu/Features.d.ts +68 -0
  314. package/dist/features/3d/webgpu/Layouts.d.ts +27 -0
  315. package/dist/features/3d/webgpu/Lines.d.ts +40 -0
  316. package/dist/features/3d/webgpu/LitExtras.d.ts +46 -0
  317. package/dist/features/3d/webgpu/LitFeatures.d.ts +41 -0
  318. package/dist/features/3d/webgpu/LitScene.d.ts +60 -0
  319. package/dist/features/3d/webgpu/LitShader.d.ts +68 -0
  320. package/dist/features/3d/webgpu/Particles.d.ts +114 -0
  321. package/dist/features/3d/webgpu/Picking.d.ts +59 -0
  322. package/dist/features/3d/webgpu/PipelineKey.d.ts +33 -0
  323. package/dist/features/3d/webgpu/Points.d.ts +41 -0
  324. package/dist/features/3d/webgpu/Probes.d.ts +45 -0
  325. package/dist/features/3d/webgpu/ShaderChunks.d.ts +18 -0
  326. package/dist/features/3d/webgpu/ShaderMaterial.d.ts +57 -0
  327. package/dist/features/3d/webgpu/ShaderMaterialSource.d.ts +5 -0
  328. package/dist/features/3d/webgpu/Shadows.d.ts +49 -0
  329. package/dist/features/3d/webgpu/Splats.d.ts +47 -0
  330. package/dist/features/3d/webgpu/Textures.d.ts +52 -0
  331. package/dist/features/3d/webgpu/Transmission.d.ts +30 -0
  332. package/dist/features/3d/webgpu/UniformLayout.d.ts +30 -0
  333. package/dist/features/3d/webgpu/UtilityShaders.d.ts +38 -0
  334. package/dist/features/3d/webgpu/WebGPURenderer.d.ts +327 -0
  335. package/dist/features/3d/webgpu/effects/EffectsShaders.d.ts +74 -0
  336. package/dist/features/3d/webgpu/effects/WebGPUEffects.d.ts +140 -0
  337. package/dist/features/3d/xr/XR.d.ts +100 -0
  338. package/dist/gltf-By-n0qEg.js +960 -0
  339. package/dist/index.d.ts +86 -81
  340. package/dist/model/document-actions/document-commands.d.ts +18 -0
  341. package/dist/model/documents/svg/create-svg-document-renderer.d.ts +32 -0
  342. package/dist/model/documents/svg/export-svg-document.d.ts +5 -0
  343. package/dist/model/documents/svg/import-svg-document.d.ts +6 -0
  344. package/dist/model/documents/svg/svg-document.types.d.ts +111 -0
  345. package/dist/model/documents/svg/svg-values.d.ts +16 -0
  346. package/dist/model/documents/svg/svg-xml.d.ts +18 -0
  347. package/dist/model/input/NovaInputProxy_Adapter.d.ts +2 -1
  348. package/dist/model/input/NovaInputValidationController.d.ts +1 -1
  349. package/dist/model/input/NovaTextInputController.d.ts +1 -1
  350. package/dist/model/input/NovaTextLayoutEngine.d.ts +2 -6
  351. package/dist/model/input/index.d.ts +7 -7
  352. package/dist/model/input/nova-input.types.d.ts +1 -1
  353. package/dist/model/lighting/LightingRenderer2D.d.ts +58 -0
  354. package/dist/model/lighting/NovaLighting2D.d.ts +56 -0
  355. package/dist/model/lighting/lighting-shaders.d.ts +3 -0
  356. package/dist/model/lighting/lighting-state.d.ts +27 -0
  357. package/dist/model/lighting/lighting.types.d.ts +107 -0
  358. package/dist/model/lottie/LottieNode.d.ts +4 -0
  359. package/dist/model/lottie/lottie.types.d.ts +83 -0
  360. package/dist/model/lottie/prepare-lottie.d.ts +3 -0
  361. package/dist/model/lottie/sample-position.d.ts +9 -0
  362. package/dist/model/motion/NovaMotionEngine.d.ts +3 -3
  363. package/dist/model/motion/nova-motion-easing.d.ts +1 -1
  364. package/dist/model/motion/nova-motion-interpolation.d.ts +1 -1
  365. package/dist/model/motion/nova-motion-presets.d.ts +2 -2
  366. package/dist/model/motion/nova-motion-timeline.d.ts +1 -1
  367. package/dist/model/platform/NovaCanvas.d.ts +7 -6
  368. package/dist/model/primitives/NovaPrimitiveUnsupportedError.d.ts +13 -0
  369. package/dist/model/primitives/definePrimitive.d.ts +5 -0
  370. package/dist/model/primitives/primitive.types.d.ts +28 -0
  371. package/dist/model/render/backends/canvas2d/NovaCanvas2DTargetManager.d.ts +3 -3
  372. package/dist/model/render/backends/canvas2d/NovaRenderer2D.d.ts +61 -15
  373. package/dist/model/render/backends/canvas2d/nova-canvas-blend.d.ts +5 -0
  374. package/dist/model/render/backends/nova-render-backend-factory.d.ts +6 -6
  375. package/dist/model/render/backends/nova-render-backend.d.ts +8 -2
  376. package/dist/model/render/backends/webgl/NovaRendererWebGL.d.ts +32 -11
  377. package/dist/model/render/backends/webgl/NovaStreamCacheIdleLedger.d.ts +12 -1
  378. package/dist/model/render/backends/webgl/NovaWebGLBatcher.d.ts +1 -1
  379. package/dist/model/render/backends/webgl/NovaWebGLCircleImagePass.d.ts +23 -0
  380. package/dist/model/render/backends/webgl/NovaWebGLCompositionPass.d.ts +9 -0
  381. package/dist/model/render/backends/webgl/NovaWebGLDevice.d.ts +3 -1
  382. package/dist/model/render/backends/webgl/NovaWebGLDiagnostics.d.ts +1 -1
  383. package/dist/model/render/backends/webgl/NovaWebGLFrameRenderer.d.ts +162 -53
  384. package/dist/model/render/backends/webgl/NovaWebGLPathClipPass.d.ts +13 -0
  385. package/dist/model/render/backends/webgl/NovaWebGLPathUnion.d.ts +23 -0
  386. package/dist/model/render/compiler/NovaRenderBuilder.d.ts +24 -10
  387. package/dist/model/render/compiler/NovaRenderCommandWriter.d.ts +10 -5
  388. package/dist/model/render/compiler/NovaRenderCompiler.d.ts +7 -6
  389. package/dist/model/render/compiler/NovaRenderFrameBuilder.d.ts +4 -3
  390. package/dist/model/render/effects/blur.d.ts +8 -0
  391. package/dist/model/render/effects/color-matrix.d.ts +8 -0
  392. package/dist/model/render/effects/drop-shadow.d.ts +18 -0
  393. package/dist/model/render/effects/nova-effect-registry.d.ts +66 -0
  394. package/dist/model/render/effects/nova-gaussian-kernel.d.ts +7 -0
  395. package/dist/model/render/effects/nova-gaussian-textures.d.ts +11 -0
  396. package/dist/model/render/effects/shader-effect.d.ts +64 -0
  397. package/dist/model/render/geometry/nova-alpha-mask.d.ts +5 -0
  398. package/dist/model/render/geometry/nova-composition.d.ts +9 -0
  399. package/dist/model/render/geometry/nova-node-clip.d.ts +17 -0
  400. package/dist/model/render/geometry/nova-path-geometry.d.ts +24 -0
  401. package/dist/model/render/geometry/nova-path-tessellation.d.ts +7 -0
  402. package/dist/model/render/geometry/nova-polygon-triangulation.d.ts +1 -1
  403. package/dist/model/render/graph/NovaRectBatchBuffer.d.ts +58 -0
  404. package/dist/model/render/graph/NovaRenderGraph.d.ts +40 -6
  405. package/dist/model/render/graph/NovaRenderHitIndex.d.ts +1 -1
  406. package/dist/model/render/graph/nova-auto-rect.d.ts +1 -1
  407. package/dist/model/render/graph/nova-linear-rect-repack.d.ts +4 -4
  408. package/dist/model/render/graph/nova-linear-rect-transition.d.ts +2 -2
  409. package/dist/model/render/graph/nova-render-culling.d.ts +2 -2
  410. package/dist/model/render/graph/nova-render-dirty-items.d.ts +1 -1
  411. package/dist/model/render/graph/nova-render-group.d.ts +1 -1
  412. package/dist/model/render/graph/nova-render-item.d.ts +2 -2
  413. package/dist/model/render/graph/nova-render-layer.d.ts +1 -1
  414. package/dist/model/render/graph/nova-render-payload-snapshot.d.ts +3 -1
  415. package/dist/model/render/graph/nova-render-program.d.ts +5 -3
  416. package/dist/model/render/graph/nova-render-sequence.d.ts +1 -1
  417. package/dist/model/render/graph/nova-render-stream.d.ts +2 -2
  418. package/dist/model/render/ktx2/BasisSession.d.ts +45 -0
  419. package/dist/model/render/ktx2/KTX2Container.d.ts +26 -0
  420. package/dist/model/render/ktx2/KTX2Loader.d.ts +55 -0
  421. package/dist/model/render/meshes/MeshNode.d.ts +13 -0
  422. package/dist/model/render/meshes/NovaMeshWebGLDevice.d.ts +27 -0
  423. package/dist/model/render/meshes/geometry.d.ts +7 -0
  424. package/dist/model/render/meshes/mesh.d.ts +3 -0
  425. package/dist/model/render/meshes/mesh.types.d.ts +116 -0
  426. package/dist/model/render/meshes/nova-mesh-registry.d.ts +55 -0
  427. package/dist/model/render/orchestration/NovaRenderOrchestrator.d.ts +25 -3
  428. package/dist/model/render/policy/nova-render-policy.d.ts +1 -1
  429. package/dist/model/render/resources/NovaGlyphAtlasManager.d.ts +2 -2
  430. package/dist/model/render/resources/NovaTextAtlasManager.d.ts +3 -3
  431. package/dist/model/render/resources/NovaTextLayoutEngine.d.ts +1 -1
  432. package/dist/model/render/resources/nova-bitmap-upload.d.ts +10 -0
  433. package/dist/model/render/schema/NovaRenderContext.d.ts +6 -4
  434. package/dist/model/render/schema/nova-style-compiler.d.ts +5 -2
  435. package/dist/model/render/targets/NovaNodeRenderTextureSource.d.ts +29 -0
  436. package/dist/model/render/targets/NovaRenderTargetManager.d.ts +1 -1
  437. package/dist/model/render/targets/NovaRenderTexture.d.ts +57 -0
  438. package/dist/model/render/targets/nova-render-target-refs.d.ts +5 -0
  439. package/dist/model/render/targets/nova-render-target-resource.d.ts +1 -1
  440. package/dist/model/render/targets/nova-render-texture-runtime.d.ts +71 -0
  441. package/dist/model/render/textures/nova-compressed-image.d.ts +20 -0
  442. package/dist/model/render/utils/nova-icon-rendering.d.ts +3 -1
  443. package/dist/model/render/utils/nova-image-geometry.d.ts +11 -0
  444. package/dist/model/render/utils/nova-markdown-layout.d.ts +19 -0
  445. package/dist/model/render/utils/nova-text-paint.d.ts +26 -0
  446. package/dist/model/render/utils/nova-wrapped-text-layout.d.ts +19 -0
  447. package/dist/model/runtime/app/Nova.d.ts +35 -35
  448. package/dist/model/runtime/app/NovaApp.d.ts +58 -30
  449. package/dist/model/runtime/app/NovaRaphRuntime.d.ts +2 -2
  450. package/dist/model/runtime/app/createNovaRaphRuntime.d.ts +3 -3
  451. package/dist/model/runtime/assets/NovaAssetRegistry.d.ts +89 -2
  452. package/dist/model/runtime/assets/NovaVideoTexture.d.ts +38 -0
  453. package/dist/model/runtime/assets/nova-render-texture-image-identity.d.ts +4 -0
  454. package/dist/model/runtime/commands/NovaCommandBus.d.ts +1 -1
  455. package/dist/model/runtime/components/NovaComponentNode.d.ts +6 -6
  456. package/dist/model/runtime/components/NovaComponentRegistry.d.ts +1 -1
  457. package/dist/model/runtime/components/NovaSchemaRegistry.d.ts +7 -6
  458. package/dist/model/runtime/components/nova-component-metadata.d.ts +1 -1
  459. package/dist/model/runtime/components/nova-component.decorator.d.ts +2 -2
  460. package/dist/model/runtime/components/nova-defined-component.d.ts +3 -3
  461. package/dist/model/runtime/context/nova-context.d.ts +1 -1
  462. package/dist/model/runtime/cursor/NovaCursorManager.d.ts +3 -3
  463. package/dist/model/runtime/diagnostics/NovaDiagnostics_Module.d.ts +3 -3
  464. package/dist/model/runtime/interaction/NovaEvents.d.ts +16 -6
  465. package/dist/model/runtime/interaction/NovaHitIndex.d.ts +1 -1
  466. package/dist/model/runtime/interaction/NovaSpatialIndex.d.ts +2 -2
  467. package/dist/model/runtime/scene/NovaScene.d.ts +3 -3
  468. package/dist/model/runtime/scene/nova-scene-components.d.ts +6 -6
  469. package/dist/model/runtime/state/nova-store-decorators.d.ts +1 -1
  470. package/dist/model/runtime/state/nova-store-runtime.d.ts +1 -1
  471. package/dist/model/runtime/state/nova-store-tracking.d.ts +7 -3
  472. package/dist/model/runtime/sync/NovaSyncScope.d.ts +11 -2
  473. package/dist/model/runtime/sync/nova-sync-context.d.ts +2 -2
  474. package/dist/model/runtime/sync/nova-sync-ports.d.ts +2 -2
  475. package/dist/model/runtime/sync/nova-sync.types.d.ts +15 -3
  476. package/dist/model/runtime/template/NovaTemplateRuntime.d.ts +6 -6
  477. package/dist/model/runtime/tree/NovaContainer.d.ts +4 -4
  478. package/dist/model/runtime/tree/NovaNode.d.ts +58 -18
  479. package/dist/model/runtime/tree/NovaRaphNode.d.ts +8 -2
  480. package/dist/model/runtime/tree/NovaSurface.d.ts +32 -10
  481. package/dist/model/runtime/tree/nova-node-capture-invalidation.d.ts +11 -0
  482. package/dist/model/semantic/NovaSemanticService.d.ts +1 -1
  483. package/dist/model/semantic/browser/createAccessibilityBridge.d.ts +29 -0
  484. package/dist/model/sound/NovaSoundEngine.d.ts +3 -2
  485. package/dist/model/text-selection/NovaTextSelectionService.d.ts +2 -2
  486. package/dist/model/text-selection/index.d.ts +2 -2
  487. package/dist/model/text-selection/nova-text-selection.types.d.ts +1 -1
  488. package/dist/model/theme/NovaGlobalThemeRegistry.d.ts +2 -2
  489. package/dist/model/theme/NovaThemeService.d.ts +5 -3
  490. package/dist/model/theme/createTokenTheme.d.ts +15 -0
  491. package/dist/model/tools/transform-tools.d.ts +43 -0
  492. package/dist/nodes--Ds4IS2h.js +621 -0
  493. package/dist/nova-color-parser-BCN_rFRN.js +250 -0
  494. package/dist/nova-compressed-image-CE2Ya9Xa.js +46 -0
  495. package/dist/nova-mesh-registry-B7Xz5mhU.js +24 -0
  496. package/dist/nova-render-texture-image-identity-DQ09XFKs.js +15 -0
  497. package/dist/nova-text-paint-CcntsRjI.js +48 -0
  498. package/dist/tokens.d.ts +2 -0
  499. package/dist/tokens.js +50 -0
  500. package/dist/vec4-BTNv1fUp.js +20 -0
  501. package/package.json +223 -4
@@ -0,0 +1,527 @@
1
+ import { N as m } from "./Errors-B2ekO9bZ.js";
2
+ import { p as Vt, l as Tt } from "./Color-vuv9UnoY.js";
3
+ import { c as qt, t as zt, a as Rt, b as Pt, d as Nt, n as kt, e as Mt, f as Ot, g as B, h as St, j as Yt, k as jt, s as Ct, l as Gt, m as Wt, o as $t, q as Ut, r as Xt, u as Zt, i as Kt, v as Qt, w as Lt } from "./Node-QfgAE2_v.js";
4
+ import { o as Ht } from "./Options-CajE7LLJ.js";
5
+ import { N as Jt, m as ts } from "./Mesh-BaRxAAJq.js";
6
+ const ls = Ht({ ...ts, capacity: !0, count: !0, colors: !0, frames: !0 }), ss = 65536;
7
+ let D = 256, Et = new Float64Array(D * 10), Ft = new Float32Array(D * 16);
8
+ function es(a) {
9
+ if (a <= D)
10
+ return !0;
11
+ if (a > ss)
12
+ return !1;
13
+ for (; D < a; )
14
+ D *= 2;
15
+ return Et = new Float64Array(D * 10), Ft = new Float32Array(D * 16), !0;
16
+ }
17
+ const C = new Float64Array(6), At = new Float64Array(4);
18
+ function ns() {
19
+ C[0] = 1 / 0, C[1] = 1 / 0, C[2] = 1 / 0, C[3] = -1 / 0, C[4] = -1 / 0, C[5] = -1 / 0;
20
+ }
21
+ const A = new Float32Array(4), V = 4096, tt = (() => {
22
+ const a = new Float64Array(V + 2);
23
+ for (let t = 0; t <= V; t++)
24
+ a[t] = Tt(t / V);
25
+ return a[V + 1] = 1, a;
26
+ })();
27
+ function Dt(a) {
28
+ const t = (a <= 0 ? 0 : a >= 1 ? 1 : a) * V, s = t | 0, n = t - s;
29
+ return tt[s] + (tt[s + 1] - tt[s]) * n;
30
+ }
31
+ class ds extends Jt {
32
+ capacity;
33
+ _count;
34
+ _poses;
35
+ _matrices;
36
+ _version = 1;
37
+ _journal = [];
38
+ _instancesBounds;
39
+ _instancesBoundsVersion = -1;
40
+ _instancesBoundsWorld = -1;
41
+ _instancesBoundsGeometry = -1;
42
+ /** Per-instance world boxes `[minX,minY,minZ,maxX,maxY,maxZ]`, valid for a world/geometry version. */
43
+ _boxes;
44
+ _boxesWorld = -1;
45
+ _boxesGeometry = -1;
46
+ /** Prefix of `_boxes` computed since the last full rebuild. */
47
+ _boxesCount = 0;
48
+ /** Instance range written since the boxes were last refreshed. */
49
+ _dirtyStart = Number.POSITIVE_INFINITY;
50
+ _dirtyEnd = 0;
51
+ /** Linear RGBA per instance when created with `colors`. */
52
+ _colors;
53
+ _colorVersion = 0;
54
+ _colorStart = Number.POSITIVE_INFINITY;
55
+ _colorEnd = 0;
56
+ /** Sprite-sheet frame per instance when created with `frames`. */
57
+ _frames;
58
+ _frameVersion = 0;
59
+ _frameStart = Number.POSITIVE_INFINITY;
60
+ _frameEnd = 0;
61
+ /** @internal */
62
+ constructor(t, s) {
63
+ if (!Number.isSafeInteger(s.capacity) || s.capacity < 1 || s.capacity * 168 > 64 * 1024 * 1024)
64
+ throw new m("invalid-option", "[Nova3D] Instance capacity must be positive and fit the 64 MiB CPU instance budget.");
65
+ const n = s.count ?? s.capacity;
66
+ if (!Number.isSafeInteger(n) || n < 0 || n > s.capacity)
67
+ throw new m("invalid-option", "[Nova3D] Invalid instance count.");
68
+ const i = new Float64Array(s.capacity * 10), e = new Float32Array(s.capacity * 16);
69
+ if (s.colors !== void 0 && typeof s.colors != "boolean")
70
+ throw new m("invalid-option", "[Nova3D] Instance colors must be boolean.");
71
+ const r = s.colors ? new Float32Array(s.capacity * 4).fill(1) : null;
72
+ if (s.frames !== void 0 && typeof s.frames != "boolean")
73
+ throw new m("invalid-option", "[Nova3D] Instance frames must be boolean.");
74
+ const o = s.frames ? new Float32Array(s.capacity) : null, c = new Uint8Array(s.capacity);
75
+ super(t, s), this._mirrored = c, this._colors = r, this._frames = o, this.capacity = s.capacity, this._count = n, this._poses = i, this._matrices = e;
76
+ const _ = Kt();
77
+ for (let h = 0; h < this.capacity; h++)
78
+ this._write(h, _);
79
+ }
80
+ get count() {
81
+ return this._count;
82
+ }
83
+ /** @internal */
84
+ get _instanceVersion() {
85
+ return this._version;
86
+ }
87
+ /** 1 where the instance scale has a negative product (a mirrored instance). */
88
+ _mirrored;
89
+ _mirroredCount = 0;
90
+ /**
91
+ * True when some instance may be mirrored (or the poses are not derived yet): only then
92
+ * must shaders cull faces per instance with a discard; otherwise fixed-function culling
93
+ * keeps early depth rejection.
94
+ * @internal
95
+ */
96
+ get _mayMirror() {
97
+ return this._mirroredCount > 0 || this._recordPoses !== null;
98
+ }
99
+ /** Recounts mirrored instances in [start, end) from the pose scales. */
100
+ _countMirrors(t, s) {
101
+ const n = this._poses, i = this._mirrored;
102
+ let e = this._mirroredCount;
103
+ for (let r = t; r < s; r++) {
104
+ const o = r * 10, c = n[o + 7] * n[o + 8] * n[o + 9] < 0 ? 1 : 0;
105
+ e += c - i[r], i[r] = c;
106
+ }
107
+ this._mirroredCount = e;
108
+ }
109
+ /**
110
+ * Compact quad records of an owner that draws through pulled quads (WebGL particles),
111
+ * `_quadRecordTexels` RGBA texels per instance: position xyz and scale; then, with
112
+ * `_quadRecordRoll`, the scaled cos and sin of the roll, frame and an unused float; then,
113
+ * without `_quadRecordColor`, the linear colour. Without the roll texel the roll is zero
114
+ * (column (scale, 0)); `_quadRecordColor` is the linear colour shared by every instance.
115
+ * The owner fills them and calls `_writeRecords`.
116
+ * @internal
117
+ */
118
+ _quadRecords = null;
119
+ /** @internal */
120
+ _quadRecordTexels = 3;
121
+ /** @internal */
122
+ _quadRecordRoll = !0;
123
+ /** @internal */
124
+ _quadRecordColor = null;
125
+ /** @internal */
126
+ _quadRecordVersion = 0;
127
+ /** Owner pose source behind the last `_writeRecords`; the instance arrays derive from it on first read. */
128
+ _recordPoses = null;
129
+ _recordCount = 0;
130
+ /**
131
+ * Owner write of `count` complete quad records (colour included); `poses` returns their
132
+ * packed poses (10 floats each) on demand: matrices, colours and frames are derived only
133
+ * when something reads them, so a WebGL particle frame touches just the records.
134
+ * @internal
135
+ */
136
+ _writeRecords(t, s) {
137
+ this._recordPoses = s, this._recordCount = t, this._quadRecordVersion++, t > 0 && (this._colors && (this._colorStart = 0, this._colorEnd = Math.max(this._colorEnd, t), this._colorVersion++), this._frames && (this._frameStart = 0, this._frameEnd = Math.max(this._frameEnd, t), this._frameVersion++), this._changed(0, t));
138
+ }
139
+ /** Derives poses, matrices, colours and frames of the last records write. */
140
+ _sync() {
141
+ const t = this._recordPoses;
142
+ if (t === null)
143
+ return;
144
+ this._recordPoses = null;
145
+ const s = this._quadRecords, n = this._recordCount, i = this._poses;
146
+ i.set(t().subarray(0, n * 10)), this._countMirrors(0, n);
147
+ const e = this._quadRecordTexels * 4, r = this._quadRecordColor, o = e - 4, c = this._colors, _ = this._quadRecordRoll ? this._frames : null;
148
+ for (let h = 0; h < n; h++) {
149
+ et(this._matrices, h * 16, i, h * 10);
150
+ const f = h * e;
151
+ if (c) {
152
+ const l = h * 4;
153
+ r ? (c[l] = r[0], c[l + 1] = r[1], c[l + 2] = r[2], c[l + 3] = r[3]) : (c[l] = s[f + o], c[l + 1] = s[f + o + 1], c[l + 2] = s[f + o + 2], c[l + 3] = s[f + o + 3]);
154
+ }
155
+ _ && (_[h] = s[f + 6]);
156
+ }
157
+ }
158
+ setCount(t) {
159
+ if (this._assertAlive(), !Number.isSafeInteger(t) || t < 0 || t > this.capacity)
160
+ throw new m("invalid-option", "[Nova3D] Invalid instance count.");
161
+ t !== this._count && (this._count = t, this._changed(0, 0));
162
+ }
163
+ setTransform(t, s) {
164
+ if (this._sync(), typeof t != "number") {
165
+ super.setTransform(t);
166
+ return;
167
+ }
168
+ if (!s)
169
+ throw new m("invalid-option", "[Nova3D] An instance transform patch is required.");
170
+ qt(s), this.updateRange(t, [s]);
171
+ }
172
+ updateRange(t, s) {
173
+ this._sync(), this._assertAlive();
174
+ const n = s.length;
175
+ if (!Number.isSafeInteger(t) || t < 0 || t + n > this.capacity)
176
+ throw new m("budget", "[Nova3D] Instance update exceeds fixed capacity.");
177
+ const i = es(n), e = i ? Et : new Float64Array(n * 10), r = i ? Ft : new Float32Array(n * 16);
178
+ for (let o = 0; o < n; o++)
179
+ is(e, o * 10, this._poses, (t + o) * 10, s[o]);
180
+ for (let o = 0; o < n; o++) {
181
+ const c = o * 10, _ = o * 16;
182
+ et(r, _, e, c);
183
+ for (let h = _; h < _ + 16; h++)
184
+ if (!Number.isFinite(r[h]))
185
+ throw new m("invalid-option", "[Nova3D] Instance matrix exceeds finite Float32 coordinates.");
186
+ }
187
+ this._poses.set(e.subarray(0, n * 10), t * 10), this._matrices.set(r.subarray(0, n * 16), t * 16), n && this._changed(t, t + n);
188
+ }
189
+ /**
190
+ * Writes poses of `[start, start + count)` from packed numbers, 10 per instance:
191
+ * position xyz, quaternion xyzw (normalized here), scale xyz. Validated before
192
+ * any write and allocation-free, for particles and simulations.
193
+ * @experimental
194
+ */
195
+ updatePoses(t, s, n = Math.floor(s.length / 10)) {
196
+ if (this._sync(), this._assertAlive(), !Number.isSafeInteger(t) || !Number.isSafeInteger(n) || t < 0 || n < 0 || t + n > this.capacity || n * 10 > s.length)
197
+ throw new m("budget", "[Nova3D] Instance poses exceed the data or the fixed capacity.");
198
+ for (let e = 0, r = n * 10; e < r; e += 10) {
199
+ for (let o = 0; o < 10; o++) {
200
+ const c = s[e + o];
201
+ if (!(Math.abs(c) <= 1e30))
202
+ throw new m("invalid-option", "[Nova3D] Instance pose values must be finite and within ±1e30.");
203
+ }
204
+ if (Math.sqrt(s[e + 3] * s[e + 3] + s[e + 4] * s[e + 4] + s[e + 5] * s[e + 5] + s[e + 6] * s[e + 6]) < 1e-15)
205
+ throw new m("invalid-option", "[Nova3D] Quaternion must have a nonzero length.");
206
+ }
207
+ const i = this._poses;
208
+ for (let e = 0; e < n; e++) {
209
+ const r = e * 10, o = (t + e) * 10;
210
+ for (let _ = 0; _ < 10; _++)
211
+ i[o + _] = s[r + _];
212
+ const c = Math.sqrt(i[o + 3] * i[o + 3] + i[o + 4] * i[o + 4] + i[o + 5] * i[o + 5] + i[o + 6] * i[o + 6]);
213
+ for (let _ = 3; _ < 7; _++)
214
+ i[o + _] /= c;
215
+ et(this._matrices, (t + e) * 16, i, o);
216
+ }
217
+ n && this._changed(t, t + n);
218
+ }
219
+ /**
220
+ * Whether the mesh was created with per-instance colours (`colors: true`).
221
+ * @experimental
222
+ */
223
+ get colors() {
224
+ return this._colors !== null;
225
+ }
226
+ /**
227
+ * Sets the sRGB colour of one instance; [r, g, b] is opaque.
228
+ * @experimental
229
+ */
230
+ setColor(t, s) {
231
+ this._sync(), this._assertAlive(), this._checkIndex(t);
232
+ const n = Vt(s);
233
+ A[0] = n[0], A[1] = n[1], A[2] = n[2], A[3] = n[3], this.updateColors(t, A, 1);
234
+ }
235
+ /**
236
+ * Writes sRGB RGBA colours of `[start, start + count)`, 4 numbers each.
237
+ * @experimental
238
+ */
239
+ updateColors(t, s, n = Math.floor(s.length / 4)) {
240
+ this._sync(), this._assertAlive();
241
+ const i = this._colors;
242
+ if (!i)
243
+ throw new m("invalid-option", "[Nova3D] Create the instanced mesh with colors: true.");
244
+ if (!Number.isSafeInteger(t) || !Number.isSafeInteger(n) || t < 0 || n < 0 || t + n > this.capacity || n * 4 > s.length)
245
+ throw new m("budget", "[Nova3D] Instance colours exceed the data or the fixed capacity.");
246
+ for (let e = 0, r = n * 4; e < r; e++) {
247
+ const o = s[e];
248
+ if (!(o >= 0 && o <= 1))
249
+ throw new m("invalid-option", "[Nova3D] Instance colours must be normalized.");
250
+ }
251
+ for (let e = 0, r = n * 4; e < r; e++)
252
+ i[t * 4 + e] = (e & 3) === 3 ? s[e] : Dt(s[e]);
253
+ n && (this._colorStart = Math.min(this._colorStart, t), this._colorEnd = Math.max(this._colorEnd, t + n), this._colorVersion++, this.scene._invalidate());
254
+ }
255
+ /** @internal */
256
+ _instanceColors() {
257
+ return this._sync(), this._colors;
258
+ }
259
+ /** @internal */
260
+ get _instanceColorVersion() {
261
+ return this._colorVersion;
262
+ }
263
+ /**
264
+ * Returns and clears the instance range of colours changed since the last upload.
265
+ * @internal
266
+ */
267
+ _takeColorRange(t) {
268
+ t.start = this._colorStart, t.end = this._colorEnd, this._colorStart = Number.POSITIVE_INFINITY, this._colorEnd = 0;
269
+ }
270
+ /**
271
+ * Whether the mesh has per-instance sprite-sheet frames.
272
+ * @experimental
273
+ */
274
+ get frames() {
275
+ return this._frames !== null;
276
+ }
277
+ /**
278
+ * Sets the sprite-sheet frame of one instance.
279
+ * @experimental
280
+ */
281
+ setFrame(t, s) {
282
+ this._sync(), this._assertAlive(), this._checkIndex(t), A[0] = s, this.updateFrames(t, A, 1);
283
+ }
284
+ /**
285
+ * Writes sprite-sheet frames of `[start, start + count)`: nonnegative integers;
286
+ * frames past the material grid wrap.
287
+ * @experimental
288
+ */
289
+ updateFrames(t, s, n = s.length) {
290
+ this._sync(), this._assertAlive();
291
+ const i = this._frames;
292
+ if (!i)
293
+ throw new m("invalid-option", "[Nova3D] Create the instanced mesh with frames: true.");
294
+ if (!Number.isSafeInteger(t) || !Number.isSafeInteger(n) || t < 0 || n < 0 || t + n > this.capacity || n > s.length)
295
+ throw new m("budget", "[Nova3D] Instance frames exceed the data or the fixed capacity.");
296
+ for (let e = 0; e < n; e++) {
297
+ const r = s[e];
298
+ if (!Number.isInteger(r) || r < 0 || r > 16777216)
299
+ throw new m("invalid-option", "[Nova3D] Instance frames must be integers in [0, 2^24].");
300
+ }
301
+ for (let e = 0; e < n; e++)
302
+ i[t + e] = s[e];
303
+ n && (this._frameStart = Math.min(this._frameStart, t), this._frameEnd = Math.max(this._frameEnd, t + n), this._frameVersion++, this.scene._invalidate());
304
+ }
305
+ /**
306
+ * Owner write of instances `[0, count)` (particle systems): packed poses (10 each), their
307
+ * matrices (16 each) and sRGB RGBA colours, produced valid by construction, so nothing is
308
+ * re-validated or re-composed. @internal
309
+ */
310
+ _writeOwned(t, s, n, i) {
311
+ this._sync(), this._poses.set(s.subarray(0, t * 10)), this._matrices.set(n.subarray(0, t * 16));
312
+ const e = this._colors;
313
+ if (i && e && t > 0) {
314
+ for (let r = 0, o = t * 4; r < o; r++)
315
+ e[r] = (r & 3) === 3 ? i[r] : Dt(i[r]);
316
+ this._colorStart = 0, this._colorEnd = Math.max(this._colorEnd, t), this._colorVersion++;
317
+ }
318
+ t > 0 && this._changed(0, t);
319
+ }
320
+ /** @internal */
321
+ _instanceFrames() {
322
+ return this._sync(), this._frames;
323
+ }
324
+ /** @internal */
325
+ get _instanceFrameVersion() {
326
+ return this._frameVersion;
327
+ }
328
+ /**
329
+ * Returns and clears the instance range of frames changed since the last upload.
330
+ * @internal
331
+ */
332
+ _takeFrameRange(t) {
333
+ t.start = this._frameStart, t.end = this._frameEnd, this._frameStart = Number.POSITIVE_INFINITY, this._frameEnd = 0;
334
+ }
335
+ getTransform(t) {
336
+ return this._sync(), t === void 0 ? super.getTransform() : (this._assertAlive(), this._checkIndex(t), this._readPose(t));
337
+ }
338
+ /** @internal */
339
+ _instanceMatrices() {
340
+ return this._sync(), this._matrices;
341
+ }
342
+ /** @internal */
343
+ _instanceChangesSince(t) {
344
+ return t === this._version ? [] : !this._journal.length || t < this._journal[0].version - 1 ? null : this._journal.filter((s) => s.version > t);
345
+ }
346
+ /** @internal */
347
+ _ownBounds() {
348
+ const t = this._worldState();
349
+ if (this._instancesBoundsVersion === this._version && this._instancesBoundsWorld === t.version && this._instancesBoundsGeometry === this.geometry.version)
350
+ return this._instancesBounds ?? null;
351
+ const s = this.geometry.getBounds();
352
+ let n = null;
353
+ const i = this._boundsOverride;
354
+ if (i)
355
+ this._boxesCount = 0, this._count > 0 && i[0] <= i[3] && (n = rs(i, t.matrix));
356
+ else if (s && this._count > 0) {
357
+ const e = this._refreshBoxes(s, t.matrix, t.version), r = C;
358
+ let o = r[0], c = r[1], _ = r[2], h = r[3], f = r[4], l = r[5];
359
+ const y = this._count, b = At;
360
+ for (let x = 0; x < 3; x++) {
361
+ const p = x === 0 ? 0 : Math.min(b[x * 2 - 1], y), u = x === 2 ? y : Math.min(b[x * 2], y);
362
+ for (let d = p * 6, N = u * 6; d < N; d += 6) {
363
+ const w = e[d], g = e[d + 1], v = e[d + 2], I = e[d + 3], E = e[d + 4], F = e[d + 5];
364
+ w < o && (o = w), g < c && (c = g), v < _ && (_ = v), I > h && (h = I), E > f && (f = E), F > l && (l = F);
365
+ }
366
+ }
367
+ n = { min: [o, c, _], max: [h, f, l] };
368
+ }
369
+ return this._instancesBounds = n, this._instancesBoundsVersion = this._version, this._instancesBoundsWorld = t.version, this._instancesBoundsGeometry = this.geometry.version, n;
370
+ }
371
+ /**
372
+ * Brings the per-instance world boxes of `[0,count)` up to date and returns them.
373
+ * Rewritten boxes below `count` are merged into `rewrittenUnion`; their ranges are
374
+ * left in `rewrittenRanges` so the caller scans only the rest.
375
+ */
376
+ _refreshBoxes(t, s, n) {
377
+ this._sync(), ns();
378
+ const i = At;
379
+ i.fill(0), (!this._boxes || this._boxesWorld !== n || this._boxesGeometry !== this.geometry.version) && (this._boxes ??= new Float32Array(this.capacity * 6), this._boxesWorld = n, this._boxesGeometry = this.geometry.version, this._boxesCount = 0);
380
+ const e = this._count;
381
+ if (this._dirtyStart < this._boxesCount) {
382
+ const r = this._dirtyStart, o = Math.min(this._dirtyEnd, this._boxesCount), c = Math.min(o, e);
383
+ r < c && (this._writeBoxes(t, s, r, c, !0), i[0] = r, i[1] = c), Math.max(r, e) < o && this._writeBoxes(t, s, Math.max(r, e), o, !1);
384
+ }
385
+ return this._boxesCount < e ? (this._writeBoxes(t, s, this._boxesCount, e, !0), i[2] = this._boxesCount, i[3] = e, this._boxesCount = e) : (i[2] = i[1], i[3] = i[1]), this._dirtyStart = Number.POSITIVE_INFINITY, this._dirtyEnd = 0, this._boxes;
386
+ }
387
+ /**
388
+ * World boxes of instances `[start, end)` by the centre/extent form of the affine
389
+ * world × instance matrix, merged into `rewrittenUnion`.
390
+ */
391
+ _writeBoxes(t, s, n, i, e) {
392
+ const r = this._boxes, o = this._matrices, c = C, _ = (t.min[0] + t.max[0]) * 0.5, h = (t.min[1] + t.max[1]) * 0.5, f = (t.min[2] + t.max[2]) * 0.5, l = (t.max[0] - t.min[0]) * 0.5, y = (t.max[1] - t.min[1]) * 0.5, b = (t.max[2] - t.min[2]) * 0.5, x = s[0], p = s[1], u = s[2], d = s[4], N = s[5], w = s[6], g = s[8], v = s[9], I = s[10], E = s[12], F = s[13], Bt = s[14];
393
+ let z = c[0], R = c[1], P = c[2], k = c[3], O = c[4], Y = c[5];
394
+ for (let T = n; T < i; T++) {
395
+ const M = T * 16, j = o[M], G = o[M + 1], W = o[M + 2], $ = o[M + 4], U = o[M + 5], X = o[M + 6], Z = o[M + 8], K = o[M + 9], Q = o[M + 10], L = o[M + 12], H = o[M + 13], J = o[M + 14], nt = x * j + d * G + g * W, it = p * j + N * G + v * W, rt = u * j + w * G + I * W, ot = x * $ + d * U + g * X, at = p * $ + N * U + v * X, ct = u * $ + w * U + I * X, ht = x * Z + d * K + g * Q, _t = p * Z + N * K + v * Q, lt = u * Z + w * K + I * Q, dt = x * L + d * H + g * J + E + nt * _ + ot * h + ht * f, mt = p * L + N * H + v * J + F + it * _ + at * h + _t * f, ft = u * L + w * H + I * J + Bt + rt * _ + ct * h + lt * f, ut = Math.abs(nt) * l + Math.abs(ot) * y + Math.abs(ht) * b, yt = Math.abs(it) * l + Math.abs(at) * y + Math.abs(_t) * b, xt = Math.abs(rt) * l + Math.abs(ct) * y + Math.abs(lt) * b, S = T * 6;
396
+ r[S] = dt - ut, r[S + 1] = mt - yt, r[S + 2] = ft - xt, r[S + 3] = dt + ut, r[S + 4] = mt + yt, r[S + 5] = ft + xt;
397
+ const gt = r[S], wt = r[S + 1], vt = r[S + 2], bt = r[S + 3], pt = r[S + 4], It = r[S + 5];
398
+ gt < z && (z = gt), wt < R && (R = wt), vt < P && (P = vt), bt > k && (k = bt), pt > O && (O = pt), It > Y && (Y = It);
399
+ }
400
+ e && (c[0] = z, c[1] = R, c[2] = P, c[3] = k, c[4] = O, c[5] = Y);
401
+ }
402
+ /** @internal */
403
+ _intersect(t, s) {
404
+ this._sync();
405
+ const n = this.geometry.getBounds();
406
+ if (!n)
407
+ return null;
408
+ let i = null;
409
+ for (let e = 0; e < this._count; e++) {
410
+ const r = this._worldInstance(e), o = zt(n, r), c = Rt(t, o);
411
+ if (c === null || i && c >= i.distance)
412
+ continue;
413
+ if (s === "bounds") {
414
+ i = { node: this, instanceIndex: e, distance: c, point: t.origin.map((u, d) => u + t.direction[d] * c), normal: null };
415
+ continue;
416
+ }
417
+ if (this.geometry.topology !== "triangles")
418
+ continue;
419
+ const _ = Pt(Nt(), r), h = kt(Mt(), r);
420
+ if (!_ || !h)
421
+ continue;
422
+ const f = Ot(B(), t.origin, _), l = St(B(), t.direction, Yt(Mt(), _)), y = this.geometry._buffers(), b = this.geometry.drawRange, x = this.material._readOptions().side, p = (u) => {
423
+ const d = (y.indices ? y.indices[u] : u) * 3;
424
+ return Qt(y.positions[d], y.positions[d + 1], y.positions[d + 2]);
425
+ };
426
+ for (let u = b.start; u < b.start + b.count; u += 3) {
427
+ const d = p(u), N = p(u + 1), w = p(u + 2), g = jt(B(), Ct(B(), N, d), Ct(B(), w, d)), v = Gt(g, l);
428
+ if (x === "front" && v >= 0 || x === "back" && v <= 0)
429
+ continue;
430
+ const I = Wt(f, l, d, N, w);
431
+ I === null || i && I >= i.distance || ($t(g, St(g, g, h)), i = { node: this, instanceIndex: e, distance: I, point: t.origin.map((E, F) => E + t.direction[F] * I), normal: Array.from(g), triangleIndex: u / 3, uv: Ut(y, u, f, l, I) });
432
+ }
433
+ }
434
+ return i;
435
+ }
436
+ _worldInstance(t) {
437
+ return Xt(Nt(), this._worldState().matrix, this._matrices.subarray(t * 16, t * 16 + 16));
438
+ }
439
+ _readPose(t) {
440
+ const s = t * 10;
441
+ return { position: Array.from(this._poses.subarray(s, s + 3)), quaternion: Array.from(this._poses.subarray(s + 3, s + 7)), scale: Array.from(this._poses.subarray(s + 7, s + 10)) };
442
+ }
443
+ _write(t, s) {
444
+ this._poses.set([...s.position, ...s.quaternion, ...s.scale], t * 10), this._matrices.set(Zt(s), t * 16);
445
+ }
446
+ _checkIndex(t) {
447
+ if (!Number.isSafeInteger(t) || t < 0 || t >= this.capacity)
448
+ throw new m("budget", "[Nova3D] Instance index exceeds capacity.");
449
+ }
450
+ /**
451
+ * Exchanges two instances: pose, matrix, colour and frame. For batched meshes
452
+ * that keep visible instances in the drawn prefix. @internal
453
+ */
454
+ _swapInstances(t, s) {
455
+ if (this._sync(), this._assertAlive(), this._checkIndex(t), this._checkIndex(s), t === s)
456
+ return;
457
+ q(this._poses, t * 10, s * 10, 10), q(this._matrices, t * 16, s * 16, 16);
458
+ const n = Math.min(t, s), i = Math.max(t, s) + 1;
459
+ this._colors && (q(this._colors, t * 4, s * 4, 4), this._colorStart = Math.min(this._colorStart, n), this._colorEnd = Math.max(this._colorEnd, i), this._colorVersion++), this._frames && (q(this._frames, t, s, 1), this._frameStart = Math.min(this._frameStart, n), this._frameEnd = Math.max(this._frameEnd, i), this._frameVersion++), this._changed(n, i);
460
+ }
461
+ /**
462
+ * Mesh-space union (min xyz, max xyz) of every instance box, kept current by the owner
463
+ * before each pose update; replaces the per-instance bounds pass. @internal
464
+ */
465
+ _setInstanceBounds(t) {
466
+ this._boundsOverride = t, this._version++, this.scene._boundsChanged(this);
467
+ }
468
+ _boundsOverride = null;
469
+ _changed(t, s) {
470
+ s > t && this._recordPoses === null && this._countMirrors(t, s), s > t && (this._dirtyStart = Math.min(this._dirtyStart, t), this._dirtyEnd = Math.max(this._dirtyEnd, s)), this._version++, this._journal.push({ version: this._version, start: t, end: s }), this._journal.length > 64 && this._journal.shift(), this.scene._boundsChanged(this);
471
+ }
472
+ }
473
+ function q(a, t, s, n) {
474
+ for (let i = 0; i < n; i++) {
475
+ const e = a[t + i];
476
+ a[t + i] = a[s + i], a[s + i] = e;
477
+ }
478
+ }
479
+ function st(a, t, s, n, i) {
480
+ if (!Array.isArray(a) && !ArrayBuffer.isView(a))
481
+ throw new m("invalid-option", `[Nova3D] ${s} must be a vector.`);
482
+ if (a.length !== t)
483
+ throw new m("invalid-option", `[Nova3D] ${s} must have ${t} components.`);
484
+ for (let e = 0; e < t; e++) {
485
+ const r = a[e];
486
+ if (!Number.isFinite(r))
487
+ throw new m("invalid-option", `[Nova3D] ${s} must be finite.`);
488
+ n[i + e] = r;
489
+ }
490
+ }
491
+ function is(a, t, s, n, i) {
492
+ if (i.rotation !== void 0 && i.quaternion !== void 0)
493
+ throw new m("invalid-option", "[Nova3D] Choose rotation or quaternion.");
494
+ for (let e = 0; e < 10; e++)
495
+ a[t + e] = s[n + e];
496
+ if (i.rotation !== void 0) {
497
+ const e = Lt(i.rotation);
498
+ for (let r = 0; r < 4; r++)
499
+ a[t + 3 + r] = e[r];
500
+ }
501
+ if (i.quaternion !== void 0) {
502
+ st(i.quaternion, 4, "quaternion", a, t + 3);
503
+ const e = Math.hypot(a[t + 3], a[t + 4], a[t + 5], a[t + 6]);
504
+ if (e < 1e-15)
505
+ throw new m("invalid-option", "[Nova3D] Quaternion must have a nonzero length.");
506
+ for (let r = 3; r < 7; r++)
507
+ a[t + r] /= e;
508
+ }
509
+ i.position !== void 0 && st(i.position, 3, "position", a, t), i.scale !== void 0 && st(i.scale, 3, "scale", a, t + 7);
510
+ }
511
+ function rs(a, t) {
512
+ const s = (a[0] + a[3]) * 0.5, n = (a[1] + a[4]) * 0.5, i = (a[2] + a[5]) * 0.5, e = (a[3] - a[0]) * 0.5, r = (a[4] - a[1]) * 0.5, o = (a[5] - a[2]) * 0.5, c = [0, 0, 0], _ = [0, 0, 0];
513
+ for (let h = 0; h < 3; h++) {
514
+ const f = t[h] * s + t[4 + h] * n + t[8 + h] * i + t[12 + h], l = Math.abs(t[h]) * e + Math.abs(t[4 + h]) * r + Math.abs(t[8 + h]) * o;
515
+ c[h] = Math.fround(f - l), _[h] = Math.fround(f + l);
516
+ }
517
+ return { min: c, max: _ };
518
+ }
519
+ function et(a, t, s, n) {
520
+ const i = s[n + 3], e = s[n + 4], r = s[n + 5], o = s[n + 6], c = i + i, _ = e + e, h = r + r, f = i * c, l = i * _, y = i * h, b = e * _, x = e * h, p = r * h, u = o * c, d = o * _, N = o * h, w = s[n + 7], g = s[n + 8], v = s[n + 9];
521
+ a[t] = (1 - (b + p)) * w, a[t + 1] = (l + N) * w, a[t + 2] = (y - d) * w, a[t + 3] = 0, a[t + 4] = (l - N) * g, a[t + 5] = (1 - (f + p)) * g, a[t + 6] = (x + u) * g, a[t + 7] = 0, a[t + 8] = (y + d) * v, a[t + 9] = (x - u) * v, a[t + 10] = (1 - (f + b)) * v, a[t + 11] = 0, a[t + 12] = s[n], a[t + 13] = s[n + 1], a[t + 14] = s[n + 2], a[t + 15] = 1;
522
+ }
523
+ export {
524
+ ds as N,
525
+ ls as i,
526
+ Dt as l
527
+ };
@@ -0,0 +1,20 @@
1
+ import { N as o } from "./Errors-B2ekO9bZ.js";
2
+ import { c as i, o as u } from "./Options-CajE7LLJ.js";
3
+ const n = u({ maxInputBytes: !0, maxJSONBytes: !0, maxBufferBytes: !0, maxAccessorBytes: !0, maxEncodedImageBytes: !0, maxDecodedImageBytes: !0, maxImageDimension: !0, maxNodes: !0, maxParts: !0, maxVertices: !0, maxPrimitives: !0, maxRecords: !0, maxDecompressedBytes: !0, maxAnimationKeys: !0, maxSplats: !0, maxResources: !0, maxDepth: !0, maxGeometryValues: !0 }), d = Object.freeze({ maxEncodedImageBytes: 256 * 1024 * 1024, maxDecodedImageBytes: 512 * 1024 * 1024 });
4
+ function f(r, m, a = "loader") {
5
+ const e = { ...m };
6
+ if (r === void 0)
7
+ return e;
8
+ i(r, n, `${a} limits`);
9
+ for (const [s, t] of Object.entries(r))
10
+ if (t !== void 0) {
11
+ if (!Number.isSafeInteger(t) || t <= 0)
12
+ throw new o("invalid-option", `[Nova3D] ${a} limit ${s} must be a positive safe integer.`);
13
+ s in e && (e[s] = t);
14
+ }
15
+ return e;
16
+ }
17
+ export {
18
+ d,
19
+ f as r
20
+ };
@@ -0,0 +1,131 @@
1
+ import { N as l } from "./Errors-B2ekO9bZ.js";
2
+ import { a as f } from "./Scene-CDfNgf9I.js";
3
+ import { p } from "./Color-vuv9UnoY.js";
4
+ import { c as _ } from "./Options-CajE7LLJ.js";
5
+ function m(r, e, t) {
6
+ return r === void 0 ? {} : (_(r, t, e), r);
7
+ }
8
+ function g(r, e, t) {
9
+ const s = r ?? e;
10
+ if (typeof s != "number" || !Number.isFinite(s) || s <= 0)
11
+ throw new l("invalid-option", `[Nova3D] Helper ${t} must be a positive finite number.`);
12
+ return s;
13
+ }
14
+ function N(r, e) {
15
+ const t = r ?? e;
16
+ return p(t), t;
17
+ }
18
+ function D(r, e) {
19
+ for (let t = 0; t < 16; t++)
20
+ if (r[t] !== e[t])
21
+ return !1;
22
+ return !0;
23
+ }
24
+ function H(r, e, t) {
25
+ for (let s = 0; s < e.length; s += 3) {
26
+ const a = e[s], o = e[s + 1], i = e[s + 2];
27
+ r[s] = t[0] * a + t[4] * o + t[8] * i + t[12], r[s + 1] = t[1] * a + t[5] * o + t[9] * i + t[13], r[s + 2] = t[2] * a + t[6] * o + t[10] * i + t[14];
28
+ }
29
+ }
30
+ function M(r, e, t, s, a, o, i, d, h = [0, 0, 0]) {
31
+ for (let n = 0; n < a; n++) {
32
+ const y = n * Math.PI * 2 / a, c = (t + n) * 3;
33
+ r[c] = h[0], r[c + 1] = h[1], r[c + 2] = h[2], r[c + i] += Math.cos(y) * o, r[c + d] += Math.sin(y) * o, e[s + n * 2] = t + n, e[s + n * 2 + 1] = t + (n + 1) % a;
34
+ }
35
+ }
36
+ class k {
37
+ /** @internal */
38
+ constructor(e, t, s = null) {
39
+ if (this._app = e, this._scene = t, !e || typeof e.createGeometry != "function" || typeof e.createMaterial != "function" || e.destroyed)
40
+ throw new l("destroyed", "[Nova3D] Helper requires a live app.");
41
+ if (!(t instanceof f) || t.destroyed)
42
+ throw new l("invalid-option", "[Nova3D] Helper requires a live scene.");
43
+ this._target = s, this.root = t.createGroup({ pickable: !1 }), this._detach = e._own(() => this.destroy());
44
+ }
45
+ /** Root group of the helper; tracked helpers write world-space lines, so keep it at identity. */
46
+ root;
47
+ /** @internal */
48
+ _parts = [];
49
+ /**
50
+ * Node whose pose or bounds the lines follow; null for static helpers.
51
+ * @internal
52
+ */
53
+ _target;
54
+ _destroyed = !1;
55
+ _detach;
56
+ get visible() {
57
+ return !this._destroyed && this.root.visible;
58
+ }
59
+ get destroyed() {
60
+ return this._destroyed;
61
+ }
62
+ /** Recomputes lines from the tracked object; a no-op for static helpers. */
63
+ update() {
64
+ this._assertAlive(), this._refresh();
65
+ }
66
+ setVisible(e) {
67
+ if (this._assertAlive(), typeof e != "boolean")
68
+ throw new l("invalid-option", "[Nova3D] Helper visibility must be boolean.");
69
+ this.root.setVisible(e);
70
+ }
71
+ /** Releases the helper's own nodes, geometry and materials, never the tracked object. */
72
+ destroy() {
73
+ if (!this._destroyed) {
74
+ this._destroyed = !0, this._detach(), !this.root.destroyed && !this._scene.destroyed && this.root.destroy();
75
+ for (const e of this._parts)
76
+ !e.mesh.destroyed && !this._scene.destroyed && e.mesh.destroy(), e.geometry.destroyed || e.geometry.destroy(), e.material.destroyed || e.material.destroy();
77
+ this._parts.length = 0;
78
+ }
79
+ }
80
+ /**
81
+ * Runs construction and releases everything already created when it throws.
82
+ * @internal
83
+ */
84
+ _build(e) {
85
+ try {
86
+ e();
87
+ } catch (t) {
88
+ throw this.destroy(), t;
89
+ }
90
+ }
91
+ /** @internal */
92
+ _addPart(e, t, s, a) {
93
+ const o = this._app.createGeometry({ positions: e, indices: t, topology: "lines", usage: a });
94
+ let i;
95
+ try {
96
+ i = this._app.createMaterial({ type: "basic", color: s });
97
+ const d = this._scene.createMesh({ geometry: o, material: i, pickable: !1 });
98
+ d.reparent(this.root);
99
+ const h = { geometry: o, material: i, mesh: d, positions: e, columns: { positions: e } };
100
+ return this._parts.push(h), h;
101
+ } catch (d) {
102
+ throw i?.destroy(), o.destroy(), d;
103
+ }
104
+ }
105
+ /** @internal */
106
+ _refresh() {
107
+ if (this._target?.destroyed)
108
+ throw new l("destroyed", "[Nova3D] Helper target is destroyed.");
109
+ this._track();
110
+ }
111
+ /**
112
+ * Rewrites the lines from the target; static helpers draw once and keep them.
113
+ * @internal
114
+ */
115
+ _track() {
116
+ }
117
+ /** @internal */
118
+ _assertAlive() {
119
+ if (this._destroyed)
120
+ throw new l("destroyed", "[Nova3D] Helper is destroyed.");
121
+ }
122
+ }
123
+ export {
124
+ k as N,
125
+ g as a,
126
+ N as b,
127
+ m as h,
128
+ D as s,
129
+ H as t,
130
+ M as w
131
+ };