@nova-lab/core 1.0.0-dev.19 → 1.1.1-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 +229 -4
package/dist/3d.d.ts ADDED
@@ -0,0 +1,40 @@
1
+ export { Nova3DError } from './features/3d/Errors.js';
2
+ export type { Nova3DErrorCode, Nova3DErrorOptions, Nova3DWarning, Nova3DWarningCode } from './features/3d/Errors.js';
3
+ export { Nova3DModel, Nova3DModelAsset } from './features/3d/import/ModelAsset.js';
4
+ export type { CloneModelOptions3D, InstantiateOptions3D } from './features/3d/import/ModelAsset.js';
5
+ export type { Limits3D } from './features/3d/loaders/Limits.js';
6
+ export { Nova3DCamera } from './features/3d/model/Camera.js';
7
+ export { Nova3DEnvironment } from './features/3d/model/Environment.js';
8
+ export type { EnvironmentOptions3D } from './features/3d/model/Environment.js';
9
+ export { Nova3DGeometry } from './features/3d/model/Geometry.js';
10
+ export { Nova3DInstancedMesh } from './features/3d/model/InstancedMesh.js';
11
+ export type { InstancedMeshOptions3D } from './features/3d/model/InstancedMesh.js';
12
+ export { Nova3DLight } from './features/3d/model/Light.js';
13
+ export type { AmbientLightOptions3D, DirectionalLightOptions3D, HemisphereLightOptions3D, LightKind3D, LightProbeOptions3D, PointLightOptions3D, SpotLightOptions3D } from './features/3d/model/Light.js';
14
+ export type { LightPatch3D, LightShadowOptions3D } from './features/3d/model/Light.js';
15
+ export { Nova3DLOD } from './features/3d/model/LOD.js';
16
+ export type { LODLevel3D, LODOptions3D } from './features/3d/model/LOD.js';
17
+ export { Nova3DMaterial } from './features/3d/model/Material.js';
18
+ export type { DepthMaterialOptions3D, LambertMaterialOptions3D, LineMaterialOptions3D, LitMaterialOptions3D, MatcapMaterialOptions3D, MaterialOptions3D, MaterialPatch3D, NormalMaterialOptions3D, PBRMaterialOptions3D, PhongMaterialOptions3D, ShaderMaterialOptions3D, ShaderUniformValue3D, ShaderWGSL3D, ToonMaterialOptions3D } from './features/3d/model/Material.js';
19
+ export type { AnisotropyOptions3D, ClearcoatOptions3D, IridescenceOptions3D, PBRExtensionOptions3D, SheenOptions3D, SpecularOptions3D, TextureReference3D, TransmissionOptions3D } from './features/3d/model/MaterialExtensions.js';
20
+ export { Nova3DMesh } from './features/3d/model/Mesh.js';
21
+ export type { Hit3D, MeshOptions3D, MeshShadowOptions3D } from './features/3d/model/Mesh.js';
22
+ export { Nova3DNode } from './features/3d/model/Node.js';
23
+ export type { ReparentOptions3D } from './features/3d/model/Node.js';
24
+ export { Nova3DReflectionProbe } from './features/3d/model/ReflectionProbe.js';
25
+ export type { ReflectionProbeOptions3D } from './features/3d/model/ReflectionProbe.js';
26
+ export { Nova3DRenderTarget } from './features/3d/model/RenderTarget.js';
27
+ export type { RenderTargetOptions3D } from './features/3d/model/RenderTarget.js';
28
+ export { Nova3DScene } from './features/3d/model/Scene.js';
29
+ export type { RaycastOptions3D, SpatialIndexOptions3D } from './features/3d/model/Scene.js';
30
+ export { Nova3DTexture } from './features/3d/model/Texture.js';
31
+ export type { ImageTextureOptions3D, ImageTextureSource3D, TextureMinFilter3D, TextureOptions3D, TextureSamplerOptions3D } from './features/3d/model/Texture.js';
32
+ export { createApp, createAppAsync, Nova3DApp } from './features/3d/Nova3DApp.js';
33
+ export type { AppOptions3D, AppSize3D, AsyncAppOptions3D, CanvasSizeOptions3D, ContextState3D, DestroyOptions3D, DiagnosticsSnapshot3D, Error3D, FrameSubmission3D, ImageExportOptions3D, Input3D, RendererOptions3D, ResizeOptions3D, SceneOptions3D, Update3D, View3D, ViewClear3D, Viewport3D } from './features/3d/Nova3DApp.js';
34
+ export type { TextureLoadOptions3D } from './features/3d/services/TextureLoader.js';
35
+ export type { ToneMapping3D } from './features/3d/services/ToneMapping.js';
36
+ export { boxGeometry, capsuleGeometry, circleGeometry, coneGeometry, cylinderGeometry, dodecahedronGeometry, icosahedronGeometry, octahedronGeometry, planeGeometry, ringGeometry, sphereGeometry, tetrahedronGeometry, torusGeometry } from './features/3d/tools/Primitives.js';
37
+ export type { BoxGeometryOptions3D, CapsuleGeometryOptions3D, CircleGeometryOptions3D, ConeGeometryOptions3D, CylinderGeometryOptions3D, PlaneGeometryOptions3D, PolyhedronGeometryOptions3D, RingGeometryOptions3D, SphereGeometryOptions3D, TorusGeometryOptions3D } from './features/3d/tools/Primitives.js';
38
+ export type { ReadyOptions3D } from './features/3d/tools/Ready.js';
39
+ export type { BackgroundOptions3D, BasicMaterialOptions3D, Bounds3D, CameraPatch3D, Clock3D, Color3D, DepthPoint3D, FogOptions3D, GeometryColumns3D, GeometryOptions3D, MaterialRenderOptions3D, Matrix3D, NodeOptions3D, OrthographicCameraOptions3D, OrthographicProjection3D, PerspectiveCameraOptions3D, PerspectiveProjection3D, ProjectedPoint3D, Quaternion3D, Ray3D, RGB3D, RGBA3D, ScreenPoint3D, ScreenSize3D, SpriteSheet3D, TextureTransform3D, Transform3D, TransformPatch3D, Vector3D, VertexPatch3D, } from './features/3d/types.js';
40
+ export type { Backend3D, BackendFeatures3D, BackendRequest3D } from './features/3d/webgpu/Features.js';
package/dist/3d.js ADDED
@@ -0,0 +1,44 @@
1
+ import { N as a } from "./Errors-B2ekO9bZ.js";
2
+ import { a as s, N as t } from "./TextureLoader-CfDzdy2m.js";
3
+ import { N as m, c as p, b as v, d as D, a as n } from "./Scene-CDfNgf9I.js";
4
+ import { N as c, i as G, j as d, k as x, m as f, n as i, q as h, t as l, u as A, v as M, w as u, x as b, y as g, z as E, A as L, B as R, D as T, E as j } from "./3d-B4jWF8Qb.js";
5
+ import { N as q } from "./Geometry-DytO490z.js";
6
+ import { N as z } from "./InstancedMesh-DPrgrw5z.js";
7
+ import { N as C } from "./Material-BpfLPmK9.js";
8
+ import { N as O } from "./Mesh-BaRxAAJq.js";
9
+ import { N as S } from "./Node-QfgAE2_v.js";
10
+ import { N as H } from "./Texture-dTKMlTpK.js";
11
+ export {
12
+ c as Nova3DApp,
13
+ m as Nova3DCamera,
14
+ G as Nova3DEnvironment,
15
+ a as Nova3DError,
16
+ q as Nova3DGeometry,
17
+ z as Nova3DInstancedMesh,
18
+ p as Nova3DLOD,
19
+ v as Nova3DLight,
20
+ C as Nova3DMaterial,
21
+ O as Nova3DMesh,
22
+ s as Nova3DModel,
23
+ t as Nova3DModelAsset,
24
+ S as Nova3DNode,
25
+ D as Nova3DReflectionProbe,
26
+ d as Nova3DRenderTarget,
27
+ n as Nova3DScene,
28
+ H as Nova3DTexture,
29
+ x as boxGeometry,
30
+ f as capsuleGeometry,
31
+ i as circleGeometry,
32
+ h as coneGeometry,
33
+ l as createApp,
34
+ A as createAppAsync,
35
+ M as cylinderGeometry,
36
+ u as dodecahedronGeometry,
37
+ b as icosahedronGeometry,
38
+ g as octahedronGeometry,
39
+ E as planeGeometry,
40
+ L as ringGeometry,
41
+ R as sphereGeometry,
42
+ T as tetrahedronGeometry,
43
+ j as torusGeometry
44
+ };
@@ -0,0 +1,44 @@
1
+ import { N as u } from "./Errors-B2ekO9bZ.js";
2
+ /*! Port of three.js examples/jsm/math/Capsule.js (MIT License, Copyright © 2010-2025 three.js authors). */
3
+ class l {
4
+ start;
5
+ end;
6
+ radius;
7
+ /** @internal */
8
+ constructor(t = [0, 0, 0], r = [0, 1, 0], s = 1) {
9
+ if (!(s >= 0))
10
+ throw new u("invalid-option", "[Nova3D] Capsule radius must be a non-negative number.");
11
+ this.start = Float64Array.of(t[0], t[1], t[2]), this.end = Float64Array.of(r[0], r[1], r[2]), this.radius = s;
12
+ }
13
+ /** Replaces both points and the radius. */
14
+ set(t, r, s) {
15
+ return this.start[0] = t[0], this.start[1] = t[1], this.start[2] = t[2], this.end[0] = r[0], this.end[1] = r[1], this.end[2] = r[2], this.radius = s, this;
16
+ }
17
+ copy(t) {
18
+ return this.set(t.start, t.end, t.radius);
19
+ }
20
+ /** Middle of the segment into `out`. */
21
+ getCenter(t = new Float64Array(3)) {
22
+ return t[0] = (this.start[0] + this.end[0]) * 0.5, t[1] = (this.start[1] + this.end[1]) * 0.5, t[2] = (this.start[2] + this.end[2]) * 0.5, t;
23
+ }
24
+ /** Moves both points by `offset` (scaled by `scale`). */
25
+ translate(t, r = 1) {
26
+ const s = t[0] * r, n = t[1] * r, i = t[2] * r;
27
+ return this.start[0] += s, this.start[1] += n, this.start[2] += i, this.end[0] += s, this.end[1] += n, this.end[2] += i, this;
28
+ }
29
+ /** Conservative test against an axis-aligned box `[minX, minY, minZ, maxX, maxY, maxZ]` at `offset`. */
30
+ intersectsBox(t, r = 0) {
31
+ const s = this.start, n = this.end, i = this.radius;
32
+ return e(s[0], s[1], n[0], n[1], t[r], t[r + 3], t[r + 1], t[r + 4], i) && e(s[0], s[2], n[0], n[2], t[r], t[r + 3], t[r + 2], t[r + 5], i) && e(s[1], s[2], n[1], n[2], t[r + 1], t[r + 4], t[r + 2], t[r + 5], i);
33
+ }
34
+ }
35
+ function e(a, t, r, s, n, i, c, d, h) {
36
+ return (n - a < h || n - r < h) && (a - i < h || r - i < h) && (c - t < h || c - s < h) && (t - d < h || s - d < h);
37
+ }
38
+ function N(a, t, r) {
39
+ return new l(a, t, r);
40
+ }
41
+ export {
42
+ l as N,
43
+ N as c
44
+ };
@@ -0,0 +1,204 @@
1
+ import { N as m } from "./Errors-B2ekO9bZ.js";
2
+ import { c as F, o as x } from "./Options-CajE7LLJ.js";
3
+ import { z as T } from "./Node-QfgAE2_v.js";
4
+ const _ = x({ name: !0, duration: !0, tracks: !0 }), j = x({ target: !0, channel: !0, times: !0, values: !0, interpolation: !0, valueSize: !0 });
5
+ class N {
6
+ name;
7
+ duration;
8
+ _tracks;
9
+ /** @internal */
10
+ constructor(e, a, l) {
11
+ this.name = e, this.duration = a, this._tracks = l, Object.freeze(this);
12
+ }
13
+ /** @internal */
14
+ static _create(e) {
15
+ F(e, _, "animation clip");
16
+ for (const n of Array.isArray(e.tracks) ? e.tracks : [])
17
+ F(n, j, "animation track");
18
+ if (!Number.isFinite(e.duration) || e.duration < 0 || e.duration > 1e9 || !Array.isArray(e.tracks) || e.tracks.length > 1024)
19
+ throw new m("invalid-option", "[Nova3D] Clip requires duration0..1e9 seconds and at most1024 tracks.");
20
+ if (e.name !== void 0 && typeof e.name != "string")
21
+ throw new m("invalid-option", "[Nova3D] Clip name must be a string.");
22
+ const a = e.name ?? "", l = e.duration;
23
+ let s = 0;
24
+ const t = /* @__PURE__ */ new Map(), o = Object.freeze(e.tracks.map((n) => {
25
+ const h = n.interpolation ?? "linear";
26
+ if (typeof n.target != "string" || !n.target || !["position", "quaternion", "scale", "weights"].includes(n.channel) || !["step", "linear", "cubic-spline"].includes(h))
27
+ throw new m("invalid-option", "[Nova3D] Invalid animation target/channel/interpolation.");
28
+ const c = n.channel === "quaternion" ? 4 : n.channel === "weights" ? n.valueSize : 3;
29
+ if (c === void 0 || !Number.isInteger(c) || c < 1 || c > 8 || n.valueSize !== void 0 && n.valueSize !== c)
30
+ throw new m("invalid-option", "[Nova3D] Invalid track valueSize; morph weights support up to8 targets.");
31
+ if (!(Array.isArray(n.times) || n.times instanceof Float32Array || n.times instanceof Float64Array) || !(Array.isArray(n.values) || n.values instanceof Float32Array || n.values instanceof Float64Array) || !n.times.length || n.values.length !== n.times.length * c * (h === "cubic-spline" ? 3 : 1))
32
+ throw new m("invalid-option", "[Nova3D] Animation sample columns have incompatible lengths.");
33
+ if (s += (n.times.length + n.values.length) * 8, s > 64 * 1024 * 1024)
34
+ throw new m("invalid-option", "[Nova3D] Clip sample columns exceed64MiB.");
35
+ const f = t.get(n.target) ?? /* @__PURE__ */ new Set();
36
+ if (f.has(n.channel))
37
+ throw new m("invalid-option", "[Nova3D] A clip cannot define the same target/channel twice.");
38
+ if (f.add(n.channel), t.set(n.target, f), !Array.from(n.times).every((i) => typeof i == "number" && Number.isFinite(i)) || !Array.from(n.values).every((i) => typeof i == "number" && Number.isFinite(Math.fround(i))))
39
+ throw new m("invalid-option", "[Nova3D] Animation samples must be finite numbers without coercion.");
40
+ const u = Float64Array.from(n.times), p = Float64Array.from(n.values);
41
+ for (let i = 0; i < u.length; i++)
42
+ if (!Number.isFinite(u[i]) || u[i] < 0 || u[i] > e.duration || i > 0 && u[i] <= u[i - 1])
43
+ throw new m("invalid-option", "[Nova3D] Key times must increase strictly within clip duration.");
44
+ if (!p.every((i) => Number.isFinite(Math.fround(i))))
45
+ throw new m("invalid-option", "[Nova3D] Key values must fit finite Float32.");
46
+ if (n.channel === "quaternion")
47
+ for (let i = 0; i < u.length; i++) {
48
+ const d = (i * (h === "cubic-spline" ? 3 : 1) + (h === "cubic-spline" ? 1 : 0)) * 4, A = Math.hypot(...p.subarray(d, d + 4));
49
+ if (Math.abs(A - 1) > 1e-3)
50
+ throw new m("invalid-option", "[Nova3D] Quaternion keys must be normalized.");
51
+ }
52
+ return Object.freeze({ target: n.target, channel: n.channel, times: u, values: p, interpolation: h, size: c });
53
+ }));
54
+ return new N(a, l, o);
55
+ }
56
+ /** @internal */
57
+ static _derive(e, a, l) {
58
+ return new N(e, a, l);
59
+ }
60
+ /** @internal */
61
+ static _bind(e, a) {
62
+ const l = e._tracks.flatMap((s) => {
63
+ const t = a(s.target, s.channel);
64
+ return (t === void 0 ? [] : typeof t == "string" ? [t] : t).map((n) => Object.freeze({ ...s, target: n }));
65
+ });
66
+ return new N(e.name, e.duration, Object.freeze(l));
67
+ }
68
+ /** @internal */
69
+ _readTracks() {
70
+ return this._tracks;
71
+ }
72
+ }
73
+ function W(r) {
74
+ return N._create(r);
75
+ }
76
+ const K = x({ reference: !0, referenceTime: !0, name: !0 });
77
+ function G(r, e = {}) {
78
+ if (F(e, K, "additive clip"), !(r instanceof N))
79
+ throw new m("invalid-option", "[Nova3D] toAdditiveClip requires an animation clip.");
80
+ const a = e.reference ?? r;
81
+ if (!(a instanceof N))
82
+ throw new m("invalid-option", "[Nova3D] Additive reference must be an animation clip.");
83
+ const l = e.referenceTime ?? 0;
84
+ if (typeof l != "number" || !Number.isFinite(l) || l < 0 || l > a.duration)
85
+ throw new m("invalid-option", "[Nova3D] Additive reference time must lie within the reference clip.");
86
+ if (e.name !== void 0 && typeof e.name != "string")
87
+ throw new m("invalid-option", "[Nova3D] Clip name must be a string.");
88
+ const s = Object.freeze(r._readTracks().map((t) => {
89
+ const o = a._readTracks().find((u) => u.target === t.target && u.channel === t.channel);
90
+ if (!o || o.size !== t.size)
91
+ throw new m("invalid-option", "[Nova3D] Additive reference lacks a matching target/channel track.");
92
+ const n = S(o, l), h = t.values.slice(), c = t.interpolation === "cubic-spline", f = t.size * (c ? 3 : 1);
93
+ for (let u = 0; u < t.times.length; u++)
94
+ if (t.channel === "quaternion")
95
+ for (let p = 0; p < (c ? 3 : 1); p++)
96
+ O(n, h, u * f + p * 4);
97
+ else {
98
+ const p = u * f + (c ? t.size : 0);
99
+ for (let i = 0; i < t.size; i++)
100
+ h[p + i] -= n[i];
101
+ }
102
+ for (let u = 0; u < h.length; u++)
103
+ if (!Number.isFinite(Math.fround(h[u])))
104
+ throw new m("invalid-option", "[Nova3D] Additive samples must fit finite Float32.");
105
+ return Object.freeze({ ...t, values: h });
106
+ }));
107
+ return N._derive(e.name ?? r.name, r.duration, s);
108
+ }
109
+ function O(r, e, a) {
110
+ const l = -r[0], s = -r[1], t = -r[2], o = r[3], n = e[a], h = e[a + 1], c = e[a + 2], f = e[a + 3];
111
+ e[a] = o * n + l * f + s * c - t * h, e[a + 1] = o * h - l * c + s * f + t * n, e[a + 2] = o * c + l * h - s * n + t * f, e[a + 3] = o * f - l * n - s * h - t * c;
112
+ }
113
+ function S(r, e) {
114
+ return I(r, e, new Float64Array(r.size));
115
+ }
116
+ const q = /* @__PURE__ */ new WeakMap();
117
+ function H(r) {
118
+ let e = null;
119
+ if (r.channel === "quaternion" && r.interpolation === "linear") {
120
+ const a = r.values;
121
+ if (e = q.get(a) ?? null, !e) {
122
+ const l = a.length / 4;
123
+ e = new Float64Array(Math.max(0, l - 1) * 4);
124
+ for (let s = 0; s + 1 < l; s++) {
125
+ const t = s * 4, o = t + 4;
126
+ let n = 0;
127
+ for (let f = 0; f < 4; f++)
128
+ n += a[t + f] * a[o + f];
129
+ const h = n < 0 ? -1 : 1;
130
+ n = Math.min(1, Math.abs(n));
131
+ const c = Math.acos(n);
132
+ e[s * 4] = h, e[s * 4 + 1] = n, e[s * 4 + 2] = c, e[s * 4 + 3] = Math.sin(c);
133
+ }
134
+ q.set(a, e);
135
+ }
136
+ }
137
+ return { key: 0, slerp: e };
138
+ }
139
+ function C(r, e, a) {
140
+ const l = r.length - 1;
141
+ if (a) {
142
+ let o = a.key;
143
+ if (o < l && r[o + 1] <= e && o++, o <= l && r[o] <= e && (o === l || r[o + 1] > e))
144
+ return o;
145
+ }
146
+ let s = 0, t = l;
147
+ for (; s < t; ) {
148
+ const o = Math.ceil((s + t) / 2);
149
+ r[o] <= e ? s = o : t = o - 1;
150
+ }
151
+ return s;
152
+ }
153
+ function I(r, e, a, l) {
154
+ if (!Number.isFinite(e))
155
+ throw new m("invalid-option", "[Nova3D] Sample time must be finite.");
156
+ const s = r.times, t = r.values, o = r.size, n = r.interpolation, h = C(s, e, l);
157
+ l && (l.key = h);
158
+ const c = e <= s[0] ? 0 : h, f = Math.min(c + 1, s.length - 1), u = o * (n === "cubic-spline" ? 3 : 1), p = c * u + (n === "cubic-spline" ? o : 0);
159
+ if (c === f || e <= s[0] || n === "step")
160
+ for (let i = 0; i < o; i++)
161
+ a[i] = t[p + i];
162
+ else {
163
+ const i = s[f] - s[c], d = Math.max(0, Math.min(1, (e - s[c]) / i)), A = f * u + (n === "cubic-spline" ? o : 0);
164
+ if (n === "cubic-spline") {
165
+ const v = d * d, g = v * d, w = 2 * g - 3 * v + 1, z = g - 2 * v + d, M = -2 * g + 3 * v, D = g - v;
166
+ for (let b = 0; b < o; b++)
167
+ a[b] = w * t[p + b] + z * i * t[p + o + b] + M * t[A + b] + D * i * t[A - o + b];
168
+ } else if (r.channel === "quaternion") {
169
+ const v = l?.slerp;
170
+ let g, w, z, M;
171
+ if (v)
172
+ g = v[c * 4], w = v[c * 4 + 1], z = v[c * 4 + 2], M = v[c * 4 + 3];
173
+ else {
174
+ w = 0;
175
+ for (let y = 0; y < 4; y++)
176
+ w += t[p + y] * t[A + y];
177
+ g = w < 0 ? -1 : 1, w = Math.min(1, Math.abs(w)), z = Math.acos(w), M = Math.sin(z);
178
+ }
179
+ const D = w > 0.9995 ? 1 - d : Math.sin((1 - d) * z) / M, b = w > 0.9995 ? d : Math.sin(d * z) / M;
180
+ for (let y = 0; y < 4; y++)
181
+ a[y] = D * t[p + y] + b * g * t[A + y];
182
+ } else
183
+ for (let v = 0; v < o; v++)
184
+ a[v] = t[p + v] * (1 - d) + t[A + v] * d;
185
+ }
186
+ if (r.channel === "quaternion") {
187
+ const i = T(a[0], a[1], a[2], a[3]);
188
+ if (i < 1e-12 || !Number.isFinite(i))
189
+ throw new m("invalid-option", "[Nova3D] Sampled quaternion is singular.");
190
+ for (let d = 0; d < 4; d++)
191
+ a[d] /= i;
192
+ }
193
+ for (let i = 0; i < o; i++)
194
+ if (!Number.isFinite(Math.fround(a[i])))
195
+ throw new m("invalid-option", "[Nova3D] Animation sample exceeds finite Float32 range.");
196
+ return a;
197
+ }
198
+ export {
199
+ N,
200
+ G as a,
201
+ W as c,
202
+ I as s,
203
+ H as t
204
+ };
@@ -0,0 +1,34 @@
1
+ import { N as f } from "./Errors-B2ekO9bZ.js";
2
+ const i = { white: "#ffffff", black: "#000000", red: "#ff0000", green: "#008000", blue: "#0000ff", transparent: "#00000000" };
3
+ function c(r, n = [1, 1, 1, 1]) {
4
+ if (r === void 0)
5
+ return [...n];
6
+ if (Array.isArray(r)) {
7
+ if (r.length !== 3 && r.length !== 4 || !r.every((o) => typeof o == "number" && Number.isFinite(o)))
8
+ throw new f("invalid-option", "[Nova3D] Color requires three or four normalized sRGB components.");
9
+ if (!r.every((o) => o >= 0 && o <= 1))
10
+ throw new f("invalid-option", "[Nova3D] Color components must be in [0, 1].");
11
+ return [r[0], r[1], r[2], r.length === 4 ? r[3] : 1];
12
+ }
13
+ const t = typeof r == "string" ? i[r.toLowerCase()] ?? r : "", a = /^#([\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.exec(t);
14
+ if (!a)
15
+ throw new f("invalid-option", "[Nova3D] Use normalized sRGB components or a hex color; convert other colors with TypedWorks Color.");
16
+ let e = a[1];
17
+ return e.length < 5 && (e = Array.from(e, (o) => o + o).join("")), e.length === 6 && (e += "ff"), [0, 2, 4, 6].map((o) => Number.parseInt(e.slice(o, o + 2), 16) / 255);
18
+ }
19
+ function l(r, n = [1, 1, 1]) {
20
+ const t = c(r, [n[0], n[1], n[2], 1]);
21
+ return [t[0], t[1], t[2]];
22
+ }
23
+ function s(r) {
24
+ return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
25
+ }
26
+ function m(r) {
27
+ return [s(r[0]), s(r[1]), s(r[2])];
28
+ }
29
+ export {
30
+ l as a,
31
+ m as b,
32
+ s as l,
33
+ c as p
34
+ };
@@ -0,0 +1,280 @@
1
+ import { N as f } from "./Errors-B2ekO9bZ.js";
2
+ import { N as A } from "./Mesh-BaRxAAJq.js";
3
+ import { d as B } from "./Node-QfgAE2_v.js";
4
+ function Y(r, t) {
5
+ const i = r.targets ?? [];
6
+ if (typeof r.flatNormals != "boolean" || i.length > 8)
7
+ throw new f("invalid-option", "[Nova3D] Deformation requires flat-normal metadata and at most8 morph targets.");
8
+ if (r.joints === void 0 != (r.weights === void 0))
9
+ throw new f("invalid-option", "[Nova3D] Joint indices and weights must be supplied together.");
10
+ if (r.joints && (!(r.joints instanceof Uint16Array) || !(r.weights instanceof Float32Array) || r.joints.length !== t * 4 || r.weights.length !== t * 4))
11
+ throw new f("invalid-option", "[Nova3D] Skin columns must match four influences per vertex.");
12
+ if (r.joints)
13
+ for (let n = 0; n < t; n++) {
14
+ let m = 0;
15
+ const h = /* @__PURE__ */ new Set();
16
+ for (let d = 0; d < 4; d++) {
17
+ const c = n * 4 + d, v = r.weights[c], _ = r.joints[c];
18
+ if (!Number.isFinite(v) || v < 0 || _ >= 256 || v > 0 && h.has(_))
19
+ throw new f("invalid-option", "[Nova3D] Skin weights must be finite/nonnegative with unique active joints below256.");
20
+ v > 0 && h.add(_), m += v;
21
+ }
22
+ if (Math.abs(m - 1) > 1e-5)
23
+ throw new f("invalid-option", "[Nova3D] Skin weights must sum to1 per vertex.");
24
+ }
25
+ const s = i.length ? Math.min(4096, Math.max(1, t)) : 0, o = i.length ? Math.ceil(t / s) : 0, e = s * o * i.length * 2 * 16;
26
+ if (o > 4096 || e > 64 * 1024 * 1024)
27
+ throw new f("invalid-option", "[Nova3D] Morph atlas exceeds4096 rows or64MiB per geometry.");
28
+ for (const n of i)
29
+ if (!(n.positions instanceof Float32Array) || n.positions.length !== t * 3 || !n.positions.every(Number.isFinite) || n.normals !== void 0 && (!(n.normals instanceof Float32Array) || n.normals.length !== t * 3 || !n.normals.every(Number.isFinite)))
30
+ throw new f("invalid-option", "[Nova3D] Morph deltas must match finite FLOAT VEC3 positions/normals.");
31
+ return Object.freeze({ joints: r.joints?.slice(), weights: r.weights?.slice(), targets: Object.freeze(i.map((n) => Object.freeze({ positions: n.positions.slice(), normals: n.normals?.slice() }))), flatNormals: r.flatNormals, atlasWidth: s, atlasHeight: o, atlasBytes: e });
32
+ }
33
+ function O(r, t) {
34
+ let i = 1;
35
+ if (t.joints)
36
+ for (const e of t.joints)
37
+ i = Math.max(i, e + 1);
38
+ const s = Array.from({ length: i }, () => [1 / 0, 1 / 0, 1 / 0]), o = Array.from({ length: i }, () => [-1 / 0, -1 / 0, -1 / 0]);
39
+ for (let e = 0; e < r.length / 3; e++)
40
+ for (let n = 0; n < (t.joints ? 4 : 1); n++) {
41
+ if (t.weights && t.weights[e * 4 + n] === 0)
42
+ continue;
43
+ const m = t.joints ? t.joints[e * 4 + n] : 0;
44
+ for (let h = 0; h < 3; h++) {
45
+ const d = r[e * 3 + h];
46
+ s[m][h] = Math.min(s[m][h], d), o[m][h] = Math.max(o[m][h], d);
47
+ }
48
+ }
49
+ return s.map((e, n) => e[0] === 1 / 0 ? null : { min: e, max: o[n] });
50
+ }
51
+ function S(r) {
52
+ return r.targets.map((t) => {
53
+ const i = [1 / 0, 1 / 0, 1 / 0], s = [-1 / 0, -1 / 0, -1 / 0];
54
+ for (let o = 0; o < t.positions.length; o++) {
55
+ const e = o % 3;
56
+ i[e] = Math.min(i[e], t.positions[o]), s[e] = Math.max(s[e], t.positions[o]);
57
+ }
58
+ return { min: i.map((o) => Number.isFinite(o) ? o : 0), max: s.map((o) => Number.isFinite(o) ? o : 0) };
59
+ });
60
+ }
61
+ const q = B(), C = [0, 0, 0], z = [0, 0, 0];
62
+ function R(r, t, i, s) {
63
+ const o = i[0], e = i[1], n = i[2], m = i[3], h = i[4], d = i[5], c = i[6], v = i[7], _ = i[8], I = i[9], l = i[10], a = i[11], p = i[12], u = i[13], j = i[14], N = i[15];
64
+ let F = !0;
65
+ for (let w = t; w < t + 16; w += 4) {
66
+ const P = s[w], b = s[w + 1], x = s[w + 2], g = s[w + 3], D = Math.fround(o * P + h * b + _ * x + p * g), k = Math.fround(e * P + d * b + I * x + u * g), y = Math.fround(n * P + c * b + l * x + j * g), M = Math.fround(m * P + v * b + a * x + N * g);
67
+ r[w] = D, r[w + 1] = k, r[w + 2] = y, r[w + 3] = M, F &&= Number.isFinite(D) && Number.isFinite(k) && Number.isFinite(y) && Number.isFinite(M);
68
+ }
69
+ return F;
70
+ }
71
+ class Z extends A {
72
+ _data;
73
+ _skin;
74
+ _weights;
75
+ _weightPose;
76
+ _weightOwner;
77
+ _palette = new Float32Array(0);
78
+ /** World version of each joint when its palette entry was written (-1: never). */
79
+ _paletteVersions = new Float64Array(0);
80
+ _poseVersion = 0;
81
+ _dirtyPose = !0;
82
+ _geometryVersion = -1;
83
+ _influence = [];
84
+ _deltas;
85
+ _worldBounds = null;
86
+ /** The one record behind `_worldBounds`, rewritten in place. */
87
+ _boundsRecord;
88
+ _spatialPositions;
89
+ _spatialVersion = -1;
90
+ _pose = { version: 0, palette: new Float32Array(0), weights: new Float64Array(0), flatNormals: !1 };
91
+ /** @internal */
92
+ constructor(t, i, s, o) {
93
+ const e = i.geometry._readDeformation();
94
+ if (!e)
95
+ throw new f("invalid-option", "[Nova3D] Deformed mesh requires imported deformation columns.");
96
+ if (s) {
97
+ if (!e.joints || s.joints.length < 1 || s.joints.length > 256 || s.inverseBindMatrices.length !== s.joints.length * 16 || !s.inverseBindMatrices.every(Number.isFinite) || s.joints.some((n) => n.scene !== t || n.destroyed))
98
+ throw new f("owner", "[Nova3D] Skin requires live same-scene joints and matching finite inverse binds.");
99
+ for (const n of e.joints)
100
+ if (n >= s.joints.length)
101
+ throw new f("invalid-option", "[Nova3D] Vertex references a joint outside this skin.");
102
+ }
103
+ if (o.length !== e.targets.length || !o.every((n) => Number.isFinite(Math.fround(n))))
104
+ throw new f("invalid-option", "[Nova3D] Morph weights must match the geometry targets.");
105
+ super(t, i), this._data = e, this._skin = s ? { joints: Object.freeze([...s.joints]), inverseBindMatrices: s.inverseBindMatrices } : void 0, this._weights = Float64Array.from(o), this._deltas = S(e), this._skin && (this._palette = new Float32Array(this._skin.joints.length * 16), this._paletteVersions = new Float64Array(this._skin.joints.length).fill(-1)), t._attachDeformed(this, this._skin?.joints ?? []);
106
+ }
107
+ setGeometry(t) {
108
+ if (t !== this.geometry)
109
+ throw new f("state", "[Nova3D] Imported deformation geometry is fixed for this model primitive.");
110
+ super.setGeometry(t);
111
+ }
112
+ /** Skin joints and inverse binds, and the base morph weights, for exporters. @internal */
113
+ _readRig() {
114
+ return { skin: this._skin, weights: this._weights, data: this._data };
115
+ }
116
+ /** @internal */
117
+ _markDeformationDirty(t = !0) {
118
+ this._dirtyPose = !0, this.scene._boundsChanged(this, t);
119
+ }
120
+ /** @internal */
121
+ _hasSkin() {
122
+ return this._skin !== void 0;
123
+ }
124
+ /** @internal */
125
+ _readMorphBase() {
126
+ return this._weights.slice();
127
+ }
128
+ /** Копирует текущие morph values в собственную базу нового instance. @internal */
129
+ _copyMorphFrom(t) {
130
+ this._weights.set(t._weightPose ?? t._weights), this._markDeformationDirty();
131
+ }
132
+ /** @internal */
133
+ _canClaimMorph(t) {
134
+ return !this.destroyed && this._data.targets.length > 0 && (!this._weightOwner || this._weightOwner === t);
135
+ }
136
+ /** @internal */
137
+ _claimMorph(t) {
138
+ if (!this._canClaimMorph(t))
139
+ throw new f("owner", "[Nova3D] Morph weights already have another owner.");
140
+ this._weightOwner = t;
141
+ }
142
+ /** @internal */
143
+ _applyMorph(t, i) {
144
+ if (this._weightOwner !== t)
145
+ throw new f("owner", "[Nova3D] Morph pose requires its channel owner.");
146
+ if (i && (i.length !== this._weights.length || !i.every((e) => Number.isFinite(Math.fround(e)))))
147
+ throw new f("invalid-option", "[Nova3D] Invalid morph pose.");
148
+ const s = this._weightPose ?? this._weights, o = i ?? this._weights;
149
+ s.every((e, n) => e === o[n]) || (this._weightPose = i?.slice(), this._markDeformationDirty());
150
+ }
151
+ /** @internal */
152
+ _releaseMorph(t) {
153
+ this._weightOwner === t && (this._applyMorph(t, void 0), this._weightOwner = void 0);
154
+ }
155
+ /** @internal */
156
+ _readDeformationPose() {
157
+ return this._prepareDeformation(), { version: this._poseVersion, palette: this._palette, weights: this._weightPose ?? this._weights, flatNormals: this._data.flatNormals };
158
+ }
159
+ /** The pose of `_readDeformationPose` in one record reused across calls (per-frame readers). @internal */
160
+ _poseRecord() {
161
+ this._prepareDeformation();
162
+ const t = this._pose;
163
+ return t.version = this._poseVersion, t.palette = this._palette, t.weights = this._weightPose ?? this._weights, t.flatNormals = this._data.flatNormals, t;
164
+ }
165
+ /** @internal */
166
+ _renderMatrix() {
167
+ return this._skin ? q : this._worldState().matrix;
168
+ }
169
+ /** @internal */
170
+ _ownBounds() {
171
+ return this._prepareDeformation(), this._worldBounds;
172
+ }
173
+ /** @internal */
174
+ _spatialParity(t) {
175
+ if (!this._skin)
176
+ return 1;
177
+ const i = new Float64Array(9);
178
+ for (let _ = 0; _ < 4; _++) {
179
+ const I = t * 4 + _, l = this._data.joints[I] * 16, a = this._data.weights[I];
180
+ for (let p = 0; p < 3; p++)
181
+ for (let u = 0; u < 3; u++)
182
+ i[p * 3 + u] += this._palette[l + p * 4 + u] * a;
183
+ }
184
+ const [s, o, e, n, m, h, d, c, v] = i;
185
+ return s * (m * v - h * c) - n * (o * v - e * c) + d * (o * h - e * m) < 0 ? -1 : 1;
186
+ }
187
+ /** @internal */
188
+ _spatialMatrix() {
189
+ return this._renderMatrix();
190
+ }
191
+ /** @internal */
192
+ _spatialBuffers() {
193
+ this._prepareDeformation();
194
+ const t = this.geometry._buffers();
195
+ if (this._spatialVersion !== this._poseVersion) {
196
+ this._spatialPositions ??= new Float32Array(t.positions.length);
197
+ const i = this._weightPose ?? this._weights;
198
+ for (let s = 0; s < this.geometry.vertexCount; s++) {
199
+ const o = [t.positions[s * 3], t.positions[s * 3 + 1], t.positions[s * 3 + 2]];
200
+ for (let e = 0; e < i.length; e++)
201
+ for (let n = 0; n < 3; n++)
202
+ o[n] += i[e] * this._data.targets[e].positions[s * 3 + n];
203
+ if (this._skin) {
204
+ const e = [0, 0, 0];
205
+ for (let n = 0; n < 4; n++) {
206
+ const m = s * 4 + n, h = this._data.weights[m], d = this._data.joints[m] * 16;
207
+ for (let c = 0; c < 3; c++)
208
+ e[c] += h * (this._palette[d + c] * o[0] + this._palette[d + 4 + c] * o[1] + this._palette[d + 8 + c] * o[2] + this._palette[d + 12 + c]);
209
+ }
210
+ o.splice(0, 3, ...e);
211
+ }
212
+ this._spatialPositions.set(o, s * 3);
213
+ }
214
+ if (!this._spatialPositions.every(Number.isFinite))
215
+ throw new f("invalid-option", "[Nova3D] Deformed picking positions exceed finite Float32.");
216
+ this._spatialVersion = this._poseVersion;
217
+ }
218
+ return { ...t, positions: this._spatialPositions };
219
+ }
220
+ /** @internal */
221
+ _onDestroy() {
222
+ this.scene._detachDeformed(this, this._skin?.joints ?? []), this._spatialPositions = void 0, this._weightPose = void 0, this._weightOwner = void 0, super._onDestroy();
223
+ }
224
+ _prepareDeformation() {
225
+ if (!this._dirtyPose && this._geometryVersion === this.geometry.version)
226
+ return;
227
+ if (this.destroyed)
228
+ throw new f("destroyed", "[Nova3D] Deformed mesh is destroyed.");
229
+ const t = this.geometry._buffers(), i = this._weightPose ?? this._weights;
230
+ if (this._geometryVersion !== this.geometry.version && (this._influence = O(t.positions, this._data)), this._skin) {
231
+ const l = this._palette, a = this._paletteVersions, p = this._skin.inverseBindMatrices, u = this._skin.joints;
232
+ let j = !0;
233
+ for (let N = 0; N < u.length; N++) {
234
+ const F = u[N];
235
+ if (F.destroyed)
236
+ throw new f("destroyed", "[Nova3D] Skin joint is no longer live.");
237
+ const w = F._worldState();
238
+ a[N] !== w.version && (j = R(l, N * 16, w.matrix, p) && j, a[N] = w.version);
239
+ }
240
+ if (!j)
241
+ throw a.fill(-1), new f("invalid-option", "[Nova3D] Skin matrices exceed finite Float32.");
242
+ }
243
+ const s = C.fill(0), o = z.fill(0);
244
+ for (let l = 0; l < i.length; l++)
245
+ for (let a = 0; a < 3; a++) {
246
+ const p = this._deltas[l].min[a] * i[l], u = this._deltas[l].max[a] * i[l];
247
+ s[a] += Math.min(p, u), o[a] += Math.max(p, u);
248
+ }
249
+ let e = 1 / 0, n = 1 / 0, m = 1 / 0, h = -1 / 0, d = -1 / 0, c = -1 / 0;
250
+ const v = this._skin ? null : this._worldState().matrix, _ = v ?? this._palette, I = this._influence;
251
+ for (let l = 0; l < I.length; l++) {
252
+ const a = I[l];
253
+ if (!a)
254
+ continue;
255
+ const p = v ? 0 : l * 16, u = a.min[0] + s[0], j = a.max[0] + o[0], N = a.min[1] + s[1], F = a.max[1] + o[1], w = a.min[2] + s[2], P = a.max[2] + o[2];
256
+ if (!Number.isFinite(Math.fround(u)) || !Number.isFinite(Math.fround(j)) || !Number.isFinite(Math.fround(N)) || !Number.isFinite(Math.fround(F)) || !Number.isFinite(Math.fround(w)) || !Number.isFinite(Math.fround(P)))
257
+ throw new f("invalid-option", "[Nova3D] Morph positions exceed finite Float32 before skinning.");
258
+ for (let b = 0; b < 3; b++) {
259
+ const x = p + b;
260
+ let g = _[x + 12], D = g, k = Math.abs(g), y = _[x] * u, M = _[x] * j;
261
+ g += Math.min(y, M), D += Math.max(y, M), k += Math.max(Math.abs(y), Math.abs(M)), y = _[x + 4] * N, M = _[x + 4] * F, g += Math.min(y, M), D += Math.max(y, M), k += Math.max(Math.abs(y), Math.abs(M)), y = _[x + 8] * w, M = _[x + 8] * P, g += Math.min(y, M), D += Math.max(y, M), k += Math.max(Math.abs(y), Math.abs(M));
262
+ const V = Math.max(1, k) * 2e-5;
263
+ g -= V, D += V, b === 0 ? (e = Math.min(e, g), h = Math.max(h, D)) : b === 1 ? (n = Math.min(n, g), d = Math.max(d, D)) : (m = Math.min(m, g), c = Math.max(c, D));
264
+ }
265
+ }
266
+ if (e === 1 / 0)
267
+ this._worldBounds = null;
268
+ else {
269
+ if (!Number.isFinite(Math.fround(e)) || !Number.isFinite(Math.fround(n)) || !Number.isFinite(Math.fround(m)) || !Number.isFinite(Math.fround(h)) || !Number.isFinite(Math.fround(d)) || !Number.isFinite(Math.fround(c)))
270
+ throw new f("invalid-option", "[Nova3D] Deformed bounds exceed finite Float32.");
271
+ const l = this._boundsRecord ??= { min: [0, 0, 0], max: [0, 0, 0] }, a = l.min, p = l.max;
272
+ a[0] = e, a[1] = n, a[2] = m, p[0] = h, p[1] = d, p[2] = c, this._worldBounds = l;
273
+ }
274
+ this._dirtyPose = !1, this._geometryVersion = this.geometry.version, this._poseVersion++;
275
+ }
276
+ }
277
+ export {
278
+ Z as N,
279
+ Y as c
280
+ };