@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,387 @@
|
|
|
1
|
+
import { N as W } from "../Capsule-BFVpZfvc.js";
|
|
2
|
+
import { c as at } from "../Capsule-BFVpZfvc.js";
|
|
3
|
+
import { N as T } from "../Errors-B2ekO9bZ.js";
|
|
4
|
+
import { N as G } from "../InstancedMesh-DPrgrw5z.js";
|
|
5
|
+
import { N as H } from "../Mesh-BaRxAAJq.js";
|
|
6
|
+
/*! Port of three.js examples/jsm/math/Octree.js (MIT License, Copyright © 2010-2025 three.js authors). */
|
|
7
|
+
const U = 1e-10;
|
|
8
|
+
class J {
|
|
9
|
+
_perLeaf;
|
|
10
|
+
_maxLevel;
|
|
11
|
+
_pending = [];
|
|
12
|
+
_built = !1;
|
|
13
|
+
/** 9 coordinates per triangle. */
|
|
14
|
+
_triangles = new Float64Array(0);
|
|
15
|
+
/** Plane per triangle: normal xyz and constant. */
|
|
16
|
+
_planes = new Float64Array(0);
|
|
17
|
+
/** Node boxes, 6 per node: min xyz, max xyz. */
|
|
18
|
+
_boxes = new Float64Array(0);
|
|
19
|
+
/** Per node: first child index and child count, first leaf entry and leaf entry count. */
|
|
20
|
+
_nodes = new Int32Array(0);
|
|
21
|
+
_children = new Int32Array(0);
|
|
22
|
+
_leaves = new Int32Array(0);
|
|
23
|
+
_visit = new Uint32Array(0);
|
|
24
|
+
_stamp = 0;
|
|
25
|
+
_stack = new Int32Array(64);
|
|
26
|
+
_found = new Int32Array(64);
|
|
27
|
+
_capsule = new W();
|
|
28
|
+
_hit = { normal: new Float64Array(3), depth: 0 };
|
|
29
|
+
_v = new Float64Array(12);
|
|
30
|
+
/** @internal */
|
|
31
|
+
constructor(t = {}) {
|
|
32
|
+
if (this._perLeaf = t.trianglesPerLeaf ?? 8, this._maxLevel = t.maxLevel ?? 16, !(this._perLeaf >= 1) || !(this._maxLevel >= 0))
|
|
33
|
+
throw new T("invalid-option", "[Nova3D] Octree trianglesPerLeaf must be ≥ 1 and maxLevel ≥ 0.");
|
|
34
|
+
}
|
|
35
|
+
/** Number of triangles in the tree. */
|
|
36
|
+
get triangleCount() {
|
|
37
|
+
return this._built ? this._triangles.length / 9 : this._pending.length / 9;
|
|
38
|
+
}
|
|
39
|
+
/** Bounds of the built tree `[minX, minY, minZ, maxX, maxY, maxZ]`, or null when empty. */
|
|
40
|
+
get bounds() {
|
|
41
|
+
return this._built && this._boxes.length ? this._boxes.subarray(0, 6) : null;
|
|
42
|
+
}
|
|
43
|
+
/** Adds triangles from xyz positions, optional indices and an optional column-major world matrix. */
|
|
44
|
+
addTriangles(t, s, n) {
|
|
45
|
+
this._assertOpen();
|
|
46
|
+
const c = s ? s.length : t.length / 3;
|
|
47
|
+
for (let e = 0; e + 2 < c; e += 3)
|
|
48
|
+
for (let o = 0; o < 3; o++) {
|
|
49
|
+
const h = (s ? s[e + o] : e + o) * 3, a = t[h], i = t[h + 1], r = t[h + 2];
|
|
50
|
+
if (n) {
|
|
51
|
+
const f = 1 / (n[3] * a + n[7] * i + n[11] * r + n[15]);
|
|
52
|
+
this._pending.push(
|
|
53
|
+
(n[0] * a + n[4] * i + n[8] * r + n[12]) * f,
|
|
54
|
+
(n[1] * a + n[5] * i + n[9] * r + n[13]) * f,
|
|
55
|
+
(n[2] * a + n[6] * i + n[10] * r + n[14]) * f
|
|
56
|
+
);
|
|
57
|
+
} else
|
|
58
|
+
this._pending.push(a, i, r);
|
|
59
|
+
}
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
/** Adds every triangle mesh under `node` (including it) in world space. Instanced meshes are skipped. */
|
|
63
|
+
addNode(t) {
|
|
64
|
+
this._assertOpen();
|
|
65
|
+
const s = [t], n = [];
|
|
66
|
+
for (; s.length; ) {
|
|
67
|
+
const c = s.pop();
|
|
68
|
+
n.push(c);
|
|
69
|
+
const e = c.children;
|
|
70
|
+
for (let o = e.length - 1; o >= 0; o--)
|
|
71
|
+
s.push(e[o]);
|
|
72
|
+
}
|
|
73
|
+
for (const c of n)
|
|
74
|
+
if (c instanceof H && !(c instanceof G) && c.geometry.topology === "triangles") {
|
|
75
|
+
const e = c.geometry._buffers(), o = c.geometry.drawRange, h = e.indices ? e.indices.subarray(o.start, o.start + o.count) : null, a = h ? e.positions : e.positions.subarray(o.start * 3, (o.start + o.count) * 3);
|
|
76
|
+
this.addTriangles(a, h, c.getWorldMatrix());
|
|
77
|
+
}
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
/** Splits the tree. Call once after adding triangles; queries need a built tree. */
|
|
81
|
+
build() {
|
|
82
|
+
this._assertOpen();
|
|
83
|
+
const t = Float64Array.from(this._pending);
|
|
84
|
+
this._pending = [], this._built = !0;
|
|
85
|
+
const s = t.length / 9;
|
|
86
|
+
this._triangles = t, this._planes = new Float64Array(s * 4);
|
|
87
|
+
for (let c = 0; c < s; c++)
|
|
88
|
+
K(t, c * 9, this._planes, c * 4);
|
|
89
|
+
if (this._visit = new Uint32Array(s), !s)
|
|
90
|
+
return this;
|
|
91
|
+
const n = { box: new Float64Array([1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0]), triangles: [], children: [] };
|
|
92
|
+
for (let c = 0; c < s; c++) {
|
|
93
|
+
const e = c * 9;
|
|
94
|
+
for (let o = 0; o < 3; o++)
|
|
95
|
+
n.box[o] = Math.min(n.box[o], t[e + o], t[e + 3 + o], t[e + 6 + o]), n.box[o + 3] = Math.max(n.box[o + 3], t[e + o], t[e + 3 + o], t[e + 6 + o]);
|
|
96
|
+
n.triangles.push(c);
|
|
97
|
+
}
|
|
98
|
+
return n.box[0] -= 0.01, n.box[1] -= 0.01, n.box[2] -= 0.01, this._split(n, 0), this._flatten(n), this;
|
|
99
|
+
}
|
|
100
|
+
/** Resolves a capsule against the level; returns null when it touches nothing. */
|
|
101
|
+
capsuleIntersect(t, s = { normal: new Float64Array(3), depth: 0 }) {
|
|
102
|
+
this._assertBuilt();
|
|
103
|
+
const n = this._capsule.copy(t), c = this._collect(n, 0);
|
|
104
|
+
let e = !1;
|
|
105
|
+
for (let h = 0; h < c; h++)
|
|
106
|
+
this._triangleCapsule(n, this._found[h], this._hit) && (e = !0, n.translate(this._hit.normal, this._hit.depth));
|
|
107
|
+
if (!e)
|
|
108
|
+
return null;
|
|
109
|
+
const o = this._v;
|
|
110
|
+
return n.getCenter(o), j(
|
|
111
|
+
o[0] - (t.start[0] + t.end[0]) * 0.5,
|
|
112
|
+
o[1] - (t.start[1] + t.end[1]) * 0.5,
|
|
113
|
+
o[2] - (t.start[2] + t.end[2]) * 0.5,
|
|
114
|
+
s
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
/** Resolves a sphere at `center` with `radius`; returns null when it touches nothing. */
|
|
118
|
+
sphereIntersect(t, s, n = { normal: new Float64Array(3), depth: 0 }) {
|
|
119
|
+
this._assertBuilt();
|
|
120
|
+
const c = this._v;
|
|
121
|
+
c[3] = t[0], c[4] = t[1], c[5] = t[2];
|
|
122
|
+
const e = this._collect(null, s, t);
|
|
123
|
+
let o = !1;
|
|
124
|
+
for (let h = 0; h < e; h++)
|
|
125
|
+
this._triangleSphere(c, 3, s, this._found[h], this._hit) && (o = !0, c[3] += this._hit.normal[0] * this._hit.depth, c[4] += this._hit.normal[1] * this._hit.depth, c[5] += this._hit.normal[2] * this._hit.depth);
|
|
126
|
+
return o ? j(c[3] - t[0], c[4] - t[1], c[5] - t[2], n) : null;
|
|
127
|
+
}
|
|
128
|
+
/** Nearest front-facing triangle along a ray with a unit `direction`. */
|
|
129
|
+
rayIntersect(t, s, n = { point: new Float64Array(3), distance: 0, triangle: -1 }) {
|
|
130
|
+
if (this._assertBuilt(), !this._boxes.length)
|
|
131
|
+
return null;
|
|
132
|
+
const c = this._triangles;
|
|
133
|
+
let e = 1 / 0, o = -1;
|
|
134
|
+
const h = this._nextStamp();
|
|
135
|
+
let a = 0;
|
|
136
|
+
const i = this._stack;
|
|
137
|
+
for (i[a++] = 0; a; ) {
|
|
138
|
+
const r = i[--a], f = this._nodes[r * 4 + 3];
|
|
139
|
+
if (f) {
|
|
140
|
+
const _ = this._nodes[r * 4 + 2];
|
|
141
|
+
for (let y = 0; y < f; y++) {
|
|
142
|
+
const p = this._leaves[_ + y];
|
|
143
|
+
if (this._visit[p] === h)
|
|
144
|
+
continue;
|
|
145
|
+
this._visit[p] = h;
|
|
146
|
+
const d = Z(t, s, c, p * 9);
|
|
147
|
+
d < e && (e = d, o = p);
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
a = this._pushChildren(r, a, (_) => Y(t, s, this._boxes, _ * 6));
|
|
152
|
+
}
|
|
153
|
+
return o < 0 ? null : (n.distance = e, n.triangle = o, n.point[0] = t[0] + s[0] * e, n.point[1] = t[1] + s[1] * e, n.point[2] = t[2] + s[2] * e, n);
|
|
154
|
+
}
|
|
155
|
+
/** Visits leaf boxes `[minX, minY, minZ, maxX, maxY, maxZ]` for debug drawing. */
|
|
156
|
+
forEachLeafBox(t) {
|
|
157
|
+
this._assertBuilt();
|
|
158
|
+
for (let s = 0; s < this._nodes.length / 4; s++)
|
|
159
|
+
this._nodes[s * 4 + 3] && t(this._boxes.subarray(s * 6, s * 6 + 6));
|
|
160
|
+
}
|
|
161
|
+
_split(t, s) {
|
|
162
|
+
const n = [(t.box[3] - t.box[0]) * 0.5, (t.box[4] - t.box[1]) * 0.5, (t.box[5] - t.box[2]) * 0.5], c = [];
|
|
163
|
+
for (let e = 0; e < 2; e++)
|
|
164
|
+
for (let o = 0; o < 2; o++)
|
|
165
|
+
for (let h = 0; h < 2; h++) {
|
|
166
|
+
const a = new Float64Array(6);
|
|
167
|
+
a[0] = t.box[0] + e * n[0], a[1] = t.box[1] + o * n[1], a[2] = t.box[2] + h * n[2], a[3] = a[0] + n[0], a[4] = a[1] + n[1], a[5] = a[2] + n[2], c.push({ box: a, triangles: [], children: [] });
|
|
168
|
+
}
|
|
169
|
+
for (; t.triangles.length; ) {
|
|
170
|
+
const e = t.triangles.pop();
|
|
171
|
+
for (const o of c)
|
|
172
|
+
V(o.box, this._triangles, e * 9) && o.triangles.push(e);
|
|
173
|
+
}
|
|
174
|
+
for (const e of c) {
|
|
175
|
+
const o = e.triangles.length;
|
|
176
|
+
o > this._perLeaf && s < this._maxLevel && this._split(e, s + 1), o !== 0 && t.children.push(e);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
_flatten(t) {
|
|
180
|
+
const s = [], n = [t];
|
|
181
|
+
for (; n.length; ) {
|
|
182
|
+
const i = n.shift();
|
|
183
|
+
s.push(i), n.push(...i.children);
|
|
184
|
+
}
|
|
185
|
+
const c = new Map(s.map((i, r) => [i, r]));
|
|
186
|
+
this._boxes = new Float64Array(s.length * 6), this._nodes = new Int32Array(s.length * 4);
|
|
187
|
+
const e = [], o = [];
|
|
188
|
+
s.forEach((i, r) => {
|
|
189
|
+
this._boxes.set(i.box, r * 6), this._nodes[r * 4] = e.length, this._nodes[r * 4 + 1] = i.children.length;
|
|
190
|
+
for (const f of i.children)
|
|
191
|
+
e.push(c.get(f));
|
|
192
|
+
this._nodes[r * 4 + 2] = o.length, this._nodes[r * 4 + 3] = i.triangles.length, o.push(...i.triangles);
|
|
193
|
+
}), this._children = Int32Array.from(e), this._leaves = Int32Array.from(o);
|
|
194
|
+
let h = 0;
|
|
195
|
+
const a = (i, r) => {
|
|
196
|
+
h = Math.max(h, r), i.children.forEach((f) => a(f, r + 1));
|
|
197
|
+
};
|
|
198
|
+
a(t, 1), this._stack = new Int32Array(Math.max(64, s.length, h * 8 + 8)), this._found = new Int32Array(Math.max(64, this.triangleCount));
|
|
199
|
+
}
|
|
200
|
+
/** Collects unique candidate triangles (three.js order) into `_found`; capsule or sphere bounds. */
|
|
201
|
+
_collect(t, s, n) {
|
|
202
|
+
if (!this._boxes.length)
|
|
203
|
+
return 0;
|
|
204
|
+
const c = this._nextStamp();
|
|
205
|
+
let e = 0;
|
|
206
|
+
const o = this._boxes, h = this._nodes;
|
|
207
|
+
let a = 0, i = this._stack;
|
|
208
|
+
const r = h[0];
|
|
209
|
+
for (let f = h[1] - 1; f >= 0; f--)
|
|
210
|
+
i[a++] = this._children[r + f];
|
|
211
|
+
for (; a; ) {
|
|
212
|
+
const f = i[--a];
|
|
213
|
+
if (t ? !t.intersectsBox(o, f * 6) : !X(n, s, o, f * 6))
|
|
214
|
+
continue;
|
|
215
|
+
const _ = h[f * 4 + 3];
|
|
216
|
+
if (_) {
|
|
217
|
+
const d = h[f * 4 + 2];
|
|
218
|
+
for (let M = 0; M < _; M++) {
|
|
219
|
+
const b = this._leaves[d + M];
|
|
220
|
+
if (this._visit[b] !== c) {
|
|
221
|
+
if (this._visit[b] = c, e === this._found.length) {
|
|
222
|
+
const m = new Int32Array(e * 2);
|
|
223
|
+
m.set(this._found), this._found = m;
|
|
224
|
+
}
|
|
225
|
+
this._found[e++] = b;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
const y = h[f * 4], p = h[f * 4 + 1];
|
|
231
|
+
if (a + p > i.length) {
|
|
232
|
+
const d = new Int32Array((a + p) * 2);
|
|
233
|
+
d.set(i), i = this._stack = d;
|
|
234
|
+
}
|
|
235
|
+
for (let d = p - 1; d >= 0; d--)
|
|
236
|
+
i[a++] = this._children[y + d];
|
|
237
|
+
}
|
|
238
|
+
return e;
|
|
239
|
+
}
|
|
240
|
+
_pushChildren(t, s, n) {
|
|
241
|
+
const c = this._nodes[t * 4], e = this._nodes[t * 4 + 1];
|
|
242
|
+
for (let o = e - 1; o >= 0; o--) {
|
|
243
|
+
const h = this._children[c + o];
|
|
244
|
+
if (n(h)) {
|
|
245
|
+
if (s === this._stack.length) {
|
|
246
|
+
const a = new Int32Array(s * 2);
|
|
247
|
+
a.set(this._stack), this._stack = a;
|
|
248
|
+
}
|
|
249
|
+
this._stack[s++] = h;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return s;
|
|
253
|
+
}
|
|
254
|
+
_nextStamp() {
|
|
255
|
+
return this._stamp = this._stamp + 1 >>> 0, this._stamp === 0 && (this._visit.fill(0), this._stamp = 1), this._stamp;
|
|
256
|
+
}
|
|
257
|
+
_triangleCapsule(t, s, n) {
|
|
258
|
+
const c = this._planes, e = s * 4, o = c[e], h = c[e + 1], a = c[e + 2], i = c[e + 3], r = t.start, f = t.end, _ = t.radius, y = o * r[0] + h * r[1] + a * r[2] + i - _, p = o * f[0] + h * f[1] + a * f[2] + i - _;
|
|
259
|
+
if (y > 0 && p > 0 || y < -_ && p < -_)
|
|
260
|
+
return !1;
|
|
261
|
+
const d = Math.abs(y / (Math.abs(y) + Math.abs(p))), M = r[0] + (f[0] - r[0]) * d, b = r[1] + (f[1] - r[1]) * d, m = r[2] + (f[2] - r[2]) * d, z = this._triangles, u = s * 9;
|
|
262
|
+
if (R(z, u, M, b, m))
|
|
263
|
+
return n.normal[0] = o, n.normal[1] = h, n.normal[2] = a, n.depth = Math.abs(Math.min(y, p)), !0;
|
|
264
|
+
const x = _ * _, v = this._v;
|
|
265
|
+
for (let g = 0; g < 3; g++) {
|
|
266
|
+
const A = u + g * 3, I = u + (g + 1) % 3 * 3;
|
|
267
|
+
Q(r, f, z, A, I, v);
|
|
268
|
+
const F = v[0] - v[3], w = v[1] - v[4], q = v[2] - v[5], k = F * F + w * w + q * q;
|
|
269
|
+
if (k < x) {
|
|
270
|
+
const C = Math.sqrt(k), L = C > 0 ? 1 / C : 0;
|
|
271
|
+
return n.normal[0] = F * L, n.normal[1] = w * L, n.normal[2] = q * L, n.depth = _ - C, !0;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return !1;
|
|
275
|
+
}
|
|
276
|
+
_triangleSphere(t, s, n, c, e) {
|
|
277
|
+
const o = this._planes, h = c * 4, a = o[h], i = o[h + 1], r = o[h + 2], f = t[s], _ = t[s + 1], y = t[s + 2], p = a * f + i * _ + r * y + o[h + 3];
|
|
278
|
+
if (Math.abs(p) > n)
|
|
279
|
+
return !1;
|
|
280
|
+
const d = Math.abs(p - n), M = n * n - d * d, b = f - a * p, m = _ - i * p, z = y - r * p, u = this._triangles, x = c * 9;
|
|
281
|
+
if (R(u, x, f, _, y))
|
|
282
|
+
return e.normal[0] = a, e.normal[1] = i, e.normal[2] = r, e.depth = d, !0;
|
|
283
|
+
for (let v = 0; v < 3; v++) {
|
|
284
|
+
const g = x + v * 3, A = x + (v + 1) % 3 * 3, I = u[A] - u[g], F = u[A + 1] - u[g + 1], w = u[A + 2] - u[g + 2], q = I * I + F * F + w * w;
|
|
285
|
+
let k = q > 0 ? ((b - u[g]) * I + (m - u[g + 1]) * F + (z - u[g + 2]) * w) / q : 0;
|
|
286
|
+
k = Math.max(0, Math.min(1, k));
|
|
287
|
+
const C = u[g] + I * k, L = u[g + 1] + F * k, D = u[g + 2] + w * k, N = f - C, B = _ - L, O = y - D, P = N * N + B * B + O * O;
|
|
288
|
+
if (P < M) {
|
|
289
|
+
const E = Math.sqrt(P), S = E > 0 ? 1 / E : 0;
|
|
290
|
+
return e.normal[0] = N * S, e.normal[1] = B * S, e.normal[2] = O * S, e.depth = n - E, !0;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return !1;
|
|
294
|
+
}
|
|
295
|
+
_assertOpen() {
|
|
296
|
+
if (this._built)
|
|
297
|
+
throw new T("state", "[Nova3D] Octree is already built; create a new one to add triangles.");
|
|
298
|
+
}
|
|
299
|
+
_assertBuilt() {
|
|
300
|
+
if (!this._built)
|
|
301
|
+
throw new T("state", "[Nova3D] Octree must be built before queries.");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function et(l) {
|
|
305
|
+
return new J(l);
|
|
306
|
+
}
|
|
307
|
+
function j(l, t, s, n) {
|
|
308
|
+
const c = Math.sqrt(l * l + t * t + s * s), e = c > 0 ? 1 / c : 0;
|
|
309
|
+
return n.normal[0] = l * e, n.normal[1] = t * e, n.normal[2] = s * e, n.depth = c, n;
|
|
310
|
+
}
|
|
311
|
+
function K(l, t, s, n) {
|
|
312
|
+
const c = l[t + 6] - l[t + 3], e = l[t + 7] - l[t + 4], o = l[t + 8] - l[t + 5], h = l[t] - l[t + 3], a = l[t + 1] - l[t + 4], i = l[t + 2] - l[t + 5];
|
|
313
|
+
let r = e * i - o * a, f = o * h - c * i, _ = c * a - e * h;
|
|
314
|
+
const y = r * r + f * f + _ * _;
|
|
315
|
+
if (y > 0) {
|
|
316
|
+
const p = 1 / Math.sqrt(y);
|
|
317
|
+
r *= p, f *= p, _ *= p;
|
|
318
|
+
} else
|
|
319
|
+
r = 0, f = 0, _ = 0;
|
|
320
|
+
s[n] = r, s[n + 1] = f, s[n + 2] = _, s[n + 3] = -(r * l[t] + f * l[t + 1] + _ * l[t + 2]);
|
|
321
|
+
}
|
|
322
|
+
function R(l, t, s, n, c) {
|
|
323
|
+
const e = l[t], o = l[t + 1], h = l[t + 2], a = l[t + 6] - e, i = l[t + 7] - o, r = l[t + 8] - h, f = l[t + 3] - e, _ = l[t + 4] - o, y = l[t + 5] - h, p = s - e, d = n - o, M = c - h, b = a * a + i * i + r * r, m = a * f + i * _ + r * y, z = a * p + i * d + r * M, u = f * f + _ * _ + y * y, x = f * p + _ * d + y * M, v = b * u - m * m;
|
|
324
|
+
if (v === 0)
|
|
325
|
+
return !1;
|
|
326
|
+
const g = 1 / v, A = (u * z - m * x) * g, I = (b * x - m * z) * g;
|
|
327
|
+
return 1 - A - I >= 0 && I >= 0 && 1 - A - I + I <= 1;
|
|
328
|
+
}
|
|
329
|
+
function Q(l, t, s, n, c, e) {
|
|
330
|
+
const o = t[0] - l[0], h = t[1] - l[1], a = t[2] - l[2], i = s[c] - s[n], r = s[c + 1] - s[n + 1], f = s[c + 2] - s[n + 2], _ = s[n] - l[0], y = s[n + 1] - l[1], p = s[n + 2] - l[2], d = o * i + h * r + a * f, M = o * o + h * h + a * a, b = i * i + r * r + f * f, m = i * _ + r * y + f * p, z = o * _ + h * y + a * p;
|
|
331
|
+
let u, x;
|
|
332
|
+
const v = M * b - d * d;
|
|
333
|
+
if (Math.abs(v) < U) {
|
|
334
|
+
const g = -m / b, A = (d - m) / b;
|
|
335
|
+
Math.abs(g - 0.5) < Math.abs(A - 0.5) ? (u = 0, x = g) : (u = 1, x = A);
|
|
336
|
+
} else
|
|
337
|
+
u = (m * d + z * b) / v, x = (u * d - m) / b;
|
|
338
|
+
x = Math.max(0, Math.min(1, x)), u = Math.max(0, Math.min(1, u)), e[0] = l[0] + o * u, e[1] = l[1] + h * u, e[2] = l[2] + a * u, e[3] = s[n] + i * x, e[4] = s[n + 1] + r * x, e[5] = s[n + 2] + f * x;
|
|
339
|
+
}
|
|
340
|
+
function V(l, t, s) {
|
|
341
|
+
const n = (l[0] + l[3]) * 0.5, c = (l[1] + l[4]) * 0.5, e = (l[2] + l[5]) * 0.5, o = l[3] - n, h = l[4] - c, a = l[5] - e, i = t[s] - n, r = t[s + 1] - c, f = t[s + 2] - e, _ = t[s + 3] - n, y = t[s + 4] - c, p = t[s + 5] - e, d = t[s + 6] - n, M = t[s + 7] - c, b = t[s + 8] - e, m = _ - i, z = y - r, u = p - f, x = d - _, v = M - y, g = b - p, A = i - d, I = r - M, F = f - b, w = (q, k, C) => {
|
|
342
|
+
const L = o * Math.abs(q) + h * Math.abs(k) + a * Math.abs(C), D = i * q + r * k + f * C, N = _ * q + y * k + p * C, B = d * q + M * k + b * C;
|
|
343
|
+
return !(Math.max(-Math.max(D, N, B), Math.min(D, N, B)) > L);
|
|
344
|
+
};
|
|
345
|
+
return w(0, -u, z) && w(0, -g, v) && w(0, -F, I) && w(u, 0, -m) && w(g, 0, -x) && w(F, 0, -A) && w(-z, m, 0) && w(-v, x, 0) && w(-I, A, 0) && w(1, 0, 0) && w(0, 1, 0) && w(0, 0, 1) && w(z * g - u * v, u * x - m * g, m * v - z * x);
|
|
346
|
+
}
|
|
347
|
+
function X(l, t, s, n) {
|
|
348
|
+
let c = 0;
|
|
349
|
+
for (let e = 0; e < 3; e++) {
|
|
350
|
+
const o = l[e], h = o < s[n + e] ? s[n + e] - o : o > s[n + e + 3] ? o - s[n + e + 3] : 0;
|
|
351
|
+
c += h * h;
|
|
352
|
+
}
|
|
353
|
+
return c <= t * t;
|
|
354
|
+
}
|
|
355
|
+
function Y(l, t, s, n) {
|
|
356
|
+
let c = 0, e = 1 / 0;
|
|
357
|
+
for (let o = 0; o < 3; o++) {
|
|
358
|
+
const h = 1 / t[o];
|
|
359
|
+
let a = (s[n + o] - l[o]) * h, i = (s[n + o + 3] - l[o]) * h;
|
|
360
|
+
if (a > i) {
|
|
361
|
+
const r = a;
|
|
362
|
+
a = i, i = r;
|
|
363
|
+
}
|
|
364
|
+
if (c = a > c ? a : c, e = i < e ? i : e, e < c)
|
|
365
|
+
return !1;
|
|
366
|
+
}
|
|
367
|
+
return !0;
|
|
368
|
+
}
|
|
369
|
+
function Z(l, t, s, n) {
|
|
370
|
+
const c = s[n + 3] - s[n], e = s[n + 4] - s[n + 1], o = s[n + 5] - s[n + 2], h = s[n + 6] - s[n], a = s[n + 7] - s[n + 1], i = s[n + 8] - s[n + 2], r = t[1] * i - t[2] * a, f = t[2] * h - t[0] * i, _ = t[0] * a - t[1] * h, y = c * r + e * f + o * _;
|
|
371
|
+
if (y < U)
|
|
372
|
+
return 1 / 0;
|
|
373
|
+
const p = 1 / y, d = l[0] - s[n], M = l[1] - s[n + 1], b = l[2] - s[n + 2], m = (d * r + M * f + b * _) * p;
|
|
374
|
+
if (m < 0 || m > 1)
|
|
375
|
+
return 1 / 0;
|
|
376
|
+
const z = M * o - b * e, u = b * c - d * o, x = d * e - M * c, v = (t[0] * z + t[1] * u + t[2] * x) * p;
|
|
377
|
+
if (v < 0 || m + v > 1)
|
|
378
|
+
return 1 / 0;
|
|
379
|
+
const g = (h * z + a * u + i * x) * p;
|
|
380
|
+
return g >= 0 ? g : 1 / 0;
|
|
381
|
+
}
|
|
382
|
+
export {
|
|
383
|
+
W as Nova3DCapsule,
|
|
384
|
+
J as Nova3DOctree,
|
|
385
|
+
at as createCapsule,
|
|
386
|
+
et as createOctree
|
|
387
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { defineCommand as h } from "@typedworks/commands";
|
|
2
|
+
import { defineHistoryOperation as f } from "@typedworks/history";
|
|
3
|
+
import { registerUndoableCommand as _, bindHistoryCommands as l } from "@typedworks/history/commands";
|
|
4
|
+
import { N as s } from "../Errors-B2ekO9bZ.js";
|
|
5
|
+
import { c as g, o as y } from "../Options-CajE7LLJ.js";
|
|
6
|
+
import { i as v } from "../Node-QfgAE2_v.js";
|
|
7
|
+
import { s as w, a as p, d as D } from "../Document-DCVEZSvM.js";
|
|
8
|
+
const c = Object.freeze({
|
|
9
|
+
apply: h("nova3d.document.apply"),
|
|
10
|
+
undo: h("nova3d.document.undo"),
|
|
11
|
+
redo: h("nova3d.document.redo")
|
|
12
|
+
}), b = y({ commandScope: !0, history: !0 });
|
|
13
|
+
class N {
|
|
14
|
+
_cleanup = [];
|
|
15
|
+
_destroyed = !1;
|
|
16
|
+
_gesture;
|
|
17
|
+
_options;
|
|
18
|
+
/** @internal */
|
|
19
|
+
constructor(e, r) {
|
|
20
|
+
this._options = { ...r, document: e };
|
|
21
|
+
const { commandScope: t, history: d } = this._options;
|
|
22
|
+
this._cleanup.push(e._bindCommands(this));
|
|
23
|
+
try {
|
|
24
|
+
const i = f({ id: "nova3d.document.apply", prepare: (o) => {
|
|
25
|
+
const n = e.getSnapshot();
|
|
26
|
+
if (o.expectedRevision !== void 0 && o.expectedRevision !== n.revision)
|
|
27
|
+
throw new s("state", "[Nova3D] Document command revision conflict.");
|
|
28
|
+
const m = e._prepare(o.changes);
|
|
29
|
+
return { run: (a) => (a.signal.throwIfAborted(), e._commit(m, n.revision)), undo: (a) => {
|
|
30
|
+
a.signal.throwIfAborted(), e._restore(m, n);
|
|
31
|
+
}, redo: (a) => {
|
|
32
|
+
a.signal.throwIfAborted(), e._restore(n, m);
|
|
33
|
+
}, didChange: (a) => !w(n, a) };
|
|
34
|
+
} });
|
|
35
|
+
this._cleanup.push(_({ command: c.apply, scope: t, history: d, operation: i })), this._cleanup.push(l({ scope: t, history: d, undo: c.undo, redo: c.redo })), this._cleanup.push(e.onChange((o) => {
|
|
36
|
+
o.kind === "destroy" ? this.destroy() : o.kind === "change" && this._gesture && this._gesture.revision !== o.snapshot.revision && this.cancelGesture();
|
|
37
|
+
}));
|
|
38
|
+
} catch (i) {
|
|
39
|
+
throw this.destroy(), i;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
execute(e) {
|
|
43
|
+
return this._assertAlive(), this._options.commandScope.execute(c.apply, e);
|
|
44
|
+
}
|
|
45
|
+
/** Pass to the gizmo callback; returned completion handles command failures explicitly. */
|
|
46
|
+
async onGesture(e) {
|
|
47
|
+
this._assertAlive();
|
|
48
|
+
const r = this._options.document;
|
|
49
|
+
if (e.type === "begin") {
|
|
50
|
+
if (this._gesture)
|
|
51
|
+
throw new s("state", "[Nova3D] A document gesture is already active.");
|
|
52
|
+
const d = r.getSnapshot(), i = d.nodes.find((n) => n.id === e.node.id);
|
|
53
|
+
if (!i || !e.node._isDocumentNode(r))
|
|
54
|
+
throw new s("invalid-option", "[Nova3D] Gesture requires a node projected from this document.");
|
|
55
|
+
const o = e.node._baseTransform();
|
|
56
|
+
if (e.node._hasAnimatedTransform() || !p(o, e.from))
|
|
57
|
+
throw new s("state", "[Nova3D] Stop animation before editing its evaluated transform with a document gizmo.");
|
|
58
|
+
if (!p(o, D(v(), i.transform ?? {})))
|
|
59
|
+
throw new s("state", "[Nova3D] Wait for the current document projection before beginning a gesture.");
|
|
60
|
+
this._gesture = { id: i.id, revision: d.revision };
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const t = this._gesture;
|
|
64
|
+
if (!t || t.id !== e.node.id)
|
|
65
|
+
throw new s("owner", "[Nova3D] Document gesture owner mismatch.");
|
|
66
|
+
if (e.type === "cancel") {
|
|
67
|
+
this.cancelGesture();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (r.getSnapshot().revision !== t.revision)
|
|
71
|
+
throw this.cancelGesture(), new s("state", "[Nova3D] Document changed during the gesture.");
|
|
72
|
+
if (e.type === "change") {
|
|
73
|
+
r._setPreview(this, t.id, e.transform);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this._gesture = void 0;
|
|
77
|
+
try {
|
|
78
|
+
await this.execute({ changes: [{ type: "transform", id: t.id, transform: e.transform }], expectedRevision: t.revision });
|
|
79
|
+
} finally {
|
|
80
|
+
r._clearPreview(this);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
cancelGesture() {
|
|
84
|
+
this._gesture = void 0, this._options.document._clearPreview(this);
|
|
85
|
+
}
|
|
86
|
+
get destroyed() {
|
|
87
|
+
return this._destroyed;
|
|
88
|
+
}
|
|
89
|
+
destroy() {
|
|
90
|
+
if (!this._destroyed) {
|
|
91
|
+
this.cancelGesture(), this._destroyed = !0;
|
|
92
|
+
for (const e of this._cleanup.splice(0).reverse())
|
|
93
|
+
e();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
_assertAlive() {
|
|
97
|
+
if (this._destroyed || this._options.document.destroyed)
|
|
98
|
+
throw new s("destroyed", "[Nova3D] Document command binding is destroyed.");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function k(u, e) {
|
|
102
|
+
return g(e, b, "document commands"), new N(u, e);
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
N as Nova3DDocumentCommands,
|
|
106
|
+
k as createDocumentCommands,
|
|
107
|
+
c as documentCommands
|
|
108
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createFirstPersonControls, createFlyControls, Nova3DCameraMotionControls, Nova3DFirstPersonControls, Nova3DFlyControls } from '../features/3d/controls/CameraMotionControls.js';
|
|
2
|
+
export type { CameraKeyAction3D, CameraKeyMap3D, CameraMotionOptions3D, FirstPersonControlsOptions3D, FlyControlsOptions3D } from '../features/3d/controls/CameraMotionControls.js';
|
|
3
|
+
export { createOrbitControls, Nova3DOrbitControls } from '../features/3d/controls/OrbitControls.js';
|
|
4
|
+
export type { OrbitControlsOptions3D } from '../features/3d/controls/OrbitControls.js';
|
|
5
|
+
export { snapRotation, snapScale, snapTranslation } from '../features/3d/controls/Snapping.js';
|
|
6
|
+
export type { SnapOptions3D, TranslationSnapOptions3D } from '../features/3d/controls/Snapping.js';
|
|
7
|
+
export { createTransformGizmo, Nova3DTransformGizmo } from '../features/3d/controls/TransformGizmo.js';
|
|
8
|
+
export type { TransformGesture3D, TransformGizmoOptions3D, TransformMode3D, TransformSpace3D } from '../features/3d/controls/TransformGizmo.js';
|