@babylonjs/core 8.10.1 → 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.d.ts +13 -3
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +64 -9
- 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.d.ts +4 -0
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +8 -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 +7 -2
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildStateSharedData.d.ts +14 -3
- package/Materials/Node/nodeMaterialBuildStateSharedData.js +24 -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/Materials/uniformBuffer.js +2 -1
- package/Materials/uniformBuffer.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.d.ts +4 -0
- package/Misc/environmentTextureTools.js +1 -0
- 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,321 @@
|
|
|
1
|
+
import { __decorate } from "../../../tslib.es6.js";
|
|
2
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
3
|
+
import { Vector2, Vector3 } from "../../../Maths/math.vector.js";
|
|
4
|
+
import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
|
|
5
|
+
import { NodeParticleBlock } from "../nodeParticleBlock.js";
|
|
6
|
+
import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
|
|
7
|
+
import { Color4 } from "../../../Maths/math.color.js";
|
|
8
|
+
/**
|
|
9
|
+
* Operations supported by the Math block
|
|
10
|
+
*/
|
|
11
|
+
export var ParticleMathBlockOperations;
|
|
12
|
+
(function (ParticleMathBlockOperations) {
|
|
13
|
+
/** Add */
|
|
14
|
+
ParticleMathBlockOperations[ParticleMathBlockOperations["Add"] = 0] = "Add";
|
|
15
|
+
/** Subtract */
|
|
16
|
+
ParticleMathBlockOperations[ParticleMathBlockOperations["Subtract"] = 1] = "Subtract";
|
|
17
|
+
/** Multiply */
|
|
18
|
+
ParticleMathBlockOperations[ParticleMathBlockOperations["Multiply"] = 2] = "Multiply";
|
|
19
|
+
/** Divide */
|
|
20
|
+
ParticleMathBlockOperations[ParticleMathBlockOperations["Divide"] = 3] = "Divide";
|
|
21
|
+
/** Max */
|
|
22
|
+
ParticleMathBlockOperations[ParticleMathBlockOperations["Max"] = 4] = "Max";
|
|
23
|
+
/** Min */
|
|
24
|
+
ParticleMathBlockOperations[ParticleMathBlockOperations["Min"] = 5] = "Min";
|
|
25
|
+
})(ParticleMathBlockOperations || (ParticleMathBlockOperations = {}));
|
|
26
|
+
/**
|
|
27
|
+
* Block used to apply math functions
|
|
28
|
+
*/
|
|
29
|
+
export class ParticleMathBlock extends NodeParticleBlock {
|
|
30
|
+
/**
|
|
31
|
+
* Create a new ParticleMathBlock
|
|
32
|
+
* @param name defines the block name
|
|
33
|
+
*/
|
|
34
|
+
constructor(name) {
|
|
35
|
+
super(name);
|
|
36
|
+
/**
|
|
37
|
+
* Gets or sets the operation applied by the block
|
|
38
|
+
*/
|
|
39
|
+
this.operation = ParticleMathBlockOperations.Add;
|
|
40
|
+
this.registerInput("left", NodeParticleBlockConnectionPointTypes.AutoDetect);
|
|
41
|
+
this.registerInput("right", NodeParticleBlockConnectionPointTypes.AutoDetect);
|
|
42
|
+
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.BasedOnInput);
|
|
43
|
+
this.output._typeConnectionSource = this.left;
|
|
44
|
+
const excludedConnectionPointTypes = [
|
|
45
|
+
NodeParticleBlockConnectionPointTypes.Matrix,
|
|
46
|
+
NodeParticleBlockConnectionPointTypes.Particle,
|
|
47
|
+
NodeParticleBlockConnectionPointTypes.Texture,
|
|
48
|
+
NodeParticleBlockConnectionPointTypes.System,
|
|
49
|
+
NodeParticleBlockConnectionPointTypes.FloatGradient,
|
|
50
|
+
NodeParticleBlockConnectionPointTypes.Color4Gradient,
|
|
51
|
+
NodeParticleBlockConnectionPointTypes.Vector2Gradient,
|
|
52
|
+
NodeParticleBlockConnectionPointTypes.Vector3Gradient,
|
|
53
|
+
];
|
|
54
|
+
this.left.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);
|
|
55
|
+
this.right.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);
|
|
56
|
+
this._linkConnectionTypes(0, 1);
|
|
57
|
+
this._connectionObservers = [
|
|
58
|
+
this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
59
|
+
this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
60
|
+
this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
61
|
+
this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Gets the current class name
|
|
66
|
+
* @returns the class name
|
|
67
|
+
*/
|
|
68
|
+
getClassName() {
|
|
69
|
+
return "ParticleMathBlock";
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Gets the left input component
|
|
73
|
+
*/
|
|
74
|
+
get left() {
|
|
75
|
+
return this._inputs[0];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Gets the right input component
|
|
79
|
+
*/
|
|
80
|
+
get right() {
|
|
81
|
+
return this._inputs[1];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Gets the geometry output component
|
|
85
|
+
*/
|
|
86
|
+
get output() {
|
|
87
|
+
return this._outputs[0];
|
|
88
|
+
}
|
|
89
|
+
_build(state) {
|
|
90
|
+
let func;
|
|
91
|
+
const left = this.left;
|
|
92
|
+
const right = this.right;
|
|
93
|
+
if (!left.isConnected || !right.isConnected) {
|
|
94
|
+
this.output._storedFunction = null;
|
|
95
|
+
this.output._storedValue = null;
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const leftIsScalar = left.type === NodeParticleBlockConnectionPointTypes.Float || left.type === NodeParticleBlockConnectionPointTypes.Int;
|
|
99
|
+
const rightIsScalar = right.type === NodeParticleBlockConnectionPointTypes.Float || right.type === NodeParticleBlockConnectionPointTypes.Int;
|
|
100
|
+
// If both input types are scalars, then this is a scalar operation.
|
|
101
|
+
const isScalar = leftIsScalar && rightIsScalar;
|
|
102
|
+
switch (this.operation) {
|
|
103
|
+
case ParticleMathBlockOperations.Add: {
|
|
104
|
+
if (isScalar) {
|
|
105
|
+
func = (state) => {
|
|
106
|
+
return left.getConnectedValue(state) + right.getConnectedValue(state);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
else if (leftIsScalar) {
|
|
110
|
+
func = (state) => {
|
|
111
|
+
return state.adapt(left, right.type).add(right.getConnectedValue(state));
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
func = (state) => {
|
|
116
|
+
return left.getConnectedValue(state).add(state.adapt(right, left.type));
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case ParticleMathBlockOperations.Subtract: {
|
|
122
|
+
if (isScalar) {
|
|
123
|
+
func = (state) => {
|
|
124
|
+
return left.getConnectedValue(state) - right.getConnectedValue(state);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
else if (leftIsScalar) {
|
|
128
|
+
func = (state) => {
|
|
129
|
+
return state.adapt(left, right.type).subtract(right.getConnectedValue(state));
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
func = (state) => {
|
|
134
|
+
return left.getConnectedValue(state).subtract(state.adapt(right, left.type));
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
case ParticleMathBlockOperations.Multiply: {
|
|
140
|
+
if (isScalar) {
|
|
141
|
+
func = (state) => {
|
|
142
|
+
return left.getConnectedValue(state) * right.getConnectedValue(state);
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
else if (leftIsScalar) {
|
|
146
|
+
func = (state) => {
|
|
147
|
+
return state.adapt(left, right.type).multiply(right.getConnectedValue(state));
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
func = (state) => {
|
|
152
|
+
return left.getConnectedValue(state).multiply(state.adapt(right, left.type));
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
case ParticleMathBlockOperations.Divide: {
|
|
158
|
+
if (isScalar) {
|
|
159
|
+
func = (state) => {
|
|
160
|
+
return left.getConnectedValue(state) / right.getConnectedValue(state);
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
else if (leftIsScalar) {
|
|
164
|
+
func = (state) => {
|
|
165
|
+
return state.adapt(left, right.type).divide(right.getConnectedValue(state));
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
func = (state) => {
|
|
170
|
+
return left.getConnectedValue(state).divide(state.adapt(right, left.type));
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
case ParticleMathBlockOperations.Min: {
|
|
176
|
+
if (isScalar) {
|
|
177
|
+
func = (state) => {
|
|
178
|
+
return Math.min(left.getConnectedValue(state), right.getConnectedValue(state));
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];
|
|
183
|
+
switch (vector.type) {
|
|
184
|
+
case NodeParticleBlockConnectionPointTypes.Vector2: {
|
|
185
|
+
func = (state) => {
|
|
186
|
+
return Vector2.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
|
|
187
|
+
};
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
case NodeParticleBlockConnectionPointTypes.Vector3: {
|
|
191
|
+
func = (state) => {
|
|
192
|
+
return Vector3.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
|
|
193
|
+
};
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
case NodeParticleBlockConnectionPointTypes.Color4: {
|
|
197
|
+
func = (state) => {
|
|
198
|
+
const other = vector.getConnectedValue(state);
|
|
199
|
+
const { r, g, b, a } = state.adapt(scalar, vector.type);
|
|
200
|
+
return new Color4(Math.min(other.r, r), Math.min(other.g, g), Math.min(other.b, b), Math.min(other.a, a));
|
|
201
|
+
};
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
case ParticleMathBlockOperations.Max: {
|
|
209
|
+
if (isScalar) {
|
|
210
|
+
func = (state) => {
|
|
211
|
+
return Math.max(left.getConnectedValue(state), right.getConnectedValue(state));
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];
|
|
216
|
+
switch (vector.type) {
|
|
217
|
+
case NodeParticleBlockConnectionPointTypes.Vector2: {
|
|
218
|
+
func = (state) => {
|
|
219
|
+
return Vector2.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
|
|
220
|
+
};
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case NodeParticleBlockConnectionPointTypes.Vector3: {
|
|
224
|
+
func = (state) => {
|
|
225
|
+
return Vector3.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));
|
|
226
|
+
};
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
case NodeParticleBlockConnectionPointTypes.Color4: {
|
|
230
|
+
func = (state) => {
|
|
231
|
+
const other = vector.getConnectedValue(state);
|
|
232
|
+
const { r, g, b, a } = state.adapt(scalar, vector.type);
|
|
233
|
+
return new Color4(Math.max(other.r, r), Math.min(other.g, g), Math.min(other.b, b), Math.min(other.a, a));
|
|
234
|
+
};
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
this.output._storedFunction = (state) => {
|
|
243
|
+
if (left.type === NodeParticleBlockConnectionPointTypes.Int) {
|
|
244
|
+
return func(state) | 0;
|
|
245
|
+
}
|
|
246
|
+
return func(state);
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
_updateInputOutputTypes() {
|
|
250
|
+
// First update the output type with the initial assumption that we'll base it on the left input.
|
|
251
|
+
this.output._typeConnectionSource = this.left;
|
|
252
|
+
if (this.left.isConnected && this.right.isConnected) {
|
|
253
|
+
// Both inputs are connected, so we need to determine the output type based on the input types.
|
|
254
|
+
if (this.left.type === NodeParticleBlockConnectionPointTypes.Int ||
|
|
255
|
+
(this.left.type === NodeParticleBlockConnectionPointTypes.Float && this.right.type !== NodeParticleBlockConnectionPointTypes.Int)) {
|
|
256
|
+
this.output._typeConnectionSource = this.right;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
else if (this.left.isConnected !== this.right.isConnected) {
|
|
260
|
+
// Only one input is connected, so we need to determine the output type based on the connected input.
|
|
261
|
+
this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;
|
|
262
|
+
}
|
|
263
|
+
// Next update the accepted connection point types for the inputs based on the current input connection state.
|
|
264
|
+
if (this.left.isConnected || this.right.isConnected) {
|
|
265
|
+
for (const [first, second] of [
|
|
266
|
+
[this.left, this.right],
|
|
267
|
+
[this.right, this.left],
|
|
268
|
+
]) {
|
|
269
|
+
// Always allow Ints and Floats.
|
|
270
|
+
first.acceptedConnectionPointTypes = [NodeParticleBlockConnectionPointTypes.Int, NodeParticleBlockConnectionPointTypes.Float];
|
|
271
|
+
if (second.isConnected) {
|
|
272
|
+
// The same types as the connected input are always allowed.
|
|
273
|
+
first.acceptedConnectionPointTypes.push(second.type);
|
|
274
|
+
// If the other input is a scalar, then we also allow Vector types.
|
|
275
|
+
if (second.type === NodeParticleBlockConnectionPointTypes.Int || second.type === NodeParticleBlockConnectionPointTypes.Float) {
|
|
276
|
+
first.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector2, NodeParticleBlockConnectionPointTypes.Vector3, NodeParticleBlockConnectionPointTypes.Color4);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Release resources
|
|
284
|
+
*/
|
|
285
|
+
dispose() {
|
|
286
|
+
super.dispose();
|
|
287
|
+
for (const observer of this._connectionObservers) {
|
|
288
|
+
observer.remove();
|
|
289
|
+
}
|
|
290
|
+
this._connectionObservers.length = 0;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Serializes this block in a JSON representation
|
|
294
|
+
* @returns the serialized block object
|
|
295
|
+
*/
|
|
296
|
+
serialize() {
|
|
297
|
+
const serializationObject = super.serialize();
|
|
298
|
+
serializationObject.operation = this.operation;
|
|
299
|
+
return serializationObject;
|
|
300
|
+
}
|
|
301
|
+
_deserialize(serializationObject) {
|
|
302
|
+
super._deserialize(serializationObject);
|
|
303
|
+
this.operation = serializationObject.operation;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
__decorate([
|
|
307
|
+
editableInPropertyPage("Operation", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
308
|
+
notifiers: { rebuild: true },
|
|
309
|
+
embedded: true,
|
|
310
|
+
options: [
|
|
311
|
+
{ label: "Add", value: ParticleMathBlockOperations.Add },
|
|
312
|
+
{ label: "Subtract", value: ParticleMathBlockOperations.Subtract },
|
|
313
|
+
{ label: "Multiply", value: ParticleMathBlockOperations.Multiply },
|
|
314
|
+
{ label: "Divide", value: ParticleMathBlockOperations.Divide },
|
|
315
|
+
{ label: "Max", value: ParticleMathBlockOperations.Max },
|
|
316
|
+
{ label: "Min", value: ParticleMathBlockOperations.Min },
|
|
317
|
+
],
|
|
318
|
+
})
|
|
319
|
+
], ParticleMathBlock.prototype, "operation", void 0);
|
|
320
|
+
RegisterClass("BABYLON.ParticleMathBlock", ParticleMathBlock);
|
|
321
|
+
//# sourceMappingURL=particleMathBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"particleMathBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleMathBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAC1D,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,MAAM,EAAE,qCAA8B;AAE/C;;GAEG;AACH,MAAM,CAAN,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AAE,KAAK,EAAE,2BAA2B,CAAC,MAAM,EAAE;YAC9D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;YACxD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;SAC3D;KACJ,CAAC;oDACiD;AAgTvD,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport type { NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\n\r\n/**\r\n * Operations supported by the Math block\r\n */\r\nexport enum ParticleMathBlockOperations {\r\n /** Add */\r\n Add,\r\n /** Subtract */\r\n Subtract,\r\n /** Multiply */\r\n Multiply,\r\n /** Divide */\r\n Divide,\r\n /** Max */\r\n Max,\r\n /** Min */\r\n Min,\r\n}\r\n\r\n/**\r\n * Block used to apply math functions\r\n */\r\nexport class ParticleMathBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Add\", value: ParticleMathBlockOperations.Add },\r\n { label: \"Subtract\", value: ParticleMathBlockOperations.Subtract },\r\n { label: \"Multiply\", value: ParticleMathBlockOperations.Multiply },\r\n { label: \"Divide\", value: ParticleMathBlockOperations.Divide },\r\n { label: \"Max\", value: ParticleMathBlockOperations.Max },\r\n { label: \"Min\", value: ParticleMathBlockOperations.Min },\r\n ],\r\n })\r\n public operation = ParticleMathBlockOperations.Add;\r\n\r\n private readonly _connectionObservers: Observer<NodeParticleConnectionPoint>[];\r\n\r\n /**\r\n * Create a new ParticleMathBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = this.left;\r\n\r\n const excludedConnectionPointTypes = [\r\n NodeParticleBlockConnectionPointTypes.Matrix,\r\n NodeParticleBlockConnectionPointTypes.Particle,\r\n NodeParticleBlockConnectionPointTypes.Texture,\r\n NodeParticleBlockConnectionPointTypes.System,\r\n NodeParticleBlockConnectionPointTypes.FloatGradient,\r\n NodeParticleBlockConnectionPointTypes.Color4Gradient,\r\n NodeParticleBlockConnectionPointTypes.Vector2Gradient,\r\n NodeParticleBlockConnectionPointTypes.Vector3Gradient,\r\n ] as const;\r\n\r\n this.left.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n this.right.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._connectionObservers = [\r\n this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n ];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"ParticleMathBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build(state: NodeParticleBuildState) {\r\n let func: (state: NodeParticleBuildState) => any;\r\n const left = this.left;\r\n const right = this.right;\r\n\r\n if (!left.isConnected || !right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const leftIsScalar = left.type === NodeParticleBlockConnectionPointTypes.Float || left.type === NodeParticleBlockConnectionPointTypes.Int;\r\n const rightIsScalar = right.type === NodeParticleBlockConnectionPointTypes.Float || right.type === NodeParticleBlockConnectionPointTypes.Int;\r\n\r\n // If both input types are scalars, then this is a scalar operation.\r\n const isScalar = leftIsScalar && rightIsScalar;\r\n\r\n switch (this.operation) {\r\n case ParticleMathBlockOperations.Add: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) + right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).add(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).add(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Subtract: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) - right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).subtract(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).subtract(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Multiply: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) * right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).multiply(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).multiply(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Divide: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) / right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).divide(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).divide(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Min: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.min(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n func = (state) => {\r\n const other = vector.getConnectedValue(state);\r\n const { r, g, b, a } = state.adapt(scalar, vector.type);\r\n\r\n return new Color4(Math.min(other.r, r), Math.min(other.g, g), Math.min(other.b, b), Math.min(other.a, a));\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Max: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.max(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n func = (state) => {\r\n const other = vector.getConnectedValue(state);\r\n const { r, g, b, a } = state.adapt(scalar, vector.type);\r\n\r\n return new Color4(Math.max(other.r, r), Math.min(other.g, g), Math.min(other.b, b), Math.min(other.a, a));\r\n };\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n if (left.type === NodeParticleBlockConnectionPointTypes.Int) {\r\n return func(state) | 0;\r\n }\r\n return func(state);\r\n };\r\n }\r\n\r\n private _updateInputOutputTypes() {\r\n // First update the output type with the initial assumption that we'll base it on the left input.\r\n this.output._typeConnectionSource = this.left;\r\n\r\n if (this.left.isConnected && this.right.isConnected) {\r\n // Both inputs are connected, so we need to determine the output type based on the input types.\r\n if (\r\n this.left.type === NodeParticleBlockConnectionPointTypes.Int ||\r\n (this.left.type === NodeParticleBlockConnectionPointTypes.Float && this.right.type !== NodeParticleBlockConnectionPointTypes.Int)\r\n ) {\r\n this.output._typeConnectionSource = this.right;\r\n }\r\n } else if (this.left.isConnected !== this.right.isConnected) {\r\n // Only one input is connected, so we need to determine the output type based on the connected input.\r\n this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;\r\n }\r\n\r\n // Next update the accepted connection point types for the inputs based on the current input connection state.\r\n if (this.left.isConnected || this.right.isConnected) {\r\n for (const [first, second] of [\r\n [this.left, this.right],\r\n [this.right, this.left],\r\n ]) {\r\n // Always allow Ints and Floats.\r\n first.acceptedConnectionPointTypes = [NodeParticleBlockConnectionPointTypes.Int, NodeParticleBlockConnectionPointTypes.Float];\r\n\r\n if (second.isConnected) {\r\n // The same types as the connected input are always allowed.\r\n first.acceptedConnectionPointTypes.push(second.type);\r\n\r\n // If the other input is a scalar, then we also allow Vector types.\r\n if (second.type === NodeParticleBlockConnectionPointTypes.Int || second.type === NodeParticleBlockConnectionPointTypes.Float) {\r\n first.acceptedConnectionPointTypes.push(\r\n NodeParticleBlockConnectionPointTypes.Vector2,\r\n NodeParticleBlockConnectionPointTypes.Vector3,\r\n NodeParticleBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n for (const observer of this._connectionObservers) {\r\n observer.remove();\r\n }\r\n this._connectionObservers.length = 0;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleMathBlock\", ParticleMathBlock);\r\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { NodeParticleBlock } from "../nodeParticleBlock.js";
|
|
2
|
+
import type { NodeParticleConnectionPoint } from "../nodeParticleBlockConnectionPoint.js";
|
|
3
|
+
/**
|
|
4
|
+
* Locks supported by the random block
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ParticleRandomBlockLocks {
|
|
7
|
+
/** None */
|
|
8
|
+
None = 0,
|
|
9
|
+
/** PerParticle */
|
|
10
|
+
PerParticle = 1,
|
|
11
|
+
/** PerSystem */
|
|
12
|
+
PerSystem = 2
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Block used to get a random number
|
|
16
|
+
*/
|
|
17
|
+
export declare class ParticleRandomBlock extends NodeParticleBlock {
|
|
18
|
+
private _currentLockId;
|
|
19
|
+
/**
|
|
20
|
+
* Gets or sets a value indicating if that block will lock its value for a specific event
|
|
21
|
+
*/
|
|
22
|
+
lockMode: ParticleRandomBlockLocks;
|
|
23
|
+
/**
|
|
24
|
+
* Create a new ParticleRandomBlock
|
|
25
|
+
* @param name defines the block name
|
|
26
|
+
*/
|
|
27
|
+
constructor(name: string);
|
|
28
|
+
/**
|
|
29
|
+
* Gets the current class name
|
|
30
|
+
* @returns the class name
|
|
31
|
+
*/
|
|
32
|
+
getClassName(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the min input component
|
|
35
|
+
*/
|
|
36
|
+
get min(): NodeParticleConnectionPoint;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the max input component
|
|
39
|
+
*/
|
|
40
|
+
get max(): NodeParticleConnectionPoint;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the geometry output component
|
|
43
|
+
*/
|
|
44
|
+
get output(): NodeParticleConnectionPoint;
|
|
45
|
+
_build(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Serializes this block in a JSON representation
|
|
48
|
+
* @returns the serialized block object
|
|
49
|
+
*/
|
|
50
|
+
serialize(): any;
|
|
51
|
+
_deserialize(serializationObject: any): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { __decorate } from "../../../tslib.es6.js";
|
|
2
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
3
|
+
import { Vector2, Vector3 } from "../../../Maths/math.vector.js";
|
|
4
|
+
import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
|
|
5
|
+
import { NodeParticleBlock } from "../nodeParticleBlock.js";
|
|
6
|
+
import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
|
|
7
|
+
import { Color4 } from "../../../Maths/math.color.js";
|
|
8
|
+
/**
|
|
9
|
+
* Locks supported by the random block
|
|
10
|
+
*/
|
|
11
|
+
export var ParticleRandomBlockLocks;
|
|
12
|
+
(function (ParticleRandomBlockLocks) {
|
|
13
|
+
/** None */
|
|
14
|
+
ParticleRandomBlockLocks[ParticleRandomBlockLocks["None"] = 0] = "None";
|
|
15
|
+
/** PerParticle */
|
|
16
|
+
ParticleRandomBlockLocks[ParticleRandomBlockLocks["PerParticle"] = 1] = "PerParticle";
|
|
17
|
+
/** PerSystem */
|
|
18
|
+
ParticleRandomBlockLocks[ParticleRandomBlockLocks["PerSystem"] = 2] = "PerSystem";
|
|
19
|
+
})(ParticleRandomBlockLocks || (ParticleRandomBlockLocks = {}));
|
|
20
|
+
/**
|
|
21
|
+
* Block used to get a random number
|
|
22
|
+
*/
|
|
23
|
+
export class ParticleRandomBlock extends NodeParticleBlock {
|
|
24
|
+
/**
|
|
25
|
+
* Create a new ParticleRandomBlock
|
|
26
|
+
* @param name defines the block name
|
|
27
|
+
*/
|
|
28
|
+
constructor(name) {
|
|
29
|
+
super(name);
|
|
30
|
+
this._currentLockId = -2;
|
|
31
|
+
/**
|
|
32
|
+
* Gets or sets a value indicating if that block will lock its value for a specific event
|
|
33
|
+
*/
|
|
34
|
+
this.lockMode = ParticleRandomBlockLocks.PerParticle;
|
|
35
|
+
this.registerInput("min", NodeParticleBlockConnectionPointTypes.AutoDetect, true, 0);
|
|
36
|
+
this.registerInput("max", NodeParticleBlockConnectionPointTypes.AutoDetect, true, 1);
|
|
37
|
+
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.BasedOnInput);
|
|
38
|
+
this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeParticleBlockConnectionPointTypes.Float |
|
|
39
|
+
NodeParticleBlockConnectionPointTypes.Int |
|
|
40
|
+
NodeParticleBlockConnectionPointTypes.Vector2 |
|
|
41
|
+
NodeParticleBlockConnectionPointTypes.Vector3 |
|
|
42
|
+
NodeParticleBlockConnectionPointTypes.Color4);
|
|
43
|
+
this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeParticleBlockConnectionPointTypes.Float |
|
|
44
|
+
NodeParticleBlockConnectionPointTypes.Int |
|
|
45
|
+
NodeParticleBlockConnectionPointTypes.Vector2 |
|
|
46
|
+
NodeParticleBlockConnectionPointTypes.Vector3 |
|
|
47
|
+
NodeParticleBlockConnectionPointTypes.Color4);
|
|
48
|
+
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
49
|
+
this._outputs[0]._defaultConnectionPointType = NodeParticleBlockConnectionPointTypes.Float;
|
|
50
|
+
this._linkConnectionTypes(0, 1);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Gets the current class name
|
|
54
|
+
* @returns the class name
|
|
55
|
+
*/
|
|
56
|
+
getClassName() {
|
|
57
|
+
return "ParticleRandomBlock";
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Gets the min input component
|
|
61
|
+
*/
|
|
62
|
+
get min() {
|
|
63
|
+
return this._inputs[0];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Gets the max input component
|
|
67
|
+
*/
|
|
68
|
+
get max() {
|
|
69
|
+
return this._inputs[1];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Gets the geometry output component
|
|
73
|
+
*/
|
|
74
|
+
get output() {
|
|
75
|
+
return this._outputs[0];
|
|
76
|
+
}
|
|
77
|
+
_build() {
|
|
78
|
+
let func = null;
|
|
79
|
+
this._currentLockId = -2;
|
|
80
|
+
switch (this.min.type) {
|
|
81
|
+
case NodeParticleBlockConnectionPointTypes.AutoDetect:
|
|
82
|
+
case NodeParticleBlockConnectionPointTypes.Int:
|
|
83
|
+
case NodeParticleBlockConnectionPointTypes.Float: {
|
|
84
|
+
func = (state) => {
|
|
85
|
+
const min = this.min.getConnectedValue(state) || 0;
|
|
86
|
+
const max = this.max.getConnectedValue(state) || 1;
|
|
87
|
+
return min + Math.random() * (max - min);
|
|
88
|
+
};
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case NodeParticleBlockConnectionPointTypes.Vector2: {
|
|
92
|
+
func = (state) => {
|
|
93
|
+
const min = this.min.getConnectedValue(state) || Vector2.Zero();
|
|
94
|
+
const max = this.max.getConnectedValue(state) || Vector2.One();
|
|
95
|
+
return new Vector2(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y));
|
|
96
|
+
};
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case NodeParticleBlockConnectionPointTypes.Vector3: {
|
|
100
|
+
func = (state) => {
|
|
101
|
+
const min = this.min.getConnectedValue(state) || Vector3.Zero();
|
|
102
|
+
const max = this.max.getConnectedValue(state) || Vector3.One();
|
|
103
|
+
return new Vector3(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y), min.z + Math.random() * (max.z - min.z));
|
|
104
|
+
};
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case NodeParticleBlockConnectionPointTypes.Color4: {
|
|
108
|
+
func = (state) => {
|
|
109
|
+
const min = this.min.getConnectedValue(state) || new Color4(0, 0, 0, 0);
|
|
110
|
+
const max = this.max.getConnectedValue(state) || new Color4(1, 1, 1, 1);
|
|
111
|
+
return new Color4(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y), min.z + Math.random() * (max.z - min.z), min.w + Math.random() * (max.w - min.w));
|
|
112
|
+
};
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
this.output._storedFunction = (state) => {
|
|
117
|
+
let lockId = 0;
|
|
118
|
+
switch (this.lockMode) {
|
|
119
|
+
case ParticleRandomBlockLocks.PerParticle:
|
|
120
|
+
lockId = state.particleContext?.id || -1;
|
|
121
|
+
break;
|
|
122
|
+
case ParticleRandomBlockLocks.PerSystem:
|
|
123
|
+
lockId = state.buildId || 0;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
if (this._currentLockId !== lockId) {
|
|
127
|
+
if (this.lockMode !== ParticleRandomBlockLocks.None) {
|
|
128
|
+
this._currentLockId = lockId;
|
|
129
|
+
}
|
|
130
|
+
this.output._storedValue = func(state);
|
|
131
|
+
}
|
|
132
|
+
return this.output._storedValue;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Serializes this block in a JSON representation
|
|
137
|
+
* @returns the serialized block object
|
|
138
|
+
*/
|
|
139
|
+
serialize() {
|
|
140
|
+
const serializationObject = super.serialize();
|
|
141
|
+
serializationObject.lockMode = this.lockMode;
|
|
142
|
+
return serializationObject;
|
|
143
|
+
}
|
|
144
|
+
_deserialize(serializationObject) {
|
|
145
|
+
super._deserialize(serializationObject);
|
|
146
|
+
this.lockMode = serializationObject.lockMode;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
__decorate([
|
|
150
|
+
editableInPropertyPage("LockMode", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
151
|
+
notifiers: { rebuild: true },
|
|
152
|
+
embedded: true,
|
|
153
|
+
options: [
|
|
154
|
+
{ label: "None", value: ParticleRandomBlockLocks.None },
|
|
155
|
+
{ label: "Per particle", value: ParticleRandomBlockLocks.PerParticle },
|
|
156
|
+
{ label: "Per system", value: ParticleRandomBlockLocks.PerSystem },
|
|
157
|
+
],
|
|
158
|
+
})
|
|
159
|
+
], ParticleRandomBlock.prototype, "lockMode", void 0);
|
|
160
|
+
RegisterClass("BABYLON.ParticleRandomBlock", ParticleRandomBlock);
|
|
161
|
+
//# sourceMappingURL=particleRandomBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"particleRandomBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleRandomBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAA0B,sBAAsB,EAAE,6CAAsC;AAC/F,OAAO,EAAE,iBAAiB,EA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,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,wBAAwB,CAAC,SAAS,EAAE;SACrE;KACJ,CAAC;qDACqD;AAsJ3D,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Vector2, Vector3 } from \"../../../Maths/math.vector\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"core/Decorators/nodeDecorator\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\n\r\n/**\r\n * Locks supported by the random block\r\n */\r\nexport enum ParticleRandomBlockLocks {\r\n /** None */\r\n None = 0,\r\n /** PerParticle */\r\n PerParticle = 1,\r\n /** PerSystem */\r\n PerSystem = 2,\r\n}\r\n\r\n/**\r\n * Block used to get a random number\r\n */\r\nexport class ParticleRandomBlock extends NodeParticleBlock {\r\n private _currentLockId = -2;\r\n /**\r\n * Gets or sets a value indicating if that block will lock its value for a specific event\r\n */\r\n @editableInPropertyPage(\"LockMode\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"None\", value: ParticleRandomBlockLocks.None },\r\n { label: \"Per particle\", value: ParticleRandomBlockLocks.PerParticle },\r\n { label: \"Per system\", value: ParticleRandomBlockLocks.PerSystem },\r\n ],\r\n })\r\n public lockMode = ParticleRandomBlockLocks.PerParticle;\r\n\r\n /**\r\n * Create a new ParticleRandomBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"min\", NodeParticleBlockConnectionPointTypes.AutoDetect, true, 0);\r\n this.registerInput(\"max\", NodeParticleBlockConnectionPointTypes.AutoDetect, true, 1);\r\n\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeParticleBlockConnectionPointTypes.Float |\r\n NodeParticleBlockConnectionPointTypes.Int |\r\n NodeParticleBlockConnectionPointTypes.Vector2 |\r\n NodeParticleBlockConnectionPointTypes.Vector3 |\r\n NodeParticleBlockConnectionPointTypes.Color4\r\n );\r\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(\r\n NodeParticleBlockConnectionPointTypes.Float |\r\n NodeParticleBlockConnectionPointTypes.Int |\r\n NodeParticleBlockConnectionPointTypes.Vector2 |\r\n NodeParticleBlockConnectionPointTypes.Vector3 |\r\n NodeParticleBlockConnectionPointTypes.Color4\r\n );\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._outputs[0]._defaultConnectionPointType = NodeParticleBlockConnectionPointTypes.Float;\r\n this._linkConnectionTypes(0, 1);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"ParticleRandomBlock\";\r\n }\r\n\r\n /**\r\n * Gets the min input component\r\n */\r\n public get min(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the max input component\r\n */\r\n public get max(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build() {\r\n let func: Nullable<(state: NodeParticleBuildState) => any> = null;\r\n this._currentLockId = -2;\r\n\r\n switch (this.min.type) {\r\n case NodeParticleBlockConnectionPointTypes.AutoDetect:\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || 0;\r\n const max = this.max.getConnectedValue(state) || 1;\r\n return min + Math.random() * (max - min);\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || Vector2.Zero();\r\n const max = this.max.getConnectedValue(state) || Vector2.One();\r\n return new Vector2(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || Vector3.Zero();\r\n const max = this.max.getConnectedValue(state) || Vector3.One();\r\n return new Vector3(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y), min.z + Math.random() * (max.z - min.z));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || new Color4(0, 0, 0, 0);\r\n const max = this.max.getConnectedValue(state) || new Color4(1, 1, 1, 1);\r\n return new Color4(\r\n min.x + Math.random() * (max.x - min.x),\r\n min.y + Math.random() * (max.y - min.y),\r\n min.z + Math.random() * (max.z - min.z),\r\n min.w + Math.random() * (max.w - min.w)\r\n );\r\n };\r\n break;\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n let lockId = 0;\r\n\r\n switch (this.lockMode) {\r\n case ParticleRandomBlockLocks.PerParticle:\r\n lockId = state.particleContext?.id || -1;\r\n break;\r\n case ParticleRandomBlockLocks.PerSystem:\r\n lockId = state.buildId || 0;\r\n break;\r\n }\r\n\r\n if (this._currentLockId !== lockId) {\r\n if (this.lockMode !== ParticleRandomBlockLocks.None) {\r\n this._currentLockId = lockId;\r\n }\r\n this.output._storedValue = func!(state);\r\n }\r\n return this.output._storedValue;\r\n };\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.lockMode = this.lockMode;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.lockMode = serializationObject.lockMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleRandomBlock\", ParticleRandomBlock);\r\n"]}
|