@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.
- package/README.md +1035 -10
- package/THIRD_PARTY_NOTICES.md +26 -0
- package/dist/2d/accessibility.d.ts +2 -0
- package/dist/2d/accessibility.js +171 -0
- package/dist/2d/commands.d.ts +2 -0
- package/dist/2d/commands.js +80 -0
- package/dist/2d/effects.d.ts +10 -0
- package/dist/2d/effects.js +566 -0
- package/dist/2d/ktx2.d.ts +5 -0
- package/dist/2d/ktx2.js +542 -0
- package/dist/2d/lighting.d.ts +3 -0
- package/dist/2d/lighting.js +495 -0
- package/dist/2d/lottie.d.ts +3 -0
- package/dist/2d/lottie.js +254 -0
- package/dist/2d/meshes.d.ts +4 -0
- package/dist/2d/meshes.js +451 -0
- package/dist/2d/primitives.d.ts +3 -0
- package/dist/2d/primitives.js +85 -0
- package/dist/2d/render-textures.d.ts +3 -0
- package/dist/2d/render-textures.js +539 -0
- package/dist/2d/svg/documents.d.ts +5 -0
- package/dist/2d/svg/documents.js +7 -0
- package/dist/2d/svg/renderer.d.ts +3 -0
- package/dist/2d/svg/renderer.js +222 -0
- package/dist/2d/svg.d.ts +3 -0
- package/dist/2d/svg.js +4 -0
- package/dist/2d/tools.d.ts +2 -0
- package/dist/2d/tools.js +100 -0
- package/dist/2d/video.d.ts +5 -0
- package/dist/2d/video.js +90 -0
- package/dist/2d.d.ts +2 -0
- package/dist/2d.js +220 -0
- package/dist/3d/animation.d.ts +8 -0
- package/dist/3d/animation.js +1396 -0
- package/dist/3d/area-lights.d.ts +2 -0
- package/dist/3d/area-lights.js +19 -0
- package/dist/3d/audio.d.ts +4 -0
- package/dist/3d/audio.js +500 -0
- package/dist/3d/character.d.ts +2 -0
- package/dist/3d/character.js +136 -0
- package/dist/3d/collision.d.ts +3 -0
- package/dist/3d/collision.js +387 -0
- package/dist/3d/commands.d.ts +2 -0
- package/dist/3d/commands.js +108 -0
- package/dist/3d/controls.d.ts +8 -0
- package/dist/3d/controls.js +1041 -0
- package/dist/3d/documents.d.ts +5 -0
- package/dist/3d/documents.js +227 -0
- package/dist/3d/effects.d.ts +5 -0
- package/dist/3d/effects.js +1986 -0
- package/dist/3d/export.d.ts +4 -0
- package/dist/3d/export.js +347 -0
- package/dist/3d/fbx.d.ts +2 -0
- package/dist/3d/fbx.js +784 -0
- package/dist/3d/gltf.d.ts +2 -0
- package/dist/3d/gltf.js +5 -0
- package/dist/3d/helpers.d.ts +5 -0
- package/dist/3d/helpers.js +191 -0
- package/dist/3d/ik.d.ts +9 -0
- package/dist/3d/ik.js +777 -0
- package/dist/3d/loaders.d.ts +17 -0
- package/dist/3d/loaders.js +1406 -0
- package/dist/3d/nodes.d.ts +8 -0
- package/dist/3d/nodes.js +49 -0
- package/dist/3d/particles.d.ts +5 -0
- package/dist/3d/particles.js +1574 -0
- package/dist/3d/physics/backend.d.ts +7 -0
- package/dist/3d/physics/backend.js +1 -0
- package/dist/3d/physics/rapier.d.ts +3 -0
- package/dist/3d/physics/rapier.js +765 -0
- package/dist/3d/physics.d.ts +5 -0
- package/dist/3d/physics.js +3346 -0
- package/dist/3d/splats.d.ts +7 -0
- package/dist/3d/splats.js +862 -0
- package/dist/3d/text.d.ts +5 -0
- package/dist/3d/text.js +1043 -0
- package/dist/3d/tiles.d.ts +24 -0
- package/dist/3d/tiles.js +1705 -0
- package/dist/3d/tools.d.ts +12 -0
- package/dist/3d/tools.js +338 -0
- package/dist/3d/usdz.d.ts +2 -0
- package/dist/3d/usdz.js +634 -0
- package/dist/3d/xr.d.ts +2 -0
- package/dist/3d/xr.js +202 -0
- package/dist/3d-B4jWF8Qb.js +5591 -0
- package/dist/3d.d.ts +40 -0
- package/dist/3d.js +44 -0
- package/dist/Capsule-BFVpZfvc.js +44 -0
- package/dist/Clip-CAN7t03k.js +204 -0
- package/dist/Color-vuv9UnoY.js +34 -0
- package/dist/DeformedMesh-CPi0P_vc.js +280 -0
- package/dist/Document-DCVEZSvM.js +415 -0
- package/dist/Errors-B2ekO9bZ.js +30 -0
- package/dist/Features-BsjmePtc.js +557 -0
- package/dist/GLTFResourceIO-CYJyCUTt.js +124 -0
- package/dist/GPUParticleState-CQlNpoDa.js +545 -0
- package/dist/Geometry-DytO490z.js +227 -0
- package/dist/Inflate-DWw0V-Up.js +42 -0
- package/dist/InstancedMesh-DPrgrw5z.js +527 -0
- package/dist/Limits-Bw5XQdFr.js +20 -0
- package/dist/LineHelper-Ad0z9uDi.js +131 -0
- package/dist/LoaderIO-BwrM84OM.js +114 -0
- package/dist/Material-BpfLPmK9.js +777 -0
- package/dist/Mesh-BaRxAAJq.js +209 -0
- package/dist/Node-QfgAE2_v.js +877 -0
- package/dist/NovaAssetRegistry-p2QlCwvT.js +1168 -0
- package/dist/NovaNode-CBZ-Ol-W.js +2016 -0
- package/dist/NovaRenderCommandWriter-CWQRa42y.js +1949 -0
- package/dist/NovaTextSelectionService-CipuujCT.js +18526 -0
- package/dist/NovaWebGLProgram-BO250QNF.js +97 -0
- package/dist/Options-CajE7LLJ.js +15 -0
- package/dist/PolygonMesh-D4PnnfIo.js +657 -0
- package/dist/Ready-BzyhRtjD.js +21 -0
- package/dist/Scene-CDfNgf9I.js +911 -0
- package/dist/Shader-b6_HDndT.js +48 -0
- package/dist/SplatShader-wJ6GJ3vo.js +130 -0
- package/dist/Texture-dTKMlTpK.js +267 -0
- package/dist/TextureLoader-CfDzdy2m.js +411 -0
- package/dist/Textures-CGL4Kf-8.js +651 -0
- package/dist/ToneMapping-D9IWvN0u.js +46 -0
- package/dist/WebGPURenderer-DjD0IxVC.js +4921 -0
- package/dist/ZipReader-C-MSEsSr.js +84 -0
- package/dist/core.js +218 -24024
- package/dist/domain/types/base.types.d.ts +18 -9
- package/dist/domain/types/component.types.d.ts +5 -5
- package/dist/domain/types/cursor.types.d.ts +1 -1
- package/dist/domain/types/diagnostics.types.d.ts +2 -0
- package/dist/domain/types/export.types.d.ts +2 -2
- package/dist/domain/types/hit-test.types.d.ts +1 -1
- package/dist/domain/types/motion.types.d.ts +2 -2
- package/dist/domain/types/renderer.types.d.ts +88 -4
- package/dist/domain/types/rendering/index.d.ts +29 -4
- package/dist/domain/types/sound.types.d.ts +1 -1
- package/dist/domain/types/theme.types.d.ts +1 -1
- package/dist/domain/utils/bounds.d.ts +1 -1
- package/dist/domain/utils/nova-text.d.ts +9 -0
- package/dist/domain/utils/schemaBounds.d.ts +2 -2
- package/dist/export-svg-document-ChaNXMaG.js +668 -0
- package/dist/features/3d/Errors.d.ts +57 -0
- package/dist/features/3d/Nova3DApp.d.ts +429 -0
- package/dist/features/3d/animation/Animator.d.ts +260 -0
- package/dist/features/3d/animation/Clip.d.ts +74 -0
- package/dist/features/3d/animation/Graph.d.ts +158 -0
- package/dist/features/3d/animation/Mask.d.ts +40 -0
- package/dist/features/3d/audio/Audio.d.ts +114 -0
- package/dist/features/3d/audio/Sound.d.ts +133 -0
- package/dist/features/3d/character/CharacterController.d.ts +61 -0
- package/dist/features/3d/collision/Capsule.d.ts +25 -0
- package/dist/features/3d/collision/Octree.d.ts +94 -0
- package/dist/features/3d/controls/CameraMotionControls.d.ts +154 -0
- package/dist/features/3d/controls/CameraOrientation.d.ts +47 -0
- package/dist/features/3d/controls/OrbitControls.d.ts +73 -0
- package/dist/features/3d/controls/PointerGesture.d.ts +25 -0
- package/dist/features/3d/controls/PointerLock.d.ts +36 -0
- package/dist/features/3d/controls/Snapping.d.ts +32 -0
- package/dist/features/3d/controls/TransformGizmo.d.ts +79 -0
- package/dist/features/3d/deformation/DeformationGPU.d.ts +52 -0
- package/dist/features/3d/deformation/DeformationShader.d.ts +2 -0
- package/dist/features/3d/deformation/DeformedMesh.d.ts +36 -0
- package/dist/features/3d/deformation/GeometryDeformation.d.ts +25 -0
- package/dist/features/3d/documents/Document.d.ts +59 -0
- package/dist/features/3d/documents/DocumentCommands.d.ts +45 -0
- package/dist/features/3d/documents/DocumentSchema.d.ts +18 -0
- package/dist/features/3d/documents/DocumentTransform.d.ts +4 -0
- package/dist/features/3d/documents/DocumentTypes.d.ts +182 -0
- package/dist/features/3d/documents/DocumentValidation.d.ts +18 -0
- package/dist/features/3d/documents/Projection.d.ts +65 -0
- package/dist/features/3d/effects/CubeLUT.d.ts +24 -0
- package/dist/features/3d/effects/Effects.d.ts +32 -0
- package/dist/features/3d/effects/EffectsGPU.d.ts +80 -0
- package/dist/features/3d/effects/EffectsPlan.d.ts +268 -0
- package/dist/features/3d/effects/EffectsShaders.d.ts +35 -0
- package/dist/features/3d/export/GLTFExporter.d.ts +49 -0
- package/dist/features/3d/export/ThreeMFExporter.d.ts +19 -0
- package/dist/features/3d/export/ZipWriter.d.ts +9 -0
- package/dist/features/3d/fbx/FBXLoader.d.ts +26 -0
- package/dist/features/3d/fbx/FBXParser.d.ts +35 -0
- package/dist/features/3d/fbx/FBXScene.d.ts +20 -0
- package/dist/features/3d/gltf/GLTFLoader.d.ts +16 -0
- package/dist/features/3d/gltf/GLTFTypes.d.ts +64 -0
- package/dist/features/3d/gltf/services/GLTFBinary.d.ts +21 -0
- package/dist/features/3d/gltf/services/GLTFGeometry.d.ts +14 -0
- package/dist/features/3d/gltf/services/GLTFResourceIO.d.ts +64 -0
- package/dist/features/3d/helpers/LineHelper.d.ts +51 -0
- package/dist/features/3d/helpers/StaticHelpers.d.ts +47 -0
- package/dist/features/3d/helpers/TrackedHelpers.d.ts +84 -0
- package/dist/features/3d/ik/ChainIK.d.ts +44 -0
- package/dist/features/3d/ik/IKChain.d.ts +92 -0
- package/dist/features/3d/ik/IKMath.d.ts +49 -0
- package/dist/features/3d/ik/IKSolver.d.ts +97 -0
- package/dist/features/3d/ik/LookAtIK.d.ts +58 -0
- package/dist/features/3d/ik/TwoBoneIK.d.ts +57 -0
- package/dist/features/3d/import/ImportAnimation.d.ts +20 -0
- package/dist/features/3d/import/ImportMath.d.ts +42 -0
- package/dist/features/3d/import/ImportedModel.d.ts +135 -0
- package/dist/features/3d/import/Inflate.d.ts +5 -0
- package/dist/features/3d/import/ModelAsset.d.ts +149 -0
- package/dist/features/3d/import/PolygonMesh.d.ts +54 -0
- package/dist/features/3d/lights/AreaLightTables.d.ts +8 -0
- package/dist/features/3d/lights/AreaLights.d.ts +11 -0
- package/dist/features/3d/loaders/EXRCompression.d.ts +13 -0
- package/dist/features/3d/loaders/EXRLoader.d.ts +39 -0
- package/dist/features/3d/loaders/HDRLoader.d.ts +26 -0
- package/dist/features/3d/loaders/Limits.d.ts +70 -0
- package/dist/features/3d/loaders/LoaderBuffers.d.ts +42 -0
- package/dist/features/3d/loaders/LoaderIO.d.ts +81 -0
- package/dist/features/3d/loaders/LoaderModel.d.ts +80 -0
- package/dist/features/3d/loaders/LoaderText.d.ts +27 -0
- package/dist/features/3d/loaders/MTLLoader.d.ts +105 -0
- package/dist/features/3d/loaders/OBJLoader.d.ts +70 -0
- package/dist/features/3d/loaders/PLYLoader.d.ts +47 -0
- package/dist/features/3d/loaders/STLLoader.d.ts +27 -0
- package/dist/features/3d/model/Camera.d.ts +33 -0
- package/dist/features/3d/model/Environment.d.ts +31 -0
- package/dist/features/3d/model/Geometry.d.ts +59 -0
- package/dist/features/3d/model/InstancedMesh.d.ts +134 -0
- package/dist/features/3d/model/LOD.d.ts +31 -0
- package/dist/features/3d/model/Light.d.ts +200 -0
- package/dist/features/3d/model/Material.d.ts +308 -0
- package/dist/features/3d/model/MaterialExtensions.d.ts +200 -0
- package/dist/features/3d/model/Mesh.d.ts +92 -0
- package/dist/features/3d/model/Node.d.ts +87 -0
- package/dist/features/3d/model/ReflectionProbe.d.ts +45 -0
- package/dist/features/3d/model/RenderTarget.d.ts +41 -0
- package/dist/features/3d/model/Scene.d.ts +173 -0
- package/dist/features/3d/model/Texture.d.ts +143 -0
- package/dist/features/3d/nodes/Nodes.d.ts +8 -0
- package/dist/features/3d/nodes/ShaderNode.d.ts +240 -0
- package/dist/features/3d/particles/GPUParticleSchedule.d.ts +67 -0
- package/dist/features/3d/particles/GPUParticleShaders.d.ts +19 -0
- package/dist/features/3d/particles/GPUParticleState.d.ts +106 -0
- package/dist/features/3d/particles/GPUParticleSystem.d.ts +192 -0
- package/dist/features/3d/particles/ParticleCurves.d.ts +34 -0
- package/dist/features/3d/particles/ParticleOptions.d.ts +78 -0
- package/dist/features/3d/particles/ParticleSystem.d.ts +368 -0
- package/dist/features/3d/physics/PhysicsBackend.d.ts +352 -0
- package/dist/features/3d/physics/PhysicsDebug.d.ts +24 -0
- package/dist/features/3d/physics/PhysicsWorld.d.ts +352 -0
- package/dist/features/3d/physics/basic/BasicCollision.d.ts +75 -0
- package/dist/features/3d/physics/basic/BasicPhysics.d.ts +24 -0
- package/dist/features/3d/physics/basic/BasicShapes.d.ts +103 -0
- package/dist/features/3d/physics/rapier/ContactBuffer.d.ts +32 -0
- package/dist/features/3d/physics/rapier/RapierBackend.d.ts +17 -0
- package/dist/features/3d/physics/rapier/RapierShapes.d.ts +4 -0
- package/dist/features/3d/physics/rapier/RapierWorld.d.ts +198 -0
- package/dist/features/3d/physics/rapier/Validation.d.ts +8 -0
- package/dist/features/3d/services/Background.d.ts +22 -0
- package/dist/features/3d/services/BasicShader.d.ts +55 -0
- package/dist/features/3d/services/ClusteredLights.d.ts +69 -0
- package/dist/features/3d/services/DrawOrder.d.ts +37 -0
- package/dist/features/3d/services/EffectsProcessor.d.ts +38 -0
- package/dist/features/3d/services/EnvironmentBRDF.d.ts +35 -0
- package/dist/features/3d/services/EnvironmentMaps.d.ts +55 -0
- package/dist/features/3d/services/FogShader.d.ts +6 -0
- package/dist/features/3d/services/Frustum.d.ts +7 -0
- package/dist/features/3d/services/GLState.d.ts +86 -0
- package/dist/features/3d/services/GPUPicker.d.ts +31 -0
- package/dist/features/3d/services/InstanceShader.d.ts +3 -0
- package/dist/features/3d/services/LineProgram.d.ts +32 -0
- package/dist/features/3d/services/PBRProgram.d.ts +115 -0
- package/dist/features/3d/services/Renderer.d.ts +50 -0
- package/dist/features/3d/services/Shader.d.ts +22 -0
- package/dist/features/3d/services/ShaderProgram.d.ts +38 -0
- package/dist/features/3d/services/ShadowMaps.d.ts +97 -0
- package/dist/features/3d/services/SpatialIndex.d.ts +16 -0
- package/dist/features/3d/services/TextureLoader.d.ts +40 -0
- package/dist/features/3d/services/TextureMipmaps.d.ts +42 -0
- package/dist/features/3d/services/ToneMapping.d.ts +12 -0
- package/dist/features/3d/services/WebGLRenderer.d.ts +261 -0
- package/dist/features/3d/splats/SplatData.d.ts +136 -0
- package/dist/features/3d/splats/SplatLoaders.d.ts +64 -0
- package/dist/features/3d/splats/SplatShader.d.ts +14 -0
- package/dist/features/3d/splats/SplatSort.d.ts +69 -0
- package/dist/features/3d/splats/Splats.d.ts +116 -0
- package/dist/features/3d/text/FontAtlas.d.ts +246 -0
- package/dist/features/3d/text/SDF.d.ts +28 -0
- package/dist/features/3d/text/Text.d.ts +179 -0
- package/dist/features/3d/text/TextLayout.d.ts +73 -0
- package/dist/features/3d/text/TextShader.d.ts +12 -0
- package/dist/features/3d/tiles/BoundingVolume.d.ts +43 -0
- package/dist/features/3d/tiles/Geodesy.d.ts +106 -0
- package/dist/features/3d/tiles/GlobeControls.d.ts +147 -0
- package/dist/features/3d/tiles/TileContent.d.ts +35 -0
- package/dist/features/3d/tiles/TileFormats.d.ts +77 -0
- package/dist/features/3d/tiles/Tiles3D.d.ts +236 -0
- package/dist/features/3d/tiles/Tileset.d.ts +81 -0
- package/dist/features/3d/tools/BatchedMesh.d.ts +74 -0
- package/dist/features/3d/tools/CanvasSurface.d.ts +81 -0
- package/dist/features/3d/tools/Color.d.ts +11 -0
- package/dist/features/3d/tools/MergeGeometries.d.ts +22 -0
- package/dist/features/3d/tools/Options.d.ts +15 -0
- package/dist/features/3d/tools/Polyhedra.d.ts +30 -0
- package/dist/features/3d/tools/PrimitiveBuffers.d.ts +42 -0
- package/dist/features/3d/tools/Primitives.d.ts +164 -0
- package/dist/features/3d/tools/Ready.d.ts +12 -0
- package/dist/features/3d/tools/SpatialMath.d.ts +57 -0
- package/dist/features/3d/tools/SphericalHarmonics.d.ts +9 -0
- package/dist/features/3d/tools/math/mat3.d.ts +7 -0
- package/dist/features/3d/tools/math/mat4.d.ts +19 -0
- package/dist/features/3d/tools/math/quat.d.ts +6 -0
- package/dist/features/3d/tools/math/vec3.d.ts +16 -0
- package/dist/features/3d/tools/math/vec4.d.ts +5 -0
- package/dist/features/3d/types.d.ts +359 -0
- package/dist/features/3d/usdz/USDAParser.d.ts +50 -0
- package/dist/features/3d/usdz/USDScene.d.ts +20 -0
- package/dist/features/3d/usdz/USDZLoader.d.ts +27 -0
- package/dist/features/3d/usdz/ZipReader.d.ts +16 -0
- package/dist/features/3d/webgpu/Backend.d.ts +40 -0
- package/dist/features/3d/webgpu/BasicShader.d.ts +10 -0
- package/dist/features/3d/webgpu/Constants.d.ts +32 -0
- package/dist/features/3d/webgpu/Deformation.d.ts +71 -0
- package/dist/features/3d/webgpu/Environment.d.ts +66 -0
- package/dist/features/3d/webgpu/Features.d.ts +68 -0
- package/dist/features/3d/webgpu/Layouts.d.ts +27 -0
- package/dist/features/3d/webgpu/Lines.d.ts +40 -0
- package/dist/features/3d/webgpu/LitExtras.d.ts +46 -0
- package/dist/features/3d/webgpu/LitFeatures.d.ts +41 -0
- package/dist/features/3d/webgpu/LitScene.d.ts +60 -0
- package/dist/features/3d/webgpu/LitShader.d.ts +68 -0
- package/dist/features/3d/webgpu/Particles.d.ts +114 -0
- package/dist/features/3d/webgpu/Picking.d.ts +59 -0
- package/dist/features/3d/webgpu/PipelineKey.d.ts +33 -0
- package/dist/features/3d/webgpu/Points.d.ts +41 -0
- package/dist/features/3d/webgpu/Probes.d.ts +45 -0
- package/dist/features/3d/webgpu/ShaderChunks.d.ts +18 -0
- package/dist/features/3d/webgpu/ShaderMaterial.d.ts +57 -0
- package/dist/features/3d/webgpu/ShaderMaterialSource.d.ts +5 -0
- package/dist/features/3d/webgpu/Shadows.d.ts +49 -0
- package/dist/features/3d/webgpu/Splats.d.ts +47 -0
- package/dist/features/3d/webgpu/Textures.d.ts +52 -0
- package/dist/features/3d/webgpu/Transmission.d.ts +30 -0
- package/dist/features/3d/webgpu/UniformLayout.d.ts +30 -0
- package/dist/features/3d/webgpu/UtilityShaders.d.ts +38 -0
- package/dist/features/3d/webgpu/WebGPURenderer.d.ts +327 -0
- package/dist/features/3d/webgpu/effects/EffectsShaders.d.ts +74 -0
- package/dist/features/3d/webgpu/effects/WebGPUEffects.d.ts +140 -0
- package/dist/features/3d/xr/XR.d.ts +100 -0
- package/dist/gltf-By-n0qEg.js +960 -0
- package/dist/index.d.ts +86 -81
- package/dist/model/document-actions/document-commands.d.ts +18 -0
- package/dist/model/documents/svg/create-svg-document-renderer.d.ts +32 -0
- package/dist/model/documents/svg/export-svg-document.d.ts +5 -0
- package/dist/model/documents/svg/import-svg-document.d.ts +6 -0
- package/dist/model/documents/svg/svg-document.types.d.ts +111 -0
- package/dist/model/documents/svg/svg-values.d.ts +16 -0
- package/dist/model/documents/svg/svg-xml.d.ts +18 -0
- package/dist/model/input/NovaInputProxy_Adapter.d.ts +2 -1
- package/dist/model/input/NovaInputValidationController.d.ts +1 -1
- package/dist/model/input/NovaTextInputController.d.ts +1 -1
- package/dist/model/input/NovaTextLayoutEngine.d.ts +2 -6
- package/dist/model/input/index.d.ts +7 -7
- package/dist/model/input/nova-input.types.d.ts +1 -1
- package/dist/model/lighting/LightingRenderer2D.d.ts +58 -0
- package/dist/model/lighting/NovaLighting2D.d.ts +56 -0
- package/dist/model/lighting/lighting-shaders.d.ts +3 -0
- package/dist/model/lighting/lighting-state.d.ts +27 -0
- package/dist/model/lighting/lighting.types.d.ts +107 -0
- package/dist/model/lottie/LottieNode.d.ts +4 -0
- package/dist/model/lottie/lottie.types.d.ts +83 -0
- package/dist/model/lottie/prepare-lottie.d.ts +3 -0
- package/dist/model/lottie/sample-position.d.ts +9 -0
- package/dist/model/motion/NovaMotionEngine.d.ts +3 -3
- package/dist/model/motion/nova-motion-easing.d.ts +1 -1
- package/dist/model/motion/nova-motion-interpolation.d.ts +1 -1
- package/dist/model/motion/nova-motion-presets.d.ts +2 -2
- package/dist/model/motion/nova-motion-timeline.d.ts +1 -1
- package/dist/model/platform/NovaCanvas.d.ts +7 -6
- package/dist/model/primitives/NovaPrimitiveUnsupportedError.d.ts +13 -0
- package/dist/model/primitives/definePrimitive.d.ts +5 -0
- package/dist/model/primitives/primitive.types.d.ts +28 -0
- package/dist/model/render/backends/canvas2d/NovaCanvas2DTargetManager.d.ts +3 -3
- package/dist/model/render/backends/canvas2d/NovaRenderer2D.d.ts +61 -15
- package/dist/model/render/backends/canvas2d/nova-canvas-blend.d.ts +5 -0
- package/dist/model/render/backends/nova-render-backend-factory.d.ts +6 -6
- package/dist/model/render/backends/nova-render-backend.d.ts +8 -2
- package/dist/model/render/backends/webgl/NovaRendererWebGL.d.ts +32 -11
- package/dist/model/render/backends/webgl/NovaStreamCacheIdleLedger.d.ts +12 -1
- package/dist/model/render/backends/webgl/NovaWebGLBatcher.d.ts +1 -1
- package/dist/model/render/backends/webgl/NovaWebGLCircleImagePass.d.ts +23 -0
- package/dist/model/render/backends/webgl/NovaWebGLCompositionPass.d.ts +9 -0
- package/dist/model/render/backends/webgl/NovaWebGLDevice.d.ts +3 -1
- package/dist/model/render/backends/webgl/NovaWebGLDiagnostics.d.ts +1 -1
- package/dist/model/render/backends/webgl/NovaWebGLFrameRenderer.d.ts +162 -53
- package/dist/model/render/backends/webgl/NovaWebGLPathClipPass.d.ts +13 -0
- package/dist/model/render/backends/webgl/NovaWebGLPathUnion.d.ts +23 -0
- package/dist/model/render/compiler/NovaRenderBuilder.d.ts +24 -10
- package/dist/model/render/compiler/NovaRenderCommandWriter.d.ts +10 -5
- package/dist/model/render/compiler/NovaRenderCompiler.d.ts +7 -6
- package/dist/model/render/compiler/NovaRenderFrameBuilder.d.ts +4 -3
- package/dist/model/render/effects/blur.d.ts +8 -0
- package/dist/model/render/effects/color-matrix.d.ts +8 -0
- package/dist/model/render/effects/drop-shadow.d.ts +18 -0
- package/dist/model/render/effects/nova-effect-registry.d.ts +66 -0
- package/dist/model/render/effects/nova-gaussian-kernel.d.ts +7 -0
- package/dist/model/render/effects/nova-gaussian-textures.d.ts +11 -0
- package/dist/model/render/effects/shader-effect.d.ts +64 -0
- package/dist/model/render/geometry/nova-alpha-mask.d.ts +5 -0
- package/dist/model/render/geometry/nova-composition.d.ts +9 -0
- package/dist/model/render/geometry/nova-node-clip.d.ts +17 -0
- package/dist/model/render/geometry/nova-path-geometry.d.ts +24 -0
- package/dist/model/render/geometry/nova-path-tessellation.d.ts +7 -0
- package/dist/model/render/geometry/nova-polygon-triangulation.d.ts +1 -1
- package/dist/model/render/graph/NovaRectBatchBuffer.d.ts +58 -0
- package/dist/model/render/graph/NovaRenderGraph.d.ts +40 -6
- package/dist/model/render/graph/NovaRenderHitIndex.d.ts +1 -1
- package/dist/model/render/graph/nova-auto-rect.d.ts +1 -1
- package/dist/model/render/graph/nova-linear-rect-repack.d.ts +4 -4
- package/dist/model/render/graph/nova-linear-rect-transition.d.ts +2 -2
- package/dist/model/render/graph/nova-render-culling.d.ts +2 -2
- package/dist/model/render/graph/nova-render-dirty-items.d.ts +1 -1
- package/dist/model/render/graph/nova-render-group.d.ts +1 -1
- package/dist/model/render/graph/nova-render-item.d.ts +2 -2
- package/dist/model/render/graph/nova-render-layer.d.ts +1 -1
- package/dist/model/render/graph/nova-render-payload-snapshot.d.ts +3 -1
- package/dist/model/render/graph/nova-render-program.d.ts +5 -3
- package/dist/model/render/graph/nova-render-sequence.d.ts +1 -1
- package/dist/model/render/graph/nova-render-stream.d.ts +2 -2
- package/dist/model/render/ktx2/BasisSession.d.ts +45 -0
- package/dist/model/render/ktx2/KTX2Container.d.ts +26 -0
- package/dist/model/render/ktx2/KTX2Loader.d.ts +55 -0
- package/dist/model/render/meshes/MeshNode.d.ts +13 -0
- package/dist/model/render/meshes/NovaMeshWebGLDevice.d.ts +27 -0
- package/dist/model/render/meshes/geometry.d.ts +7 -0
- package/dist/model/render/meshes/mesh.d.ts +3 -0
- package/dist/model/render/meshes/mesh.types.d.ts +116 -0
- package/dist/model/render/meshes/nova-mesh-registry.d.ts +55 -0
- package/dist/model/render/orchestration/NovaRenderOrchestrator.d.ts +25 -3
- package/dist/model/render/policy/nova-render-policy.d.ts +1 -1
- package/dist/model/render/resources/NovaGlyphAtlasManager.d.ts +2 -2
- package/dist/model/render/resources/NovaTextAtlasManager.d.ts +3 -3
- package/dist/model/render/resources/NovaTextLayoutEngine.d.ts +1 -1
- package/dist/model/render/resources/nova-bitmap-upload.d.ts +10 -0
- package/dist/model/render/schema/NovaRenderContext.d.ts +6 -4
- package/dist/model/render/schema/nova-style-compiler.d.ts +5 -2
- package/dist/model/render/targets/NovaNodeRenderTextureSource.d.ts +29 -0
- package/dist/model/render/targets/NovaRenderTargetManager.d.ts +1 -1
- package/dist/model/render/targets/NovaRenderTexture.d.ts +57 -0
- package/dist/model/render/targets/nova-render-target-refs.d.ts +5 -0
- package/dist/model/render/targets/nova-render-target-resource.d.ts +1 -1
- package/dist/model/render/targets/nova-render-texture-runtime.d.ts +71 -0
- package/dist/model/render/textures/nova-compressed-image.d.ts +20 -0
- package/dist/model/render/utils/nova-icon-rendering.d.ts +3 -1
- package/dist/model/render/utils/nova-image-geometry.d.ts +11 -0
- package/dist/model/render/utils/nova-markdown-layout.d.ts +19 -0
- package/dist/model/render/utils/nova-text-paint.d.ts +26 -0
- package/dist/model/render/utils/nova-wrapped-text-layout.d.ts +19 -0
- package/dist/model/runtime/app/Nova.d.ts +35 -35
- package/dist/model/runtime/app/NovaApp.d.ts +58 -30
- package/dist/model/runtime/app/NovaRaphRuntime.d.ts +2 -2
- package/dist/model/runtime/app/createNovaRaphRuntime.d.ts +3 -3
- package/dist/model/runtime/assets/NovaAssetRegistry.d.ts +89 -2
- package/dist/model/runtime/assets/NovaVideoTexture.d.ts +38 -0
- package/dist/model/runtime/assets/nova-render-texture-image-identity.d.ts +4 -0
- package/dist/model/runtime/commands/NovaCommandBus.d.ts +1 -1
- package/dist/model/runtime/components/NovaComponentNode.d.ts +6 -6
- package/dist/model/runtime/components/NovaComponentRegistry.d.ts +1 -1
- package/dist/model/runtime/components/NovaSchemaRegistry.d.ts +7 -6
- package/dist/model/runtime/components/nova-component-metadata.d.ts +1 -1
- package/dist/model/runtime/components/nova-component.decorator.d.ts +2 -2
- package/dist/model/runtime/components/nova-defined-component.d.ts +3 -3
- package/dist/model/runtime/context/nova-context.d.ts +1 -1
- package/dist/model/runtime/cursor/NovaCursorManager.d.ts +3 -3
- package/dist/model/runtime/diagnostics/NovaDiagnostics_Module.d.ts +3 -3
- package/dist/model/runtime/interaction/NovaEvents.d.ts +16 -6
- package/dist/model/runtime/interaction/NovaHitIndex.d.ts +1 -1
- package/dist/model/runtime/interaction/NovaSpatialIndex.d.ts +2 -2
- package/dist/model/runtime/scene/NovaScene.d.ts +3 -3
- package/dist/model/runtime/scene/nova-scene-components.d.ts +6 -6
- package/dist/model/runtime/state/nova-store-decorators.d.ts +1 -1
- package/dist/model/runtime/state/nova-store-runtime.d.ts +1 -1
- package/dist/model/runtime/state/nova-store-tracking.d.ts +7 -3
- package/dist/model/runtime/sync/NovaSyncScope.d.ts +11 -2
- package/dist/model/runtime/sync/nova-sync-context.d.ts +2 -2
- package/dist/model/runtime/sync/nova-sync-ports.d.ts +2 -2
- package/dist/model/runtime/sync/nova-sync.types.d.ts +15 -3
- package/dist/model/runtime/template/NovaTemplateRuntime.d.ts +6 -6
- package/dist/model/runtime/tree/NovaContainer.d.ts +4 -4
- package/dist/model/runtime/tree/NovaNode.d.ts +58 -18
- package/dist/model/runtime/tree/NovaRaphNode.d.ts +8 -2
- package/dist/model/runtime/tree/NovaSurface.d.ts +32 -10
- package/dist/model/runtime/tree/nova-node-capture-invalidation.d.ts +11 -0
- package/dist/model/semantic/NovaSemanticService.d.ts +1 -1
- package/dist/model/semantic/browser/createAccessibilityBridge.d.ts +29 -0
- package/dist/model/sound/NovaSoundEngine.d.ts +3 -2
- package/dist/model/text-selection/NovaTextSelectionService.d.ts +2 -2
- package/dist/model/text-selection/index.d.ts +2 -2
- package/dist/model/text-selection/nova-text-selection.types.d.ts +1 -1
- package/dist/model/theme/NovaGlobalThemeRegistry.d.ts +2 -2
- package/dist/model/theme/NovaThemeService.d.ts +5 -3
- package/dist/model/theme/createTokenTheme.d.ts +15 -0
- package/dist/model/tools/transform-tools.d.ts +43 -0
- package/dist/nodes--Ds4IS2h.js +621 -0
- package/dist/nova-color-parser-BCN_rFRN.js +250 -0
- package/dist/nova-compressed-image-CE2Ya9Xa.js +46 -0
- package/dist/nova-mesh-registry-B7Xz5mhU.js +24 -0
- package/dist/nova-render-texture-image-identity-DQ09XFKs.js +15 -0
- package/dist/nova-text-paint-CcntsRjI.js +48 -0
- package/dist/tokens.d.ts +2 -0
- package/dist/tokens.js +50 -0
- package/dist/vec4-BTNv1fUp.js +20 -0
- package/package.json +229 -4
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { N as E } from "./Clip-CAN7t03k.js";
|
|
2
|
+
import { N as k } from "./DeformedMesh-CPi0P_vc.js";
|
|
3
|
+
import { N as a, a as O, f as U } from "./Errors-B2ekO9bZ.js";
|
|
4
|
+
import { N as L } from "./Geometry-DytO490z.js";
|
|
5
|
+
import { N as T } from "./Material-BpfLPmK9.js";
|
|
6
|
+
import { s as C } from "./Scene-CDfNgf9I.js";
|
|
7
|
+
import { N as j } from "./Texture-dTKMlTpK.js";
|
|
8
|
+
import { c as N, o as I } from "./Options-CajE7LLJ.js";
|
|
9
|
+
import { r as P, d as v } from "./Limits-Bw5XQdFr.js";
|
|
10
|
+
const z = I({ sceneIndex: !0, parent: !0 }), G = I({ parent: !0, pose: !0 });
|
|
11
|
+
class K {
|
|
12
|
+
/** @internal */
|
|
13
|
+
constructor(t, e, o, r, l) {
|
|
14
|
+
this._release = r, this._cloneInstance = l;
|
|
15
|
+
const n = o.sceneIndex ?? e.defaultScene;
|
|
16
|
+
if (!Number.isInteger(n) || n < 0 || n >= e.scenes.length)
|
|
17
|
+
throw new a("invalid-option", "[Nova3D] Invalid model sceneIndex.");
|
|
18
|
+
if (o.parent && (o.parent.scene !== t || o.parent.destroyed))
|
|
19
|
+
throw new a("owner", "[Nova3D] Model parent must be live and belong to its scene.");
|
|
20
|
+
const i = [], f = [...e.scenes[n]];
|
|
21
|
+
for (; f.length; ) {
|
|
22
|
+
const w = f.pop();
|
|
23
|
+
i.push(w), f.push(...e.nodes[w].children);
|
|
24
|
+
}
|
|
25
|
+
this.root = t.createGroup();
|
|
26
|
+
const m = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
27
|
+
try {
|
|
28
|
+
for (const c of i) {
|
|
29
|
+
const s = t.createGroup(e.nodes[c].transform);
|
|
30
|
+
m.set(c, s), this._nodes.push(s);
|
|
31
|
+
}
|
|
32
|
+
for (const c of i) {
|
|
33
|
+
const s = e.nodes[c], g = m.get(c);
|
|
34
|
+
if (s.mesh !== void 0)
|
|
35
|
+
for (const h of e.meshes[s.mesh]) {
|
|
36
|
+
const y = s.skin === void 0 ? void 0 : e.skins[s.skin], _ = y ? { inverseBindMatrices: y.inverseBindMatrices, joints: y.joints.map((D) => {
|
|
37
|
+
const b = m.get(D);
|
|
38
|
+
if (!b)
|
|
39
|
+
throw new a("owner", "[Nova3D] Skin joint must belong to the instantiated scene.");
|
|
40
|
+
return b;
|
|
41
|
+
}) } : void 0, A = s.weights ?? e.meshWeights[s.mesh];
|
|
42
|
+
let x;
|
|
43
|
+
if (s.instances) {
|
|
44
|
+
const D = s.instances.length / 10, b = t.createInstancedMesh({ ...h, capacity: D });
|
|
45
|
+
b.updatePoses(0, s.instances, D), x = b;
|
|
46
|
+
} else
|
|
47
|
+
x = _ || h.geometry._readDeformation()?.targets.length ? t._createDeformedMesh(h, _, A) : t.createMesh(h);
|
|
48
|
+
const B = u.get(c) ?? [];
|
|
49
|
+
B.push(x), u.set(c, B), this._nodes.push(x), x.reparent(g, { preserve: "local" });
|
|
50
|
+
}
|
|
51
|
+
if (s.camera) {
|
|
52
|
+
const { type: h, ...y } = s.camera, _ = h === "perspective" ? t.createPerspectiveCamera(y) : t.createOrthographicCamera(y);
|
|
53
|
+
this._nodes.push(_), p.set(c, _), _.reparent(g, { preserve: "local" });
|
|
54
|
+
}
|
|
55
|
+
if (s.light) {
|
|
56
|
+
const h = s.light, y = { color: h.color, intensity: h.intensity, range: h.range }, _ = h.kind === "directional" ? t.createDirectionalLight({ color: h.color, intensity: h.intensity }) : h.kind === "point" ? t.createPointLight(y) : t.createSpotLight({ ...y, innerConeAngle: h.innerConeAngle, outerConeAngle: h.outerConeAngle });
|
|
57
|
+
this._nodes.push(_), _.reparent(g, { preserve: "local" });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
for (const c of i)
|
|
61
|
+
for (const s of e.nodes[c].children)
|
|
62
|
+
m.get(s).reparent(m.get(c), { preserve: "local" });
|
|
63
|
+
for (const c of e.scenes[n])
|
|
64
|
+
m.get(c).reparent(this.root, { preserve: "local" });
|
|
65
|
+
const w = [...e.scenes[n]].reverse();
|
|
66
|
+
for (; w.length; ) {
|
|
67
|
+
const c = w.pop(), s = e.nodes[c].name;
|
|
68
|
+
s !== void 0 && !this._names.has(s) && this._names.set(s, m.get(c));
|
|
69
|
+
const g = e.nodes[c].children;
|
|
70
|
+
for (let h = g.length - 1; h >= 0; h--)
|
|
71
|
+
w.push(g[h]);
|
|
72
|
+
}
|
|
73
|
+
for (const c of [...p.keys()].sort((s, g) => s - g))
|
|
74
|
+
this._cameras.push(p.get(c));
|
|
75
|
+
this._clips = Object.freeze((e.animations ?? []).map((c) => E._bind(c, (s, g) => g === "weights" ? u.get(Number(s))?.map((h) => h.id) : m.get(Number(s))?.id))), o.parent && this.root.reparent(o.parent, { preserve: "local" });
|
|
76
|
+
} catch (w) {
|
|
77
|
+
const c = /* @__PURE__ */ new Set([this.root, ...this._nodes]);
|
|
78
|
+
for (const s of [...this._nodes].reverse())
|
|
79
|
+
s.destroyed || s._destroyOwned(c);
|
|
80
|
+
throw this.root.destroy(), O(w);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
root;
|
|
84
|
+
_clips = Object.freeze([]);
|
|
85
|
+
_destroyed = !1;
|
|
86
|
+
_nodes = [];
|
|
87
|
+
_cameras = [];
|
|
88
|
+
_names = /* @__PURE__ */ new Map();
|
|
89
|
+
get clips() {
|
|
90
|
+
return this._clips;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* First node of this instance with the file's node `name` (three.js `getObjectByName`),
|
|
94
|
+
* for attaching objects to bones and other named parts.
|
|
95
|
+
* @experimental
|
|
96
|
+
*/
|
|
97
|
+
findNode(t) {
|
|
98
|
+
if (typeof t != "string")
|
|
99
|
+
throw new a("invalid-option", "[Nova3D] Node name must be a string.");
|
|
100
|
+
const e = this._names.get(t);
|
|
101
|
+
return e && !e.destroyed ? e : void 0;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Cameras of the instantiated scene in node order.
|
|
105
|
+
* @experimental
|
|
106
|
+
*/
|
|
107
|
+
get cameras() {
|
|
108
|
+
return this._cameras;
|
|
109
|
+
}
|
|
110
|
+
get destroyed() {
|
|
111
|
+
return this._destroyed;
|
|
112
|
+
}
|
|
113
|
+
/** Клонирует кости, pose и привязки clips через владеющий asset. @experimental */
|
|
114
|
+
clone(t = {}) {
|
|
115
|
+
if (N(t, G, "model clone"), t.pose !== void 0 && t.pose !== "current" && t.pose !== "bind")
|
|
116
|
+
throw new a("invalid-option", "[Nova3D] Clone pose: current или bind.");
|
|
117
|
+
if (this._destroyed || this.root.destroyed)
|
|
118
|
+
throw new a("destroyed", "[Nova3D] Нельзя клонировать уничтоженную модель.");
|
|
119
|
+
for (const o of this._nodes) {
|
|
120
|
+
if (o.destroyed)
|
|
121
|
+
throw new a("state", "[Nova3D] Исходный узел модели уничтожен.");
|
|
122
|
+
let r = o.parent;
|
|
123
|
+
for (; r !== this.root && r !== this.root.scene; )
|
|
124
|
+
r = r.parent;
|
|
125
|
+
if (r !== this.root)
|
|
126
|
+
throw new a("state", "[Nova3D] Исходные узлы модели уничтожены или вынесены из её иерархии.");
|
|
127
|
+
}
|
|
128
|
+
const e = this._cloneInstance({ parent: t.parent });
|
|
129
|
+
try {
|
|
130
|
+
if (e.root.setTransform(this.root.getTransform()), e.root.setVisible(this.root.visible), e.root.setPickable(this.root.pickable), t.pose !== "bind") {
|
|
131
|
+
const o = /* @__PURE__ */ new Map([[this.root, e.root]]);
|
|
132
|
+
for (let r = 0; r < this._nodes.length; r++)
|
|
133
|
+
o.set(this._nodes[r], e._nodes[r]);
|
|
134
|
+
for (let r = 0; r < this._nodes.length; r++) {
|
|
135
|
+
const l = this._nodes[r], n = e._nodes[r];
|
|
136
|
+
if (n.parent !== o.get(l.parent))
|
|
137
|
+
throw new a("state", "[Nova3D] Current clone требует исходную иерархию узлов модели.");
|
|
138
|
+
n.setTransform(l.getTransform()), n.setVisible(l.visible), n.setPickable(l.pickable), n instanceof k && l instanceof k && n._copyMorphFrom(l);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return e;
|
|
142
|
+
} catch (o) {
|
|
143
|
+
throw e.destroy(), o;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
destroy() {
|
|
147
|
+
if (this._destroyed)
|
|
148
|
+
return;
|
|
149
|
+
for (const o of [this.root, ...this._nodes])
|
|
150
|
+
if (!o.destroyed && o._getLODOwner())
|
|
151
|
+
throw new a("state", "[Nova3D] Release model nodes from externally managed LODs before model destroy.");
|
|
152
|
+
const t = /* @__PURE__ */ new Set(), e = [this.root, ...this._nodes];
|
|
153
|
+
for (; e.length; ) {
|
|
154
|
+
const o = e.pop();
|
|
155
|
+
t.has(o) || o.destroyed || (t.add(o), e.push(...o.children));
|
|
156
|
+
}
|
|
157
|
+
for (const o of t)
|
|
158
|
+
o.scene._assertJointUsers(o, t);
|
|
159
|
+
this.root.destroyed || this.root._destroyOwned(t);
|
|
160
|
+
for (const o of this._nodes)
|
|
161
|
+
o.destroyed || o._destroyOwned(t);
|
|
162
|
+
this._destroyed = !0, this._nodes.length = 0, this._clips = Object.freeze([]), this._release();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Adds the live nodes of the model, the users its asset may release with it.
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
_collectNodes(t) {
|
|
169
|
+
for (const e of [this.root, ...this._nodes])
|
|
170
|
+
e.destroyed || t.add(e);
|
|
171
|
+
}
|
|
172
|
+
/** @internal */
|
|
173
|
+
_abandonFromApp() {
|
|
174
|
+
this._nodes.length = 0, this._clips = Object.freeze([]), this._destroyed = !0, this._release();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
class Z {
|
|
178
|
+
owner = {};
|
|
179
|
+
geometry = [];
|
|
180
|
+
materials = [];
|
|
181
|
+
textures = [];
|
|
182
|
+
createGeometry(t) {
|
|
183
|
+
const e = new L(this.owner, t);
|
|
184
|
+
return this.geometry.push(e), e;
|
|
185
|
+
}
|
|
186
|
+
createMaterial(t) {
|
|
187
|
+
const e = new T(this.owner, t);
|
|
188
|
+
return this.materials.push(e), e;
|
|
189
|
+
}
|
|
190
|
+
createTexture(t) {
|
|
191
|
+
const e = new j(this.owner, t);
|
|
192
|
+
return this.textures.push(e), e;
|
|
193
|
+
}
|
|
194
|
+
/** Destroys everything created so far (a failed load). */
|
|
195
|
+
destroy() {
|
|
196
|
+
for (const t of [...this.materials, ...this.geometry, ...this.textures])
|
|
197
|
+
t.destroy();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
class ee {
|
|
201
|
+
/** @internal */
|
|
202
|
+
constructor(t, e) {
|
|
203
|
+
this._definition = t;
|
|
204
|
+
for (const o of [...t.geometry, ...t.materials, ...t.textures])
|
|
205
|
+
o._retain(this, () => {
|
|
206
|
+
});
|
|
207
|
+
this.warnings = Object.freeze([...e]);
|
|
208
|
+
}
|
|
209
|
+
/** Non-fatal notes of the load (skipped textures, ignored data, approximations). */
|
|
210
|
+
warnings;
|
|
211
|
+
_models = /* @__PURE__ */ new Set();
|
|
212
|
+
_app = null;
|
|
213
|
+
_destroyed = !1;
|
|
214
|
+
_detach = () => {
|
|
215
|
+
};
|
|
216
|
+
get destroyed() {
|
|
217
|
+
return this._destroyed;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Places a new model in `scene`. The first call binds the asset to the scene's app;
|
|
221
|
+
* a scene of another app throws (`owner`): load the file again for that app.
|
|
222
|
+
* The model is owned by the asset and the scene: destroyed with either.
|
|
223
|
+
*/
|
|
224
|
+
instantiate(t, e = {}) {
|
|
225
|
+
if (N(e, z, "model instance"), this._destroyed)
|
|
226
|
+
throw new a("destroyed", "[Nova3D] Model asset is destroyed.");
|
|
227
|
+
const o = C(t);
|
|
228
|
+
if (o.destroyed || !o._ownsScene(t))
|
|
229
|
+
throw new a("destroyed", "[Nova3D] Model instances require a live scene.");
|
|
230
|
+
if (this._app === null)
|
|
231
|
+
this._bind(o);
|
|
232
|
+
else if (this._app !== o)
|
|
233
|
+
throw new a("owner", "[Nova3D] Model asset is bound to the app of its first instance; load it again for another app.");
|
|
234
|
+
const r = e.sceneIndex ?? this._definition.defaultScene, l = new K(t, this._definition, e, () => this._models.delete(l), (n) => this.instantiate(t, { ...n, sceneIndex: r }));
|
|
235
|
+
return this._models.add(l), l;
|
|
236
|
+
}
|
|
237
|
+
destroy() {
|
|
238
|
+
if (this._destroyed)
|
|
239
|
+
return;
|
|
240
|
+
const t = /* @__PURE__ */ new Set([this]);
|
|
241
|
+
for (const o of this._models)
|
|
242
|
+
o._collectNodes(t);
|
|
243
|
+
const e = /* @__PURE__ */ new Set([...t, ...this._definition.materials]);
|
|
244
|
+
if (this._definition.geometry.some((o) => o._hasOtherUsers(t)) || this._definition.materials.some((o) => o._hasOtherUsers(t)) || this._definition.textures.some((o) => o._hasOtherUsers(e)))
|
|
245
|
+
throw new a("state", "[Nova3D] Imported resources still have external users.");
|
|
246
|
+
for (const o of [...this._models])
|
|
247
|
+
o.destroy();
|
|
248
|
+
this._releaseUsers();
|
|
249
|
+
for (const o of this._definition.materials)
|
|
250
|
+
o.destroy();
|
|
251
|
+
for (const o of this._definition.geometry)
|
|
252
|
+
o.destroy();
|
|
253
|
+
for (const o of this._definition.textures)
|
|
254
|
+
o.destroy();
|
|
255
|
+
this._closeBitmaps(), this._destroyed = !0, this._detach();
|
|
256
|
+
}
|
|
257
|
+
_bind(t) {
|
|
258
|
+
t._adoptResources(this._definition.geometry, this._definition.materials, this._definition.textures), this._app = t, this._detach = t._own(() => {
|
|
259
|
+
for (const e of [...this._models])
|
|
260
|
+
e._abandonFromApp();
|
|
261
|
+
this._releaseUsers(), this._closeBitmaps(), this._destroyed = !0, this._detach();
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
_closeBitmaps() {
|
|
265
|
+
for (const t of this._definition.bitmaps ?? [])
|
|
266
|
+
t.close();
|
|
267
|
+
}
|
|
268
|
+
_releaseUsers() {
|
|
269
|
+
for (const t of [...this._definition.geometry, ...this._definition.materials, ...this._definition.textures])
|
|
270
|
+
t._releaseUser(this);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
const R = I({ signal: !0, colorSpace: !0, limits: !0 });
|
|
274
|
+
function te(d, t) {
|
|
275
|
+
N(d, R, "texture load");
|
|
276
|
+
const e = P(d.limits, { ...v, maxImageDimension: 8192 }, "texture");
|
|
277
|
+
return { signal: t, colorSpace: d.colorSpace, maxEncodedBytes: e.maxEncodedImageBytes, maxDecodedBytes: e.maxDecodedImageBytes, maxDimension: e.maxImageDimension };
|
|
278
|
+
}
|
|
279
|
+
function S(d) {
|
|
280
|
+
const t = new DataView(d.buffer, d.byteOffset, d.byteLength);
|
|
281
|
+
if (d.length >= 33 && [137, 80, 78, 71, 13, 10, 26, 10].every((e, o) => d[o] === e)) {
|
|
282
|
+
if (t.getUint32(8) !== 13 || t.getUint32(12) !== 1229472850)
|
|
283
|
+
throw new a("format", "[Nova3D] PNG requires an initial IHDR chunk.");
|
|
284
|
+
return { width: t.getUint32(16), height: t.getUint32(20), mime: "image/png" };
|
|
285
|
+
}
|
|
286
|
+
if (d.length >= 4 && d[0] === 255 && d[1] === 216) {
|
|
287
|
+
let e = 2;
|
|
288
|
+
for (; e + 1 < d.length && d[e++] === 255; ) {
|
|
289
|
+
for (; d[e] === 255; )
|
|
290
|
+
e++;
|
|
291
|
+
const o = d[e++];
|
|
292
|
+
if (o === 218 || o === 217)
|
|
293
|
+
break;
|
|
294
|
+
if (o === 1 || o >= 208 && o <= 215)
|
|
295
|
+
continue;
|
|
296
|
+
if (e + 2 > d.length)
|
|
297
|
+
break;
|
|
298
|
+
const r = t.getUint16(e);
|
|
299
|
+
if (r < 2 || e + r > d.length)
|
|
300
|
+
break;
|
|
301
|
+
if ([192, 193, 194].includes(o) && r >= 8)
|
|
302
|
+
return { width: t.getUint16(e + 5), height: t.getUint16(e + 3), mime: "image/jpeg" };
|
|
303
|
+
e += r;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
throw new a("format", "[Nova3D] Texture loader accepts PNG and baseline/progressive JPEG with valid dimensions.");
|
|
307
|
+
}
|
|
308
|
+
async function M(d, t) {
|
|
309
|
+
if (typeof createImageBitmap != "function")
|
|
310
|
+
throw new a("unsupported", "[Nova3D] Texture decoding requires createImageBitmap.");
|
|
311
|
+
try {
|
|
312
|
+
return await createImageBitmap(new Blob([new Uint8Array(d)], { type: t }), { premultiplyAlpha: "none", colorSpaceConversion: "none", imageOrientation: "none" });
|
|
313
|
+
} catch (e) {
|
|
314
|
+
throw new a("format", "[Nova3D] Texture image data could not be decoded.", { cause: e });
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
async function oe(d, t, e) {
|
|
318
|
+
const { signal: o } = e, r = e.maxEncodedBytes ?? v.maxEncodedImageBytes, l = e.maxDecodedBytes ?? v.maxDecodedImageBytes, n = e.maxDimension ?? 8192;
|
|
319
|
+
if (![r, l, n].every((s) => Number.isSafeInteger(s) && s > 0))
|
|
320
|
+
throw new a("invalid-option", "[Nova3D] Texture limits must be positive safe integers.");
|
|
321
|
+
if (e.colorSpace !== void 0 && !["srgb", "linear"].includes(e.colorSpace))
|
|
322
|
+
throw new a("invalid-option", "[Nova3D] Invalid texture color space.");
|
|
323
|
+
o.throwIfAborted();
|
|
324
|
+
const i = await U(t, { signal: o });
|
|
325
|
+
if (!i.ok)
|
|
326
|
+
throw new a("network", `[Nova3D] Texture request failed (${i.status}).`);
|
|
327
|
+
const f = i.body?.getReader();
|
|
328
|
+
if (!f)
|
|
329
|
+
throw new a("network", "[Nova3D] Texture response has no readable body.");
|
|
330
|
+
const m = () => {
|
|
331
|
+
f.cancel(o.reason).catch(() => {
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
o.addEventListener("abort", m, { once: !0 });
|
|
335
|
+
const u = [];
|
|
336
|
+
let p = 0;
|
|
337
|
+
try {
|
|
338
|
+
o.throwIfAborted();
|
|
339
|
+
const s = i.headers.get("content-length");
|
|
340
|
+
if (s !== null && Number(s) > r)
|
|
341
|
+
throw new a("budget", "[Nova3D] Encoded texture exceeds byte budget.");
|
|
342
|
+
for (; ; ) {
|
|
343
|
+
const g = await f.read();
|
|
344
|
+
if (o.throwIfAborted(), g.done)
|
|
345
|
+
break;
|
|
346
|
+
if (g.value.byteLength > r - p)
|
|
347
|
+
throw new a("budget", "[Nova3D] Encoded texture exceeds byte budget.");
|
|
348
|
+
u.push(g.value), p += g.value.byteLength;
|
|
349
|
+
}
|
|
350
|
+
} finally {
|
|
351
|
+
o.removeEventListener("abort", m), await f.cancel().catch(() => {
|
|
352
|
+
}), f.releaseLock();
|
|
353
|
+
}
|
|
354
|
+
const w = new Uint8Array(p);
|
|
355
|
+
let c = 0;
|
|
356
|
+
for (const s of u)
|
|
357
|
+
w.set(s, c), c += s.byteLength;
|
|
358
|
+
return u.length = 0, q(d, w, e);
|
|
359
|
+
}
|
|
360
|
+
async function se(d, t) {
|
|
361
|
+
const { signal: e } = t, o = t.maxEncodedBytes ?? v.maxEncodedImageBytes, r = t.maxDecodedBytes ?? v.maxDecodedImageBytes, l = t.maxDimension ?? 8192;
|
|
362
|
+
if (![o, r, l].every((f) => Number.isSafeInteger(f) && f > 0) || d.byteLength > o)
|
|
363
|
+
throw new a("budget", "[Nova3D] Encoded texture exceeds validated limits.");
|
|
364
|
+
const n = S(d);
|
|
365
|
+
if (n.width < 1 || n.height < 1 || n.width > l || n.height > l || n.width * n.height > Math.floor(r / 4))
|
|
366
|
+
throw new a("budget", "[Nova3D] Decoded texture exceeds dimension or byte budget.");
|
|
367
|
+
e.throwIfAborted();
|
|
368
|
+
const i = await M(d, n.mime);
|
|
369
|
+
if (e.aborted || i.width !== n.width || i.height !== n.height)
|
|
370
|
+
throw i.close(), e.throwIfAborted(), new a("format", "[Nova3D] Decoder dimensions differ from the validated image header.");
|
|
371
|
+
return { image: i, width: n.width, height: n.height };
|
|
372
|
+
}
|
|
373
|
+
async function q(d, t, e) {
|
|
374
|
+
const { signal: o } = e, r = e.maxEncodedBytes ?? v.maxEncodedImageBytes, l = e.maxDecodedBytes ?? v.maxDecodedImageBytes, n = e.maxDimension ?? 8192;
|
|
375
|
+
if (![r, l, n].every((m) => Number.isSafeInteger(m) && m > 0) || t.byteLength > r)
|
|
376
|
+
throw new a("budget", "[Nova3D] Encoded texture exceeds validated limits.");
|
|
377
|
+
if (e.colorSpace !== void 0 && !["srgb", "linear"].includes(e.colorSpace))
|
|
378
|
+
throw new a("invalid-option", "[Nova3D] Invalid texture color space.");
|
|
379
|
+
const i = S(t);
|
|
380
|
+
if (i.width < 1 || i.height < 1 || i.width > n || i.height > n || i.width * i.height > Math.floor(l / 4))
|
|
381
|
+
throw new a("budget", "[Nova3D] Decoded texture exceeds dimension or byte budget.");
|
|
382
|
+
o.throwIfAborted();
|
|
383
|
+
const f = await M(t, i.mime);
|
|
384
|
+
try {
|
|
385
|
+
if (o.throwIfAborted(), f.width !== i.width || f.height !== i.height)
|
|
386
|
+
throw new a("format", "[Nova3D] Decoder dimensions differ from the validated image header.");
|
|
387
|
+
const m = d.createElement("canvas");
|
|
388
|
+
m.width = i.width, m.height = i.height;
|
|
389
|
+
try {
|
|
390
|
+
const u = m.getContext("2d");
|
|
391
|
+
if (!u)
|
|
392
|
+
throw new a("unsupported", "[Nova3D] Texture decoder canvas is unavailable.");
|
|
393
|
+
u.drawImage(f, 0, 0);
|
|
394
|
+
const p = u.getImageData(0, 0, i.width, i.height).data;
|
|
395
|
+
return e.colorSpace === void 0 ? { width: i.width, height: i.height, data: new Uint8Array(p.buffer) } : { width: i.width, height: i.height, data: new Uint8Array(p.buffer), colorSpace: e.colorSpace };
|
|
396
|
+
} finally {
|
|
397
|
+
m.width = 0, m.height = 0;
|
|
398
|
+
}
|
|
399
|
+
} finally {
|
|
400
|
+
f.close();
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
export {
|
|
404
|
+
Z as M,
|
|
405
|
+
ee as N,
|
|
406
|
+
K as a,
|
|
407
|
+
se as b,
|
|
408
|
+
q as d,
|
|
409
|
+
oe as l,
|
|
410
|
+
te as t
|
|
411
|
+
};
|