@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,246 @@
|
|
|
1
|
+
import { Nova3DTexture } from '../model/Texture.js';
|
|
2
|
+
import { Nova3DApp } from '../Nova3DApp.js';
|
|
3
|
+
import { ReadyOptions3D } from '../tools/Ready.js';
|
|
4
|
+
/**
|
|
5
|
+
* Glyph metrics in pixels at the rasterized size, as `CanvasRenderingContext2D.measureText`.
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Options of `atlas.whenReady`.
|
|
10
|
+
* @experimental
|
|
11
|
+
*/
|
|
12
|
+
export interface FontReadyOptions3D extends ReadyOptions3D {
|
|
13
|
+
/** Characters whose font faces must be loaded (unicode-range subsets); default the basic face. */
|
|
14
|
+
text?: string;
|
|
15
|
+
}
|
|
16
|
+
/** @experimental */
|
|
17
|
+
export interface GlyphMetrics3D {
|
|
18
|
+
advance: number;
|
|
19
|
+
/** Ink extent left of the pen origin (actualBoundingBoxLeft). */
|
|
20
|
+
left: number;
|
|
21
|
+
/** Ink extent right of the pen origin (actualBoundingBoxRight). */
|
|
22
|
+
right: number;
|
|
23
|
+
/** Ink extent above the alphabetic baseline. */
|
|
24
|
+
ascent: number;
|
|
25
|
+
/** Ink extent below the alphabetic baseline. */
|
|
26
|
+
descent: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Font rasterizer behind an atlas: Canvas 2D by default; tests and custom font
|
|
30
|
+
* engines inject their own. `font` is a CSS font shorthand at the SDF size.
|
|
31
|
+
* @experimental
|
|
32
|
+
*/
|
|
33
|
+
export interface GlyphRasterizer3D {
|
|
34
|
+
/** Font ascent and descent above and below the alphabetic baseline, in pixels. */
|
|
35
|
+
measureFont: (font: string) => {
|
|
36
|
+
ascent: number;
|
|
37
|
+
descent: number;
|
|
38
|
+
};
|
|
39
|
+
measureGlyph: (text: string, font: string) => GlyphMetrics3D;
|
|
40
|
+
/** Advance of a whole string with the font's kerning, in pixels. */
|
|
41
|
+
measureWidth: (text: string, font: string) => number;
|
|
42
|
+
/**
|
|
43
|
+
* Draws `text` with its pen at (`x`, `y`) on the alphabetic baseline into a cleared
|
|
44
|
+
* `width`×`height` area and returns its RGBA pixels from the top row; alpha is coverage.
|
|
45
|
+
*/
|
|
46
|
+
rasterize: (text: string, font: string, x: number, y: number, width: number, height: number) => ArrayLike<number>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Font face and SDF settings of a glyph atlas.
|
|
50
|
+
* @experimental
|
|
51
|
+
*/
|
|
52
|
+
export interface FontOptions3D {
|
|
53
|
+
/** CSS font-family list; default 'sans-serif'. Load web fonts first (`atlas.whenReady`). */
|
|
54
|
+
family?: string;
|
|
55
|
+
/** CSS font-weight; default 'normal'. */
|
|
56
|
+
weight?: string | number;
|
|
57
|
+
style?: 'normal' | 'italic' | 'oblique';
|
|
58
|
+
/** Rasterized em size in pixels, an integer in [8, 256]; default 48. */
|
|
59
|
+
sdfSize?: number;
|
|
60
|
+
/** Distance range in pixels encoded by a byte; default sdfSize / 4. */
|
|
61
|
+
radius?: number;
|
|
62
|
+
/** Fraction of the byte range inside the glyph, [0, 1); default 0.25. */
|
|
63
|
+
cutoff?: number;
|
|
64
|
+
/** Padding in pixels around the ink; default ⌈radius·(1 − cutoff)⌉ + 1. */
|
|
65
|
+
buffer?: number;
|
|
66
|
+
/** Atlas width in texels, an integer in [64, 8192]; default 1024. */
|
|
67
|
+
atlasWidth?: number;
|
|
68
|
+
/** Height limit of the growing atlas in texels; default 4096. */
|
|
69
|
+
maxAtlasHeight?: number;
|
|
70
|
+
/** Kerning from measured pair widths of the pairs in use; default true. */
|
|
71
|
+
kerning?: boolean;
|
|
72
|
+
/** Glyph rasterizer; default Canvas 2D (OffscreenCanvas when available). */
|
|
73
|
+
rasterizer?: GlyphRasterizer3D;
|
|
74
|
+
}
|
|
75
|
+
/** Receiver of atlas growth and refresh. */
|
|
76
|
+
export interface FontAtlasUser3D {
|
|
77
|
+
}
|
|
78
|
+
/** Glyph record stride: advance, quad x0 y0 x1 y1 (em), texel u v w h, channel, ink x0 y0 x1 y1 (em). */
|
|
79
|
+
export declare const GLYPH_STRIDE = 15;
|
|
80
|
+
/** Validated font settings with defaults. */
|
|
81
|
+
declare function resolveFont(options: FontOptions3D): {
|
|
82
|
+
family: string;
|
|
83
|
+
weight: string;
|
|
84
|
+
style: "normal" | "italic" | "oblique";
|
|
85
|
+
sdfSize: number;
|
|
86
|
+
radius: number;
|
|
87
|
+
cutoff: number;
|
|
88
|
+
buffer: number;
|
|
89
|
+
atlasWidth: number;
|
|
90
|
+
maxAtlasHeight: number;
|
|
91
|
+
kerning: boolean;
|
|
92
|
+
rasterizer: GlyphRasterizer3D | undefined;
|
|
93
|
+
key: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Runtime SDF glyph atlas of one font, shared per app and ref-counted by the
|
|
97
|
+
* `Nova3DFontAtlas` handles and texts that use it. Glyphs are rasterized by the
|
|
98
|
+
* browser on first use, converted with an exact Euclidean distance transform and
|
|
99
|
+
* packed into the four channels of an RGBA8 texture that grows in height on
|
|
100
|
+
* demand; new glyphs upload as one row band.
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
export declare class FontAtlas3D {
|
|
104
|
+
readonly family: string;
|
|
105
|
+
readonly weight: string;
|
|
106
|
+
readonly style: 'normal' | 'italic' | 'oblique';
|
|
107
|
+
readonly sdfSize: number;
|
|
108
|
+
readonly radius: number;
|
|
109
|
+
readonly cutoff: number;
|
|
110
|
+
readonly buffer: number;
|
|
111
|
+
readonly kerning: boolean;
|
|
112
|
+
/** CSS font shorthand at the SDF size. */
|
|
113
|
+
readonly font: string;
|
|
114
|
+
/** Atlas texels: SDF bytes in R, G, B and A, one glyph layer per channel. */
|
|
115
|
+
readonly texture: Nova3DTexture;
|
|
116
|
+
private readonly _app;
|
|
117
|
+
private readonly _key;
|
|
118
|
+
private readonly _rasterizer;
|
|
119
|
+
private readonly _builder;
|
|
120
|
+
private readonly _maxHeight;
|
|
121
|
+
private readonly _width;
|
|
122
|
+
private _height;
|
|
123
|
+
private _pixels;
|
|
124
|
+
private readonly _ids;
|
|
125
|
+
private _info;
|
|
126
|
+
private _count;
|
|
127
|
+
private readonly _kerning;
|
|
128
|
+
/** Per channel: shelf y, height and fill x as triples, then the channel bottom. */
|
|
129
|
+
private readonly _shelves;
|
|
130
|
+
private readonly _bottoms;
|
|
131
|
+
private _dirtyTop;
|
|
132
|
+
private _dirtyBottom;
|
|
133
|
+
private _ascent;
|
|
134
|
+
private _descent;
|
|
135
|
+
private _refs;
|
|
136
|
+
private _destroyed;
|
|
137
|
+
private readonly _users;
|
|
138
|
+
private readonly _detach;
|
|
139
|
+
constructor(app: Nova3DApp, resolved: ReturnType<typeof resolveFont>);
|
|
140
|
+
/** Atlas width in texels. */
|
|
141
|
+
get width(): number;
|
|
142
|
+
/** Current atlas height in texels; doubles when glyphs no longer fit. */
|
|
143
|
+
get height(): number;
|
|
144
|
+
/** Rasterized glyphs, white space included. */
|
|
145
|
+
get glyphCount(): number;
|
|
146
|
+
/** Handles keeping the atlas alive. */
|
|
147
|
+
get refCount(): number;
|
|
148
|
+
get destroyed(): boolean;
|
|
149
|
+
/** Font ascent in em. */
|
|
150
|
+
get ascent(): number;
|
|
151
|
+
/** Font descent in em. */
|
|
152
|
+
get descent(): number;
|
|
153
|
+
/** Rasterizes the glyphs of `text` now, so later layouts upload nothing. */
|
|
154
|
+
prepare(text: string): void;
|
|
155
|
+
/**
|
|
156
|
+
* Drops every glyph and re-rasterizes on demand, then lays out every text
|
|
157
|
+
* again: call it after a web font finished loading.
|
|
158
|
+
*/
|
|
159
|
+
refresh(): void;
|
|
160
|
+
/**
|
|
161
|
+
* Waits for `document.fonts` to load the face (for `text` when given), then
|
|
162
|
+
* refreshes. Resolves without a refresh where the Font Loading API is missing.
|
|
163
|
+
*/
|
|
164
|
+
whenReady(options?: FontReadyOptions3D): Promise<void>;
|
|
165
|
+
/** Shelf-packs a cell into the first channel with room, growing the atlas when none has. */
|
|
166
|
+
private readonly _placement;
|
|
167
|
+
private _place;
|
|
168
|
+
/** Doubles the atlas height; the texture is reallocated once and every text gets the new size. */
|
|
169
|
+
private _grow;
|
|
170
|
+
private _textureOptions;
|
|
171
|
+
private _measureFont;
|
|
172
|
+
/** App teardown: texts go first so the texture has no material users left. */
|
|
173
|
+
private _teardown;
|
|
174
|
+
private _destroy;
|
|
175
|
+
private _assertAlive;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* A reference to the app's shared SDF glyph atlas of one font. Handles of equal
|
|
179
|
+
* font settings share one atlas: one texture and one set of glyphs, rasterized
|
|
180
|
+
* on first use and packed into the four channels of an RGBA8 texture that grows
|
|
181
|
+
* in height on demand. The atlas is freed when its last handle is destroyed, or
|
|
182
|
+
* with the app. Every text holds its own handle (`text.atlas`).
|
|
183
|
+
* @experimental
|
|
184
|
+
*/
|
|
185
|
+
export declare class Nova3DFontAtlas {
|
|
186
|
+
protected constructor();
|
|
187
|
+
private readonly _textOwned;
|
|
188
|
+
private _destroyed;
|
|
189
|
+
get family(): string;
|
|
190
|
+
get weight(): string;
|
|
191
|
+
get style(): 'normal' | 'italic' | 'oblique';
|
|
192
|
+
get sdfSize(): number;
|
|
193
|
+
get radius(): number;
|
|
194
|
+
get cutoff(): number;
|
|
195
|
+
get buffer(): number;
|
|
196
|
+
get kerning(): boolean;
|
|
197
|
+
/** CSS font shorthand at the SDF size. */
|
|
198
|
+
get font(): string;
|
|
199
|
+
/** Atlas texels: SDF bytes in R, G, B and A, one glyph layer per channel. */
|
|
200
|
+
get texture(): Nova3DTexture;
|
|
201
|
+
/** Atlas width in texels. */
|
|
202
|
+
get width(): number;
|
|
203
|
+
/** Current atlas height in texels; doubles when glyphs no longer fit. */
|
|
204
|
+
get height(): number;
|
|
205
|
+
/** Rasterized glyphs, white space included. */
|
|
206
|
+
get glyphCount(): number;
|
|
207
|
+
/** Live handles of the shared atlas, the ones texts hold included. */
|
|
208
|
+
get refCount(): number;
|
|
209
|
+
/** Font ascent in em. */
|
|
210
|
+
get ascent(): number;
|
|
211
|
+
/** Font descent in em. */
|
|
212
|
+
get descent(): number;
|
|
213
|
+
/** True after `destroy()`, or once the app destroyed the shared atlas. */
|
|
214
|
+
get destroyed(): boolean;
|
|
215
|
+
/** Rasterizes the glyphs of `text` now, so later layouts upload nothing. */
|
|
216
|
+
prepare(text: string): void;
|
|
217
|
+
/**
|
|
218
|
+
* Drops every glyph and re-rasterizes on demand, then lays out every text of
|
|
219
|
+
* the atlas again: call it after a web font finished loading.
|
|
220
|
+
*/
|
|
221
|
+
refresh(): void;
|
|
222
|
+
/**
|
|
223
|
+
* Waits for `document.fonts` to load the face (for `text` when given), then
|
|
224
|
+
* refreshes. Resolves without a refresh where the Font Loading API is missing.
|
|
225
|
+
*/
|
|
226
|
+
whenReady(options?: FontReadyOptions3D): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* Releases this handle; the shared atlas is freed when no handle is left. The
|
|
229
|
+
* handle of a text belongs to the text: destroy the text instead.
|
|
230
|
+
*/
|
|
231
|
+
destroy(): void;
|
|
232
|
+
private _assertAlive;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Returns a new handle to the app's shared atlas of a font (equal options share
|
|
236
|
+
* one atlas); `destroy()` releases it. Owned by the app: destroyed with it.
|
|
237
|
+
* @experimental
|
|
238
|
+
*/
|
|
239
|
+
export declare function createFontAtlas(app: Nova3DApp, font?: FontOptions3D): Nova3DFontAtlas;
|
|
240
|
+
/**
|
|
241
|
+
* The app's shared atlas of a font, created on first use; the caller takes a
|
|
242
|
+
* reference through a handle.
|
|
243
|
+
* @internal
|
|
244
|
+
*/
|
|
245
|
+
export declare function sharedFontAtlas3D(app: Nova3DApp, font: FontOptions3D): FontAtlas3D;
|
|
246
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Squared distance meaning "no feature in reach". */
|
|
2
|
+
export declare const SDF_INFINITY = 100000000000000000000;
|
|
3
|
+
/**
|
|
4
|
+
* Exact 1D squared Euclidean distance transform (Felzenszwalb and Huttenlocher)
|
|
5
|
+
* of `length` samples at `offset` with `stride`, in place. `f` and `v` hold at
|
|
6
|
+
* least `length` entries, `z` at least `length + 1`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function distanceTransform1D(grid: Float64Array, offset: number, stride: number, length: number, f: Float64Array, v: Int32Array, z: Float64Array): void;
|
|
9
|
+
/** 2D squared distance transform of a `width`×`height` window of a row-major grid. */
|
|
10
|
+
export declare function distanceTransform2D(grid: Float64Array, x0: number, y0: number, width: number, height: number, gridWidth: number, f: Float64Array, v: Int32Array, z: Float64Array): void;
|
|
11
|
+
/**
|
|
12
|
+
* Builds glyph signed distance fields (TinySDF encoding) with reusable scratch
|
|
13
|
+
* grids: byte = 255 − 255·(d / radius + cutoff), d in pixels, positive outside.
|
|
14
|
+
*/
|
|
15
|
+
export declare class GlyphSDFBuilder3D {
|
|
16
|
+
private _outer;
|
|
17
|
+
private _inner;
|
|
18
|
+
private _f;
|
|
19
|
+
private _v;
|
|
20
|
+
private _z;
|
|
21
|
+
constructor(maxSide: number);
|
|
22
|
+
/**
|
|
23
|
+
* Converts RGBA coverage `pixels` (alpha used, `inkWidth`×`inkHeight` rows from
|
|
24
|
+
* the top) into a field of (ink + 2·buffer) cells written to channel `channel`
|
|
25
|
+
* of the RGBA8 `target` at texel (`x`, `y`) of a `targetWidth`-wide image.
|
|
26
|
+
*/
|
|
27
|
+
build(pixels: ArrayLike<number>, inkWidth: number, inkHeight: number, buffer: number, radius: number, cutoff: number, target: Uint8Array, targetWidth: number, x: number, y: number, channel: number): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { Hit3D, MeshShadowOptions3D } from '../model/Mesh.js';
|
|
2
|
+
import { Nova3DScene } from '../model/Scene.js';
|
|
3
|
+
import { Nova3DApp } from '../Nova3DApp.js';
|
|
4
|
+
import { Color3D, NodeOptions3D, Ray3D } from '../types.js';
|
|
5
|
+
import { FontOptions3D, Nova3DFontAtlas } from './FontAtlas.js';
|
|
6
|
+
import { TextAlign3D, TextAnchorX3D, TextAnchorY3D } from './TextLayout.js';
|
|
7
|
+
import { Nova3DNode } from '../model/Node.js';
|
|
8
|
+
/**
|
|
9
|
+
* World units, or a percentage of fontSize such as '8%'.
|
|
10
|
+
* @experimental
|
|
11
|
+
*/
|
|
12
|
+
export type TextLength3D = number | `${number}%`;
|
|
13
|
+
/**
|
|
14
|
+
* Layout and appearance of a text; every field has a default.
|
|
15
|
+
* @experimental
|
|
16
|
+
*/
|
|
17
|
+
export interface TextStyle3D {
|
|
18
|
+
/** Em size in world units; default 1. */
|
|
19
|
+
fontSize?: number;
|
|
20
|
+
/** Wrap width in world units; default Infinity (no wrapping). */
|
|
21
|
+
maxWidth?: number;
|
|
22
|
+
/** Line advance as a multiple of fontSize; default 1.2. */
|
|
23
|
+
lineHeight?: number;
|
|
24
|
+
/** Extra advance after each glyph in em; default 0. */
|
|
25
|
+
letterSpacing?: number;
|
|
26
|
+
/** Default 'left'; 'justify' stretches soft-wrapped lines to the block width. */
|
|
27
|
+
textAlign?: TextAlign3D;
|
|
28
|
+
/** Default 'left'. */
|
|
29
|
+
anchorX?: TextAnchorX3D;
|
|
30
|
+
/** Default 'top'; 'baseline' is the first line's baseline. */
|
|
31
|
+
anchorY?: TextAnchorY3D;
|
|
32
|
+
/** 'nowrap' ignores maxWidth; default 'normal'. */
|
|
33
|
+
whiteSpace?: 'normal' | 'nowrap';
|
|
34
|
+
/** 'break-word' breaks inside words longer than maxWidth; default 'normal'. */
|
|
35
|
+
overflowWrap?: 'normal' | 'break-word';
|
|
36
|
+
/** sRGB fill colour; alpha multiplies `opacity`. Default white. */
|
|
37
|
+
color?: Color3D;
|
|
38
|
+
/** Multiplies fill and outline alpha, [0, 1]; default 1. */
|
|
39
|
+
opacity?: number;
|
|
40
|
+
/** Outline width outside the glyph edge; default 0. */
|
|
41
|
+
outlineWidth?: TextLength3D;
|
|
42
|
+
/** sRGB outline colour; alpha multiplies `outlineOpacity`. Default black. */
|
|
43
|
+
outlineColor?: Color3D;
|
|
44
|
+
/** [0, 1]; default 1. */
|
|
45
|
+
outlineOpacity?: number;
|
|
46
|
+
/** Soft falloff added outside the outline (a glow or shadow without a width); default 0. */
|
|
47
|
+
outlineBlur?: TextLength3D;
|
|
48
|
+
/** Faces the camera from the node origin, keeping node scale; default false (world-oriented). */
|
|
49
|
+
billboard?: boolean;
|
|
50
|
+
/** Default true. */
|
|
51
|
+
depthTest?: boolean;
|
|
52
|
+
/** Default false with blending, true with mask. */
|
|
53
|
+
depthWrite?: boolean;
|
|
54
|
+
/** 'blend' (default) or 'mask' at coverage 0.5. */
|
|
55
|
+
alphaMode?: 'blend' | 'mask';
|
|
56
|
+
/** With 'mask', MSAA coverage instead of a hard cutoff; default false. */
|
|
57
|
+
alphaToCoverage?: boolean;
|
|
58
|
+
/** Default 'double'. */
|
|
59
|
+
side?: 'front' | 'back' | 'double';
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Patch of `text.set` and the result of `text.getOptions`: the style and the string.
|
|
63
|
+
* @experimental
|
|
64
|
+
*/
|
|
65
|
+
export interface TextPatch3D extends TextStyle3D {
|
|
66
|
+
text?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Text creation options.
|
|
70
|
+
* @experimental
|
|
71
|
+
*/
|
|
72
|
+
export type TextOptions3D = NodeOptions3D & TextStyle3D & {
|
|
73
|
+
text: string;
|
|
74
|
+
/** Font settings (shared atlas per app and settings) or a font atlas handle; default sans-serif. */
|
|
75
|
+
font?: FontOptions3D | Nova3DFontAtlas;
|
|
76
|
+
renderOrder?: number;
|
|
77
|
+
layers?: number;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Layout result in the text's local units (x right, y up, origin at the anchor).
|
|
81
|
+
* Arrays are views reused by later layouts; copy them to keep.
|
|
82
|
+
* @experimental
|
|
83
|
+
*/
|
|
84
|
+
export interface TextLayout3D {
|
|
85
|
+
/** Laid-out code points: the text without carriage returns. */
|
|
86
|
+
readonly glyphCount: number;
|
|
87
|
+
/** Glyphs drawn (ink present). */
|
|
88
|
+
readonly quadCount: number;
|
|
89
|
+
readonly lineCount: number;
|
|
90
|
+
/** minX, minY, maxX, maxY of the line boxes. */
|
|
91
|
+
readonly blockBounds: readonly [number, number, number, number];
|
|
92
|
+
/** Union of glyph ink boxes; null without ink. */
|
|
93
|
+
readonly visibleBounds: readonly [number, number, number, number] | null;
|
|
94
|
+
/** Pen origin on the baseline, x and y per glyph. */
|
|
95
|
+
readonly glyphPositions: Float32Array;
|
|
96
|
+
/** Ink box minX, minY, maxX, maxY per glyph; empty boxes for white space. */
|
|
97
|
+
readonly glyphBounds: Float32Array;
|
|
98
|
+
/** UTF-16 index of each glyph in the text. */
|
|
99
|
+
readonly glyphCharIndices: Uint32Array;
|
|
100
|
+
/** Line of each glyph. */
|
|
101
|
+
readonly glyphLines: Uint32Array;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* SDF text drawn as one indexed mesh of glyph quads in one draw (troika-three-text,
|
|
105
|
+
* Babylon.js TextRenderer, PlayCanvas text elements). Move, parent, hide and
|
|
106
|
+
* raycast the text through `node`; its material and geometry stay internal.
|
|
107
|
+
* Glyph quads live in a dynamic geometry rewritten in place with `updateRange`
|
|
108
|
+
* while capacity allows; colours and outline are uniforms.
|
|
109
|
+
* @experimental
|
|
110
|
+
*/
|
|
111
|
+
export declare class Nova3DText {
|
|
112
|
+
protected constructor();
|
|
113
|
+
/**
|
|
114
|
+
* The scene node drawing the text: transform, reparent, hide or parent other
|
|
115
|
+
* nodes to it. Text hits report it as `hit.node`.
|
|
116
|
+
*/
|
|
117
|
+
readonly node: Nova3DNode;
|
|
118
|
+
/** The text's handle to its shared glyph atlas, released with the text. */
|
|
119
|
+
readonly atlas: Nova3DFontAtlas;
|
|
120
|
+
private readonly _mesh;
|
|
121
|
+
private readonly _font;
|
|
122
|
+
private _text;
|
|
123
|
+
private _style;
|
|
124
|
+
private _capacity;
|
|
125
|
+
private _positions;
|
|
126
|
+
private _uvs;
|
|
127
|
+
/** Quads whose vertices may hold old glyphs, collapsed on the next write. */
|
|
128
|
+
private _written;
|
|
129
|
+
private _quads;
|
|
130
|
+
private _fresh;
|
|
131
|
+
private readonly _buffers;
|
|
132
|
+
private readonly _input;
|
|
133
|
+
private readonly _source;
|
|
134
|
+
private _glyphBounds;
|
|
135
|
+
private _glyphPositions;
|
|
136
|
+
private _glyphIds;
|
|
137
|
+
/** Local box of block and quads: minX, minY, maxX, maxY. */
|
|
138
|
+
private readonly _box;
|
|
139
|
+
private readonly _ink;
|
|
140
|
+
private _version;
|
|
141
|
+
private _view;
|
|
142
|
+
private readonly _detachApp;
|
|
143
|
+
private readonly _app;
|
|
144
|
+
get destroyed(): boolean;
|
|
145
|
+
/** Draw order within the opaque or blended group; see `Nova3DMesh.renderOrder`. */
|
|
146
|
+
get renderOrder(): number;
|
|
147
|
+
setRenderOrder(value: number): void;
|
|
148
|
+
/** Layer bit mask; see `Nova3DMesh.layers`. */
|
|
149
|
+
get layers(): number;
|
|
150
|
+
setLayers(mask: number): void;
|
|
151
|
+
/** Shadow casting and receiving of the glyph quads; see `Nova3DMesh.setShadows`. */
|
|
152
|
+
setShadows(options: MeshShadowOptions3D): void;
|
|
153
|
+
/** Removes the node and releases the geometry, the material and the atlas handle. */
|
|
154
|
+
destroy(): void;
|
|
155
|
+
/** The laid-out string. */
|
|
156
|
+
get text(): string;
|
|
157
|
+
/** Glyph quads the geometry holds without reallocation. */
|
|
158
|
+
get capacity(): number;
|
|
159
|
+
/** Layout of the current text and style; rebuilt only after changes. */
|
|
160
|
+
get layout(): TextLayout3D;
|
|
161
|
+
/** Current style with defaults filled in. */
|
|
162
|
+
/** The style with every default filled in and the string; `depthWrite` only when set. */
|
|
163
|
+
getOptions(): Readonly<TextPatch3D>;
|
|
164
|
+
/** Replaces the string; buffers are rewritten in place while capacity allows. */
|
|
165
|
+
setText(text: string): void;
|
|
166
|
+
/** Applies a text and style patch atomically: one layout at most, validated first. */
|
|
167
|
+
set(patch: TextPatch3D): void;
|
|
168
|
+
/** Lays out the text and rewrites the glyph quads, reusing buffers when they fit. */
|
|
169
|
+
private _rebuild;
|
|
170
|
+
private _assertAlive;
|
|
171
|
+
/** Grows quad and per-glyph storage; a new geometry is created on the next write. */
|
|
172
|
+
private _reserve;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Creates an SDF text in `scene`, holding a handle to its font atlas until
|
|
176
|
+
* destroyed. Owned by the scene's app: destroyed with it.
|
|
177
|
+
* @experimental
|
|
178
|
+
*/
|
|
179
|
+
export declare function createText(scene: Nova3DScene, options: TextOptions3D): Nova3DText;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Horizontal alignment of lines inside the block.
|
|
3
|
+
* @experimental
|
|
4
|
+
*/
|
|
5
|
+
export type TextAlign3D = 'left' | 'center' | 'right' | 'justify';
|
|
6
|
+
/**
|
|
7
|
+
* Block point placed at the text origin; a number is an offset from the left edge.
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export type TextAnchorX3D = 'left' | 'center' | 'right' | number;
|
|
11
|
+
/**
|
|
12
|
+
* Block point placed at the text origin; a number is an offset down from the top edge.
|
|
13
|
+
* @experimental
|
|
14
|
+
*/
|
|
15
|
+
export type TextAnchorY3D = 'top' | 'middle' | 'baseline' | 'bottom' | number;
|
|
16
|
+
/** Resolved layout parameters in world units. */
|
|
17
|
+
export interface TextLayoutInput3D {
|
|
18
|
+
fontSize: number;
|
|
19
|
+
/** Wrap width; Infinity disables wrapping. */
|
|
20
|
+
maxWidth: number;
|
|
21
|
+
/** Line advance as a multiple of fontSize. */
|
|
22
|
+
lineHeight: number;
|
|
23
|
+
/** Extra advance after every glyph, in em. */
|
|
24
|
+
letterSpacing: number;
|
|
25
|
+
textAlign: TextAlign3D;
|
|
26
|
+
anchorX: TextAnchorX3D;
|
|
27
|
+
anchorY: TextAnchorY3D;
|
|
28
|
+
/** Breaks at overflow inside words without other break opportunities. */
|
|
29
|
+
breakWord: boolean;
|
|
30
|
+
/** Font ascent and descent in em. */
|
|
31
|
+
ascent: number;
|
|
32
|
+
descent: number;
|
|
33
|
+
}
|
|
34
|
+
/** Glyph advances and kerning in em. */
|
|
35
|
+
export interface TextGlyphSource3D {
|
|
36
|
+
advance: (codePoint: number) => number;
|
|
37
|
+
kerning: (left: number, right: number) => number;
|
|
38
|
+
}
|
|
39
|
+
/** Breakable white space; NBSP and U+2007 do not break. */
|
|
40
|
+
export declare function isBreakSpace3D(codePoint: number): boolean;
|
|
41
|
+
/** Ideographic, kana and Hangul characters break between any two of them. */
|
|
42
|
+
export declare function isCJK3D(codePoint: number): boolean;
|
|
43
|
+
/** Whether a soft line break is allowed between two adjacent code points. */
|
|
44
|
+
export declare function canBreakBetween3D(previous: number, next: number): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Reusable layout storage. Glyph `i` is the i-th code point of the text without
|
|
47
|
+
* carriage returns (newlines included); `x`, `y` are its pen origin on the
|
|
48
|
+
* baseline after alignment and anchoring.
|
|
49
|
+
*/
|
|
50
|
+
export declare class TextLayoutBuffers3D {
|
|
51
|
+
count: number;
|
|
52
|
+
lineCount: number;
|
|
53
|
+
codePoints: Uint32Array<ArrayBuffer>;
|
|
54
|
+
charIndices: Uint32Array<ArrayBuffer>;
|
|
55
|
+
lines: Uint32Array<ArrayBuffer>;
|
|
56
|
+
x: Float32Array<ArrayBuffer>;
|
|
57
|
+
y: Float32Array<ArrayBuffer>;
|
|
58
|
+
advances: Float32Array<ArrayBuffer>;
|
|
59
|
+
lineStart: Uint32Array<ArrayBuffer>;
|
|
60
|
+
lineEnd: Uint32Array<ArrayBuffer>;
|
|
61
|
+
lineWidth: Float64Array<ArrayBuffer>;
|
|
62
|
+
lineHard: Uint8Array<ArrayBuffer>;
|
|
63
|
+
/** minX, minY, maxX, maxY of the line boxes. */
|
|
64
|
+
readonly blockBounds: Float64Array<ArrayBuffer>;
|
|
65
|
+
/** Grows glyph storage to at least `size` entries, keeping contents. */
|
|
66
|
+
reserve(size: number): void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Lays out `text` into `out`: decoding, kerning, greedy wrapping at Unicode-aware
|
|
70
|
+
* break opportunities, alignment, justification and anchoring. Allocation-free
|
|
71
|
+
* once `out` has grown to the text size.
|
|
72
|
+
*/
|
|
73
|
+
export declare function layoutText3D(text: string, input: TextLayoutInput3D, source: TextGlyphSource3D, out: TextLayoutBuffers3D): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Atlas channel stride packed into the texel u coordinate: u + channel · 65536. */
|
|
2
|
+
export declare const TEXT_CHANNEL_STRIDE = 65536;
|
|
3
|
+
/**
|
|
4
|
+
* Glyph quads in the text plane, or offset in view space from the node origin
|
|
5
|
+
* when billboarded (node rotation ignored, node scale kept).
|
|
6
|
+
*/
|
|
7
|
+
export declare const textVertex3D: string;
|
|
8
|
+
/**
|
|
9
|
+
* SDF coverage from the texel distance and its screen footprint (fwidth), fill
|
|
10
|
+
* composited over the outline; colours are linear.
|
|
11
|
+
*/
|
|
12
|
+
export declare const textFragment3D = "uniform sampler2D textAtlas;\nuniform vec2 textAtlasSize;\n\nuniform vec4 textSdf;\nuniform vec4 textFill;\nuniform vec4 textOutline;\nin vec2 vTexel;\nflat in vec4 vChannel;\nvoid main(){\n float value=dot(texture(textAtlas,vTexel/textAtlasSize),vChannel);\n float dist=(1.0-textSdf.y-value)*textSdf.x;\n float reach=textSdf.x*(1.0-textSdf.y);\n\n float width=clamp(0.5*length(fwidth(vTexel)),1e-4,reach);\n float fill=(1.0-smoothstep(-width,width,dist))*textFill.a;\n float outline=0.0;\n float extent=textSdf.z+textSdf.w;\n if(extent>0.0){\n float soft=clamp(reach-extent,1e-4,width);\n outline=(1.0-smoothstep(textSdf.z-soft,extent+soft,dist))*textOutline.a;\n }\n float alpha=fill+outline*(1.0-fill);\n if(alpha<0.002)discard;\n novaOutput(vec4((textFill.rgb*fill+textOutline.rgb*outline*(1.0-fill))/alpha,alpha));\n}";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tile bounding volume in tileset space, held as an oriented box (centre plus three
|
|
3
|
+
* half-axis vectors) with an enclosing sphere. Spheres keep `sphere = true` and
|
|
4
|
+
* use only the sphere in tests. All storage is double precision.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class Nova3DTileVolume {
|
|
8
|
+
protected constructor();
|
|
9
|
+
readonly center: Float64Array<ArrayBuffer>;
|
|
10
|
+
/** Half-axis vectors as three columns: x (0..2), y (3..5), z (6..8). */
|
|
11
|
+
readonly axes: Float64Array<ArrayBuffer>;
|
|
12
|
+
/** Squared half-axis lengths (0 for degenerate axes). */
|
|
13
|
+
readonly lengths: Float64Array<ArrayBuffer>;
|
|
14
|
+
radius: number;
|
|
15
|
+
sphere: boolean;
|
|
16
|
+
/** WGS84 region [west, south, east, north, minHeight, maxHeight] for containment, when given as a region. */
|
|
17
|
+
region: Float64Array | null;
|
|
18
|
+
/** Distance from a point to the volume (0 inside). */
|
|
19
|
+
distanceTo(x: number, y: number, z: number): number;
|
|
20
|
+
/** True unless the volume lies entirely behind one of the planes (n·p + d ≥ 0 inside). */
|
|
21
|
+
intersectsFrustum(planes: Float64Array): boolean;
|
|
22
|
+
/** Point containment, used by viewer request volumes. */
|
|
23
|
+
contains(x: number, y: number, z: number, radii: readonly [number, number, number]): boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Builds a conservative oriented box around a WGS84 region (radians and metres) in the
|
|
27
|
+
* east-north-up frame of its centre, sampling the boundary at ≤ π/8 steps and padding
|
|
28
|
+
* by the sagitta between samples.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function regionVolume(volume: Nova3DTileVolume, region: ArrayLike<number>, radii: readonly [number, number, number]): Nova3DTileVolume;
|
|
32
|
+
/**
|
|
33
|
+
* Parses a 3D Tiles bounding volume and applies the accumulated tile transform (box
|
|
34
|
+
* and sphere only: regions are absolute ECEF by definition).
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare function tileVolume3D(json: unknown, transform: Float64Array, radii: readonly [number, number, number]): Nova3DTileVolume;
|
|
38
|
+
/**
|
|
39
|
+
* Writes the six normalized frustum planes (left, right, bottom, top, near, far) of
|
|
40
|
+
* a column-major clip matrix into `out` (24 numbers, n·p + d ≥ 0 inside).
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export declare function frustumPlanes3D(out: Float64Array, m: ArrayLike<number>): Float64Array;
|