@babylonjs/core 8.11.0 → 8.12.0
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/Cameras/arcRotateCamera.js +8 -0
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/targetCamera.js +2 -0
- package/Cameras/targetCamera.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +4 -0
- package/Collisions/gpuPicker.js +6 -0
- package/Collisions/gpuPicker.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +2 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +6 -1
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +29 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +36 -9
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +1 -0
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.js +1 -0
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +2 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +23 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +126 -21
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +5 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +4 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +2 -4
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +4 -17
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
- package/FrameGraph/frameGraph.js +1 -1
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphContext.d.ts +30 -0
- package/FrameGraph/frameGraphContext.js +47 -0
- package/FrameGraph/frameGraphContext.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +1 -4
- package/FrameGraph/frameGraphRenderContext.js +2 -5
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.d.ts +0 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +0 -12
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +4 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +2 -3
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +4 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +2 -2
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +3 -4
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.d.ts +2 -3
- package/Materials/Node/Blocks/Dual/textureBlock.js +2 -2
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +4 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +2 -2
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +2 -2
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +2 -2
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.d.ts +3 -3
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js +6 -3
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +1 -2
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -4
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +1 -2
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.d.ts +2 -3
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +5 -2
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.d.ts +1 -2
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -2
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +1 -2
- package/Materials/Node/Blocks/PBR/refractionBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.d.ts +2 -3
- package/Materials/Node/Blocks/PBR/sheenBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.d.ts +2 -3
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/bonesBlock.d.ts +2 -2
- package/Materials/Node/Blocks/Vertex/bonesBlock.js +3 -3
- package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.d.ts +2 -2
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +8 -2
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.d.ts +3 -3
- package/Materials/Node/Blocks/transformBlock.js +4 -5
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.d.ts +1 -3
- package/Materials/Node/Blocks/triPlanarBlock.js +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +28 -42
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.d.ts +8 -12
- package/Materials/Node/nodeMaterialBlock.js +10 -12
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +3 -1
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildStateSharedData.d.ts +7 -3
- package/Materials/Node/nodeMaterialBuildStateSharedData.js +17 -6
- package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +2 -0
- package/Materials/PBR/pbrBaseMaterial.js +11 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Loaders/exrTextureLoader.d.ts +10 -0
- package/Materials/Textures/Loaders/exrTextureLoader.js +28 -1
- package/Materials/Textures/Loaders/exrTextureLoader.js.map +1 -1
- package/Materials/materialHelper.functions.js +1 -1
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.js +7 -0
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/standardMaterial.d.ts +2 -0
- package/Materials/standardMaterial.js +11 -0
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +7 -0
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +11 -5
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.d.ts +6 -0
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +42 -4
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +8 -0
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Misc/environmentTextureTools.js +1 -1
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/minMaxReducer.d.ts +8 -6
- package/Misc/minMaxReducer.js +57 -90
- package/Misc/minMaxReducer.js.map +1 -1
- package/Misc/thinMinMaxReducer.d.ts +47 -0
- package/Misc/thinMinMaxReducer.js +148 -0
- package/Misc/thinMinMaxReducer.js.map +1 -0
- package/Particles/EmitterTypes/customParticleEmitter.d.ts +5 -0
- package/Particles/EmitterTypes/customParticleEmitter.js +9 -1
- package/Particles/EmitterTypes/customParticleEmitter.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +4 -0
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/Node/Blocks/Conditions/particleConditionBlock.d.ts +75 -0
- package/Particles/Node/Blocks/Conditions/particleConditionBlock.js +179 -0
- package/Particles/Node/Blocks/Conditions/particleConditionBlock.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.d.ts +47 -0
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js +107 -0
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/createParticleBlock.d.ts +46 -0
- package/Particles/Node/Blocks/Emitters/createParticleBlock.js +97 -0
- package/Particles/Node/Blocks/Emitters/createParticleBlock.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/customShapeBlock.d.ts +39 -0
- package/Particles/Node/Blocks/Emitters/customShapeBlock.js +84 -0
- package/Particles/Node/Blocks/Emitters/customShapeBlock.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.d.ts +48 -0
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js +120 -0
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/index.d.ts +7 -0
- package/Particles/Node/Blocks/Emitters/index.js +8 -0
- package/Particles/Node/Blocks/Emitters/index.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.d.ts +39 -0
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js +86 -0
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.d.ts +53 -0
- package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.js +111 -0
- package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.d.ts +43 -0
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +108 -0
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -0
- package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.d.ts +48 -0
- package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.js +100 -0
- package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.js.map +1 -0
- package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.d.ts +47 -0
- package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.js +82 -0
- package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.js.map +1 -0
- package/Particles/Node/Blocks/Triggers/particleTriggerBlock.d.ts +48 -0
- package/Particles/Node/Blocks/Triggers/particleTriggerBlock.js +133 -0
- package/Particles/Node/Blocks/Triggers/particleTriggerBlock.js.map +1 -0
- package/Particles/Node/Blocks/Triggers/triggerTools.d.ts +9 -0
- package/Particles/Node/Blocks/Triggers/triggerTools.js +16 -0
- package/Particles/Node/Blocks/Triggers/triggerTools.js.map +1 -0
- package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.d.ts +31 -0
- package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js +64 -0
- package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js.map +1 -0
- package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.d.ts +31 -0
- package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.js +63 -0
- package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.js.map +1 -0
- package/Particles/Node/Blocks/Update/updateAngleBlock.d.ts +35 -0
- package/Particles/Node/Blocks/Update/updateAngleBlock.js +73 -0
- package/Particles/Node/Blocks/Update/updateAngleBlock.js.map +1 -0
- package/Particles/Node/Blocks/Update/updateColorBlock.d.ts +35 -0
- package/Particles/Node/Blocks/Update/updateColorBlock.js +73 -0
- package/Particles/Node/Blocks/Update/updateColorBlock.js.map +1 -0
- package/Particles/Node/Blocks/Update/updateDirectionBlock.d.ts +35 -0
- package/Particles/Node/Blocks/Update/updateDirectionBlock.js +73 -0
- package/Particles/Node/Blocks/Update/updateDirectionBlock.js.map +1 -0
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.d.ts +41 -0
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.js +102 -0
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.js.map +1 -0
- package/Particles/Node/Blocks/Update/updatePositionBlock.d.ts +35 -0
- package/Particles/Node/Blocks/Update/updatePositionBlock.js +73 -0
- package/Particles/Node/Blocks/Update/updatePositionBlock.js.map +1 -0
- package/Particles/Node/Blocks/Update/updateScaleBlock.d.ts +35 -0
- package/Particles/Node/Blocks/Update/updateScaleBlock.js +73 -0
- package/Particles/Node/Blocks/Update/updateScaleBlock.js.map +1 -0
- package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.d.ts +35 -0
- package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.js +74 -0
- package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.js.map +1 -0
- package/Particles/Node/Blocks/index.d.ts +27 -0
- package/Particles/Node/Blocks/index.js +29 -0
- package/Particles/Node/Blocks/index.js.map +1 -0
- package/Particles/Node/Blocks/particleConverterBlock.d.ts +85 -0
- package/Particles/Node/Blocks/particleConverterBlock.js +267 -0
- package/Particles/Node/Blocks/particleConverterBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleDebugBlock.d.ts +37 -0
- package/Particles/Node/Blocks/particleDebugBlock.js +109 -0
- package/Particles/Node/Blocks/particleDebugBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleElbowBlock.d.ts +27 -0
- package/Particles/Node/Blocks/particleElbowBlock.js +47 -0
- package/Particles/Node/Blocks/particleElbowBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleGradientBlock.d.ts +28 -0
- package/Particles/Node/Blocks/particleGradientBlock.js +118 -0
- package/Particles/Node/Blocks/particleGradientBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleGradientValueBlock.d.ts +32 -0
- package/Particles/Node/Blocks/particleGradientValueBlock.js +79 -0
- package/Particles/Node/Blocks/particleGradientValueBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleInputBlock.d.ts +87 -0
- package/Particles/Node/Blocks/particleInputBlock.js +279 -0
- package/Particles/Node/Blocks/particleInputBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleLerpBlock.d.ts +34 -0
- package/Particles/Node/Blocks/particleLerpBlock.js +92 -0
- package/Particles/Node/Blocks/particleLerpBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleMathBlock.d.ts +64 -0
- package/Particles/Node/Blocks/particleMathBlock.js +321 -0
- package/Particles/Node/Blocks/particleMathBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleRandomBlock.d.ts +52 -0
- package/Particles/Node/Blocks/particleRandomBlock.js +161 -0
- package/Particles/Node/Blocks/particleRandomBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleSourceTextureBlock.d.ts +65 -0
- package/Particles/Node/Blocks/particleSourceTextureBlock.js +173 -0
- package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleTrigonometryBlock.d.ts +80 -0
- package/Particles/Node/Blocks/particleTrigonometryBlock.js +272 -0
- package/Particles/Node/Blocks/particleTrigonometryBlock.js.map +1 -0
- package/Particles/Node/Blocks/randomRangeBlock.d.ts +45 -0
- package/Particles/Node/Blocks/randomRangeBlock.js +151 -0
- package/Particles/Node/Blocks/randomRangeBlock.js.map +1 -0
- package/Particles/Node/Blocks/systemBlock.d.ts +71 -0
- package/Particles/Node/Blocks/systemBlock.js +193 -0
- package/Particles/Node/Blocks/systemBlock.js.map +1 -0
- package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.d.ts +39 -0
- package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.js +41 -0
- package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.js.map +1 -0
- package/Particles/Node/Enums/nodeParticleContextualSources.d.ts +31 -0
- package/Particles/Node/Enums/nodeParticleContextualSources.js +34 -0
- package/Particles/Node/Enums/nodeParticleContextualSources.js.map +1 -0
- package/Particles/Node/Enums/nodeParticleSystemSources.d.ts +13 -0
- package/Particles/Node/Enums/nodeParticleSystemSources.js +15 -0
- package/Particles/Node/Enums/nodeParticleSystemSources.js.map +1 -0
- package/Particles/Node/index.d.ts +8 -0
- package/Particles/Node/index.js +10 -0
- package/Particles/Node/index.js.map +1 -0
- package/Particles/Node/nodeParticleBlock.d.ts +154 -0
- package/Particles/Node/nodeParticleBlock.js +355 -0
- package/Particles/Node/nodeParticleBlock.js.map +1 -0
- package/Particles/Node/nodeParticleBlockConnectionPoint.d.ts +188 -0
- package/Particles/Node/nodeParticleBlockConnectionPoint.js +337 -0
- package/Particles/Node/nodeParticleBlockConnectionPoint.js.map +1 -0
- package/Particles/Node/nodeParticleBuildState.d.ts +89 -0
- package/Particles/Node/nodeParticleBuildState.js +170 -0
- package/Particles/Node/nodeParticleBuildState.js.map +1 -0
- package/Particles/Node/nodeParticleSystemSet.d.ts +120 -0
- package/Particles/Node/nodeParticleSystemSet.js +382 -0
- package/Particles/Node/nodeParticleSystemSet.js.map +1 -0
- package/Particles/Queue/executionQueue.d.ts +2 -0
- package/Particles/Queue/executionQueue.js +10 -0
- package/Particles/Queue/executionQueue.js.map +1 -1
- package/Particles/baseParticleSystem.d.ts +2 -1
- package/Particles/baseParticleSystem.js +1 -0
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/flowMap.d.ts +7 -0
- package/Particles/flowMap.js +32 -0
- package/Particles/flowMap.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +4 -0
- package/Particles/gpuParticleSystem.js +4 -0
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/index.d.ts +1 -0
- package/Particles/index.js +1 -0
- package/Particles/index.js.map +1 -1
- package/Particles/particleSystem.d.ts +12 -0
- package/Particles/particleSystem.js +22 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +32 -11
- package/Particles/thinParticleSystem.js +62 -36
- package/Particles/thinParticleSystem.js.map +1 -1
- package/PostProcesses/postProcessManager.d.ts +2 -1
- package/PostProcesses/postProcessManager.js +3 -2
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/Shaders/ShadersInclude/defaultUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/defaultUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/defaultVertexDeclaration.js +1 -0
- package/Shaders/ShadersInclude/defaultVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +5 -2
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js +3 -0
- package/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +3 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js +1 -0
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/prePassDeclaration.js +3 -0
- package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/prePassVertex.js +3 -0
- package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
- package/Shaders/ShadersInclude/prePassVertexDeclaration.js +3 -0
- package/Shaders/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
- package/Shaders/default.fragment.js +3 -0
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/minmaxRedux.fragment.js +13 -5
- package/Shaders/minmaxRedux.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js +5 -2
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js +3 -0
- package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +3 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +3 -0
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassVertex.js +3 -0
- package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js +3 -0
- package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +3 -0
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/minmaxRedux.fragment.js +14 -6
- package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +5 -0
- package/scene.js +8 -0
- package/scene.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeParticleBuildState.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleBuildState.ts"],"names":[],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IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC9B,OAAsB,IAAI,CAAC,aAAa,CAAC,OAAQ,CAAC,gBAAgB,CAAC;QACvE,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,OAAkB,CAAC;IACjD,CAAC;IAED;;;;OAIG;IACI,cAAc,CAAC,MAAiC;QACnD,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,QAAQ,MAAM,EAAE,CAAC;YACb,KAAK,yBAAyB,CAAC,IAAI;gBAC/B,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC;YAC3C,KAAK,yBAAyB,CAAC,KAAK;gBAChC,OAAO,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC;YACjD,KAAK,yBAAyB,CAAC,OAAO;gBAClC,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;oBAC9B,MAAM,WAAW,GAAiB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;oBAC7D,OAAO,WAAW,CAAC,gBAAgB,CAAC;gBACxC,CAAC;qBAAM,CAAC;oBACJ,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;gBACtC,CAAC;QACT,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { NodeParticleConnectionPoint } from \"./nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport type { Particle } from \"../particle\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"./Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport type { ThinParticleSystem } from \"../thinParticleSystem\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { NodeParticleSystemSources } from \"./Enums/nodeParticleSystemSources\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\n\r\n/**\r\n * Class used to store node based geometry build state\r\n */\r\nexport class NodeParticleBuildState {\r\n /**\r\n * Gets the capactity of the particle system to build\r\n */\r\n public capacity: number;\r\n\r\n /**\r\n * Gets the scene where the particle system is built\r\n */\r\n public scene: Scene;\r\n\r\n /** Gets or sets the build identifier */\r\n public buildId: number;\r\n\r\n /** Gets or sets the list of non connected mandatory inputs */\r\n public notConnectedNonOptionalInputs: NodeParticleConnectionPoint[] = [];\r\n\r\n /** Gets or sets a boolean indicating that verbose mode is on */\r\n public verbose: boolean;\r\n\r\n /**\r\n * Gets or sets the particle context for contextual data\r\n */\r\n public particleContext: Nullable<Particle> = null;\r\n\r\n /**\r\n * Gets or sets the system context for contextual data\r\n */\r\n public systemContext: Nullable<ThinParticleSystem> = null;\r\n\r\n /**\r\n * Gets or sets the index of the gradient to use\r\n */\r\n public gradientIndex: number = 0;\r\n /**\r\n * Gets or sets next gradient in line\r\n */\r\n public nextGradientIndex: number = 0;\r\n /**\r\n * Gets or sets the next gradient value\r\n */\r\n public nextGradientValue: any;\r\n\r\n /**\r\n * Emits errors if any\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n for (const notConnectedInput of this.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Build of Node Particle System Set failed:\\n\" + errorMessage;\r\n }\r\n }\r\n\r\n /**\r\n * Adapt a value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @returns the adapted value\r\n */\r\n adapt(source: NodeParticleConnectionPoint, targetType: NodeParticleBlockConnectionPointTypes) {\r\n const value = source.getConnectedValue(this) || 0;\r\n\r\n if (source.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeParticleBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeParticleBlockConnectionPointTypes.Color4:\r\n return new Color4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual source\r\n * @param source Source of the contextual value\r\n * @returns the value associated with the source\r\n */\r\n public getContextualValue(source: NodeParticleContextualSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleContextualSources.Position:\r\n return this.particleContext.position;\r\n case NodeParticleContextualSources.Direction:\r\n return this.particleContext.direction;\r\n case NodeParticleContextualSources.ScaledDirection:\r\n this.particleContext.direction.scaleToRef(this.systemContext._directionScale, this.systemContext._scaledDirection);\r\n return this.systemContext._scaledDirection;\r\n case NodeParticleContextualSources.Color:\r\n return this.particleContext.color;\r\n case NodeParticleContextualSources.Age:\r\n return this.particleContext.age;\r\n case NodeParticleContextualSources.Lifetime:\r\n return this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.Angle:\r\n return this.particleContext.angle;\r\n case NodeParticleContextualSources.Scale:\r\n return this.particleContext.scale;\r\n case NodeParticleContextualSources.AgeGradient:\r\n return this.particleContext.age / this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.SpriteCellEnd:\r\n return this.systemContext.endSpriteCellID;\r\n case NodeParticleContextualSources.SpriteCellIndex:\r\n return this.particleContext.cellIndex;\r\n case NodeParticleContextualSources.SpriteCellStart:\r\n return this.systemContext.startSpriteCellID;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the emitter is a transform node (or a simple vector3)\r\n */\r\n public get isEmitterTransformNode() {\r\n if (!this.systemContext) {\r\n return false;\r\n }\r\n\r\n if ((<AbstractMesh>this.systemContext.emitter).position) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets the emitter world matrix\r\n */\r\n public get emitterWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter inverse world matrix\r\n */\r\n public get emitterInverseWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterInverseWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter position\r\n */\r\n public get emitterPosition() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n\r\n if (this.isEmitterTransformNode) {\r\n return (<AbstractMesh>this.systemContext.emitter).absolutePosition;\r\n }\r\n\r\n return this.systemContext.emitter as Vector3;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a system source\r\n * @param source Source of the system value\r\n * @returns the value associated with the source\r\n */\r\n public getSystemValue(source: NodeParticleSystemSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleSystemSources.Time:\r\n return this.systemContext._actualFrame;\r\n case NodeParticleSystemSources.Delta:\r\n return this.systemContext._scaledUpdateSpeed;\r\n case NodeParticleSystemSources.Emitter:\r\n if (this.isEmitterTransformNode) {\r\n const emitterMesh = <AbstractMesh>this.systemContext.emitter;\r\n return emitterMesh.absolutePosition;\r\n } else {\r\n return this.systemContext.emitter;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { ParticleSystemSet } from "../particleSystemSet.js";
|
|
2
|
+
import { SystemBlock } from "./Blocks/systemBlock.js";
|
|
3
|
+
import type { Scene } from "../../scene.js";
|
|
4
|
+
import type { NodeParticleBlock } from "./nodeParticleBlock.js";
|
|
5
|
+
import { Observable } from "../../Misc/observable.js";
|
|
6
|
+
import { ParticleInputBlock } from "./Blocks/particleInputBlock.js";
|
|
7
|
+
/**
|
|
8
|
+
* Defines a set of particle systems defined as a node graph.
|
|
9
|
+
* @experimental This API is experimental and may change in future releases.
|
|
10
|
+
* #K6F1ZB
|
|
11
|
+
*/
|
|
12
|
+
export declare class NodeParticleSystemSet {
|
|
13
|
+
private _systemBlocks;
|
|
14
|
+
private _buildId;
|
|
15
|
+
/** Define the Url to load node editor script */
|
|
16
|
+
static EditorURL: string;
|
|
17
|
+
/** Define the Url to load snippets */
|
|
18
|
+
static SnippetUrl: string;
|
|
19
|
+
/**
|
|
20
|
+
* Snippet ID if the material was created from the snippet server
|
|
21
|
+
*/
|
|
22
|
+
snippetId: string;
|
|
23
|
+
/**
|
|
24
|
+
* Gets an array of blocks that needs to be serialized even if they are not yet connected
|
|
25
|
+
*/
|
|
26
|
+
attachedBlocks: NodeParticleBlock[];
|
|
27
|
+
/**
|
|
28
|
+
* Gets or sets data used by visual editor
|
|
29
|
+
* @see https://npe.babylonjs.com
|
|
30
|
+
*/
|
|
31
|
+
editorData: any;
|
|
32
|
+
/**
|
|
33
|
+
* Observable raised when the particle set is built
|
|
34
|
+
*/
|
|
35
|
+
onBuildObservable: Observable<NodeParticleSystemSet>;
|
|
36
|
+
/**
|
|
37
|
+
* The name of the set
|
|
38
|
+
*/
|
|
39
|
+
name: string;
|
|
40
|
+
/**
|
|
41
|
+
* A free comment about the set
|
|
42
|
+
*/
|
|
43
|
+
comment: string;
|
|
44
|
+
/**
|
|
45
|
+
* Gets the system blocks
|
|
46
|
+
*/
|
|
47
|
+
get systemBlocks(): SystemBlock[];
|
|
48
|
+
/**
|
|
49
|
+
* Gets the list of input blocks attached to this material
|
|
50
|
+
* @returns an array of InputBlocks
|
|
51
|
+
*/
|
|
52
|
+
get inputBlocks(): ParticleInputBlock[];
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new set
|
|
55
|
+
* @param name defines the name of the set
|
|
56
|
+
*/
|
|
57
|
+
constructor(name: string);
|
|
58
|
+
/**
|
|
59
|
+
* Gets the current class name of the geometry e.g. "NodeParticleSystemSet"
|
|
60
|
+
* @returns the class name
|
|
61
|
+
*/
|
|
62
|
+
getClassName(): string;
|
|
63
|
+
private _initializeBlock;
|
|
64
|
+
/**
|
|
65
|
+
* Builds the particle system set from the defined blocks.
|
|
66
|
+
* @param scene defines the hosting scene
|
|
67
|
+
* @param verbose defines whether to log detailed information during the build process (false by default)
|
|
68
|
+
* @returns a promise that resolves to the built particle system set
|
|
69
|
+
*/
|
|
70
|
+
buildAsync(scene: Scene, verbose?: boolean): Promise<ParticleSystemSet>;
|
|
71
|
+
/**
|
|
72
|
+
* Clear the current geometry
|
|
73
|
+
*/
|
|
74
|
+
clear(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Clear the current set and restore it to a default state
|
|
77
|
+
*/
|
|
78
|
+
setToDefault(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Remove a block from the current system set
|
|
81
|
+
* @param block defines the block to remove
|
|
82
|
+
*/
|
|
83
|
+
removeBlock(block: NodeParticleBlock): void;
|
|
84
|
+
/**
|
|
85
|
+
* Clear the current graph and load a new one from a serialization object
|
|
86
|
+
* @param source defines the JSON representation of the particle set
|
|
87
|
+
* @param merge defines whether or not the source must be merged or replace the current content
|
|
88
|
+
*/
|
|
89
|
+
parseSerializedObject(source: any, merge?: boolean): void;
|
|
90
|
+
private _restoreConnections;
|
|
91
|
+
/**
|
|
92
|
+
* Serializes this geometry in a JSON representation
|
|
93
|
+
* @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)
|
|
94
|
+
* @returns the serialized geometry object
|
|
95
|
+
*/
|
|
96
|
+
serialize(selectedBlocks?: NodeParticleBlock[]): any;
|
|
97
|
+
/**
|
|
98
|
+
* Disposes the resources
|
|
99
|
+
*/
|
|
100
|
+
dispose(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a new node particle set set to default basic configuration
|
|
103
|
+
* @param name defines the name of the particle set
|
|
104
|
+
* @returns a new NodeParticleSystemSet
|
|
105
|
+
*/
|
|
106
|
+
static CreateDefault(name: string): NodeParticleSystemSet;
|
|
107
|
+
/**
|
|
108
|
+
* Creates a node particle set from parsed data
|
|
109
|
+
* @param source defines the JSON representation of the particle set
|
|
110
|
+
* @returns a new node particle set
|
|
111
|
+
*/
|
|
112
|
+
static Parse(source: any): NodeParticleSystemSet;
|
|
113
|
+
/**
|
|
114
|
+
* Creates a node particle set from a snippet saved by the node geometry editor
|
|
115
|
+
* @param snippetId defines the snippet to load
|
|
116
|
+
* @param nodeParticleSet defines a node particle set to update (instead of creating a new one)
|
|
117
|
+
* @returns a promise that will resolve to the new node geometry
|
|
118
|
+
*/
|
|
119
|
+
static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet>;
|
|
120
|
+
}
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { __decorate } from "../../tslib.es6.js";
|
|
2
|
+
import { serialize } from "../../Misc/decorators.js";
|
|
3
|
+
import { ParticleSystemSet } from "../particleSystemSet.js";
|
|
4
|
+
import { SystemBlock } from "./Blocks/systemBlock.js";
|
|
5
|
+
import { NodeParticleBuildState } from "./nodeParticleBuildState.js";
|
|
6
|
+
import { SerializationHelper } from "../../Misc/decorators.serialization.js";
|
|
7
|
+
import { Observable } from "../../Misc/observable.js";
|
|
8
|
+
import { GetClass } from "../../Misc/typeStore.js";
|
|
9
|
+
import { WebRequest } from "../../Misc/webRequest.js";
|
|
10
|
+
|
|
11
|
+
import { Tools } from "../../Misc/tools.js";
|
|
12
|
+
import { AbstractEngine } from "../../Engines/abstractEngine.js";
|
|
13
|
+
import { ParticleInputBlock } from "./Blocks/particleInputBlock.js";
|
|
14
|
+
import { ParticleTextureSourceBlock } from "./Blocks/particleSourceTextureBlock.js";
|
|
15
|
+
import { NodeParticleContextualSources } from "./Enums/nodeParticleContextualSources.js";
|
|
16
|
+
import { UpdatePositionBlock } from "./Blocks/Update/updatePositionBlock.js";
|
|
17
|
+
import { ParticleMathBlock, ParticleMathBlockOperations } from "./Blocks/particleMathBlock.js";
|
|
18
|
+
import { BoxShapeBlock } from "./Blocks/Emitters/boxShapeBlock.js";
|
|
19
|
+
import { CreateParticleBlock } from "./Blocks/Emitters/createParticleBlock.js";
|
|
20
|
+
/**
|
|
21
|
+
* Defines a set of particle systems defined as a node graph.
|
|
22
|
+
* @experimental This API is experimental and may change in future releases.
|
|
23
|
+
* #K6F1ZB
|
|
24
|
+
*/
|
|
25
|
+
export class NodeParticleSystemSet {
|
|
26
|
+
/**
|
|
27
|
+
* Gets the system blocks
|
|
28
|
+
*/
|
|
29
|
+
get systemBlocks() {
|
|
30
|
+
return this._systemBlocks;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Gets the list of input blocks attached to this material
|
|
34
|
+
* @returns an array of InputBlocks
|
|
35
|
+
*/
|
|
36
|
+
get inputBlocks() {
|
|
37
|
+
const blocks = [];
|
|
38
|
+
for (const block of this.attachedBlocks) {
|
|
39
|
+
if (block.isInput) {
|
|
40
|
+
blocks.push(block);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return blocks;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Creates a new set
|
|
47
|
+
* @param name defines the name of the set
|
|
48
|
+
*/
|
|
49
|
+
constructor(name) {
|
|
50
|
+
this._systemBlocks = [];
|
|
51
|
+
this._buildId = 0;
|
|
52
|
+
/**
|
|
53
|
+
* Gets an array of blocks that needs to be serialized even if they are not yet connected
|
|
54
|
+
*/
|
|
55
|
+
this.attachedBlocks = [];
|
|
56
|
+
/**
|
|
57
|
+
* Gets or sets data used by visual editor
|
|
58
|
+
* @see https://npe.babylonjs.com
|
|
59
|
+
*/
|
|
60
|
+
this.editorData = null;
|
|
61
|
+
/**
|
|
62
|
+
* Observable raised when the particle set is built
|
|
63
|
+
*/
|
|
64
|
+
this.onBuildObservable = new Observable();
|
|
65
|
+
this.name = name;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Gets the current class name of the geometry e.g. "NodeParticleSystemSet"
|
|
69
|
+
* @returns the class name
|
|
70
|
+
*/
|
|
71
|
+
getClassName() {
|
|
72
|
+
return "NodeParticleSystemSet";
|
|
73
|
+
}
|
|
74
|
+
_initializeBlock(node, autoConfigure = true) {
|
|
75
|
+
if (this.attachedBlocks.indexOf(node) === -1) {
|
|
76
|
+
this.attachedBlocks.push(node);
|
|
77
|
+
}
|
|
78
|
+
for (const input of node.inputs) {
|
|
79
|
+
const connectedPoint = input.connectedPoint;
|
|
80
|
+
if (connectedPoint) {
|
|
81
|
+
const block = connectedPoint.ownerBlock;
|
|
82
|
+
if (block !== node) {
|
|
83
|
+
this._initializeBlock(block, autoConfigure);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Builds the particle system set from the defined blocks.
|
|
90
|
+
* @param scene defines the hosting scene
|
|
91
|
+
* @param verbose defines whether to log detailed information during the build process (false by default)
|
|
92
|
+
* @returns a promise that resolves to the built particle system set
|
|
93
|
+
*/
|
|
94
|
+
async buildAsync(scene, verbose = false) {
|
|
95
|
+
return await new Promise((resolve) => {
|
|
96
|
+
const output = new ParticleSystemSet();
|
|
97
|
+
// Initialize all blocks
|
|
98
|
+
for (const block of this._systemBlocks) {
|
|
99
|
+
this._initializeBlock(block);
|
|
100
|
+
}
|
|
101
|
+
// Build the blocks
|
|
102
|
+
for (const block of this.systemBlocks) {
|
|
103
|
+
const state = new NodeParticleBuildState();
|
|
104
|
+
state.buildId = this._buildId++;
|
|
105
|
+
state.scene = scene;
|
|
106
|
+
state.verbose = verbose;
|
|
107
|
+
const system = block.createSystem(state);
|
|
108
|
+
// Errors
|
|
109
|
+
state.emitErrors();
|
|
110
|
+
output.systems.push(system);
|
|
111
|
+
}
|
|
112
|
+
this.onBuildObservable.notifyObservers(this);
|
|
113
|
+
resolve(output);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Clear the current geometry
|
|
118
|
+
*/
|
|
119
|
+
clear() {
|
|
120
|
+
this.attachedBlocks.length = 0;
|
|
121
|
+
this._systemBlocks.length = 0;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Clear the current set and restore it to a default state
|
|
125
|
+
*/
|
|
126
|
+
setToDefault() {
|
|
127
|
+
this.clear();
|
|
128
|
+
this.editorData = null;
|
|
129
|
+
// Main system
|
|
130
|
+
const system = new SystemBlock("Particle system");
|
|
131
|
+
// Update position
|
|
132
|
+
const updatePositionBlock = new UpdatePositionBlock("Update position");
|
|
133
|
+
updatePositionBlock.output.connectTo(system.particle);
|
|
134
|
+
// Contextual inputs
|
|
135
|
+
const positionBlock = new ParticleInputBlock("Position");
|
|
136
|
+
positionBlock.contextualValue = NodeParticleContextualSources.Position;
|
|
137
|
+
const directionBlock = new ParticleInputBlock("Scaled direction");
|
|
138
|
+
directionBlock.contextualValue = NodeParticleContextualSources.ScaledDirection;
|
|
139
|
+
// Add
|
|
140
|
+
const addBlock = new ParticleMathBlock("Add");
|
|
141
|
+
addBlock.operation = ParticleMathBlockOperations.Add;
|
|
142
|
+
positionBlock.output.connectTo(addBlock.left);
|
|
143
|
+
directionBlock.output.connectTo(addBlock.right);
|
|
144
|
+
addBlock.output.connectTo(updatePositionBlock.position);
|
|
145
|
+
// Create particle
|
|
146
|
+
const createParticleBlock = new CreateParticleBlock("Create particle");
|
|
147
|
+
// Shape
|
|
148
|
+
const emitterShape = new BoxShapeBlock("Box shape");
|
|
149
|
+
createParticleBlock.particle.connectTo(emitterShape.particle);
|
|
150
|
+
emitterShape.output.connectTo(updatePositionBlock.particle);
|
|
151
|
+
// Texture
|
|
152
|
+
const textureBlock = new ParticleTextureSourceBlock("Texture");
|
|
153
|
+
textureBlock.texture.connectTo(system.texture);
|
|
154
|
+
textureBlock.url = "https://assets.babylonjs.com/textures/flare.png";
|
|
155
|
+
this._systemBlocks.push(system);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Remove a block from the current system set
|
|
159
|
+
* @param block defines the block to remove
|
|
160
|
+
*/
|
|
161
|
+
removeBlock(block) {
|
|
162
|
+
const attachedBlockIndex = this.attachedBlocks.indexOf(block);
|
|
163
|
+
if (attachedBlockIndex > -1) {
|
|
164
|
+
this.attachedBlocks.splice(attachedBlockIndex, 1);
|
|
165
|
+
}
|
|
166
|
+
if (block.isSystem) {
|
|
167
|
+
const index = this._systemBlocks.indexOf(block);
|
|
168
|
+
if (index > -1) {
|
|
169
|
+
this._systemBlocks.splice(index, 1);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Clear the current graph and load a new one from a serialization object
|
|
175
|
+
* @param source defines the JSON representation of the particle set
|
|
176
|
+
* @param merge defines whether or not the source must be merged or replace the current content
|
|
177
|
+
*/
|
|
178
|
+
parseSerializedObject(source, merge = false) {
|
|
179
|
+
if (!merge) {
|
|
180
|
+
this.clear();
|
|
181
|
+
}
|
|
182
|
+
const map = {};
|
|
183
|
+
// Create blocks
|
|
184
|
+
for (const parsedBlock of source.blocks) {
|
|
185
|
+
const blockType = GetClass(parsedBlock.customType);
|
|
186
|
+
if (blockType) {
|
|
187
|
+
const block = new blockType();
|
|
188
|
+
block._deserialize(parsedBlock);
|
|
189
|
+
map[parsedBlock.id] = block;
|
|
190
|
+
this.attachedBlocks.push(block);
|
|
191
|
+
if (block.isSystem) {
|
|
192
|
+
this._systemBlocks.push(block);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Reconnect teleportation
|
|
197
|
+
for (const block of this.attachedBlocks) {
|
|
198
|
+
if (block.isTeleportOut) {
|
|
199
|
+
const teleportOut = block;
|
|
200
|
+
const id = teleportOut._tempEntryPointUniqueId;
|
|
201
|
+
if (id) {
|
|
202
|
+
const source = map[id];
|
|
203
|
+
if (source) {
|
|
204
|
+
source.attachToEndpoint(teleportOut);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Connections - Starts with input blocks only (except if in "merge" mode where we scan all blocks)
|
|
210
|
+
for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {
|
|
211
|
+
const parsedBlock = source.blocks[blockIndex];
|
|
212
|
+
const block = map[parsedBlock.id];
|
|
213
|
+
if (!block) {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (block.inputs.length && parsedBlock.inputs.some((i) => i.targetConnectionName) && !merge) {
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
this._restoreConnections(block, source, map);
|
|
220
|
+
}
|
|
221
|
+
// UI related info
|
|
222
|
+
if (source.locations || (source.editorData && source.editorData.locations)) {
|
|
223
|
+
const locations = source.locations || source.editorData.locations;
|
|
224
|
+
for (const location of locations) {
|
|
225
|
+
if (map[location.blockId]) {
|
|
226
|
+
location.blockId = map[location.blockId].uniqueId;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (merge && this.editorData && this.editorData.locations) {
|
|
230
|
+
locations.concat(this.editorData.locations);
|
|
231
|
+
}
|
|
232
|
+
if (source.locations) {
|
|
233
|
+
this.editorData = {
|
|
234
|
+
locations: locations,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
this.editorData = source.editorData;
|
|
239
|
+
this.editorData.locations = locations;
|
|
240
|
+
}
|
|
241
|
+
const blockMap = [];
|
|
242
|
+
for (const key in map) {
|
|
243
|
+
blockMap[key] = map[key].uniqueId;
|
|
244
|
+
}
|
|
245
|
+
this.editorData.map = blockMap;
|
|
246
|
+
}
|
|
247
|
+
this.comment = source.comment;
|
|
248
|
+
}
|
|
249
|
+
_restoreConnections(block, source, map) {
|
|
250
|
+
for (const outputPoint of block.outputs) {
|
|
251
|
+
for (const candidate of source.blocks) {
|
|
252
|
+
const target = map[candidate.id];
|
|
253
|
+
if (!target) {
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
for (const input of candidate.inputs) {
|
|
257
|
+
if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {
|
|
258
|
+
const inputPoint = target.getInputByName(input.inputName);
|
|
259
|
+
if (!inputPoint || inputPoint.isConnected) {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
outputPoint.connectTo(inputPoint, true);
|
|
263
|
+
this._restoreConnections(target, source, map);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Serializes this geometry in a JSON representation
|
|
272
|
+
* @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)
|
|
273
|
+
* @returns the serialized geometry object
|
|
274
|
+
*/
|
|
275
|
+
serialize(selectedBlocks) {
|
|
276
|
+
const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);
|
|
277
|
+
serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy
|
|
278
|
+
let blocks = [];
|
|
279
|
+
if (selectedBlocks) {
|
|
280
|
+
blocks = selectedBlocks;
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
serializationObject.customType = "BABYLON.NodeParticleSystemSet";
|
|
284
|
+
}
|
|
285
|
+
// Blocks
|
|
286
|
+
serializationObject.blocks = [];
|
|
287
|
+
for (const block of blocks) {
|
|
288
|
+
serializationObject.blocks.push(block.serialize());
|
|
289
|
+
}
|
|
290
|
+
if (!selectedBlocks) {
|
|
291
|
+
for (const block of this.attachedBlocks) {
|
|
292
|
+
if (blocks.indexOf(block) !== -1) {
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
serializationObject.blocks.push(block.serialize());
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return serializationObject;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Disposes the resources
|
|
302
|
+
*/
|
|
303
|
+
dispose() {
|
|
304
|
+
for (const block of this.attachedBlocks) {
|
|
305
|
+
block.dispose();
|
|
306
|
+
}
|
|
307
|
+
this.attachedBlocks.length = 0;
|
|
308
|
+
this.onBuildObservable.clear();
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Creates a new node particle set set to default basic configuration
|
|
312
|
+
* @param name defines the name of the particle set
|
|
313
|
+
* @returns a new NodeParticleSystemSet
|
|
314
|
+
*/
|
|
315
|
+
static CreateDefault(name) {
|
|
316
|
+
const nodeParticleSet = new NodeParticleSystemSet(name);
|
|
317
|
+
nodeParticleSet.setToDefault();
|
|
318
|
+
return nodeParticleSet;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Creates a node particle set from parsed data
|
|
322
|
+
* @param source defines the JSON representation of the particle set
|
|
323
|
+
* @returns a new node particle set
|
|
324
|
+
*/
|
|
325
|
+
static Parse(source) {
|
|
326
|
+
const nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(source.name), source, null);
|
|
327
|
+
nodeParticleSet.parseSerializedObject(source);
|
|
328
|
+
return nodeParticleSet;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Creates a node particle set from a snippet saved by the node geometry editor
|
|
332
|
+
* @param snippetId defines the snippet to load
|
|
333
|
+
* @param nodeParticleSet defines a node particle set to update (instead of creating a new one)
|
|
334
|
+
* @returns a promise that will resolve to the new node geometry
|
|
335
|
+
*/
|
|
336
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax
|
|
337
|
+
static ParseFromSnippetAsync(snippetId, nodeParticleSet) {
|
|
338
|
+
if (snippetId === "_BLANK") {
|
|
339
|
+
return Promise.resolve(NodeParticleSystemSet.CreateDefault("blank"));
|
|
340
|
+
}
|
|
341
|
+
return new Promise((resolve, reject) => {
|
|
342
|
+
const request = new WebRequest();
|
|
343
|
+
request.addEventListener("readystatechange", () => {
|
|
344
|
+
if (request.readyState == 4) {
|
|
345
|
+
if (request.status == 200) {
|
|
346
|
+
const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
|
|
347
|
+
const serializationObject = JSON.parse(snippet.nodeParticle);
|
|
348
|
+
if (!nodeParticleSet) {
|
|
349
|
+
nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(snippetId), serializationObject, null);
|
|
350
|
+
}
|
|
351
|
+
nodeParticleSet.parseSerializedObject(serializationObject);
|
|
352
|
+
nodeParticleSet.snippetId = snippetId;
|
|
353
|
+
try {
|
|
354
|
+
resolve(nodeParticleSet);
|
|
355
|
+
}
|
|
356
|
+
catch (err) {
|
|
357
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
358
|
+
reject(err);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
363
|
+
reject("Unable to load the snippet " + snippetId);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
request.open("GET", this.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
|
|
368
|
+
request.send();
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
/** Define the Url to load node editor script */
|
|
373
|
+
NodeParticleSystemSet.EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/nodeParticleEditor/babylon.nodeParticleEditor.js`;
|
|
374
|
+
/** Define the Url to load snippets */
|
|
375
|
+
NodeParticleSystemSet.SnippetUrl = `https://snippet.babylonjs.com`;
|
|
376
|
+
__decorate([
|
|
377
|
+
serialize()
|
|
378
|
+
], NodeParticleSystemSet.prototype, "name", void 0);
|
|
379
|
+
__decorate([
|
|
380
|
+
serialize("comment")
|
|
381
|
+
], NodeParticleSystemSet.prototype, "comment", void 0);
|
|
382
|
+
//# sourceMappingURL=nodeParticleSystemSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeParticleSystemSet.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles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OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AAtbD,gDAAgD;AAClC,+BAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,cAAc,CAAC,OAAO,mDAAmD,AAAxG,CAAyG;AAEhI,sCAAsC;AACxB,gCAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AA2BzC;IADN,SAAS,EAAE;mDACQ;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;sDACE","sourcesContent":["import { serialize } from \"core/Misc/decorators\";\r\nimport { ParticleSystemSet } from \"../particleSystemSet\";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { NodeParticleBuildState } from \"./nodeParticleBuildState\";\r\nimport type { NodeParticleBlock } from \"./nodeParticleBlock\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { GetClass } from \"core/Misc/typeStore\";\r\nimport { WebRequest } from \"core/Misc/webRequest\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport type { ParticleTeleportOutBlock } from \"./Blocks/Teleport/particleTeleportOutBlock\";\r\nimport type { ParticleTeleportInBlock } from \"./Blocks/Teleport/particleTeleportInBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\n\r\n/**\r\n * Defines a set of particle systems defined as a node graph.\r\n * @experimental This API is experimental and may change in future releases.\r\n * #K6F1ZB\r\n */\r\nexport class NodeParticleSystemSet {\r\n private _systemBlocks: SystemBlock[] = [];\r\n private _buildId: number = 0;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/nodeParticleEditor/babylon.nodeParticleEditor.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /**\r\n * Snippet ID if the material was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeParticleBlock[] = [];\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://npe.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Observable raised when the particle set is built\r\n */\r\n public onBuildObservable = new Observable<NodeParticleSystemSet>();\r\n\r\n /**\r\n * The name of the set\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the set\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n /**\r\n * Gets the system blocks\r\n */\r\n public get systemBlocks(): SystemBlock[] {\r\n return this._systemBlocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public get inputBlocks() {\r\n const blocks: ParticleInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as ParticleInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Creates a new set\r\n * @param name defines the name of the set\r\n */\r\n public constructor(name: string) {\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Gets the current class name of the geometry e.g. \"NodeParticleSystemSet\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeParticleSystemSet\";\r\n }\r\n\r\n private _initializeBlock(node: NodeParticleBlock, autoConfigure = true) {\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block, autoConfigure);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Builds the particle system set from the defined blocks.\r\n * @param scene defines the hosting scene\r\n * @param verbose defines whether to log detailed information during the build process (false by default)\r\n * @returns a promise that resolves to the built particle system set\r\n */\r\n public async buildAsync(scene: Scene, verbose = false): Promise<ParticleSystemSet> {\r\n return await new Promise<ParticleSystemSet>((resolve) => {\r\n const output = new ParticleSystemSet();\r\n\r\n // Initialize all blocks\r\n for (const block of this._systemBlocks) {\r\n this._initializeBlock(block);\r\n }\r\n\r\n // Build the blocks\r\n for (const block of this.systemBlocks) {\r\n const state = new NodeParticleBuildState();\r\n state.buildId = this._buildId++;\r\n state.scene = scene;\r\n state.verbose = verbose;\r\n\r\n const system = block.createSystem(state);\r\n\r\n // Errors\r\n state.emitErrors();\r\n\r\n output.systems.push(system);\r\n }\r\n\r\n this.onBuildObservable.notifyObservers(this);\r\n\r\n resolve(output);\r\n });\r\n }\r\n\r\n /**\r\n * Clear the current geometry\r\n */\r\n public clear() {\r\n this.attachedBlocks.length = 0;\r\n this._systemBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Clear the current set and restore it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Main system\r\n const system = new SystemBlock(\"Particle system\");\r\n\r\n // Update position\r\n const updatePositionBlock = new UpdatePositionBlock(\"Update position\");\r\n updatePositionBlock.output.connectTo(system.particle);\r\n\r\n // Contextual inputs\r\n const positionBlock = new ParticleInputBlock(\"Position\");\r\n positionBlock.contextualValue = NodeParticleContextualSources.Position;\r\n const directionBlock = new ParticleInputBlock(\"Scaled direction\");\r\n directionBlock.contextualValue = NodeParticleContextualSources.ScaledDirection;\r\n\r\n // Add\r\n const addBlock = new ParticleMathBlock(\"Add\");\r\n addBlock.operation = ParticleMathBlockOperations.Add;\r\n positionBlock.output.connectTo(addBlock.left);\r\n directionBlock.output.connectTo(addBlock.right);\r\n addBlock.output.connectTo(updatePositionBlock.position);\r\n\r\n // Create particle\r\n const createParticleBlock = new CreateParticleBlock(\"Create particle\");\r\n\r\n // Shape\r\n const emitterShape = new BoxShapeBlock(\"Box shape\");\r\n createParticleBlock.particle.connectTo(emitterShape.particle);\r\n emitterShape.output.connectTo(updatePositionBlock.particle);\r\n\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n textureBlock.texture.connectTo(system.texture);\r\n textureBlock.url = \"https://assets.babylonjs.com/textures/flare.png\";\r\n\r\n this._systemBlocks.push(system);\r\n }\r\n\r\n /**\r\n * Remove a block from the current system set\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeParticleBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block.isSystem) {\r\n const index = this._systemBlocks.indexOf(block as SystemBlock);\r\n if (index > -1) {\r\n this._systemBlocks.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the particle set\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeParticleBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const block: NodeParticleBlock = new blockType();\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n\r\n if (block.isSystem) {\r\n this._systemBlocks.push(block as SystemBlock);\r\n }\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as ParticleTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as ParticleTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: number[] = [];\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeParticleBlock, source: any, map: { [key: number]: NodeParticleBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serializes this geometry in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)\r\n * @returns the serialized geometry object\r\n */\r\n public serialize(selectedBlocks?: NodeParticleBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeParticleBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeParticleSystemSet\";\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node particle set set to default basic configuration\r\n * @param name defines the name of the particle set\r\n * @returns a new NodeParticleSystemSet\r\n */\r\n public static CreateDefault(name: string) {\r\n const nodeParticleSet = new NodeParticleSystemSet(name);\r\n\r\n nodeParticleSet.setToDefault();\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from parsed data\r\n * @param source defines the JSON representation of the particle set\r\n * @returns a new node particle set\r\n */\r\n public static Parse(source: any): NodeParticleSystemSet {\r\n const nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(source.name), source, null);\r\n\r\n nodeParticleSet.parseSerializedObject(source);\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from a snippet saved by the node geometry editor\r\n * @param snippetId defines the snippet to load\r\n * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)\r\n * @returns a promise that will resolve to the new node geometry\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeParticleSystemSet.CreateDefault(\"blank\"));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeParticle);\r\n\r\n if (!nodeParticleSet) {\r\n nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(snippetId), serializationObject, null);\r\n }\r\n\r\n nodeParticleSet.parseSerializedObject(serializationObject);\r\n nodeParticleSet.snippetId = snippetId;\r\n\r\n try {\r\n resolve(nodeParticleSet);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -15,4 +15,6 @@ export declare function _ConnectBefore(newOne: _IExecutionQueueItem, activeOne:
|
|
|
15
15
|
/** @internal */
|
|
16
16
|
export declare function _ConnectAfter(newOne: _IExecutionQueueItem, activeOne: _IExecutionQueueItem): void;
|
|
17
17
|
/** @internal */
|
|
18
|
+
export declare function _ConnectAtTheEnd(newOne: _IExecutionQueueItem, root: _IExecutionQueueItem): void;
|
|
19
|
+
/** @internal */
|
|
18
20
|
export declare function _RemoveFromQueue(item: _IExecutionQueueItem): void;
|
|
@@ -17,6 +17,16 @@ export function _ConnectAfter(newOne, activeOne) {
|
|
|
17
17
|
activeOne.nextItem = newOne;
|
|
18
18
|
}
|
|
19
19
|
/** @internal */
|
|
20
|
+
export function _ConnectAtTheEnd(newOne, root) {
|
|
21
|
+
let activeOne = root;
|
|
22
|
+
while (activeOne.nextItem) {
|
|
23
|
+
activeOne = activeOne.nextItem;
|
|
24
|
+
}
|
|
25
|
+
newOne.previousItem = activeOne;
|
|
26
|
+
newOne.nextItem = activeOne.nextItem;
|
|
27
|
+
activeOne.nextItem = newOne;
|
|
28
|
+
}
|
|
29
|
+
/** @internal */
|
|
20
30
|
export function _RemoveFromQueue(item) {
|
|
21
31
|
if (item.previousItem) {
|
|
22
32
|
item.previousItem.nextItem = item.nextItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executionQueue.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Queue/executionQueue.ts"],"names":[],"mappings":"AAcA,gBAAgB;AAChB,MAAM,UAAU,cAAc,CAAC,MAA4B,EAAE,SAA+B;IACxF,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;IAC7C,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;QACzB,SAAS,CAAC,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC;IAC7C,CAAC;IACD,SAAS,CAAC,YAAY,GAAG,MAAM,CAAC;AACpC,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,aAAa,CAAC,MAA4B,EAAE,SAA+B;IACvF,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC;IAChC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;IACrC,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;QACrB,SAAS,CAAC,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC;IAC7C,CAAC;IACD,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC;AAChC,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,IAA0B;IACvD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/C,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACnD,CAAC;AACL,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Particle } from \"../particle\";\r\nimport type { ThinParticleSystem } from \"../thinParticleSystem\";\r\n\r\n/** @internal */\r\nexport interface _IExecutionQueueItem {\r\n /** @internal */\r\n process: (particle: Particle, system: ThinParticleSystem) => void;\r\n /** @internal */\r\n previousItem: Nullable<_IExecutionQueueItem>;\r\n /** @internal */\r\n nextItem: Nullable<_IExecutionQueueItem>;\r\n}\r\n\r\n/** @internal */\r\nexport function _ConnectBefore(newOne: _IExecutionQueueItem, activeOne: _IExecutionQueueItem) {\r\n newOne.previousItem = activeOne.previousItem;\r\n newOne.nextItem = activeOne;\r\n if (activeOne.previousItem) {\r\n activeOne.previousItem.nextItem = newOne;\r\n }\r\n activeOne.previousItem = newOne;\r\n}\r\n\r\n/** @internal */\r\nexport function _ConnectAfter(newOne: _IExecutionQueueItem, activeOne: _IExecutionQueueItem) {\r\n newOne.previousItem = activeOne;\r\n newOne.nextItem = activeOne.nextItem;\r\n if (activeOne.nextItem) {\r\n activeOne.nextItem.previousItem = newOne;\r\n }\r\n activeOne.nextItem = newOne;\r\n}\r\n\r\n/** @internal */\r\nexport function _RemoveFromQueue(item: _IExecutionQueueItem) {\r\n if (item.previousItem) {\r\n item.previousItem.nextItem = item.nextItem;\r\n }\r\n if (item.nextItem) {\r\n item.nextItem.previousItem = item.previousItem;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"executionQueue.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Queue/executionQueue.ts"],"names":[],"mappings":"AAcA,gBAAgB;AAChB,MAAM,UAAU,cAAc,CAAC,MAA4B,EAAE,SAA+B;IACxF,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;IAC7C,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;QACzB,SAAS,CAAC,YAAY,CAAC,QAAQ,GAAG,MAAM,CAAC;IAC7C,CAAC;IACD,SAAS,CAAC,YAAY,GAAG,MAAM,CAAC;AACpC,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,aAAa,CAAC,MAA4B,EAAE,SAA+B;IACvF,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC;IAChC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;IACrC,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;QACrB,SAAS,CAAC,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC;IAC7C,CAAC;IACD,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC;AAChC,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,MAA4B,EAAE,IAA0B;IACrF,IAAI,SAAS,GAAG,IAAI,CAAC;IACrB,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;QACxB,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC;IACnC,CAAC;IACD,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC;IAChC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;IACrC,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC;AAChC,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,gBAAgB,CAAC,IAA0B;IACvD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/C,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACnD,CAAC;AACL,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Particle } from \"../particle\";\r\nimport type { ThinParticleSystem } from \"../thinParticleSystem\";\r\n\r\n/** @internal */\r\nexport interface _IExecutionQueueItem {\r\n /** @internal */\r\n process: (particle: Particle, system: ThinParticleSystem) => void;\r\n /** @internal */\r\n previousItem: Nullable<_IExecutionQueueItem>;\r\n /** @internal */\r\n nextItem: Nullable<_IExecutionQueueItem>;\r\n}\r\n\r\n/** @internal */\r\nexport function _ConnectBefore(newOne: _IExecutionQueueItem, activeOne: _IExecutionQueueItem) {\r\n newOne.previousItem = activeOne.previousItem;\r\n newOne.nextItem = activeOne;\r\n if (activeOne.previousItem) {\r\n activeOne.previousItem.nextItem = newOne;\r\n }\r\n activeOne.previousItem = newOne;\r\n}\r\n\r\n/** @internal */\r\nexport function _ConnectAfter(newOne: _IExecutionQueueItem, activeOne: _IExecutionQueueItem) {\r\n newOne.previousItem = activeOne;\r\n newOne.nextItem = activeOne.nextItem;\r\n if (activeOne.nextItem) {\r\n activeOne.nextItem.previousItem = newOne;\r\n }\r\n activeOne.nextItem = newOne;\r\n}\r\n\r\n/** @internal */\r\nexport function _ConnectAtTheEnd(newOne: _IExecutionQueueItem, root: _IExecutionQueueItem) {\r\n let activeOne = root;\r\n while (activeOne.nextItem) {\r\n activeOne = activeOne.nextItem;\r\n }\r\n newOne.previousItem = activeOne;\r\n newOne.nextItem = activeOne.nextItem;\r\n activeOne.nextItem = newOne;\r\n}\r\n\r\n/** @internal */\r\nexport function _RemoveFromQueue(item: _IExecutionQueueItem) {\r\n if (item.previousItem) {\r\n item.previousItem.nextItem = item.nextItem;\r\n }\r\n if (item.nextItem) {\r\n item.nextItem.previousItem = item.previousItem;\r\n }\r\n}\r\n"]}
|
|
@@ -93,7 +93,8 @@ export declare class BaseParticleSystem implements IClipPlanesHolder {
|
|
|
93
93
|
* The overall motion speed (0.01 is default update speed, faster updates = faster animation)
|
|
94
94
|
*/
|
|
95
95
|
updateSpeed: number;
|
|
96
|
-
|
|
96
|
+
/** @internal */
|
|
97
|
+
_targetStopDuration: number;
|
|
97
98
|
/**
|
|
98
99
|
* The amount of time the particle system is running (depends of the overall update speed).
|
|
99
100
|
*/
|
|
@@ -364,6 +364,7 @@ export class BaseParticleSystem {
|
|
|
364
364
|
* The overall motion speed (0.01 is default update speed, faster updates = faster animation)
|
|
365
365
|
*/
|
|
366
366
|
this.updateSpeed = 0.01;
|
|
367
|
+
/** @internal */
|
|
367
368
|
this._targetStopDuration = 0;
|
|
368
369
|
/**
|
|
369
370
|
* Specifies whether the particle system will be disposed once it reaches the end of the animation.
|