@nova-lab/core 1.0.0-dev.19 → 1.1.0-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 +223 -4
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
import { N as g } from "./Errors-B2ekO9bZ.js";
|
|
2
|
+
import { c as nn, o as Z } from "./Options-CajE7LLJ.js";
|
|
3
|
+
/*! gl-matrix 3.4.4 (functions copied into Nova) | MIT License
|
|
4
|
+
Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
8
|
+
function On() {
|
|
9
|
+
const n = new Float32Array(9);
|
|
10
|
+
return n[0] = 1, n[4] = 1, n[8] = 1, n;
|
|
11
|
+
}
|
|
12
|
+
function Vn(n, s) {
|
|
13
|
+
return n[0] = s[0], n[1] = s[1], n[2] = s[2], n[3] = s[4], n[4] = s[5], n[5] = s[6], n[6] = s[8], n[7] = s[9], n[8] = s[10], n;
|
|
14
|
+
}
|
|
15
|
+
function sn(n, s, t, i, e, o, r, c, l) {
|
|
16
|
+
const a = new Float32Array(9);
|
|
17
|
+
return a[0] = n, a[1] = s, a[2] = t, a[3] = i, a[4] = e, a[5] = o, a[6] = r, a[7] = c, a[8] = l, a;
|
|
18
|
+
}
|
|
19
|
+
function tn(n) {
|
|
20
|
+
return n[0] = 1, n[1] = 0, n[2] = 0, n[3] = 0, n[4] = 1, n[5] = 0, n[6] = 0, n[7] = 0, n[8] = 1, n;
|
|
21
|
+
}
|
|
22
|
+
function kn(n, s) {
|
|
23
|
+
const t = s[0], i = s[1], e = s[2], o = s[3], r = s[4], c = s[5], l = s[6], a = s[7], h = s[8], d = h * r - c * a, p = -h * o + c * l, f = a * o - r * l;
|
|
24
|
+
let w = t * d + i * p + e * f;
|
|
25
|
+
return w ? (w = 1 / w, n[0] = d * w, n[1] = (-h * i + e * a) * w, n[2] = (c * i - e * r) * w, n[3] = p * w, n[4] = (h * t - e * l) * w, n[5] = (-c * t + e * o) * w, n[6] = f * w, n[7] = (-a * t + i * l) * w, n[8] = (r * t - i * o) * w, n) : null;
|
|
26
|
+
}
|
|
27
|
+
function en(n, s) {
|
|
28
|
+
const t = s[0], i = s[1], e = s[2], o = s[3], r = s[4], c = s[5], l = s[6], a = s[7], h = s[8], d = s[9], p = s[10], f = s[11], w = s[12], v = s[13], _ = s[14], q = s[15], x = t * c - i * r, y = t * l - e * r, b = t * a - o * r, M = i * l - e * c, m = i * a - o * c, A = e * a - o * l, V = h * v - d * w, k = h * _ - p * w, z = h * q - f * w, P = d * _ - p * v, D = d * q - f * v, O = p * q - f * _;
|
|
29
|
+
let N = x * O - y * D + b * P + M * z - m * k + A * V;
|
|
30
|
+
return N ? (N = 1 / N, n[0] = (c * O - l * D + a * P) * N, n[1] = (l * z - r * O - a * k) * N, n[2] = (r * D - c * z + a * V) * N, n[3] = (e * D - i * O - o * P) * N, n[4] = (t * O - e * z + o * k) * N, n[5] = (i * z - t * D - o * V) * N, n[6] = (v * A - _ * m + q * M) * N, n[7] = (_ * b - w * A - q * y) * N, n[8] = (w * m - v * b + q * x) * N, n) : null;
|
|
31
|
+
}
|
|
32
|
+
/*! gl-matrix 3.4.4 (functions copied into Nova) | MIT License
|
|
33
|
+
Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.
|
|
34
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
35
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
36
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
37
|
+
const C = 1e-6;
|
|
38
|
+
function on(n, s) {
|
|
39
|
+
return n[0] = s[0], n[1] = s[1], n[2] = s[2], n[3] = s[3], n[4] = s[4], n[5] = s[5], n[6] = s[6], n[7] = s[7], n[8] = s[8], n[9] = s[9], n[10] = s[10], n[11] = s[11], n[12] = s[12], n[13] = s[13], n[14] = s[14], n[15] = s[15], n;
|
|
40
|
+
}
|
|
41
|
+
function W() {
|
|
42
|
+
const n = new Float32Array(16);
|
|
43
|
+
return n[0] = 1, n[5] = 1, n[10] = 1, n[15] = 1, n;
|
|
44
|
+
}
|
|
45
|
+
function rn(n) {
|
|
46
|
+
const s = n[0], t = n[1], i = n[2], e = n[3], o = n[4], r = n[5], c = n[6], l = n[7], a = n[8], h = n[9], d = n[10], p = n[11], f = n[12], w = n[13], v = n[14], _ = n[15], q = s * r - t * o, x = s * c - i * o, y = t * c - i * r, b = a * w - h * f, M = a * v - d * f, m = h * v - d * w, A = s * m - t * M + i * b, V = o * m - r * M + c * b, k = a * y - h * x + d * q, z = f * y - w * x + v * q;
|
|
47
|
+
return l * A - e * V + _ * k - p * z;
|
|
48
|
+
}
|
|
49
|
+
function Pn(n, s, t) {
|
|
50
|
+
let i = t[0], e = t[1], o = t[2], r = Math.sqrt(i * i + e * e + o * o);
|
|
51
|
+
if (r < C)
|
|
52
|
+
return null;
|
|
53
|
+
r = 1 / r, i *= r, e *= r, o *= r;
|
|
54
|
+
const c = Math.sin(s), l = Math.cos(s), a = 1 - l;
|
|
55
|
+
return n[0] = i * i * a + l, n[1] = e * i * a + o * c, n[2] = o * i * a - e * c, n[3] = 0, n[4] = i * e * a - o * c, n[5] = e * e * a + l, n[6] = o * e * a + i * c, n[7] = 0, n[8] = i * o * a + e * c, n[9] = e * o * a - i * c, n[10] = o * o * a + l, n[11] = 0, n[12] = 0, n[13] = 0, n[14] = 0, n[15] = 1, n;
|
|
56
|
+
}
|
|
57
|
+
function cn(n, s, t, i) {
|
|
58
|
+
const e = s[0], o = s[1], r = s[2], c = s[3], l = e + e, a = o + o, h = r + r, d = e * l, p = e * a, f = e * h, w = o * a, v = o * h, _ = r * h, q = c * l, x = c * a, y = c * h, b = i[0], M = i[1], m = i[2];
|
|
59
|
+
return n[0] = (1 - (w + _)) * b, n[1] = (p + y) * b, n[2] = (f - x) * b, n[3] = 0, n[4] = (p - y) * M, n[5] = (1 - (d + _)) * M, n[6] = (v + q) * M, n[7] = 0, n[8] = (f + x) * m, n[9] = (v - q) * m, n[10] = (1 - (d + w)) * m, n[11] = 0, n[12] = t[0], n[13] = t[1], n[14] = t[2], n[15] = 1, n;
|
|
60
|
+
}
|
|
61
|
+
function Fn(n, s) {
|
|
62
|
+
return n[0] = 1, n[1] = 0, n[2] = 0, n[3] = 0, n[4] = 0, n[5] = 1, n[6] = 0, n[7] = 0, n[8] = 0, n[9] = 0, n[10] = 1, n[11] = 0, n[12] = s[0], n[13] = s[1], n[14] = s[2], n[15] = 1, n;
|
|
63
|
+
}
|
|
64
|
+
function Tn(n, s, t, i, e, o, r, c, l, a, h, d, p, f, w, v) {
|
|
65
|
+
const _ = new Float32Array(16);
|
|
66
|
+
return _[0] = n, _[1] = s, _[2] = t, _[3] = i, _[4] = e, _[5] = o, _[6] = r, _[7] = c, _[8] = l, _[9] = a, _[10] = h, _[11] = d, _[12] = p, _[13] = f, _[14] = w, _[15] = v, _;
|
|
67
|
+
}
|
|
68
|
+
function Rn(n, s) {
|
|
69
|
+
const t = new Float32Array(3);
|
|
70
|
+
u(t, s);
|
|
71
|
+
const i = 1 / t[0], e = 1 / t[1], o = 1 / t[2], r = s[0] * i, c = s[1] * e, l = s[2] * o, a = s[4] * i, h = s[5] * e, d = s[6] * o, p = s[8] * i, f = s[9] * e, w = s[10] * o, v = r + h + w;
|
|
72
|
+
let _ = 0;
|
|
73
|
+
return v > 0 ? (_ = Math.sqrt(v + 1) * 2, n[3] = 0.25 * _, n[0] = (d - f) / _, n[1] = (p - l) / _, n[2] = (c - a) / _) : r > h && r > w ? (_ = Math.sqrt(1 + r - h - w) * 2, n[3] = (d - f) / _, n[0] = 0.25 * _, n[1] = (c + a) / _, n[2] = (p + l) / _) : h > w ? (_ = Math.sqrt(1 + h - r - w) * 2, n[3] = (p - l) / _, n[0] = (c + a) / _, n[1] = 0.25 * _, n[2] = (d + f) / _) : (_ = Math.sqrt(1 + w - r - h) * 2, n[3] = (c - a) / _, n[0] = (p + l) / _, n[1] = (d + f) / _, n[2] = 0.25 * _), n;
|
|
74
|
+
}
|
|
75
|
+
function u(n, s) {
|
|
76
|
+
const t = s[0], i = s[1], e = s[2], o = s[4], r = s[5], c = s[6], l = s[8], a = s[9], h = s[10];
|
|
77
|
+
return n[0] = Math.sqrt(t * t + i * i + e * e), n[1] = Math.sqrt(o * o + r * r + c * c), n[2] = Math.sqrt(l * l + a * a + h * h), n;
|
|
78
|
+
}
|
|
79
|
+
function an(n, s) {
|
|
80
|
+
return n[0] = s[12], n[1] = s[13], n[2] = s[14], n;
|
|
81
|
+
}
|
|
82
|
+
function ln(n) {
|
|
83
|
+
return n[0] = 1, n[1] = 0, n[2] = 0, n[3] = 0, n[4] = 0, n[5] = 1, n[6] = 0, n[7] = 0, n[8] = 0, n[9] = 0, n[10] = 1, n[11] = 0, n[12] = 0, n[13] = 0, n[14] = 0, n[15] = 1, n;
|
|
84
|
+
}
|
|
85
|
+
function U(n, s) {
|
|
86
|
+
const t = s[0], i = s[1], e = s[2], o = s[3], r = s[4], c = s[5], l = s[6], a = s[7], h = s[8], d = s[9], p = s[10], f = s[11], w = s[12], v = s[13], _ = s[14], q = s[15], x = t * c - i * r, y = t * l - e * r, b = t * a - o * r, M = i * l - e * c, m = i * a - o * c, A = e * a - o * l, V = h * v - d * w, k = h * _ - p * w, z = h * q - f * w, P = d * _ - p * v, D = d * q - f * v, O = p * q - f * _;
|
|
87
|
+
let N = x * O - y * D + b * P + M * z - m * k + A * V;
|
|
88
|
+
return N ? (N = 1 / N, n[0] = (c * O - l * D + a * P) * N, n[1] = (e * D - i * O - o * P) * N, n[2] = (v * A - _ * m + q * M) * N, n[3] = (p * m - d * A - f * M) * N, n[4] = (l * z - r * O - a * k) * N, n[5] = (t * O - e * z + o * k) * N, n[6] = (_ * b - w * A - q * y) * N, n[7] = (h * A - p * b + f * y) * N, n[8] = (r * D - c * z + a * V) * N, n[9] = (i * z - t * D - o * V) * N, n[10] = (w * m - v * b + q * x) * N, n[11] = (d * b - h * m - f * x) * N, n[12] = (c * k - r * P - l * V) * N, n[13] = (t * P - i * k + e * V) * N, n[14] = (v * y - w * M - _ * x) * N, n[15] = (h * M - d * y + p * x) * N, n) : null;
|
|
89
|
+
}
|
|
90
|
+
function Wn(n, s, t, i) {
|
|
91
|
+
let e, o, r, c, l, a, h, d, p, f;
|
|
92
|
+
const w = s[0], v = s[1], _ = s[2], q = i[0], x = i[1], y = i[2], b = t[0], M = t[1], m = t[2];
|
|
93
|
+
return Math.abs(w - b) < C && Math.abs(v - M) < C && Math.abs(_ - m) < C ? ln(n) : (h = w - b, d = v - M, p = _ - m, f = 1 / Math.sqrt(h * h + d * d + p * p), h *= f, d *= f, p *= f, e = x * p - y * d, o = y * h - q * p, r = q * d - x * h, f = Math.sqrt(e * e + o * o + r * r), f ? (f = 1 / f, e *= f, o *= f, r *= f) : (e = 0, o = 0, r = 0), c = d * r - p * o, l = p * e - h * r, a = h * o - d * e, f = Math.sqrt(c * c + l * l + a * a), f ? (f = 1 / f, c *= f, l *= f, a *= f) : (c = 0, l = 0, a = 0), n[0] = e, n[1] = c, n[2] = h, n[3] = 0, n[4] = o, n[5] = l, n[6] = d, n[7] = 0, n[8] = r, n[9] = a, n[10] = p, n[11] = 0, n[12] = -(e * w + o * v + r * _), n[13] = -(c * w + l * v + a * _), n[14] = -(h * w + d * v + p * _), n[15] = 1, n);
|
|
94
|
+
}
|
|
95
|
+
function H(n, s, t) {
|
|
96
|
+
const i = s[0], e = s[1], o = s[2], r = s[3], c = s[4], l = s[5], a = s[6], h = s[7], d = s[8], p = s[9], f = s[10], w = s[11], v = s[12], _ = s[13], q = s[14], x = s[15];
|
|
97
|
+
let y = t[0], b = t[1], M = t[2], m = t[3];
|
|
98
|
+
return n[0] = y * i + b * c + M * d + m * v, n[1] = y * e + b * l + M * p + m * _, n[2] = y * o + b * a + M * f + m * q, n[3] = y * r + b * h + M * w + m * x, y = t[4], b = t[5], M = t[6], m = t[7], n[4] = y * i + b * c + M * d + m * v, n[5] = y * e + b * l + M * p + m * _, n[6] = y * o + b * a + M * f + m * q, n[7] = y * r + b * h + M * w + m * x, y = t[8], b = t[9], M = t[10], m = t[11], n[8] = y * i + b * c + M * d + m * v, n[9] = y * e + b * l + M * p + m * _, n[10] = y * o + b * a + M * f + m * q, n[11] = y * r + b * h + M * w + m * x, y = t[12], b = t[13], M = t[14], m = t[15], n[12] = y * i + b * c + M * d + m * v, n[13] = y * e + b * l + M * p + m * _, n[14] = y * o + b * a + M * f + m * q, n[15] = y * r + b * h + M * w + m * x, n;
|
|
99
|
+
}
|
|
100
|
+
function $n(n, s, t, i, e, o, r) {
|
|
101
|
+
const c = 1 / (s - t), l = 1 / (i - e), a = 1 / (o - r);
|
|
102
|
+
return n[0] = -2 * c, n[1] = 0, n[2] = 0, n[3] = 0, n[4] = 0, n[5] = -2 * l, n[6] = 0, n[7] = 0, n[8] = 0, n[9] = 0, n[10] = 2 * a, n[11] = 0, n[12] = (s + t) * c, n[13] = (e + i) * l, n[14] = (r + o) * a, n[15] = 1, n;
|
|
103
|
+
}
|
|
104
|
+
function Ln(n, s, t, i, e) {
|
|
105
|
+
const o = 1 / Math.tan(s / 2);
|
|
106
|
+
if (n[0] = o / t, n[1] = 0, n[2] = 0, n[3] = 0, n[4] = 0, n[5] = o, n[6] = 0, n[7] = 0, n[8] = 0, n[9] = 0, n[11] = -1, n[12] = 0, n[13] = 0, n[15] = 0, e != null && e !== 1 / 0) {
|
|
107
|
+
const r = 1 / (i - e);
|
|
108
|
+
n[10] = (e + i) * r, n[14] = 2 * e * i * r;
|
|
109
|
+
} else
|
|
110
|
+
n[10] = -1, n[14] = -2 * i;
|
|
111
|
+
return n;
|
|
112
|
+
}
|
|
113
|
+
function hn(n, s, t) {
|
|
114
|
+
const i = t[0], e = t[1], o = t[2];
|
|
115
|
+
return n[0] = s[0] * i, n[1] = s[1] * i, n[2] = s[2] * i, n[3] = s[3] * i, n[4] = s[4] * e, n[5] = s[5] * e, n[6] = s[6] * e, n[7] = s[7] * e, n[8] = s[8] * o, n[9] = s[9] * o, n[10] = s[10] * o, n[11] = s[11] * o, n[12] = s[12], n[13] = s[13], n[14] = s[14], n[15] = s[15], n;
|
|
116
|
+
}
|
|
117
|
+
function fn(n, s, t, i) {
|
|
118
|
+
const e = s[0], o = s[1], r = s[2], c = i[0], l = i[1], a = i[2];
|
|
119
|
+
let h = e - t[0], d = o - t[1], p = r - t[2], f = h * h + d * d + p * p;
|
|
120
|
+
f > 0 && (f = 1 / Math.sqrt(f), h *= f, d *= f, p *= f);
|
|
121
|
+
let w = l * p - a * d, v = a * h - c * p, _ = c * d - l * h;
|
|
122
|
+
return f = w * w + v * v + _ * _, f > 0 && (f = 1 / Math.sqrt(f), w *= f, v *= f, _ *= f), n[0] = w, n[1] = v, n[2] = _, n[3] = 0, n[4] = d * _ - p * v, n[5] = p * w - h * _, n[6] = h * v - d * w, n[7] = 0, n[8] = h, n[9] = d, n[10] = p, n[11] = 0, n[12] = e, n[13] = o, n[14] = r, n[15] = 1, n;
|
|
123
|
+
}
|
|
124
|
+
/*! gl-matrix 3.4.4 (functions copied into Nova) | MIT License
|
|
125
|
+
Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.
|
|
126
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
127
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
128
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
129
|
+
function J() {
|
|
130
|
+
const n = new Float32Array(4);
|
|
131
|
+
return n[3] = 1, n;
|
|
132
|
+
}
|
|
133
|
+
function dn(n, s) {
|
|
134
|
+
const t = s[0] + s[4] + s[8];
|
|
135
|
+
let i;
|
|
136
|
+
if (t > 0)
|
|
137
|
+
i = Math.sqrt(t + 1), n[3] = 0.5 * i, i = 0.5 / i, n[0] = (s[5] - s[7]) * i, n[1] = (s[6] - s[2]) * i, n[2] = (s[1] - s[3]) * i;
|
|
138
|
+
else {
|
|
139
|
+
let e = 0;
|
|
140
|
+
s[4] > s[0] && (e = 1), s[8] > s[e * 3 + e] && (e = 2);
|
|
141
|
+
const o = (e + 1) % 3, r = (e + 2) % 3;
|
|
142
|
+
i = Math.sqrt(s[e * 3 + e] - s[o * 3 + o] - s[r * 3 + r] + 1), n[e] = 0.5 * i, i = 0.5 / i, n[3] = (s[o * 3 + r] - s[r * 3 + o]) * i, n[o] = (s[o * 3 + e] + s[e * 3 + o]) * i, n[r] = (s[r * 3 + e] + s[e * 3 + r]) * i;
|
|
143
|
+
}
|
|
144
|
+
return n;
|
|
145
|
+
}
|
|
146
|
+
function In(n, s, t) {
|
|
147
|
+
const i = s[0], e = s[1], o = s[2], r = s[3], c = t[0], l = t[1], a = t[2], h = t[3];
|
|
148
|
+
return n[0] = i * h + r * c + e * a - o * l, n[1] = e * h + r * l + o * c - i * a, n[2] = o * h + r * a + i * l - e * c, n[3] = r * h - i * c - e * l - o * a, n;
|
|
149
|
+
}
|
|
150
|
+
function _n(n, s) {
|
|
151
|
+
const t = s[0], i = s[1], e = s[2], o = s[3];
|
|
152
|
+
let r = t * t + i * i + e * e + o * o;
|
|
153
|
+
return r > 0 && (r = 1 / Math.sqrt(r)), n[0] = t * r, n[1] = i * r, n[2] = e * r, n[3] = o * r, n;
|
|
154
|
+
}
|
|
155
|
+
function Sn(n, s, t) {
|
|
156
|
+
t = t * 0.5;
|
|
157
|
+
const i = Math.sin(t);
|
|
158
|
+
return n[0] = i * s[0], n[1] = i * s[1], n[2] = i * s[2], n[3] = Math.cos(t), n;
|
|
159
|
+
}
|
|
160
|
+
/*! gl-matrix 3.4.4 (functions copied into Nova) | MIT License
|
|
161
|
+
Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.
|
|
162
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
163
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
164
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
165
|
+
function Cn(n, s, t) {
|
|
166
|
+
return n[0] = s[0] + t[0], n[1] = s[1] + t[1], n[2] = s[2] + t[2], n;
|
|
167
|
+
}
|
|
168
|
+
function jn(n) {
|
|
169
|
+
const s = new Float32Array(3);
|
|
170
|
+
return s[0] = n[0], s[1] = n[1], s[2] = n[2], s;
|
|
171
|
+
}
|
|
172
|
+
function T() {
|
|
173
|
+
return new Float32Array(3);
|
|
174
|
+
}
|
|
175
|
+
function Q(n, s, t) {
|
|
176
|
+
const i = s[0], e = s[1], o = s[2], r = t[0], c = t[1], l = t[2];
|
|
177
|
+
return n[0] = e * l - o * c, n[1] = o * r - i * l, n[2] = i * c - e * r, n;
|
|
178
|
+
}
|
|
179
|
+
function Bn(n, s) {
|
|
180
|
+
const t = s[0] - n[0], i = s[1] - n[1], e = s[2] - n[2];
|
|
181
|
+
return Math.sqrt(t * t + i * i + e * e);
|
|
182
|
+
}
|
|
183
|
+
function S(n, s) {
|
|
184
|
+
return n[0] * s[0] + n[1] * s[1] + n[2] * s[2];
|
|
185
|
+
}
|
|
186
|
+
function En(n, s, t) {
|
|
187
|
+
const i = new Float32Array(3);
|
|
188
|
+
return i[0] = n, i[1] = s, i[2] = t, i;
|
|
189
|
+
}
|
|
190
|
+
function I(n) {
|
|
191
|
+
const s = n[0], t = n[1], i = n[2];
|
|
192
|
+
return Math.sqrt(s * s + t * t + i * i);
|
|
193
|
+
}
|
|
194
|
+
function Kn(n, s) {
|
|
195
|
+
const t = s[0], i = s[1], e = s[2];
|
|
196
|
+
let o = t * t + i * i + e * e;
|
|
197
|
+
return o > 0 && (o = 1 / Math.sqrt(o)), n[0] = s[0] * o, n[1] = s[1] * o, n[2] = s[2] * o, n;
|
|
198
|
+
}
|
|
199
|
+
function Qn(n, s, t) {
|
|
200
|
+
return n[0] = s[0] * t, n[1] = s[1] * t, n[2] = s[2] * t, n;
|
|
201
|
+
}
|
|
202
|
+
function Un(n, s, t, i) {
|
|
203
|
+
return n[0] = s[0] + t[0] * i, n[1] = s[1] + t[1] * i, n[2] = s[2] + t[2] * i, n;
|
|
204
|
+
}
|
|
205
|
+
function Hn(n, s, t, i) {
|
|
206
|
+
return n[0] = s, n[1] = t, n[2] = i, n;
|
|
207
|
+
}
|
|
208
|
+
function j(n, s, t) {
|
|
209
|
+
return n[0] = s[0] - t[0], n[1] = s[1] - t[1], n[2] = s[2] - t[2], n;
|
|
210
|
+
}
|
|
211
|
+
function Jn(n, s, t) {
|
|
212
|
+
const i = s[0], e = s[1], o = s[2];
|
|
213
|
+
return n[0] = i * t[0] + e * t[3] + o * t[6], n[1] = i * t[1] + e * t[4] + o * t[7], n[2] = i * t[2] + e * t[5] + o * t[8], n;
|
|
214
|
+
}
|
|
215
|
+
function Gn(n, s, t) {
|
|
216
|
+
const i = s[0], e = s[1], o = s[2];
|
|
217
|
+
let r = t[3] * i + t[7] * e + t[11] * o + t[15];
|
|
218
|
+
return r = r || 1, n[0] = (t[0] * i + t[4] * e + t[8] * o + t[12]) / r, n[1] = (t[1] * i + t[5] * e + t[9] * o + t[13]) / r, n[2] = (t[2] * i + t[6] * e + t[10] * o + t[14]) / r, n;
|
|
219
|
+
}
|
|
220
|
+
function R(n, s) {
|
|
221
|
+
if (!Number.isFinite(n))
|
|
222
|
+
throw new g("invalid-option", `[Nova3D] ${s} must be finite.`);
|
|
223
|
+
return n;
|
|
224
|
+
}
|
|
225
|
+
function $(n, s, t) {
|
|
226
|
+
if (!Array.isArray(n) && !ArrayBuffer.isView(n))
|
|
227
|
+
throw new g("invalid-option", `[Nova3D] ${t} must be a vector.`);
|
|
228
|
+
if (n.length !== s)
|
|
229
|
+
throw new g("invalid-option", `[Nova3D] ${t} must have ${s} components.`);
|
|
230
|
+
if (s === 3)
|
|
231
|
+
return [R(n[0], t), R(n[1], t), R(n[2], t)];
|
|
232
|
+
if (s === 4)
|
|
233
|
+
return [R(n[0], t), R(n[1], t), R(n[2], t), R(n[3], t)];
|
|
234
|
+
const i = [];
|
|
235
|
+
for (let e = 0; e < s; e++)
|
|
236
|
+
i.push(R(n[e], t));
|
|
237
|
+
return i;
|
|
238
|
+
}
|
|
239
|
+
function pn(n) {
|
|
240
|
+
if (n === null || typeof n != "object")
|
|
241
|
+
throw new g("invalid-option", "[Nova3D] transform options must be an object.");
|
|
242
|
+
for (const s in n)
|
|
243
|
+
if (s !== "position" && s !== "scale" && s !== "rotation" && s !== "quaternion")
|
|
244
|
+
throw new g("invalid-option", `[Nova3D] Unknown transform option ${s}.`);
|
|
245
|
+
}
|
|
246
|
+
function wn() {
|
|
247
|
+
return { position: [0, 0, 0], quaternion: [0, 0, 0, 1], scale: [1, 1, 1] };
|
|
248
|
+
}
|
|
249
|
+
function yn(n) {
|
|
250
|
+
const [s, t, i] = $(n, 3, "rotation").map((h) => h / 2), e = Math.sin(s), o = Math.sin(t), r = Math.sin(i), c = Math.cos(s), l = Math.cos(t), a = Math.cos(i);
|
|
251
|
+
return [e * l * a + c * o * r, c * o * a - e * l * r, c * l * r + e * o * a, c * l * a - e * o * r];
|
|
252
|
+
}
|
|
253
|
+
function B(n, s) {
|
|
254
|
+
if (s.rotation !== void 0 && s.quaternion !== void 0)
|
|
255
|
+
throw new g("invalid-option", "[Nova3D] Choose rotation or quaternion.");
|
|
256
|
+
let t = n.quaternion;
|
|
257
|
+
if (s.rotation !== void 0 && (t = yn(s.rotation)), s.quaternion !== void 0) {
|
|
258
|
+
const i = $(s.quaternion, 4, "quaternion"), e = Math.hypot(i[0], i[1], i[2], i[3]);
|
|
259
|
+
if (e < 1e-15)
|
|
260
|
+
throw new g("invalid-option", "[Nova3D] Quaternion must have a nonzero length.");
|
|
261
|
+
i[0] /= e, i[1] /= e, i[2] /= e, i[3] /= e, t = i;
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
position: s.position === void 0 ? n.position : $(s.position, 3, "position"),
|
|
265
|
+
quaternion: t,
|
|
266
|
+
scale: s.scale === void 0 ? n.scale : $(s.scale, 3, "scale")
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
function vn(n) {
|
|
270
|
+
return cn(W(), n.quaternion, n.position, n.scale);
|
|
271
|
+
}
|
|
272
|
+
function Xn(n, s) {
|
|
273
|
+
if (en(n, s))
|
|
274
|
+
return n;
|
|
275
|
+
const t = s;
|
|
276
|
+
n[0] = t[5] * t[10] - t[6] * t[9], n[1] = t[6] * t[8] - t[4] * t[10], n[2] = t[4] * t[9] - t[5] * t[8], n[3] = t[9] * t[2] - t[10] * t[1], n[4] = t[10] * t[0] - t[8] * t[2], n[5] = t[8] * t[1] - t[9] * t[0], n[6] = t[1] * t[6] - t[2] * t[5], n[7] = t[2] * t[4] - t[0] * t[6], n[8] = t[0] * t[5] - t[1] * t[4];
|
|
277
|
+
let i = 0;
|
|
278
|
+
for (let e = 0; e < 9; e++)
|
|
279
|
+
i = Math.max(i, Math.abs(n[e]));
|
|
280
|
+
if (!(i > 0) || !Number.isFinite(i))
|
|
281
|
+
return tn(n);
|
|
282
|
+
for (let e = 0; e < 9; e++)
|
|
283
|
+
n[e] /= i;
|
|
284
|
+
return n;
|
|
285
|
+
}
|
|
286
|
+
function G(n) {
|
|
287
|
+
const s = [Math.hypot(n[0], n[1], n[2]), Math.hypot(n[4], n[5], n[6]), Math.hypot(n[8], n[9], n[10])];
|
|
288
|
+
if (s.some((r) => r < 1e-12) || !Array.from(n).every(Number.isFinite))
|
|
289
|
+
throw new g("invalid-option", "[Nova3D] Cannot decompose a singular transform.");
|
|
290
|
+
rn(n) < 0 && (s[0] *= -1);
|
|
291
|
+
const t = sn(
|
|
292
|
+
n[0] / s[0],
|
|
293
|
+
n[1] / s[0],
|
|
294
|
+
n[2] / s[0],
|
|
295
|
+
n[4] / s[1],
|
|
296
|
+
n[5] / s[1],
|
|
297
|
+
n[6] / s[1],
|
|
298
|
+
n[8] / s[2],
|
|
299
|
+
n[9] / s[2],
|
|
300
|
+
n[10] / s[2]
|
|
301
|
+
), i = _n(J(), dn(J(), t)), e = {
|
|
302
|
+
position: [n[12], n[13], n[14]],
|
|
303
|
+
quaternion: Array.from(i),
|
|
304
|
+
scale: s
|
|
305
|
+
}, o = vn(e);
|
|
306
|
+
if (Array.from(n).some((r, c) => Math.abs(r - o[c]) > 2e-5 * Math.max(1, Math.abs(r))))
|
|
307
|
+
throw new g("invalid-option", "[Nova3D] Transform contains unsupported shear or perspective.");
|
|
308
|
+
return e;
|
|
309
|
+
}
|
|
310
|
+
function Yn(n, s, t = { min: [0, 0, 0], max: [0, 0, 0] }) {
|
|
311
|
+
const { min: i, max: e } = t;
|
|
312
|
+
i.fill(1 / 0), e.fill(-1 / 0);
|
|
313
|
+
for (let o = 0; o < 8; o++) {
|
|
314
|
+
const r = o & 1 ? n.max[0] : n.min[0], c = o & 2 ? n.max[1] : n.min[1], l = o & 4 ? n.max[2] : n.min[2], a = s[3] * r + s[7] * c + s[11] * l + s[15] || 1;
|
|
315
|
+
for (let h = 0; h < 3; h++) {
|
|
316
|
+
const d = Math.fround((s[h] * r + s[h + 4] * c + s[h + 8] * l + s[h + 12]) / a);
|
|
317
|
+
i[h] = Math.min(i[h], d), e[h] = Math.max(e[h], d);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
return t;
|
|
321
|
+
}
|
|
322
|
+
function Zn(n) {
|
|
323
|
+
const s = $(n.origin, 3, "ray origin"), t = $(n.direction, 3, "ray direction"), i = Math.hypot(...t);
|
|
324
|
+
if (i < 1e-15)
|
|
325
|
+
throw new g("invalid-option", "[Nova3D] Ray direction must be nonzero.");
|
|
326
|
+
return { origin: s, direction: t.map((e) => e / i) };
|
|
327
|
+
}
|
|
328
|
+
function un(n, s) {
|
|
329
|
+
let t = 0, i = 1 / 0;
|
|
330
|
+
for (let e = 0; e < 3; e++) {
|
|
331
|
+
const o = n.origin[e], r = n.direction[e];
|
|
332
|
+
if (Math.abs(r) < 1e-15) {
|
|
333
|
+
if (o < s.min[e] || o > s.max[e])
|
|
334
|
+
return null;
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
let c = (s.min[e] - o) / r, l = (s.max[e] - o) / r;
|
|
338
|
+
if (c > l && ([c, l] = [l, c]), t = Math.max(t, c), i = Math.min(i, l), t > i)
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
return t;
|
|
342
|
+
}
|
|
343
|
+
function ns(n, s, t, i, e) {
|
|
344
|
+
const o = n.uvs;
|
|
345
|
+
if (!o)
|
|
346
|
+
return;
|
|
347
|
+
const r = n.indices ? n.indices[s] : s, c = n.indices ? n.indices[s + 1] : s + 1, l = n.indices ? n.indices[s + 2] : s + 2, a = n.positions, h = t[0] + i[0] * e, d = t[1] + i[1] * e, p = t[2] + i[2] * e, f = a[c * 3] - a[r * 3], w = a[c * 3 + 1] - a[r * 3 + 1], v = a[c * 3 + 2] - a[r * 3 + 2], _ = a[l * 3] - a[r * 3], q = a[l * 3 + 1] - a[r * 3 + 1], x = a[l * 3 + 2] - a[r * 3 + 2], y = h - a[r * 3], b = d - a[r * 3 + 1], M = p - a[r * 3 + 2], m = f * f + w * w + v * v, A = f * _ + w * q + v * x, V = _ * _ + q * q + x * x, k = y * f + b * w + M * v, z = y * _ + b * q + M * x, P = m * V - A * A;
|
|
348
|
+
if (Math.abs(P) < 1e-30)
|
|
349
|
+
return;
|
|
350
|
+
const D = (V * k - A * z) / P, O = (m * z - A * k) / P, N = 1 - D - O;
|
|
351
|
+
return [N * o[r * 2] + D * o[c * 2] + O * o[l * 2], N * o[r * 2 + 1] + D * o[c * 2 + 1] + O * o[l * 2 + 1]];
|
|
352
|
+
}
|
|
353
|
+
function ss(n, s, t, i, e) {
|
|
354
|
+
const o = j(T(), i, t), r = j(T(), e, t), c = Q(T(), s, r), l = S(o, c);
|
|
355
|
+
if (Math.abs(l) <= 32 * Number.EPSILON * I(o) * I(r) * I(s))
|
|
356
|
+
return null;
|
|
357
|
+
const a = j(T(), n, t), h = S(a, c) / l;
|
|
358
|
+
if (h < -1e-7 || h > 1 + 1e-7)
|
|
359
|
+
return null;
|
|
360
|
+
const d = Q(T(), a, o), p = S(s, d) / l;
|
|
361
|
+
if (p < -1e-7 || h + p > 1 + 1e-7)
|
|
362
|
+
return null;
|
|
363
|
+
const f = S(r, d) / l;
|
|
364
|
+
return f >= 0 ? f : null;
|
|
365
|
+
}
|
|
366
|
+
function L(n, s, t, i) {
|
|
367
|
+
const e = Math.abs(n), o = Math.abs(s), r = Math.abs(t), c = Math.abs(i);
|
|
368
|
+
let l = 0;
|
|
369
|
+
if (e > l && (l = e), o > l && (l = o), r > l && (l = r), c > l && (l = c), l === 1 / 0)
|
|
370
|
+
return 1 / 0;
|
|
371
|
+
if (Number.isNaN(n) || Number.isNaN(s) || Number.isNaN(t) || Number.isNaN(i))
|
|
372
|
+
return Number.NaN;
|
|
373
|
+
if (l === 0)
|
|
374
|
+
return 0;
|
|
375
|
+
let a = 0, h = 0, d = e / l, p = d * d - h, f = a + p;
|
|
376
|
+
return h = f - a - p, a = f, d = o / l, p = d * d - h, f = a + p, h = f - a - p, a = f, d = r / l, p = d * d - h, f = a + p, h = f - a - p, a = f, d = c / l, p = d * d - h, f = a + p, Math.sqrt(f) * l;
|
|
377
|
+
}
|
|
378
|
+
function bn(n, s, t, i) {
|
|
379
|
+
return Math.hypot(n, s, t, i);
|
|
380
|
+
}
|
|
381
|
+
function mn() {
|
|
382
|
+
let n = 795556381;
|
|
383
|
+
const s = () => (n = Math.imul(n, 1103515245) + 12345 >>> 0, n / 4294967296);
|
|
384
|
+
for (let t = 0; t < 512; t++) {
|
|
385
|
+
const i = t % 3 === 0 ? 1 : t % 3 === 1 ? 1e-6 : 1e6, e = (s() * 2 - 1) * i, o = (s() * 2 - 1) * i, r = (s() * 2 - 1) * i, c = t % 5 === 0 ? 0 : (s() * 2 - 1) * i;
|
|
386
|
+
if (!Object.is(Math.hypot(e, o, r, c), L(e, o, r, c)))
|
|
387
|
+
return !1;
|
|
388
|
+
}
|
|
389
|
+
return Object.is(Math.hypot(0, -0, 0, 0), L(0, -0, 0, 0)) && Object.is(Math.hypot(Number.NaN, 1 / 0, 0, 0), L(Number.NaN, 1 / 0, 0, 0)) && Object.is(Math.hypot(Number.NaN, 1, 0, 0), L(Number.NaN, 1, 0, 0));
|
|
390
|
+
}
|
|
391
|
+
const ts = mn() ? L : bn;
|
|
392
|
+
function E(n, s, t) {
|
|
393
|
+
if (s !== void 0) {
|
|
394
|
+
if (!Array.isArray(s) && !ArrayBuffer.isView(s) || s.length !== t)
|
|
395
|
+
throw new g("invalid-option", `[Nova3D] ${n} must have ${t} components.`);
|
|
396
|
+
for (let i = 0; i < t; i++)
|
|
397
|
+
if (!Number.isFinite(s[i]))
|
|
398
|
+
throw new g("invalid-option", `[Nova3D] ${n} must be finite.`);
|
|
399
|
+
if (t === 4) {
|
|
400
|
+
const i = Math.sqrt(s[0] * s[0] + s[1] * s[1] + s[2] * s[2] + s[3] * s[3]);
|
|
401
|
+
if (!(i >= 1e-15) || !Number.isFinite(i))
|
|
402
|
+
throw new g("invalid-option", Number.isFinite(i) ? "[Nova3D] Quaternion must have a nonzero length." : "[Nova3D] quaternion must be finite.");
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
function X(n, s) {
|
|
407
|
+
return n[0] !== s[0] || n[1] !== s[1] || n[2] !== s[2];
|
|
408
|
+
}
|
|
409
|
+
function Mn(n, s) {
|
|
410
|
+
return n[0] !== s[0] || n[1] !== s[1] || n[2] !== s[2] || n[3] !== s[3];
|
|
411
|
+
}
|
|
412
|
+
function Y(n, s, t) {
|
|
413
|
+
const i = t[0], e = t[1], o = t[2], r = i !== s[0] || e !== s[1] || o !== s[2];
|
|
414
|
+
return n[0] = i, n[1] = e, n[2] = o, r;
|
|
415
|
+
}
|
|
416
|
+
function qn(n, s, t) {
|
|
417
|
+
const i = 1 / Math.sqrt(t[0] * t[0] + t[1] * t[1] + t[2] * t[2] + t[3] * t[3]), e = t[0] * i, o = t[1] * i, r = t[2] * i, c = t[3] * i, l = e !== s[0] || o !== s[1] || r !== s[2] || c !== s[3];
|
|
418
|
+
return n[0] = e, n[1] = o, n[2] = r, n[3] = c, l;
|
|
419
|
+
}
|
|
420
|
+
function Nn(n, s, t, i) {
|
|
421
|
+
const e = s[0], o = s[1], r = s[2], c = s[3], l = e + e, a = o + o, h = r + r, d = e * l, p = e * a, f = e * h, w = o * a, v = o * h, _ = r * h, q = c * l, x = c * a, y = c * h, b = i[0], M = i[1], m = i[2];
|
|
422
|
+
n[0] = (1 - (w + _)) * b, n[1] = (p + y) * b, n[2] = (f - x) * b, n[3] = 0, n[4] = (p - y) * M, n[5] = (1 - (d + _)) * M, n[6] = (v + q) * M, n[7] = 0, n[8] = (f + x) * m, n[9] = (v - q) * m, n[10] = (1 - (d + w)) * m, n[11] = 0, n[12] = t[0], n[13] = t[1], n[14] = t[2], n[15] = 1;
|
|
423
|
+
}
|
|
424
|
+
function gn(n, s, t) {
|
|
425
|
+
const i = s[0], e = s[1], o = s[2], r = s[3], c = s[4], l = s[5], a = s[6], h = s[7], d = s[8], p = s[9], f = s[10], w = s[11], v = s[12], _ = s[13], q = s[14], x = s[15];
|
|
426
|
+
for (let y = 0; y < 16; y += 4) {
|
|
427
|
+
const b = t[y], M = t[y + 1], m = t[y + 2], A = t[y + 3];
|
|
428
|
+
n[y] = b * i + M * c + m * d + A * v, n[y + 1] = b * e + M * l + m * p + A * _, n[y + 2] = b * o + M * a + m * f + A * q, n[y + 3] = b * r + M * h + m * w + A * x;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
const xn = Z({ preserve: !0 }), An = { position: !0, scale: !0, rotation: !0, quaternion: !0, id: !0, visible: !0, pickable: !0, parent: !0 }, is = Z(An);
|
|
432
|
+
class F {
|
|
433
|
+
/** @internal */
|
|
434
|
+
constructor(s, t = {}) {
|
|
435
|
+
if (this.scene = s, this._transform = B(wn(), t), this._visible = t.visible ?? !0, this._pickable = t.pickable ?? !0, typeof this._visible != "boolean" || typeof this._pickable != "boolean")
|
|
436
|
+
throw new g("invalid-option", "[Nova3D] visible and pickable must be boolean.");
|
|
437
|
+
const i = t.parent;
|
|
438
|
+
if (i !== void 0 && (!(i instanceof F) || i.destroyed || i.scene !== s))
|
|
439
|
+
throw new g("owner", "[Nova3D] Parent must be a live node of the same scene.");
|
|
440
|
+
i?._assertLogicalWrite(), this.id = s._register(this, t.id), i ? (this._parent = i, i._children.add(this)) : (this._parent = s, s._roots.add(this)), s._invalidate(this);
|
|
441
|
+
}
|
|
442
|
+
_parent;
|
|
443
|
+
_children = /* @__PURE__ */ new Set();
|
|
444
|
+
_animationOwners = /* @__PURE__ */ new Map();
|
|
445
|
+
/** Evaluated channels; every key is always present (undefined: not animated) so the shape stays fixed. */
|
|
446
|
+
_animationPose = { position: void 0, quaternion: void 0, scale: void 0 };
|
|
447
|
+
/** Arrays the animated channels are written into, kept across frames. */
|
|
448
|
+
_posePosition = void 0;
|
|
449
|
+
_poseQuaternion = void 0;
|
|
450
|
+
_poseScale = void 0;
|
|
451
|
+
/** Post-animation rotation layer (IK); overrides the evaluated local rotation. */
|
|
452
|
+
_poseRotation = null;
|
|
453
|
+
_poseActive = !1;
|
|
454
|
+
_poseOwner;
|
|
455
|
+
_transform;
|
|
456
|
+
_local = W();
|
|
457
|
+
_localVersion = 0;
|
|
458
|
+
_appliedVersion = -1;
|
|
459
|
+
_parentVersion = -1;
|
|
460
|
+
_world = W();
|
|
461
|
+
_worldVersion = 0;
|
|
462
|
+
/** Live world record; read immediately, never kept as a snapshot. */
|
|
463
|
+
_worldRecord = { matrix: this._world, version: 0, children: this._children };
|
|
464
|
+
_documentSource;
|
|
465
|
+
_documentWrite;
|
|
466
|
+
_destroyed = !1;
|
|
467
|
+
_lodVisible = !0;
|
|
468
|
+
_visibleHierarchy = -1;
|
|
469
|
+
_visibleFlags = -1;
|
|
470
|
+
_visibleCached = !1;
|
|
471
|
+
_lodOwner;
|
|
472
|
+
_visible = !0;
|
|
473
|
+
_pickable = !0;
|
|
474
|
+
/** Queued in the scene's stale world matrices. @internal */
|
|
475
|
+
_matrixDirty = !1;
|
|
476
|
+
/** Skinned meshes using this node as a joint (the scene's set, mirrored for the matrix flush). @internal */
|
|
477
|
+
_skinUsers = void 0;
|
|
478
|
+
id;
|
|
479
|
+
get parent() {
|
|
480
|
+
return this._parent;
|
|
481
|
+
}
|
|
482
|
+
get children() {
|
|
483
|
+
return [...this._children];
|
|
484
|
+
}
|
|
485
|
+
get destroyed() {
|
|
486
|
+
return this._destroyed;
|
|
487
|
+
}
|
|
488
|
+
get visible() {
|
|
489
|
+
return this._visible;
|
|
490
|
+
}
|
|
491
|
+
get pickable() {
|
|
492
|
+
return this._pickable;
|
|
493
|
+
}
|
|
494
|
+
getTransform() {
|
|
495
|
+
this._assertAlive();
|
|
496
|
+
const s = this._animationPose, t = this._transform;
|
|
497
|
+
return { position: [...s.position ?? t.position], quaternion: [...s.quaternion ?? t.quaternion], scale: [...s.scale ?? t.scale] };
|
|
498
|
+
}
|
|
499
|
+
setTransform(s) {
|
|
500
|
+
pn(s), this._setTransform(s);
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* `setTransform` without the key check, for engine writers that patch every frame
|
|
504
|
+
* (controls, physics, XR, tiles).
|
|
505
|
+
* @internal
|
|
506
|
+
*/
|
|
507
|
+
_setTransform(s) {
|
|
508
|
+
if (this._assertLogicalWrite(), s.position !== void 0 && this._animationOwners.has("position") || s.scale !== void 0 && this._animationOwners.has("scale") || (s.quaternion !== void 0 || s.rotation !== void 0) && this._animationOwners.has("quaternion"))
|
|
509
|
+
throw new g("state", "[Nova3D] Stop the owning animation before editing an animated transform channel.");
|
|
510
|
+
const t = B(this._transform, s), i = this._transform;
|
|
511
|
+
K(t.position, i.position, 3) && K(t.quaternion, i.quaternion, 4) && K(t.scale, i.scale, 3) || (this._transform = t, this._localVersion++, this.scene._invalidate(this));
|
|
512
|
+
}
|
|
513
|
+
setVisible(s) {
|
|
514
|
+
if (this._assertLogicalWrite(), typeof s != "boolean")
|
|
515
|
+
throw new g("invalid-option", "[Nova3D] visible must be boolean.");
|
|
516
|
+
s !== this._visible && (this._visible = s, this.scene._visibilityVersion++, this.scene._invalidate());
|
|
517
|
+
}
|
|
518
|
+
setPickable(s) {
|
|
519
|
+
if (this._assertLogicalWrite(), typeof s != "boolean")
|
|
520
|
+
throw new g("invalid-option", "[Nova3D] pickable must be boolean.");
|
|
521
|
+
this._pickable = s;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Keeps the world placement atomically and refuses shear and singular parents.
|
|
525
|
+
*/
|
|
526
|
+
reparent(s, t = {}) {
|
|
527
|
+
if (nn(t, xn, "reparent"), this._assertLogicalWrite(), s instanceof F && s._assertLogicalWrite(), this._lodOwner && s !== this._lodOwner)
|
|
528
|
+
throw new g("owner", "[Nova3D] A level root is owned by its LOD.");
|
|
529
|
+
if (s === this._parent)
|
|
530
|
+
return;
|
|
531
|
+
if (s !== this.scene && (!(s instanceof F) || s.scene !== this.scene || s.destroyed))
|
|
532
|
+
throw new g("owner", "[Nova3D] Parent must be a live node in the same scene.");
|
|
533
|
+
let i = s;
|
|
534
|
+
for (; i instanceof F; ) {
|
|
535
|
+
if (i === this)
|
|
536
|
+
throw new g("invalid-option", "[Nova3D] Reparent would create a cycle.");
|
|
537
|
+
i = i._parent;
|
|
538
|
+
}
|
|
539
|
+
if (t.preserve !== void 0 && t.preserve !== "local" && t.preserve !== "world")
|
|
540
|
+
throw new g("invalid-option", "[Nova3D] Unsupported reparent mode.");
|
|
541
|
+
let e;
|
|
542
|
+
if (t.preserve === "world") {
|
|
543
|
+
if (this._animationOwners.size)
|
|
544
|
+
throw new g("state", "[Nova3D] World-preserving reparent requires stopping animated channels.");
|
|
545
|
+
this.scene._flushMatrices();
|
|
546
|
+
const o = W();
|
|
547
|
+
if (s instanceof F && !U(o, s._world))
|
|
548
|
+
throw new g("invalid-option", "[Nova3D] Parent transform is singular.");
|
|
549
|
+
e = G(H(W(), o, this._world));
|
|
550
|
+
}
|
|
551
|
+
this._detach(), this._parent = s, s instanceof F ? s._children.add(this) : this.scene._roots.add(this), e && (this._transform = e), this._localVersion++, this._parentVersion = -1, this.scene._hierarchyVersion++, this.scene._invalidate(this);
|
|
552
|
+
}
|
|
553
|
+
getWorldMatrix(s = W()) {
|
|
554
|
+
return this._assertAlive(), this.scene._flushMatrices(), on(s, this._world);
|
|
555
|
+
}
|
|
556
|
+
getWorldBounds() {
|
|
557
|
+
this._assertAlive(), this.scene._flushMatrices();
|
|
558
|
+
const s = [1 / 0, 1 / 0, 1 / 0], t = [-1 / 0, -1 / 0, -1 / 0], i = [this];
|
|
559
|
+
let e = !1;
|
|
560
|
+
for (; i.length > 0; ) {
|
|
561
|
+
const o = i.pop(), r = o._ownBounds();
|
|
562
|
+
if (r) {
|
|
563
|
+
e = !0;
|
|
564
|
+
for (let c = 0; c < 3; c++)
|
|
565
|
+
s[c] = Math.min(s[c], r.min[c]), t[c] = Math.max(t[c], r.max[c]);
|
|
566
|
+
}
|
|
567
|
+
for (const c of o._children)
|
|
568
|
+
i.push(c);
|
|
569
|
+
}
|
|
570
|
+
return e ? { min: s, max: t } : null;
|
|
571
|
+
}
|
|
572
|
+
lookAt(s, t = [0, 1, 0]) {
|
|
573
|
+
this._assertAlive();
|
|
574
|
+
const i = $(s, 3, "lookAt target"), e = $(t, 3, "lookAt up");
|
|
575
|
+
this.scene._flushMatrices();
|
|
576
|
+
const o = an(T(), this._world), r = j(T(), o, i);
|
|
577
|
+
if (I(r) < 1e-12 || I(Q(T(), r, e)) < 1e-12)
|
|
578
|
+
throw new g("invalid-option", "[Nova3D] lookAt requires distinct points and a nonparallel up vector.");
|
|
579
|
+
const c = fn(W(), o, i, e);
|
|
580
|
+
if (hn(c, c, u(T(), this._world)), this._parent instanceof F) {
|
|
581
|
+
const l = U(W(), this._parent._world);
|
|
582
|
+
if (!l)
|
|
583
|
+
throw new g("invalid-option", "[Nova3D] Parent transform is singular.");
|
|
584
|
+
H(c, l, c);
|
|
585
|
+
}
|
|
586
|
+
this._setTransform(G(c));
|
|
587
|
+
}
|
|
588
|
+
destroy() {
|
|
589
|
+
this._destroyOwned();
|
|
590
|
+
}
|
|
591
|
+
/** @internal */
|
|
592
|
+
_destroyOwned(s) {
|
|
593
|
+
if (this._lodOwner)
|
|
594
|
+
throw new g("owner", "[Nova3D] Destroy the owning LOD instead of a managed level root.");
|
|
595
|
+
if (this._destroyed)
|
|
596
|
+
return;
|
|
597
|
+
const t = [this], i = [];
|
|
598
|
+
for (; t.length > 0; ) {
|
|
599
|
+
const o = t.pop();
|
|
600
|
+
i.push(o);
|
|
601
|
+
for (const r of o._children)
|
|
602
|
+
t.push(r);
|
|
603
|
+
}
|
|
604
|
+
const e = s ?? new Set(i);
|
|
605
|
+
for (const o of i)
|
|
606
|
+
o._assertLogicalWrite(), this.scene._assertJointUsers(o, e);
|
|
607
|
+
this._detach(), this.scene._hierarchyVersion++;
|
|
608
|
+
for (let o = i.length - 1; o >= 0; o--) {
|
|
609
|
+
const r = i[o];
|
|
610
|
+
r._destroyed = !0, r._documentWrite = void 0, r._documentSource = void 0, r._animationOwners.clear(), r._animationPose = { position: void 0, quaternion: void 0, scale: void 0 }, r._poseActive = !1, r._poseOwner = void 0, r._lodOwner = void 0, r._children.clear(), r._onDestroy(), this.scene._unregister(r);
|
|
611
|
+
}
|
|
612
|
+
this.scene._invalidate();
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* @internal
|
|
616
|
+
*/
|
|
617
|
+
_updateWorld(s, t) {
|
|
618
|
+
if (this._appliedVersion === this._localVersion && this._parentVersion === t)
|
|
619
|
+
return !1;
|
|
620
|
+
if (this._appliedVersion !== this._localVersion) {
|
|
621
|
+
const i = this._animationPose, e = this._transform;
|
|
622
|
+
Nn(this._local, (this._poseActive ? this._poseRotation : null) ?? i.quaternion ?? e.quaternion, i.position ?? e.position, i.scale ?? e.scale);
|
|
623
|
+
}
|
|
624
|
+
return gn(this._world, s, this._local), this._appliedVersion = this._localVersion, this._parentVersion = t, this._worldVersion++, this._worldRecord.version = this._worldVersion, !0;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* @internal
|
|
628
|
+
*/
|
|
629
|
+
_worldState() {
|
|
630
|
+
return this._worldRecord;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* @internal
|
|
634
|
+
*/
|
|
635
|
+
_ownBounds() {
|
|
636
|
+
return null;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* @internal
|
|
640
|
+
*/
|
|
641
|
+
_effective(s) {
|
|
642
|
+
if (s === "visible") {
|
|
643
|
+
const t = this.scene;
|
|
644
|
+
if (this._visibleHierarchy === t._hierarchyVersion && this._visibleFlags === t._visibilityVersion)
|
|
645
|
+
return this._visibleCached;
|
|
646
|
+
const i = this._walkEffective(s);
|
|
647
|
+
return this._visibleHierarchy = t._hierarchyVersion, this._visibleFlags = t._visibilityVersion, this._visibleCached = i, i;
|
|
648
|
+
}
|
|
649
|
+
return this._walkEffective(s);
|
|
650
|
+
}
|
|
651
|
+
_walkEffective(s) {
|
|
652
|
+
if (this.destroyed || !(s === "visible" ? this._visible && this._lodVisible : this._pickable))
|
|
653
|
+
return !1;
|
|
654
|
+
let t = this._parent;
|
|
655
|
+
for (; t instanceof F; ) {
|
|
656
|
+
if (t.destroyed || !(s === "visible" ? t._visible && t._lodVisible : t._pickable))
|
|
657
|
+
return !1;
|
|
658
|
+
t = t._parent;
|
|
659
|
+
}
|
|
660
|
+
return !0;
|
|
661
|
+
}
|
|
662
|
+
/** @internal */
|
|
663
|
+
_getLODOwner() {
|
|
664
|
+
return this._lodOwner;
|
|
665
|
+
}
|
|
666
|
+
/** @internal */
|
|
667
|
+
_setLODOwner(s) {
|
|
668
|
+
this._lodOwner = s;
|
|
669
|
+
}
|
|
670
|
+
/** @internal */
|
|
671
|
+
_setLODVisible(s) {
|
|
672
|
+
s !== this._lodVisible && (this._lodVisible = s, this.scene._visibilityVersion++);
|
|
673
|
+
}
|
|
674
|
+
/** Logical base of one channel, read without copying (callers must not keep or mutate it). @internal */
|
|
675
|
+
_baseChannel(s) {
|
|
676
|
+
return this._transform[s];
|
|
677
|
+
}
|
|
678
|
+
/** @internal */
|
|
679
|
+
_baseTransform() {
|
|
680
|
+
return { position: [...this._transform.position], quaternion: [...this._transform.quaternion], scale: [...this._transform.scale] };
|
|
681
|
+
}
|
|
682
|
+
/** @internal */
|
|
683
|
+
_canClaimAnimation(s, t) {
|
|
684
|
+
return !this.destroyed && !this.scene.destroyed && [...t].every((i) => !this._animationOwners.has(i) || this._animationOwners.get(i) === s);
|
|
685
|
+
}
|
|
686
|
+
/** @internal */
|
|
687
|
+
_claimAnimation(s, t) {
|
|
688
|
+
if (this._assertAlive(), !this._canClaimAnimation(s, t))
|
|
689
|
+
throw new g("owner", "[Nova3D] Animation channel already has an owner.");
|
|
690
|
+
for (const i of t)
|
|
691
|
+
this._animationOwners.set(i, s);
|
|
692
|
+
}
|
|
693
|
+
/** @internal */
|
|
694
|
+
_applyAnimationPose(s, t) {
|
|
695
|
+
this._assertAlive();
|
|
696
|
+
const i = this._animationOwners, e = i.get("position") === s, o = i.get("quaternion") === s, r = i.get("scale") === s, c = t.position, l = t.quaternion, a = t.scale;
|
|
697
|
+
if (c !== void 0 && !e || l !== void 0 && !o || a !== void 0 && !r)
|
|
698
|
+
throw new g("owner", "[Nova3D] Animation pose can only be applied by its channel owner.");
|
|
699
|
+
e && E("position", c, 3), o && E("quaternion", l, 4), r && E("scale", a, 3);
|
|
700
|
+
const h = this._animationPose, d = this._transform;
|
|
701
|
+
let p = !1;
|
|
702
|
+
if (e) {
|
|
703
|
+
const f = h.position;
|
|
704
|
+
if (c === void 0)
|
|
705
|
+
h.position = void 0, p = f !== void 0 && X(f, d.position);
|
|
706
|
+
else {
|
|
707
|
+
const w = this._posePosition ??= [0, 0, 0];
|
|
708
|
+
p = Y(w, f ?? d.position, c), h.position = w;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
if (o) {
|
|
712
|
+
const f = h.quaternion;
|
|
713
|
+
if (l === void 0)
|
|
714
|
+
h.quaternion = void 0, p = f !== void 0 && Mn(f, d.quaternion) || p;
|
|
715
|
+
else {
|
|
716
|
+
const w = this._poseQuaternion ??= [0, 0, 0, 1];
|
|
717
|
+
p = qn(w, f ?? d.quaternion, l) || p, h.quaternion = w;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
if (r) {
|
|
721
|
+
const f = h.scale;
|
|
722
|
+
if (a === void 0)
|
|
723
|
+
h.scale = void 0, p = f !== void 0 && X(f, d.scale) || p;
|
|
724
|
+
else {
|
|
725
|
+
const w = this._poseScale ??= [0, 0, 0];
|
|
726
|
+
p = Y(w, f ?? d.scale, a) || p, h.scale = w;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
p && (this._localVersion++, this.scene._invalidate(this));
|
|
730
|
+
}
|
|
731
|
+
/** @internal */
|
|
732
|
+
_releaseAnimation(s, t) {
|
|
733
|
+
if (this.destroyed)
|
|
734
|
+
return;
|
|
735
|
+
const i = this.getTransform();
|
|
736
|
+
for (const [e, o] of this._animationOwners)
|
|
737
|
+
o === s && !t?.has(e) && (this._animationOwners.delete(e), this._animationPose[e] = void 0);
|
|
738
|
+
this._invalidatePose(i);
|
|
739
|
+
}
|
|
740
|
+
_invalidatePose(s) {
|
|
741
|
+
const t = this._animationPose, i = this._transform, e = { position: t.position ?? i.position, quaternion: t.quaternion ?? i.quaternion, scale: t.scale ?? i.scale };
|
|
742
|
+
["position", "quaternion", "scale"].every((o) => e[o].every((r, c) => r === s[o][c])) || (this._localVersion++, this.scene._invalidate(this));
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Reads position (3), rotation (4) and scale (3) into `out` at `offset` without allocating;
|
|
746
|
+
* `layer` includes the post-animation rotation layer.
|
|
747
|
+
* @internal
|
|
748
|
+
*/
|
|
749
|
+
_readLocal(s, t, i) {
|
|
750
|
+
const e = this._animationPose, o = this._transform, r = e.position ?? o.position, c = (i && this._poseActive ? this._poseRotation : null) ?? e.quaternion ?? o.quaternion, l = e.scale ?? o.scale;
|
|
751
|
+
s[t] = r[0], s[t + 1] = r[1], s[t + 2] = r[2], s[t + 3] = c[0], s[t + 4] = c[1], s[t + 5] = c[2], s[t + 6] = c[3], s[t + 7] = l[0], s[t + 8] = l[1], s[t + 9] = l[2];
|
|
752
|
+
}
|
|
753
|
+
/** @internal */
|
|
754
|
+
_claimPoseRotation(s) {
|
|
755
|
+
if (this._assertAlive(), this._poseOwner && this._poseOwner !== s)
|
|
756
|
+
throw new g("owner", "[Nova3D] Node rotation already has a pose (IK) owner.");
|
|
757
|
+
this._poseOwner = s;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Writes the normalized post-animation rotation; unchanged values do not invalidate.
|
|
761
|
+
* @internal
|
|
762
|
+
*/
|
|
763
|
+
_setPoseRotation(s, t, i) {
|
|
764
|
+
if (this._poseOwner !== s)
|
|
765
|
+
throw new g("owner", "[Nova3D] Pose rotation can only be written by its owner.");
|
|
766
|
+
let e = this._poseRotation;
|
|
767
|
+
this._poseActive && e && e[0] === t[i] && e[1] === t[i + 1] && e[2] === t[i + 2] && e[3] === t[i + 3] || (e ??= this._poseRotation = new Float64Array(4), e[0] = t[i], e[1] = t[i + 1], e[2] = t[i + 2], e[3] = t[i + 3], this._poseActive = !0, this._localVersion++, this.scene._invalidate(this));
|
|
768
|
+
}
|
|
769
|
+
/** Removes the rotation layer; with `release` the owner gives the node up. @internal */
|
|
770
|
+
_clearPoseRotation(s, t = !1) {
|
|
771
|
+
this._poseOwner === s && (t && (this._poseOwner = void 0), !(!this._poseActive || this.destroyed) && (this._poseActive = !1, this._localVersion++, this.scene._invalidate(this)));
|
|
772
|
+
}
|
|
773
|
+
/** @internal */
|
|
774
|
+
_guardDocument(s, t) {
|
|
775
|
+
if (this._documentWrite && this._documentWrite !== s)
|
|
776
|
+
throw new g("owner", "[Nova3D] Node already has a document owner.");
|
|
777
|
+
this._documentWrite = s, this._documentSource = t;
|
|
778
|
+
}
|
|
779
|
+
/** @internal */
|
|
780
|
+
_isDocumentNode(s) {
|
|
781
|
+
return this._documentSource === s;
|
|
782
|
+
}
|
|
783
|
+
/** @internal */
|
|
784
|
+
_hasAnimatedTransform() {
|
|
785
|
+
return this._animationOwners.size > 0;
|
|
786
|
+
}
|
|
787
|
+
/** @internal */
|
|
788
|
+
_assertLogicalWrite() {
|
|
789
|
+
this._assertAlive(), this._documentWrite?.();
|
|
790
|
+
}
|
|
791
|
+
/** Writes logical base while a separate animator still owns its evaluated pose. @internal */
|
|
792
|
+
_setDocumentTransform(s) {
|
|
793
|
+
this._assertLogicalWrite();
|
|
794
|
+
const t = B(this._transform, s);
|
|
795
|
+
["position", "quaternion", "scale"].every((i) => t[i].every((e, o) => e === this._transform[i][o])) || (this._transform = t, this._localVersion++, this.scene._invalidate(this));
|
|
796
|
+
}
|
|
797
|
+
/** @internal */
|
|
798
|
+
_onDestroy() {
|
|
799
|
+
}
|
|
800
|
+
/** @internal */
|
|
801
|
+
_assertAlive() {
|
|
802
|
+
if (this._destroyed || this.scene.destroyed)
|
|
803
|
+
throw new g("destroyed", "[Nova3D] Node is destroyed.");
|
|
804
|
+
}
|
|
805
|
+
_detach() {
|
|
806
|
+
this._parent instanceof F ? this._parent._children.delete(this) : this.scene._roots.delete(this);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
function K(n, s, t) {
|
|
810
|
+
if (n === s)
|
|
811
|
+
return !0;
|
|
812
|
+
for (let i = 0; i < t; i++)
|
|
813
|
+
if (n[i] !== s[i])
|
|
814
|
+
return !1;
|
|
815
|
+
return !0;
|
|
816
|
+
}
|
|
817
|
+
export {
|
|
818
|
+
jn as $,
|
|
819
|
+
Tn as A,
|
|
820
|
+
cn as B,
|
|
821
|
+
rn as C,
|
|
822
|
+
on as D,
|
|
823
|
+
ln as E,
|
|
824
|
+
kn as F,
|
|
825
|
+
J as G,
|
|
826
|
+
Rn as H,
|
|
827
|
+
Hn as I,
|
|
828
|
+
Ln as J,
|
|
829
|
+
Wn as K,
|
|
830
|
+
I as L,
|
|
831
|
+
$n as M,
|
|
832
|
+
F as N,
|
|
833
|
+
Cn as O,
|
|
834
|
+
Un as P,
|
|
835
|
+
R as Q,
|
|
836
|
+
sn as R,
|
|
837
|
+
dn as S,
|
|
838
|
+
_n as T,
|
|
839
|
+
Zn as U,
|
|
840
|
+
is as V,
|
|
841
|
+
$ as W,
|
|
842
|
+
fn as X,
|
|
843
|
+
G as Y,
|
|
844
|
+
hn as Z,
|
|
845
|
+
Bn as _,
|
|
846
|
+
un as a,
|
|
847
|
+
In as a0,
|
|
848
|
+
Sn as a1,
|
|
849
|
+
Fn as a2,
|
|
850
|
+
Pn as a3,
|
|
851
|
+
Xn as a4,
|
|
852
|
+
U as b,
|
|
853
|
+
pn as c,
|
|
854
|
+
W as d,
|
|
855
|
+
On as e,
|
|
856
|
+
Gn as f,
|
|
857
|
+
T as g,
|
|
858
|
+
Jn as h,
|
|
859
|
+
wn as i,
|
|
860
|
+
Vn as j,
|
|
861
|
+
Q as k,
|
|
862
|
+
S as l,
|
|
863
|
+
ss as m,
|
|
864
|
+
en as n,
|
|
865
|
+
Kn as o,
|
|
866
|
+
B as p,
|
|
867
|
+
ns as q,
|
|
868
|
+
H as r,
|
|
869
|
+
j as s,
|
|
870
|
+
Yn as t,
|
|
871
|
+
vn as u,
|
|
872
|
+
En as v,
|
|
873
|
+
yn as w,
|
|
874
|
+
Qn as x,
|
|
875
|
+
An as y,
|
|
876
|
+
ts as z
|
|
877
|
+
};
|