@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,308 @@
|
|
|
1
|
+
import { CompiledNodeSurface3D, NodeSurface3D } from '../nodes/ShaderNode.js';
|
|
2
|
+
import { BasicMaterialOptions3D, Color3D, MaterialRenderOptions3D, TextureTransform3D, Vector3D } from '../types.js';
|
|
3
|
+
import { ExtensionLayout3D, PBRExtensionOptions3D, PBRExtensionsState3D } from './MaterialExtensions.js';
|
|
4
|
+
import { Nova3DTexture } from './Texture.js';
|
|
5
|
+
/**
|
|
6
|
+
* Surface options shared by every lit material (PBR, Lambert, Phong, toon).
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
export type LitMaterialOptions3D = MaterialRenderOptions3D & Pick<BasicMaterialOptions3D, 'fog'> & {
|
|
10
|
+
/** Linear RGBA multiplier of the base colour. */
|
|
11
|
+
baseColorFactor?: readonly [
|
|
12
|
+
number,
|
|
13
|
+
number,
|
|
14
|
+
number,
|
|
15
|
+
number
|
|
16
|
+
];
|
|
17
|
+
baseColorMap?: Nova3DTexture | null;
|
|
18
|
+
normalMap?: Nova3DTexture | null;
|
|
19
|
+
occlusionMap?: Nova3DTexture | null;
|
|
20
|
+
emissiveMap?: Nova3DTexture | null;
|
|
21
|
+
/**
|
|
22
|
+
* UV transforms of the matching maps.
|
|
23
|
+
* @experimental
|
|
24
|
+
*/
|
|
25
|
+
baseColorMapTransform?: TextureTransform3D | null;
|
|
26
|
+
normalMapTransform?: TextureTransform3D | null;
|
|
27
|
+
occlusionMapTransform?: TextureTransform3D | null;
|
|
28
|
+
emissiveMapTransform?: TextureTransform3D | null;
|
|
29
|
+
normalScale?: number;
|
|
30
|
+
occlusionStrength?: number;
|
|
31
|
+
emissiveFactor?: Vector3D;
|
|
32
|
+
/**
|
|
33
|
+
* Baked irradiance added to diffuse lighting like ambient light (three.js lightMap):
|
|
34
|
+
* a white map at intensity π shows the albedo. Use `lightMapTransform.texCoord: 1`
|
|
35
|
+
* for a second UV set.
|
|
36
|
+
* @experimental
|
|
37
|
+
*/
|
|
38
|
+
lightMap?: Nova3DTexture | null;
|
|
39
|
+
lightMapIntensity?: number;
|
|
40
|
+
lightMapTransform?: TextureTransform3D | null;
|
|
41
|
+
};
|
|
42
|
+
/** @experimental */
|
|
43
|
+
export type PBRMaterialOptions3D = LitMaterialOptions3D & PBRExtensionOptions3D & {
|
|
44
|
+
type: 'pbr';
|
|
45
|
+
metallicFactor?: number;
|
|
46
|
+
roughnessFactor?: number;
|
|
47
|
+
metallicRoughnessMap?: Nova3DTexture | null;
|
|
48
|
+
metallicRoughnessMapTransform?: TextureTransform3D | null;
|
|
49
|
+
/**
|
|
50
|
+
* Node graph outputs replacing surface inputs (three.js node materials, Babylon
|
|
51
|
+
* NodeMaterial); build them with `@nova-lab/core/3d/nodes`.
|
|
52
|
+
* @experimental
|
|
53
|
+
*/
|
|
54
|
+
nodes?: NodeSurface3D | null;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Lambert diffuse under every light type (three.js MeshLambertMaterial).
|
|
58
|
+
* @experimental
|
|
59
|
+
*/
|
|
60
|
+
export type LambertMaterialOptions3D = LitMaterialOptions3D & {
|
|
61
|
+
type: 'lambert';
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Lambert diffuse plus Blinn-Phong specular (three.js MeshPhongMaterial).
|
|
65
|
+
* @experimental
|
|
66
|
+
*/
|
|
67
|
+
export type PhongMaterialOptions3D = LitMaterialOptions3D & {
|
|
68
|
+
type: 'phong';
|
|
69
|
+
/** sRGB specular colour at normal incidence (three.js `specular`); alpha is ignored. Default #111111. */
|
|
70
|
+
specularColor?: Color3D;
|
|
71
|
+
/** Blinn-Phong exponent. Default 30. */
|
|
72
|
+
shininess?: number;
|
|
73
|
+
/** Linear map whose red channel scales the specular term. */
|
|
74
|
+
specularMap?: Nova3DTexture | null;
|
|
75
|
+
specularMapTransform?: TextureTransform3D | null;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Banded diffuse (three.js MeshToonMaterial): `gradientMap` is sampled at
|
|
79
|
+
* N·L·0.5 + 0.5; without it, two bands at 0.7 and 1.0.
|
|
80
|
+
* @experimental
|
|
81
|
+
*/
|
|
82
|
+
export type ToonMaterialOptions3D = LitMaterialOptions3D & {
|
|
83
|
+
type: 'toon';
|
|
84
|
+
gradientMap?: Nova3DTexture | null;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Unlit colour times a matcap texture looked up by the view-space normal
|
|
88
|
+
* (three.js MeshMatcapMaterial). Requires normals.
|
|
89
|
+
* @experimental
|
|
90
|
+
*/
|
|
91
|
+
export type MatcapMaterialOptions3D = Omit<BasicMaterialOptions3D, 'type'> & {
|
|
92
|
+
type: 'matcap';
|
|
93
|
+
/** sRGB sphere image; flip DOM images with `flipY` so the top shows on top, as in three.js. */
|
|
94
|
+
matcap?: Nova3DTexture | null;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* View-space normals as colour, N·0.5 + 0.5 (three.js MeshNormalMaterial). Requires normals.
|
|
98
|
+
* @experimental
|
|
99
|
+
*/
|
|
100
|
+
export type NormalMaterialOptions3D = MaterialRenderOptions3D & Pick<BasicMaterialOptions3D, 'pointSize' | 'sizeAttenuation'> & {
|
|
101
|
+
type: 'normal';
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Window depth as grey, 1 − z: near is white (three.js MeshDepthMaterial).
|
|
105
|
+
* @experimental
|
|
106
|
+
*/
|
|
107
|
+
export type DepthMaterialOptions3D = MaterialRenderOptions3D & Pick<BasicMaterialOptions3D, 'pointSize' | 'sizeAttenuation'> & {
|
|
108
|
+
type: 'depth';
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Uniform value of a shader material: float, bool, vec2–4, mat3, mat4 or a texture.
|
|
112
|
+
* @experimental
|
|
113
|
+
*/
|
|
114
|
+
export type ShaderUniformValue3D = number | boolean | readonly number[] | Float32Array | Nova3DTexture;
|
|
115
|
+
/**
|
|
116
|
+
* Custom GLSL ES 3.00 stages (three.js ShaderMaterial). Nova prepends attributes
|
|
117
|
+
* (position, normal, uv, color, uv1), matrices (modelMatrix, normalMatrix,
|
|
118
|
+
* viewMatrix, projectionMatrix, viewProjectionMatrix), cameraPosition and the
|
|
119
|
+
* helpers novaWorldPosition/novaWorldNormal (instancing included). The fragment
|
|
120
|
+
* stage declares its own inputs and calls `novaOutput(vec4 linearColor)`, which
|
|
121
|
+
* applies opacity, mask/coverage, blending and the display encoding. Declare
|
|
122
|
+
* every user uniform in GLSL; numbers upload as float, booleans as int.
|
|
123
|
+
* @experimental
|
|
124
|
+
*/
|
|
125
|
+
export type ShaderMaterialOptions3D = MaterialRenderOptions3D & {
|
|
126
|
+
type: 'shader';
|
|
127
|
+
/** Vertex stage with `void main()`; the default passes vWorldPosition, vWorldNormal and vUv. */
|
|
128
|
+
vertex?: string;
|
|
129
|
+
fragment: string;
|
|
130
|
+
uniforms?: Readonly<Record<string, ShaderUniformValue3D>>;
|
|
131
|
+
defines?: Readonly<Record<string, string | number | boolean>>;
|
|
132
|
+
/**
|
|
133
|
+
* WGSL twin of the stages for the WebGPU backend, which cannot run GLSL; without
|
|
134
|
+
* it a shader material is refused on WebGPU. Entry points are `@vertex fn
|
|
135
|
+
* vertexMain(input: NovaVertexInput)` and `@fragment fn fragmentMain`, which
|
|
136
|
+
* returns `novaOutput(linearColor)`. The default vertex stage outputs
|
|
137
|
+
* `NovaVaryings` (worldPosition, worldNormal, uv). The prelude declares
|
|
138
|
+
* `NovaVertexInput` (position, normal, uv, color, uv1; missing attributes read
|
|
139
|
+
* 0 with colour alpha 1), the GLSL built-ins as functions (`modelMatrix()`,
|
|
140
|
+
* `normalMatrix()`, `viewMatrix()`, `projectionMatrix()`,
|
|
141
|
+
* `viewProjectionMatrix()`, `cameraPosition()`), `novaWorldPosition(input,
|
|
142
|
+
* local)`, `novaWorldNormal(input, local)`, `novaClip(world)` (world position
|
|
143
|
+
* to WebGPU clip space) and `novaClipFromGL(clip)` (WebGL clip coordinates such
|
|
144
|
+
* as `viewProjectionMatrix() * world` to WebGPU's). User uniforms are fields of
|
|
145
|
+
* `uniforms` (numbers f32, booleans u32, vec2–4, mat3x3f, mat4x4f); a texture
|
|
146
|
+
* `name` binds as `name: texture_2d<f32>` with `nameSampler`. Number and
|
|
147
|
+
* boolean defines become WGSL constants.
|
|
148
|
+
* @experimental
|
|
149
|
+
*/
|
|
150
|
+
wgsl?: ShaderWGSL3D;
|
|
151
|
+
/**
|
|
152
|
+
* Declares that the vertex stage turns each quad toward the camera, as the basic
|
|
153
|
+
* material's `billboard` does: GPU picking then skips the mesh. The stage itself
|
|
154
|
+
* does the turning. Default 'none'.
|
|
155
|
+
* @experimental
|
|
156
|
+
*/
|
|
157
|
+
billboard?: 'none' | 'spherical' | 'vertical';
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* WGSL stages of a shader material (`ShaderMaterialOptions3D.wgsl`).
|
|
161
|
+
* @experimental
|
|
162
|
+
*/
|
|
163
|
+
export interface ShaderWGSL3D {
|
|
164
|
+
/** `@vertex fn vertexMain`; the default passes NovaVaryings. */
|
|
165
|
+
vertex?: string;
|
|
166
|
+
/** `@fragment fn fragmentMain`. */
|
|
167
|
+
fragment: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Wide lines for 'lines' geometry (segment pairs), drawn as camera-facing quads
|
|
171
|
+
* with round caps (three.js LineMaterial/LineSegments2).
|
|
172
|
+
* @experimental
|
|
173
|
+
*/
|
|
174
|
+
export type LineMaterialOptions3D = MaterialRenderOptions3D & Pick<BasicMaterialOptions3D, 'color' | 'fog'> & {
|
|
175
|
+
type: 'line';
|
|
176
|
+
/** CSS pixels, or world units with `worldUnits`. Default 1. */
|
|
177
|
+
width?: number;
|
|
178
|
+
worldUnits?: boolean;
|
|
179
|
+
/** Dash and gap lengths along the line in local units; dashSize 0 draws solid lines. */
|
|
180
|
+
dashSize?: number;
|
|
181
|
+
gapSize?: number;
|
|
182
|
+
dashOffset?: number;
|
|
183
|
+
};
|
|
184
|
+
/** @experimental */
|
|
185
|
+
export type MaterialOptions3D = BasicMaterialOptions3D | MatcapMaterialOptions3D | ShaderMaterialOptions3D | LineMaterialOptions3D | NormalMaterialOptions3D | DepthMaterialOptions3D | PBRMaterialOptions3D | LambertMaterialOptions3D | PhongMaterialOptions3D | ToonMaterialOptions3D;
|
|
186
|
+
/**
|
|
187
|
+
* Patch of `material.set`: options of the material's own type; `type` cannot change.
|
|
188
|
+
* @experimental
|
|
189
|
+
*/
|
|
190
|
+
export type MaterialPatch3D = Partial<BasicMaterialOptions3D> | Partial<MatcapMaterialOptions3D> | Partial<ShaderMaterialOptions3D> | Partial<LineMaterialOptions3D> | Partial<NormalMaterialOptions3D> | Partial<DepthMaterialOptions3D> | Partial<PBRMaterialOptions3D> | Partial<LambertMaterialOptions3D> | Partial<PhongMaterialOptions3D> | Partial<ToonMaterialOptions3D>;
|
|
191
|
+
/**
|
|
192
|
+
* Normalized state of every lit material. Slot 1 (`metallicRoughnessMap`) carries
|
|
193
|
+
* the metal-rough, specular or gradient map of the respective model.
|
|
194
|
+
*/
|
|
195
|
+
export type LitMaterialState3D = Omit<Required<PBRMaterialOptions3D>, 'type' | 'nodes' | keyof MaterialRenderState3D | keyof PBRExtensionOptions3D> & MaterialRenderState3D & Omit<PBRExtensionsState3D, never> & {
|
|
196
|
+
/** Normalized PBR extensions; the same fields also sit at the top level for set(). */
|
|
197
|
+
readonly extensions: PBRExtensionsState3D;
|
|
198
|
+
readonly type: 'pbr' | 'lambert' | 'phong' | 'toon';
|
|
199
|
+
/** 0 PBR, 1 Lambert, 2 Phong, 3 toon. */
|
|
200
|
+
readonly shading: 0 | 1 | 2 | 3;
|
|
201
|
+
readonly specularColor: Vector3D;
|
|
202
|
+
readonly shininess: number;
|
|
203
|
+
readonly specularMap: Nova3DTexture | null;
|
|
204
|
+
readonly specularMapTransform: TextureTransform3D | null;
|
|
205
|
+
readonly gradientMap: Nova3DTexture | null;
|
|
206
|
+
readonly color: readonly [
|
|
207
|
+
number,
|
|
208
|
+
number,
|
|
209
|
+
number,
|
|
210
|
+
number
|
|
211
|
+
];
|
|
212
|
+
readonly map: Nova3DTexture | null;
|
|
213
|
+
};
|
|
214
|
+
/** Normalized state of the unlit family drawn by the basic program. */
|
|
215
|
+
/** Resolved render state; depthWrite 'auto' follows alphaMode. */
|
|
216
|
+
export interface MaterialRenderState3D {
|
|
217
|
+
readonly blending: 'normal' | 'additive' | 'multiply' | 'subtractive';
|
|
218
|
+
readonly depthTest: boolean;
|
|
219
|
+
readonly depthWrite: boolean | 'auto';
|
|
220
|
+
readonly alphaToCoverage: boolean;
|
|
221
|
+
}
|
|
222
|
+
export type UnlitMaterialState3D = Omit<Required<BasicMaterialOptions3D>, 'color' | 'type' | keyof MaterialRenderState3D> & MaterialRenderState3D & {
|
|
223
|
+
readonly type: 'basic' | 'matcap' | 'normal' | 'depth';
|
|
224
|
+
/** 0 colour, 1 matcap, 2 normal, 3 depth. */
|
|
225
|
+
readonly shade: 0 | 1 | 2 | 3;
|
|
226
|
+
readonly matcap: Nova3DTexture | null;
|
|
227
|
+
readonly color: readonly [
|
|
228
|
+
number,
|
|
229
|
+
number,
|
|
230
|
+
number,
|
|
231
|
+
number
|
|
232
|
+
];
|
|
233
|
+
};
|
|
234
|
+
/** Normalized state of a shader material. */
|
|
235
|
+
export type ShaderMaterialState3D = Omit<UnlitMaterialState3D, 'type' | 'shade'> & {
|
|
236
|
+
readonly type: 'shader';
|
|
237
|
+
readonly vertex: string;
|
|
238
|
+
readonly fragment: string;
|
|
239
|
+
readonly defines: Readonly<Record<string, string | number | boolean>>;
|
|
240
|
+
/** Initial values; live values are on the material (`setUniform`). */
|
|
241
|
+
readonly uniforms: Readonly<Record<string, ShaderUniformValue3D>>;
|
|
242
|
+
/** WGSL stages for WebGPU (vertex defaulted), or null. */
|
|
243
|
+
readonly wgsl: {
|
|
244
|
+
readonly vertex: string;
|
|
245
|
+
readonly fragment: string;
|
|
246
|
+
} | null;
|
|
247
|
+
};
|
|
248
|
+
/** Normalized state of a line material. */
|
|
249
|
+
export type LineMaterialState3D = Omit<UnlitMaterialState3D, 'type' | 'shade'> & {
|
|
250
|
+
readonly type: 'line';
|
|
251
|
+
readonly width: number;
|
|
252
|
+
readonly worldUnits: boolean;
|
|
253
|
+
readonly dashSize: number;
|
|
254
|
+
readonly gapSize: number;
|
|
255
|
+
readonly dashOffset: number;
|
|
256
|
+
};
|
|
257
|
+
export type MaterialState3D = UnlitMaterialState3D | LitMaterialState3D | ShaderMaterialState3D | LineMaterialState3D;
|
|
258
|
+
/** Validates the WGSL twin of a shader material and interns its identity. */
|
|
259
|
+
export declare function shaderWGSL3D(value: unknown, defineSource?: string): ShaderMaterialState3D['wgsl'];
|
|
260
|
+
/** True for materials drawn by the lit (PBR family) program. */
|
|
261
|
+
export declare function litMaterial3D(state: Readonly<MaterialState3D>): state is Readonly<LitMaterialState3D>;
|
|
262
|
+
/** @experimental */
|
|
263
|
+
export declare class Nova3DMaterial {
|
|
264
|
+
protected constructor();
|
|
265
|
+
private _release;
|
|
266
|
+
private _options;
|
|
267
|
+
/** Normalized options the state was built from (`getOptions`). */
|
|
268
|
+
private _source;
|
|
269
|
+
private readonly _uniformValues;
|
|
270
|
+
private _uniformVersion;
|
|
271
|
+
private readonly _uniformView;
|
|
272
|
+
private readonly _users;
|
|
273
|
+
private _documentWrite?;
|
|
274
|
+
private _destroyed;
|
|
275
|
+
private readonly _linear;
|
|
276
|
+
private _linearSource?;
|
|
277
|
+
/** Column-major 3×3 map transforms (basic: slot 0; PBR: base, metal-rough, normal, occlusion, emissive). */
|
|
278
|
+
private readonly _transforms;
|
|
279
|
+
private _transformSource?;
|
|
280
|
+
private _extensionLayout;
|
|
281
|
+
private _extensionSource?;
|
|
282
|
+
private _version;
|
|
283
|
+
get version(): number;
|
|
284
|
+
get destroyed(): boolean;
|
|
285
|
+
/**
|
|
286
|
+
* The material's options with every default filled in: colours as normalized sRGB
|
|
287
|
+
* components, identity texture transforms as null, a shader's live uniform values.
|
|
288
|
+
* `depthWrite` is present only when it was set explicitly.
|
|
289
|
+
*/
|
|
290
|
+
getOptions(): Readonly<MaterialOptions3D>;
|
|
291
|
+
/** Patches the options of the material's type; `type` cannot change. */
|
|
292
|
+
set(patch: MaterialPatch3D): void;
|
|
293
|
+
/**
|
|
294
|
+
* Updates one declared uniform of a shader material without revalidating the
|
|
295
|
+
* material: the value keeps its kind (float, bool, vecN/matN or texture
|
|
296
|
+
* dimension).
|
|
297
|
+
* @experimental
|
|
298
|
+
*/
|
|
299
|
+
setUniform(name: string, value: ShaderUniformValue3D): void;
|
|
300
|
+
private _resetUniforms;
|
|
301
|
+
destroy(): void;
|
|
302
|
+
private static _createTransforms;
|
|
303
|
+
private _assertAlive;
|
|
304
|
+
private _changed;
|
|
305
|
+
/** Validates options and records their normalized form as `_source`. */
|
|
306
|
+
private _validate;
|
|
307
|
+
private _state;
|
|
308
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { TextureTransform3D, Vector3D } from '../types.js';
|
|
2
|
+
import { Nova3DTexture } from './Texture.js';
|
|
3
|
+
/**
|
|
4
|
+
* A texture with an optional UV transform (KHR_texture_transform).
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
export type TextureReference3D = Nova3DTexture | {
|
|
8
|
+
readonly texture: Nova3DTexture;
|
|
9
|
+
readonly transform?: TextureTransform3D | null;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Clear lacquer layer (KHR_materials_clearcoat). Factor defaults to 1 when present.
|
|
13
|
+
* @experimental
|
|
14
|
+
*/
|
|
15
|
+
export interface ClearcoatOptions3D {
|
|
16
|
+
factor?: number;
|
|
17
|
+
roughness?: number;
|
|
18
|
+
/** Red channel scales the factor. */
|
|
19
|
+
map?: TextureReference3D | null;
|
|
20
|
+
/** Green channel scales the roughness. */
|
|
21
|
+
roughnessMap?: TextureReference3D | null;
|
|
22
|
+
normalMap?: TextureReference3D | null;
|
|
23
|
+
normalScale?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Cloth-like retro-reflection (KHR_materials_sheen), Charlie distribution.
|
|
27
|
+
* @experimental
|
|
28
|
+
*/
|
|
29
|
+
export interface SheenOptions3D {
|
|
30
|
+
/** Linear RGB sheen colour (glTF sheenColorFactor), default white. */
|
|
31
|
+
colorFactor?: Vector3D;
|
|
32
|
+
roughness?: number;
|
|
33
|
+
/** sRGB colour in RGB. */
|
|
34
|
+
colorMap?: TextureReference3D | null;
|
|
35
|
+
/** Alpha channel scales the roughness. */
|
|
36
|
+
roughnessMap?: TextureReference3D | null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Thin-film interference (KHR_materials_iridescence). Thickness in nanometres.
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
export interface IridescenceOptions3D {
|
|
43
|
+
factor?: number;
|
|
44
|
+
ior?: number;
|
|
45
|
+
/** Minimum and maximum film thickness; without a map the maximum applies. Default [100, 400]. */
|
|
46
|
+
thicknessRange?: readonly [number, number];
|
|
47
|
+
/** Red channel scales the factor. */
|
|
48
|
+
map?: TextureReference3D | null;
|
|
49
|
+
/** Green channel mixes between the thickness range ends. */
|
|
50
|
+
thicknessMap?: TextureReference3D | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Anisotropic GGX highlights (KHR_materials_anisotropy).
|
|
54
|
+
* @experimental
|
|
55
|
+
*/
|
|
56
|
+
export interface AnisotropyOptions3D {
|
|
57
|
+
strength?: number;
|
|
58
|
+
/** Rotation of the direction in tangent space, radians counter-clockwise. */
|
|
59
|
+
rotation?: number;
|
|
60
|
+
/** RG direction in tangent space and B strength. */
|
|
61
|
+
map?: TextureReference3D | null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Dielectric specular strength and tint (KHR_materials_specular).
|
|
65
|
+
* @experimental
|
|
66
|
+
*/
|
|
67
|
+
export interface SpecularOptions3D {
|
|
68
|
+
factor?: number;
|
|
69
|
+
/** Linear RGB tint of F0 (glTF specularColorFactor), 0–∞, clamped to 1 after multiplying. Default white. */
|
|
70
|
+
colorFactor?: Vector3D;
|
|
71
|
+
/** Alpha channel scales the factor. */
|
|
72
|
+
map?: TextureReference3D | null;
|
|
73
|
+
/** sRGB tint in RGB. */
|
|
74
|
+
colorMap?: TextureReference3D | null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Thin or volumetric transmission (KHR_materials_transmission and _volume).
|
|
78
|
+
* @experimental
|
|
79
|
+
*/
|
|
80
|
+
export interface TransmissionOptions3D {
|
|
81
|
+
factor?: number;
|
|
82
|
+
/** Red channel scales the factor. */
|
|
83
|
+
map?: TextureReference3D | null;
|
|
84
|
+
/** Volume thickness in local units; 0 is a thin wall. */
|
|
85
|
+
thickness?: number;
|
|
86
|
+
/** Green channel scales the thickness. */
|
|
87
|
+
thicknessMap?: TextureReference3D | null;
|
|
88
|
+
/** Distance at which light reaches `attenuationColorLinear`; Infinity disables absorption. */
|
|
89
|
+
attenuationDistance?: number;
|
|
90
|
+
/** Linear RGB colour light reaches after `attenuationDistance` (glTF attenuationColor). Default white. */
|
|
91
|
+
attenuationColorLinear?: Vector3D;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* PBR extension options of the 'pbr' material.
|
|
95
|
+
* @experimental
|
|
96
|
+
*/
|
|
97
|
+
export interface PBRExtensionOptions3D {
|
|
98
|
+
/** Index of refraction for the dielectric F0 (KHR_materials_ior), 1–5. Default 1.5. */
|
|
99
|
+
ior?: number;
|
|
100
|
+
/** Multiplier of the emissive factor (KHR_materials_emissive_strength). Default 1. */
|
|
101
|
+
emissiveStrength?: number;
|
|
102
|
+
clearcoat?: ClearcoatOptions3D | null;
|
|
103
|
+
sheen?: SheenOptions3D | null;
|
|
104
|
+
iridescence?: IridescenceOptions3D | null;
|
|
105
|
+
anisotropy?: AnisotropyOptions3D | null;
|
|
106
|
+
specular?: SpecularOptions3D | null;
|
|
107
|
+
transmission?: TransmissionOptions3D | null;
|
|
108
|
+
}
|
|
109
|
+
export interface TextureSlot3D {
|
|
110
|
+
readonly texture: Nova3DTexture;
|
|
111
|
+
readonly transform: TextureTransform3D | null;
|
|
112
|
+
}
|
|
113
|
+
export interface ClearcoatState3D {
|
|
114
|
+
readonly factor: number;
|
|
115
|
+
readonly roughness: number;
|
|
116
|
+
readonly map: TextureSlot3D | null;
|
|
117
|
+
readonly roughnessMap: TextureSlot3D | null;
|
|
118
|
+
readonly normalMap: TextureSlot3D | null;
|
|
119
|
+
readonly normalScale: number;
|
|
120
|
+
}
|
|
121
|
+
export interface SheenState3D {
|
|
122
|
+
readonly color: Vector3D;
|
|
123
|
+
readonly roughness: number;
|
|
124
|
+
readonly colorMap: TextureSlot3D | null;
|
|
125
|
+
readonly roughnessMap: TextureSlot3D | null;
|
|
126
|
+
}
|
|
127
|
+
export interface IridescenceState3D {
|
|
128
|
+
readonly factor: number;
|
|
129
|
+
readonly ior: number;
|
|
130
|
+
readonly thicknessRange: readonly [number, number];
|
|
131
|
+
readonly map: TextureSlot3D | null;
|
|
132
|
+
readonly thicknessMap: TextureSlot3D | null;
|
|
133
|
+
}
|
|
134
|
+
export interface AnisotropyState3D {
|
|
135
|
+
readonly strength: number;
|
|
136
|
+
readonly rotation: number;
|
|
137
|
+
readonly map: TextureSlot3D | null;
|
|
138
|
+
}
|
|
139
|
+
export interface SpecularState3D {
|
|
140
|
+
readonly factor: number;
|
|
141
|
+
readonly color: Vector3D;
|
|
142
|
+
readonly map: TextureSlot3D | null;
|
|
143
|
+
readonly colorMap: TextureSlot3D | null;
|
|
144
|
+
}
|
|
145
|
+
export interface TransmissionState3D {
|
|
146
|
+
readonly factor: number;
|
|
147
|
+
readonly map: TextureSlot3D | null;
|
|
148
|
+
readonly thickness: number;
|
|
149
|
+
readonly thicknessMap: TextureSlot3D | null;
|
|
150
|
+
readonly attenuationDistance: number;
|
|
151
|
+
readonly attenuationColor: Vector3D;
|
|
152
|
+
}
|
|
153
|
+
export interface PBRExtensionsState3D {
|
|
154
|
+
readonly ior: number;
|
|
155
|
+
readonly emissiveStrength: number;
|
|
156
|
+
readonly clearcoat: ClearcoatState3D | null;
|
|
157
|
+
readonly sheen: SheenState3D | null;
|
|
158
|
+
readonly iridescence: IridescenceState3D | null;
|
|
159
|
+
readonly anisotropy: AnisotropyState3D | null;
|
|
160
|
+
readonly specular: SpecularState3D | null;
|
|
161
|
+
readonly transmission: TransmissionState3D | null;
|
|
162
|
+
}
|
|
163
|
+
export declare const defaultExtensions3D: PBRExtensionsState3D;
|
|
164
|
+
/** Extension maps in a fixed order; the layout names each by its index. */
|
|
165
|
+
export declare const extensionMapNames3D: readonly ["clearcoat", "clearcoatRoughness", "clearcoatNormal", "sheenColor", "sheenRoughness", "iridescence", "iridescenceThickness", "anisotropy", "specular", "specularColor", "transmission", "thickness"];
|
|
166
|
+
/** Texture units 10–13 hold extension maps; unit 14 keeps the area-light tables. */
|
|
167
|
+
export declare const extensionUnits3D = 4;
|
|
168
|
+
export declare const firstExtensionUnit3D = 10;
|
|
169
|
+
/** Extension options of a normalized state, as `material.getOptions` returns them. */
|
|
170
|
+
export declare function extensionOptions3D(state: PBRExtensionsState3D): PBRExtensionOptions3D;
|
|
171
|
+
/**
|
|
172
|
+
* Validates PBR extension options. `slot` normalizes a texture reference (the caller
|
|
173
|
+
* checks ownership and the transform); the result is frozen.
|
|
174
|
+
*/
|
|
175
|
+
export declare function validateExtensions3D(options: PBRExtensionOptions3D, slot: (value: TextureReference3D | null | undefined, name: string) => TextureSlot3D | null): PBRExtensionsState3D;
|
|
176
|
+
/** The extension maps of a state in `extensionMapNames3D` order (null when absent). */
|
|
177
|
+
export declare function extensionMaps3D(state: PBRExtensionsState3D): (TextureSlot3D | null)[];
|
|
178
|
+
export declare function extensionMapIsColor3D(index: number): boolean;
|
|
179
|
+
/** Unit assignment and shader signature of a material's extensions. */
|
|
180
|
+
export interface ExtensionLayout3D {
|
|
181
|
+
/** Interned signature id (0: no extensions), part of the PBR variant key. */
|
|
182
|
+
readonly id: number;
|
|
183
|
+
/** Texture per extension unit (≤ 4): maps sharing a texture and transform share a unit. */
|
|
184
|
+
readonly units: readonly Nova3DTexture[];
|
|
185
|
+
/** Column-major 3×3 UV transform per unit. */
|
|
186
|
+
readonly matrices: Float32Array;
|
|
187
|
+
/** Views of `matrices`, one per unit, for uploads without allocation. */
|
|
188
|
+
readonly slots: readonly Float32Array[];
|
|
189
|
+
/** Bit k set when unit k samples the second UV set. */
|
|
190
|
+
readonly sets: number;
|
|
191
|
+
/** Unit of each map in `extensionMapNames3D` order, −1 when absent. */
|
|
192
|
+
readonly mapUnits: readonly number[];
|
|
193
|
+
}
|
|
194
|
+
/** Signature of an interned layout id: features, then `map:unit` pairs, then unit UV sets. */
|
|
195
|
+
export declare function extensionSignature3D(id: number): string;
|
|
196
|
+
export declare const emptyExtensionLayout3D: ExtensionLayout3D;
|
|
197
|
+
/** Assigns units and interns the signature; `write` fills one column-major transform. */
|
|
198
|
+
export declare function extensionLayout3D(state: PBRExtensionsState3D, write: (out: Float32Array, index: number, value: TextureTransform3D | null) => void): ExtensionLayout3D;
|
|
199
|
+
/** Every texture referenced by extension maps. */
|
|
200
|
+
export declare function extensionTextures3D(state: PBRExtensionsState3D): Nova3DTexture[];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Bounds3D, NodeOptions3D, Ray3D, Vector3D } from '../types.js';
|
|
2
|
+
import { Nova3DGeometry } from './Geometry.js';
|
|
3
|
+
import { Nova3DMaterial } from './Material.js';
|
|
4
|
+
import { Nova3DScene } from './Scene.js';
|
|
5
|
+
import { Nova3DNode } from './Node.js';
|
|
6
|
+
/** @experimental */
|
|
7
|
+
export type MeshOptions3D = NodeOptions3D & {
|
|
8
|
+
geometry: Nova3DGeometry;
|
|
9
|
+
material: Nova3DMaterial;
|
|
10
|
+
/**
|
|
11
|
+
* Draw order within the opaque or the blended group: lower values draw first;
|
|
12
|
+
* blended meshes with equal values draw back to front. Default 0.
|
|
13
|
+
* @experimental
|
|
14
|
+
*/
|
|
15
|
+
renderOrder?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Layer bit mask; a view draws the mesh when the masks share a bit. Default 1.
|
|
18
|
+
* @experimental
|
|
19
|
+
*/
|
|
20
|
+
layers?: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Shadow casting and receiving of a mesh (`mesh.setShadows`); both default false.
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
26
|
+
export interface MeshShadowOptions3D {
|
|
27
|
+
cast?: boolean;
|
|
28
|
+
receive?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Keys of `MeshOptions3D`, spread into the key sets of mesh subtypes. */
|
|
31
|
+
export declare const meshKeyRecord3D: {
|
|
32
|
+
readonly geometry: true;
|
|
33
|
+
readonly material: true;
|
|
34
|
+
readonly renderOrder: true;
|
|
35
|
+
readonly layers: true;
|
|
36
|
+
readonly position: true;
|
|
37
|
+
readonly scale: true;
|
|
38
|
+
readonly rotation: true;
|
|
39
|
+
readonly quaternion: true;
|
|
40
|
+
readonly id: true;
|
|
41
|
+
readonly visible: true;
|
|
42
|
+
readonly pickable: true;
|
|
43
|
+
readonly parent: true;
|
|
44
|
+
};
|
|
45
|
+
export declare const meshOptionKeys3D: ReadonlySet<string>;
|
|
46
|
+
/** Validates an unsigned 32-bit layer mask and returns it as a uint32. */
|
|
47
|
+
export declare function validateLayers3D(mask: number): number;
|
|
48
|
+
/** @experimental */
|
|
49
|
+
export interface Hit3D {
|
|
50
|
+
readonly node: Nova3DMesh;
|
|
51
|
+
readonly point: Vector3D;
|
|
52
|
+
readonly normal: Vector3D | null;
|
|
53
|
+
readonly distance: number;
|
|
54
|
+
readonly triangleIndex?: number;
|
|
55
|
+
readonly instanceIndex?: number;
|
|
56
|
+
/**
|
|
57
|
+
* UV0 at the hit for triangle hits on geometry with UVs.
|
|
58
|
+
* @experimental
|
|
59
|
+
*/
|
|
60
|
+
readonly uv?: readonly [number, number];
|
|
61
|
+
}
|
|
62
|
+
/** @experimental */
|
|
63
|
+
export declare class Nova3DMesh extends Nova3DNode {
|
|
64
|
+
protected constructor();
|
|
65
|
+
private _shadow;
|
|
66
|
+
private _geometry;
|
|
67
|
+
private _material;
|
|
68
|
+
private _bounds?;
|
|
69
|
+
private _boundsWorld;
|
|
70
|
+
private _boundsGeometry;
|
|
71
|
+
private _renderOrder;
|
|
72
|
+
private _layers;
|
|
73
|
+
get geometry(): Nova3DGeometry;
|
|
74
|
+
get material(): Nova3DMaterial;
|
|
75
|
+
/** Patches shadow casting and receiving. */
|
|
76
|
+
setShadows(options: MeshShadowOptions3D): void;
|
|
77
|
+
get renderOrder(): number;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the draw order within the mesh's opaque or blended group.
|
|
80
|
+
* @experimental
|
|
81
|
+
*/
|
|
82
|
+
setRenderOrder(value: number): void;
|
|
83
|
+
get layers(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the layer bit mask (unsigned 32-bit).
|
|
86
|
+
* @experimental
|
|
87
|
+
*/
|
|
88
|
+
setLayers(mask: number): void;
|
|
89
|
+
private static _validateOrder;
|
|
90
|
+
setGeometry(geometry: Nova3DGeometry): void;
|
|
91
|
+
setMaterial(material: Nova3DMaterial): void;
|
|
92
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { mat4 as Matrix4 } from 'gl-matrix';
|
|
2
|
+
import { Nova3DDeformedMesh } from '../deformation/DeformedMesh.js';
|
|
3
|
+
import { Bounds3D, Matrix3D, NodeOptions3D, Transform3D, TransformPatch3D, Vector3D } from '../types.js';
|
|
4
|
+
import { Nova3DScene } from './Scene.js';
|
|
5
|
+
export type AnimatedTransformChannel3D = 'position' | 'quaternion' | 'scale';
|
|
6
|
+
/**
|
|
7
|
+
* Options of `node.reparent`.
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export interface ReparentOptions3D {
|
|
11
|
+
/** 'local' (default) keeps the local transform; 'world' keeps the world placement. */
|
|
12
|
+
preserve?: 'local' | 'world';
|
|
13
|
+
}
|
|
14
|
+
/** Keys of `NodeOptions3D`, spread into the key sets of node-creating options. */
|
|
15
|
+
export declare const nodeKeyRecord3D: {
|
|
16
|
+
readonly position: true;
|
|
17
|
+
readonly scale: true;
|
|
18
|
+
readonly rotation: true;
|
|
19
|
+
readonly quaternion: true;
|
|
20
|
+
readonly id: true;
|
|
21
|
+
readonly visible: true;
|
|
22
|
+
readonly pickable: true;
|
|
23
|
+
readonly parent: true;
|
|
24
|
+
};
|
|
25
|
+
export declare const nodeOptionKeys3D: ReadonlySet<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Scene node: a local transform under a parent node or the scene root; the
|
|
28
|
+
* hierarchy changes through `reparent`.
|
|
29
|
+
* @experimental
|
|
30
|
+
*/
|
|
31
|
+
export declare class Nova3DNode {
|
|
32
|
+
protected constructor();
|
|
33
|
+
readonly scene: Nova3DScene;
|
|
34
|
+
private _parent;
|
|
35
|
+
private readonly _children;
|
|
36
|
+
private readonly _animationOwners;
|
|
37
|
+
/** Evaluated channels; every key is always present (undefined: not animated) so the shape stays fixed. */
|
|
38
|
+
private _animationPose;
|
|
39
|
+
/** Arrays the animated channels are written into, kept across frames. */
|
|
40
|
+
private _posePosition;
|
|
41
|
+
private _poseQuaternion;
|
|
42
|
+
private _poseScale;
|
|
43
|
+
/** Post-animation rotation layer (IK); overrides the evaluated local rotation. */
|
|
44
|
+
private _poseRotation;
|
|
45
|
+
private _poseActive;
|
|
46
|
+
private _poseOwner?;
|
|
47
|
+
private _transform;
|
|
48
|
+
private _local;
|
|
49
|
+
private _localVersion;
|
|
50
|
+
private _appliedVersion;
|
|
51
|
+
private _parentVersion;
|
|
52
|
+
private _world;
|
|
53
|
+
private _worldVersion;
|
|
54
|
+
/** Live world record; read immediately, never kept as a snapshot. */
|
|
55
|
+
private readonly _worldRecord;
|
|
56
|
+
private _documentSource?;
|
|
57
|
+
private _documentWrite?;
|
|
58
|
+
private _destroyed;
|
|
59
|
+
private _lodVisible;
|
|
60
|
+
private _visibleHierarchy;
|
|
61
|
+
private _visibleFlags;
|
|
62
|
+
private _visibleCached;
|
|
63
|
+
private _lodOwner?;
|
|
64
|
+
private _visible;
|
|
65
|
+
private _pickable;
|
|
66
|
+
readonly id: string;
|
|
67
|
+
get parent(): Nova3DNode | Nova3DScene;
|
|
68
|
+
get children(): readonly Nova3DNode[];
|
|
69
|
+
get destroyed(): boolean;
|
|
70
|
+
get visible(): boolean;
|
|
71
|
+
get pickable(): boolean;
|
|
72
|
+
getTransform(): Transform3D;
|
|
73
|
+
setTransform(patch: TransformPatch3D): void;
|
|
74
|
+
setVisible(value: boolean): void;
|
|
75
|
+
setPickable(value: boolean): void;
|
|
76
|
+
/**
|
|
77
|
+
* Keeps the world placement atomically and refuses shear and singular parents.
|
|
78
|
+
*/
|
|
79
|
+
reparent(parent: Nova3DNode | Nova3DScene, options?: ReparentOptions3D): void;
|
|
80
|
+
getWorldMatrix(out?: Matrix3D): Matrix3D;
|
|
81
|
+
getWorldBounds(): Bounds3D | null;
|
|
82
|
+
lookAt(target: Vector3D, up?: Vector3D): void;
|
|
83
|
+
destroy(): void;
|
|
84
|
+
private _walkEffective;
|
|
85
|
+
private _invalidatePose;
|
|
86
|
+
private _detach;
|
|
87
|
+
}
|