@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,352 @@
|
|
|
1
|
+
import { Quaternion3D, Vector3D } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Engine-agnostic physics backend contract of Nova 3D.
|
|
4
|
+
*
|
|
5
|
+
* Nova does not ship a physics engine. It ships this contract, a small reference
|
|
6
|
+
* backend (`createBasicPhysics`) and the Nova integration (`createPhysicsWorld`).
|
|
7
|
+
* Rapier, Havok, Jolt or Ammo adapters implement the same two interfaces:
|
|
8
|
+
*
|
|
9
|
+
* - {@link PhysicsBackend3D}: a factory, usually created after the engine's WASM
|
|
10
|
+
* module has loaded (`await createRapierBackend()`), so world creation is synchronous;
|
|
11
|
+
* - {@link PhysicsBackendWorld3D}: one simulation world.
|
|
12
|
+
*
|
|
13
|
+
* Conventions shared by every backend:
|
|
14
|
+
* - units are metres, kilograms, seconds and radians; gravity is m/s²;
|
|
15
|
+
* - all poses and velocities are in world space; angular velocity is an axis × rad/s vector;
|
|
16
|
+
* - quaternions are `[x, y, z, w]`;
|
|
17
|
+
* - a body's origin is its centre of mass (backends that compute a separate centre of
|
|
18
|
+
* mass must still report and accept poses of the body origin);
|
|
19
|
+
* - bodies and joints are plain integer handles, never objects, so a world can keep its
|
|
20
|
+
* state in structure-of-arrays form and a WASM engine can pass its own ids through;
|
|
21
|
+
* - getters write into caller-owned arrays (`out`) and return them; setters copy their
|
|
22
|
+
* input; no method keeps a reference to a caller array, so callers may reuse scratch;
|
|
23
|
+
* - every method except `destroy` throws once the world is destroyed; methods taking a
|
|
24
|
+
* handle throw `RangeError` for a stale or foreign handle.
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
export interface PhysicsBackend3D {
|
|
28
|
+
/** Stable lower-case id, for example `basic`, `rapier`, `havok`, `jolt` or `ammo`. */
|
|
29
|
+
readonly name: string;
|
|
30
|
+
/** What this backend implements; Nova checks shapes and joints against it before calling. */
|
|
31
|
+
readonly capabilities: PhysicsCapabilities3D;
|
|
32
|
+
/** Creates an independent world. Worlds of one backend never share bodies. */
|
|
33
|
+
createWorld: (options: PhysicsWorldDesc3D) => PhysicsBackendWorld3D;
|
|
34
|
+
}
|
|
35
|
+
/** @experimental */
|
|
36
|
+
export type PhysicsBodyType3D = 'static' | 'dynamic' | 'kinematic';
|
|
37
|
+
/** @experimental */
|
|
38
|
+
export type PhysicsShapeType3D = PhysicsShape3D['type'];
|
|
39
|
+
/** @experimental */
|
|
40
|
+
export type PhysicsJointType3D = PhysicsJointDesc3D['type'];
|
|
41
|
+
/**
|
|
42
|
+
* Writable numeric array a getter fills: `number[]`, `Float32Array` or `Float64Array`.
|
|
43
|
+
* @experimental
|
|
44
|
+
*/
|
|
45
|
+
export type PhysicsOut3D = number[] | Float32Array | Float64Array;
|
|
46
|
+
/**
|
|
47
|
+
* Integer handle of a body; meaningful only to the world that returned it. Backends should keep handles below 2³⁰ so JavaScript engines store them unboxed.
|
|
48
|
+
* @experimental
|
|
49
|
+
*/
|
|
50
|
+
export type PhysicsBodyHandle3D = number;
|
|
51
|
+
/**
|
|
52
|
+
* Integer handle of a joint; meaningful only to the world that returned it.
|
|
53
|
+
* @experimental
|
|
54
|
+
*/
|
|
55
|
+
export type PhysicsJointHandle3D = number;
|
|
56
|
+
/** @experimental */
|
|
57
|
+
export interface PhysicsCapabilities3D {
|
|
58
|
+
/** Shape types accepted by `createBody`. */
|
|
59
|
+
readonly shapes: readonly PhysicsShapeType3D[];
|
|
60
|
+
/** Shape types accepted on dynamic and kinematic bodies (a subset of `shapes`). */
|
|
61
|
+
readonly movingShapes: readonly PhysicsShapeType3D[];
|
|
62
|
+
/** Joint types accepted by `createJoint`. */
|
|
63
|
+
readonly joints: readonly PhysicsJointType3D[];
|
|
64
|
+
/** Whether resting bodies are put to sleep and woken by contacts and edits. */
|
|
65
|
+
readonly sleeping: boolean;
|
|
66
|
+
/** Whether identical calls on identical worlds give bit-identical results on one machine. */
|
|
67
|
+
readonly deterministic: boolean;
|
|
68
|
+
}
|
|
69
|
+
/** @experimental */
|
|
70
|
+
export interface PhysicsWorldDesc3D {
|
|
71
|
+
/** World gravity, m/s². */
|
|
72
|
+
readonly gravity: Vector3D;
|
|
73
|
+
/** Whether `drainContacts` also reports `stay` events for touching pairs; default false. */
|
|
74
|
+
readonly contactStay?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Collision shapes, described in the body's local frame (metres). Shapes are values:
|
|
78
|
+
* a backend may cache the engine shape by descriptor identity, so reuse one
|
|
79
|
+
* descriptor object for many bodies to share one engine shape.
|
|
80
|
+
* @experimental
|
|
81
|
+
*/
|
|
82
|
+
export type PhysicsShape3D = PhysicsSphereShape3D | PhysicsBoxShape3D | PhysicsCapsuleShape3D | PhysicsCylinderShape3D | PhysicsPlaneShape3D | PhysicsConvexHullShape3D | PhysicsTriangleMeshShape3D | PhysicsCompoundShape3D;
|
|
83
|
+
/** @experimental */
|
|
84
|
+
export interface PhysicsSphereShape3D {
|
|
85
|
+
readonly type: 'sphere';
|
|
86
|
+
readonly radius: number;
|
|
87
|
+
}
|
|
88
|
+
/** @experimental */
|
|
89
|
+
export interface PhysicsBoxShape3D {
|
|
90
|
+
readonly type: 'box';
|
|
91
|
+
/** Half the box size per axis; `boxGeometry({ size })` matches `halfExtents = size / 2`. */
|
|
92
|
+
readonly halfExtents: Vector3D;
|
|
93
|
+
}
|
|
94
|
+
/** @experimental */
|
|
95
|
+
export interface PhysicsCapsuleShape3D {
|
|
96
|
+
readonly type: 'capsule';
|
|
97
|
+
readonly radius: number;
|
|
98
|
+
/** Half the length of the straight part along local +Y; `capsuleGeometry({ length })` matches `length / 2`. */
|
|
99
|
+
readonly halfHeight: number;
|
|
100
|
+
}
|
|
101
|
+
/** @experimental */
|
|
102
|
+
export interface PhysicsCylinderShape3D {
|
|
103
|
+
readonly type: 'cylinder';
|
|
104
|
+
readonly radius: number;
|
|
105
|
+
/** Half the height along local +Y. */
|
|
106
|
+
readonly halfHeight: number;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Infinite half-space `normal · x ≤ offset` in body space; static bodies only.
|
|
110
|
+
* @experimental
|
|
111
|
+
*/
|
|
112
|
+
export interface PhysicsPlaneShape3D {
|
|
113
|
+
readonly type: 'plane';
|
|
114
|
+
/** Outward normal; default `[0, 1, 0]`. */
|
|
115
|
+
readonly normal?: Vector3D;
|
|
116
|
+
/** Plane distance from the body origin along the normal; default 0. */
|
|
117
|
+
readonly offset?: number;
|
|
118
|
+
}
|
|
119
|
+
/** @experimental */
|
|
120
|
+
export interface PhysicsConvexHullShape3D {
|
|
121
|
+
readonly type: 'convex-hull';
|
|
122
|
+
/** xyz triples; the backend builds their convex hull. They must span a volume. */
|
|
123
|
+
readonly points: ArrayLike<number>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Static triangle soup, for level geometry; static bodies only.
|
|
127
|
+
* @experimental
|
|
128
|
+
*/
|
|
129
|
+
export interface PhysicsTriangleMeshShape3D {
|
|
130
|
+
readonly type: 'triangle-mesh';
|
|
131
|
+
/** xyz triples. */
|
|
132
|
+
readonly positions: ArrayLike<number>;
|
|
133
|
+
/** Triangle vertex indices; default consecutive triples. */
|
|
134
|
+
readonly indices?: ArrayLike<number>;
|
|
135
|
+
}
|
|
136
|
+
/** @experimental */
|
|
137
|
+
export interface PhysicsCompoundChild3D {
|
|
138
|
+
/** Any shape except `compound` and `plane`. */
|
|
139
|
+
readonly shape: Exclude<PhysicsShape3D, PhysicsCompoundShape3D | PhysicsPlaneShape3D>;
|
|
140
|
+
readonly position?: Vector3D;
|
|
141
|
+
readonly quaternion?: Quaternion3D;
|
|
142
|
+
}
|
|
143
|
+
/** @experimental */
|
|
144
|
+
export interface PhysicsCompoundShape3D {
|
|
145
|
+
readonly type: 'compound';
|
|
146
|
+
readonly children: readonly PhysicsCompoundChild3D[];
|
|
147
|
+
}
|
|
148
|
+
/** @experimental */
|
|
149
|
+
export interface PhysicsBodyDesc3D {
|
|
150
|
+
readonly type: PhysicsBodyType3D;
|
|
151
|
+
readonly shape: PhysicsShape3D;
|
|
152
|
+
/** World position of the body origin; default origin. */
|
|
153
|
+
readonly position?: Vector3D;
|
|
154
|
+
/** World orientation; default identity. */
|
|
155
|
+
readonly quaternion?: Quaternion3D;
|
|
156
|
+
/** Dynamic bodies only, kg, > 0; default 1. Inertia follows from the shape. */
|
|
157
|
+
readonly mass?: number;
|
|
158
|
+
/** Velocity damping per second, ≥ 0; default 0. */
|
|
159
|
+
readonly linearDamping?: number;
|
|
160
|
+
readonly angularDamping?: number;
|
|
161
|
+
/** Coulomb friction coefficient, ≥ 0; default 0.5. Pairs combine by `sqrt(a · b)` in the reference backend. */
|
|
162
|
+
readonly friction?: number;
|
|
163
|
+
/** Restitution in [0, 1]; default 0. Pairs combine by `max(a, b)` in the reference backend. */
|
|
164
|
+
readonly restitution?: number;
|
|
165
|
+
/** Multiplies world gravity for this body; default 1. */
|
|
166
|
+
readonly gravityScale?: number;
|
|
167
|
+
readonly linearVelocity?: Vector3D;
|
|
168
|
+
readonly angularVelocity?: Vector3D;
|
|
169
|
+
/**
|
|
170
|
+
* Membership bits; default 1. Two bodies collide when
|
|
171
|
+
* `(a.group & b.mask) !== 0 && (b.group & a.mask) !== 0`. Rapier keeps 16 bits.
|
|
172
|
+
*/
|
|
173
|
+
readonly collisionGroup?: number;
|
|
174
|
+
/** Bits of groups this body collides with; default all (0xFFFFFFFF). */
|
|
175
|
+
readonly collisionMask?: number;
|
|
176
|
+
/** A sensor reports contacts but never pushes and is never pushed; default false. */
|
|
177
|
+
readonly sensor?: boolean;
|
|
178
|
+
/** Default true. */
|
|
179
|
+
readonly canSleep?: boolean;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Common joint fields. Anchors and axes are in each body's local frame.
|
|
183
|
+
* @experimental
|
|
184
|
+
*/
|
|
185
|
+
export interface PhysicsJointBase3D {
|
|
186
|
+
readonly bodyA: PhysicsBodyHandle3D;
|
|
187
|
+
/** Second body, or null to pin `bodyA` to the world, with `anchorB` and `axisB` in world space. */
|
|
188
|
+
readonly bodyB: PhysicsBodyHandle3D | null;
|
|
189
|
+
readonly anchorA?: Vector3D;
|
|
190
|
+
readonly anchorB?: Vector3D;
|
|
191
|
+
/** Whether the two bodies still collide with each other; default false. */
|
|
192
|
+
readonly collideConnected?: boolean;
|
|
193
|
+
}
|
|
194
|
+
/** @experimental */
|
|
195
|
+
export interface PhysicsJointMotor3D {
|
|
196
|
+
/** Target relative speed: rad/s for a hinge, m/s for a slider. */
|
|
197
|
+
readonly targetVelocity: number;
|
|
198
|
+
/** Maximum torque (N·m) or force (N) the motor applies, ≥ 0. */
|
|
199
|
+
readonly maxForce: number;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Locks all relative motion; the relative orientation at creation is kept.
|
|
203
|
+
* @experimental
|
|
204
|
+
*/
|
|
205
|
+
export interface PhysicsFixedJointDesc3D extends PhysicsJointBase3D {
|
|
206
|
+
readonly type: 'fixed';
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Ball-and-socket: anchors coincide, rotation is free.
|
|
210
|
+
* @experimental
|
|
211
|
+
*/
|
|
212
|
+
export interface PhysicsBallJointDesc3D extends PhysicsJointBase3D {
|
|
213
|
+
readonly type: 'ball';
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Rotation about one axis: anchors coincide and `axisA` stays parallel to `axisB`.
|
|
217
|
+
* Angles, limits and motor speeds measure bodyB relative to bodyA about the axis
|
|
218
|
+
* (right-hand rule); with `bodyB: null` the world plays bodyB.
|
|
219
|
+
* @experimental
|
|
220
|
+
*/
|
|
221
|
+
export interface PhysicsHingeJointDesc3D extends PhysicsJointBase3D {
|
|
222
|
+
readonly type: 'hinge';
|
|
223
|
+
readonly axisA: Vector3D;
|
|
224
|
+
readonly axisB: Vector3D;
|
|
225
|
+
/** Relative angle range in radians about the axis, measured from the pose at creation. */
|
|
226
|
+
readonly limits?: readonly [number, number];
|
|
227
|
+
readonly motor?: PhysicsJointMotor3D;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Translation along one axis, rotation locked.
|
|
231
|
+
* @experimental
|
|
232
|
+
*/
|
|
233
|
+
export interface PhysicsSliderJointDesc3D extends PhysicsJointBase3D {
|
|
234
|
+
readonly type: 'slider';
|
|
235
|
+
readonly axisA: Vector3D;
|
|
236
|
+
readonly axisB: Vector3D;
|
|
237
|
+
/** Range in metres along the axis, measured from the pose at creation. */
|
|
238
|
+
readonly limits?: readonly [number, number];
|
|
239
|
+
readonly motor?: PhysicsJointMotor3D;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Keeps the anchor distance within `[minDistance, maxDistance]`; rotation is free.
|
|
243
|
+
* @experimental
|
|
244
|
+
*/
|
|
245
|
+
export interface PhysicsDistanceJointDesc3D extends PhysicsJointBase3D {
|
|
246
|
+
readonly type: 'distance';
|
|
247
|
+
readonly minDistance: number;
|
|
248
|
+
readonly maxDistance: number;
|
|
249
|
+
}
|
|
250
|
+
/** @experimental */
|
|
251
|
+
export type PhysicsJointDesc3D = PhysicsFixedJointDesc3D | PhysicsBallJointDesc3D | PhysicsHingeJointDesc3D | PhysicsSliderJointDesc3D | PhysicsDistanceJointDesc3D;
|
|
252
|
+
/**
|
|
253
|
+
* Mutable ray hit record a caller owns and `raycast` fills.
|
|
254
|
+
* @experimental
|
|
255
|
+
*/
|
|
256
|
+
export interface PhysicsRayHitRecord3D {
|
|
257
|
+
body: PhysicsBodyHandle3D;
|
|
258
|
+
/** Distance along the normalized ray direction. */
|
|
259
|
+
distance: number;
|
|
260
|
+
readonly point: PhysicsOut3D;
|
|
261
|
+
/** Unit surface normal facing the ray origin side. */
|
|
262
|
+
readonly normal: PhysicsOut3D;
|
|
263
|
+
}
|
|
264
|
+
/** @experimental */
|
|
265
|
+
export type PhysicsContactPhase3D = 'begin' | 'stay' | 'end';
|
|
266
|
+
/**
|
|
267
|
+
* One contact event, delivered by `drainContacts`. The record is reused for the next
|
|
268
|
+
* event: copy what you keep. `normal` points from `bodyA` to `bodyB`.
|
|
269
|
+
* @experimental
|
|
270
|
+
*/
|
|
271
|
+
export interface PhysicsContactEvent3D {
|
|
272
|
+
readonly phase: PhysicsContactPhase3D;
|
|
273
|
+
readonly bodyA: PhysicsBodyHandle3D;
|
|
274
|
+
readonly bodyB: PhysicsBodyHandle3D;
|
|
275
|
+
/** Deepest contact point in world space; for `end`, the last known point. */
|
|
276
|
+
readonly point: ArrayLike<number>;
|
|
277
|
+
readonly normal: ArrayLike<number>;
|
|
278
|
+
/** Sum of normal impulses of the pair in the last step, N·s; 0 for `end` and sensors. */
|
|
279
|
+
readonly impulse: number;
|
|
280
|
+
/** Whether either body is a sensor. */
|
|
281
|
+
readonly sensor: boolean;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* One simulation world. All mutators may be called between steps; none may be called
|
|
285
|
+
* from inside a `drainContacts` visitor except reads.
|
|
286
|
+
* @experimental
|
|
287
|
+
*/
|
|
288
|
+
export interface PhysicsBackendWorld3D {
|
|
289
|
+
readonly backend: PhysicsBackend3D;
|
|
290
|
+
readonly destroyed: boolean;
|
|
291
|
+
/** Releases every engine resource; idempotent. Handles become invalid. */
|
|
292
|
+
destroy: () => void;
|
|
293
|
+
setGravity: (gravity: Vector3D) => void;
|
|
294
|
+
getGravity: <T extends PhysicsOut3D>(out: T) => T;
|
|
295
|
+
/**
|
|
296
|
+
* Advances the world by exactly `dt` seconds (> 0). Nova always passes its fixed step;
|
|
297
|
+
* contact events of this step replace the undrained events of the previous one.
|
|
298
|
+
*/
|
|
299
|
+
step: (dt: number) => void;
|
|
300
|
+
/** Creates a body and returns its handle. Throws for shapes outside `capabilities`. */
|
|
301
|
+
createBody: (desc: PhysicsBodyDesc3D) => PhysicsBodyHandle3D;
|
|
302
|
+
/** Removes a body, its contacts and every joint attached to it; no `end` events are sent. */
|
|
303
|
+
destroyBody: (body: PhysicsBodyHandle3D) => void;
|
|
304
|
+
hasBody: (body: PhysicsBodyHandle3D) => boolean;
|
|
305
|
+
getBodyType: (body: PhysicsBodyHandle3D) => PhysicsBodyType3D;
|
|
306
|
+
/** Switches the motion type; switching to dynamic restores the stored mass. */
|
|
307
|
+
setBodyType: (body: PhysicsBodyHandle3D, type: PhysicsBodyType3D) => void;
|
|
308
|
+
setMass: (body: PhysicsBodyHandle3D, mass: number) => void;
|
|
309
|
+
setDamping: (body: PhysicsBodyHandle3D, linear: number, angular: number) => void;
|
|
310
|
+
setMaterial: (body: PhysicsBodyHandle3D, friction: number, restitution: number) => void;
|
|
311
|
+
setGravityScale: (body: PhysicsBodyHandle3D, scale: number) => void;
|
|
312
|
+
setCollisionFilter: (body: PhysicsBodyHandle3D, group: number, mask: number) => void;
|
|
313
|
+
/** Writes `px py pz qx qy qz qw` at `out[offset…offset + 6]`. */
|
|
314
|
+
getTransform: <T extends PhysicsOut3D>(body: PhysicsBodyHandle3D, out: T, offset?: number) => T;
|
|
315
|
+
/** Teleports the body and wakes it; velocities are kept. */
|
|
316
|
+
setTransform: (body: PhysicsBodyHandle3D, position: Vector3D, quaternion: Quaternion3D) => void;
|
|
317
|
+
/**
|
|
318
|
+
* Kinematic bodies only: the pose to reach at the end of the next step. The backend
|
|
319
|
+
* derives the velocity, so dynamic bodies are pushed and carried correctly.
|
|
320
|
+
*/
|
|
321
|
+
setKinematicTarget: (body: PhysicsBodyHandle3D, position: Vector3D, quaternion: Quaternion3D) => void;
|
|
322
|
+
getLinearVelocity: <T extends PhysicsOut3D>(body: PhysicsBodyHandle3D, out: T) => T;
|
|
323
|
+
setLinearVelocity: (body: PhysicsBodyHandle3D, velocity: Vector3D) => void;
|
|
324
|
+
getAngularVelocity: <T extends PhysicsOut3D>(body: PhysicsBodyHandle3D, out: T) => T;
|
|
325
|
+
setAngularVelocity: (body: PhysicsBodyHandle3D, velocity: Vector3D) => void;
|
|
326
|
+
/** Adds a force (N) for the next step only, at a world `point` or the origin. */
|
|
327
|
+
applyForce: (body: PhysicsBodyHandle3D, force: Vector3D, point?: Vector3D) => void;
|
|
328
|
+
/** Changes momentum immediately (N·s), at a world `point` or the origin. */
|
|
329
|
+
applyImpulse: (body: PhysicsBodyHandle3D, impulse: Vector3D, point?: Vector3D) => void;
|
|
330
|
+
/** Adds a torque (N·m) for the next step only. */
|
|
331
|
+
applyTorque: (body: PhysicsBodyHandle3D, torque: Vector3D) => void;
|
|
332
|
+
/** Changes angular momentum immediately (N·m·s). */
|
|
333
|
+
applyTorqueImpulse: (body: PhysicsBodyHandle3D, impulse: Vector3D) => void;
|
|
334
|
+
getSleeping: (body: PhysicsBodyHandle3D) => boolean;
|
|
335
|
+
wake: (body: PhysicsBodyHandle3D) => void;
|
|
336
|
+
/** Creates a joint, wakes both bodies and returns its handle. */
|
|
337
|
+
createJoint: (desc: PhysicsJointDesc3D) => PhysicsJointHandle3D;
|
|
338
|
+
destroyJoint: (joint: PhysicsJointHandle3D) => void;
|
|
339
|
+
/** Hinge and slider joints only; `null` turns the motor off. */
|
|
340
|
+
setJointMotor: (joint: PhysicsJointHandle3D, motor: PhysicsJointMotor3D | null) => void;
|
|
341
|
+
/**
|
|
342
|
+
* Casts a ray against every non-sensor body whose group shares a bit with `mask`.
|
|
343
|
+
* `direction` need not be normalized. Fills `out` with the nearest hit and returns
|
|
344
|
+
* true, or returns false and leaves `out` unspecified. A ray starting inside a solid
|
|
345
|
+
* hits it at distance 0.
|
|
346
|
+
*/
|
|
347
|
+
raycast: (origin: Vector3D, direction: Vector3D, maxDistance: number, mask: number, out: PhysicsRayHitRecord3D) => boolean;
|
|
348
|
+
/** Visits the contact events of the last step in a stable order, then clears them. */
|
|
349
|
+
drainContacts: (visitor: (event: PhysicsContactEvent3D) => void) => void;
|
|
350
|
+
/** Backend-specific counters for tests and tools. */
|
|
351
|
+
diagnostics?: () => Readonly<Record<string, number>>;
|
|
352
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Nova3DScene } from '../model/Scene.js';
|
|
2
|
+
import { Nova3DApp } from '../Nova3DApp.js';
|
|
3
|
+
import { Color3D } from '../types.js';
|
|
4
|
+
import { PhysicsBackendWorld3D, PhysicsBodyHandle3D, PhysicsShape3D } from './PhysicsBackend.js';
|
|
5
|
+
import { Nova3DHelper } from '../helpers/LineHelper.js';
|
|
6
|
+
/** Line segments (xyz pairs) outlining a collider in the body frame. @internal */
|
|
7
|
+
export declare function shapeWireframe(shape: PhysicsShape3D): Float32Array;
|
|
8
|
+
/**
|
|
9
|
+
* Collider lines of a physics world, drawn through the debug-helper pipeline: one
|
|
10
|
+
* unlit line mesh under a non-pickable root, rebuilt only when bodies change.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare class PhysicsDebugHelper extends Nova3DHelper {
|
|
14
|
+
private readonly _templates;
|
|
15
|
+
private readonly _color;
|
|
16
|
+
private _part;
|
|
17
|
+
private _dirty;
|
|
18
|
+
private _world;
|
|
19
|
+
private readonly _pose;
|
|
20
|
+
constructor(app: Nova3DApp, scene: Nova3DScene, options: {
|
|
21
|
+
color?: Color3D;
|
|
22
|
+
});
|
|
23
|
+
private _rebuild;
|
|
24
|
+
}
|