@babylonjs/core 8.11.0 → 8.12.1
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/observable.d.ts +1 -1
- package/Misc/observable.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 +8 -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 +121 -0
- package/Particles/Node/nodeParticleSystemSet.js +383 -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 +6 -1
- package/Particles/baseParticleSystem.js +7 -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,46 @@
|
|
|
1
|
+
import { NodeParticleBlock } from "../../nodeParticleBlock.js";
|
|
2
|
+
import type { NodeParticleConnectionPoint } from "../../nodeParticleBlockConnectionPoint.js";
|
|
3
|
+
import type { NodeParticleBuildState } from "../../nodeParticleBuildState.js";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class CreateParticleBlock extends NodeParticleBlock {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new CreateParticleBlock
|
|
10
|
+
* @param name defines the block name
|
|
11
|
+
*/
|
|
12
|
+
constructor(name: string);
|
|
13
|
+
/**
|
|
14
|
+
* Gets the current class name
|
|
15
|
+
* @returns the class name
|
|
16
|
+
*/
|
|
17
|
+
getClassName(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the emitPower input component
|
|
20
|
+
*/
|
|
21
|
+
get emitPower(): NodeParticleConnectionPoint;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the lifeTime input component
|
|
24
|
+
*/
|
|
25
|
+
get lifeTime(): NodeParticleConnectionPoint;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the color input component
|
|
28
|
+
*/
|
|
29
|
+
get color(): NodeParticleConnectionPoint;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the scale input component
|
|
32
|
+
*/
|
|
33
|
+
get scale(): NodeParticleConnectionPoint;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the angle input component
|
|
36
|
+
*/
|
|
37
|
+
get angle(): NodeParticleConnectionPoint;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the particle output component
|
|
40
|
+
*/
|
|
41
|
+
get particle(): NodeParticleConnectionPoint;
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
_build(state: NodeParticleBuildState): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { NodeParticleBlockConnectionPointTypes } from "../../Enums/nodeParticleBlockConnectionPointTypes.js";
|
|
2
|
+
import { NodeParticleBlock } from "../../nodeParticleBlock.js";
|
|
3
|
+
import { ParticleSystem } from "../../../particleSystem.js";
|
|
4
|
+
import { Color4 } from "../../../../Maths/math.color.js";
|
|
5
|
+
import { Vector2 } from "../../../../Maths/math.vector.js";
|
|
6
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
7
|
+
import { PointParticleEmitter } from "../../../EmitterTypes/pointParticleEmitter.js";
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export class CreateParticleBlock extends NodeParticleBlock {
|
|
12
|
+
/**
|
|
13
|
+
* Create a new CreateParticleBlock
|
|
14
|
+
* @param name defines the block name
|
|
15
|
+
*/
|
|
16
|
+
constructor(name) {
|
|
17
|
+
super(name);
|
|
18
|
+
this.registerInput("emitPower", NodeParticleBlockConnectionPointTypes.Float, true, 1);
|
|
19
|
+
this.registerInput("lifeTime", NodeParticleBlockConnectionPointTypes.Float, true, 1);
|
|
20
|
+
this.registerInput("color", NodeParticleBlockConnectionPointTypes.Color4, true, new Color4(1, 1, 1, 1));
|
|
21
|
+
this.registerInput("scale", NodeParticleBlockConnectionPointTypes.Vector2, true, new Vector2(1, 1));
|
|
22
|
+
this.registerInput("angle", NodeParticleBlockConnectionPointTypes.Float, true, 0);
|
|
23
|
+
this.registerOutput("particle", NodeParticleBlockConnectionPointTypes.Particle);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Gets the current class name
|
|
27
|
+
* @returns the class name
|
|
28
|
+
*/
|
|
29
|
+
getClassName() {
|
|
30
|
+
return "CreateParticleBlock";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Gets the emitPower input component
|
|
34
|
+
*/
|
|
35
|
+
get emitPower() {
|
|
36
|
+
return this._inputs[0];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Gets the lifeTime input component
|
|
40
|
+
*/
|
|
41
|
+
get lifeTime() {
|
|
42
|
+
return this._inputs[1];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Gets the color input component
|
|
46
|
+
*/
|
|
47
|
+
get color() {
|
|
48
|
+
return this._inputs[2];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Gets the scale input component
|
|
52
|
+
*/
|
|
53
|
+
get scale() {
|
|
54
|
+
return this._inputs[3];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Gets the angle input component
|
|
58
|
+
*/
|
|
59
|
+
get angle() {
|
|
60
|
+
return this._inputs[4];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Gets the particle output component
|
|
64
|
+
*/
|
|
65
|
+
get particle() {
|
|
66
|
+
return this._outputs[0];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
_build(state) {
|
|
72
|
+
const system = new ParticleSystem(this.name, state.capacity, state.scene, null, false, undefined, true);
|
|
73
|
+
system.particleEmitterType = new PointParticleEmitter();
|
|
74
|
+
// Creation
|
|
75
|
+
system._lifeTimeCreation.process = (particle, system) => {
|
|
76
|
+
state.particleContext = particle;
|
|
77
|
+
particle.lifeTime = this.lifeTime.getConnectedValue(state);
|
|
78
|
+
system._emitPower = this.emitPower.getConnectedValue(state);
|
|
79
|
+
};
|
|
80
|
+
system._colorCreation.process = (particle) => {
|
|
81
|
+
state.particleContext = particle;
|
|
82
|
+
particle.color.copyFrom(this.color.getConnectedValue(state));
|
|
83
|
+
};
|
|
84
|
+
system._sizeCreation.process = (particle) => {
|
|
85
|
+
state.particleContext = particle;
|
|
86
|
+
particle.size = 1;
|
|
87
|
+
particle.scale.copyFrom(this.scale.getConnectedValue(state));
|
|
88
|
+
};
|
|
89
|
+
system._angleCreation.process = (particle) => {
|
|
90
|
+
state.particleContext = particle;
|
|
91
|
+
particle.angle = this.angle.getConnectedValue(state);
|
|
92
|
+
};
|
|
93
|
+
this.particle._storedValue = system;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
RegisterClass("BABYLON.CreateParticleBlock", CreateParticleBlock);
|
|
97
|
+
//# sourceMappingURL=createParticleBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createParticleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Particles/Node/Blocks/Emitters/createParticleBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,mCAAsC;AAQ/D,OAAO,EAAE,MAAM,EAAE,wCAA8B;AAC/C,OAAO,EAAE,OAAO,EAAE,yCAA+B;AACjD,OAAO,EAAE,aAAa,EAAE,sCAA4B;AACpD,OAAO,EAAE,oBAAoB,EAAE,sDAAyD;AAExF;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,cAAc,CAA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AAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAChE,CAAC,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,QAAkB,EAAE,EAAE;YACnD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;YACjC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC;QAEF,MAAM,CAAC,aAAa,CAAC,OAAO,GAAG,CAAC,QAAkB,EAAE,EAAE;YAClD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;YACjC,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC;YAClB,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,QAAkB,EAAE,EAAE;YACnD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;YACjC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC;IACxC,CAAC;CACJ;AAED,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { NodeParticleBlockConnectionPointTypes } from \"../../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleBlock } from \"../../nodeParticleBlock\";\r\nimport type { NodeParticleConnectionPoint } from \"../../nodeParticleBlockConnectionPoint\";\r\nimport { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { NodeParticleBuildState } from \"../../nodeParticleBuildState\";\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport type { _IExecutionQueueItem } from \"core/Particles/Queue/executionQueue\";\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { _RemoveFromQueue } from \"core/Particles/Queue/executionQueue\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\nimport type { ThinParticleSystem } from \"core/Particles/thinParticleSystem\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { PointParticleEmitter } from \"core/Particles/EmitterTypes/pointParticleEmitter\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class CreateParticleBlock extends NodeParticleBlock {\r\n /**\r\n * Create a new CreateParticleBlock\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(\"emitPower\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"lifeTime\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"color\", NodeParticleBlockConnectionPointTypes.Color4, true, new Color4(1, 1, 1, 1));\r\n this.registerInput(\"scale\", NodeParticleBlockConnectionPointTypes.Vector2, true, new Vector2(1, 1));\r\n this.registerInput(\"angle\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\r\n this.registerOutput(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\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 \"CreateParticleBlock\";\r\n }\r\n\r\n /**\r\n * Gets the emitPower input component\r\n */\r\n public get emitPower(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the lifeTime input component\r\n */\r\n public get lifeTime(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the color input component\r\n */\r\n public get color(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the scale input component\r\n */\r\n public get scale(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the angle input component\r\n */\r\n public get angle(): NodeParticleConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the particle output component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _build(state: NodeParticleBuildState) {\r\n const system = new ParticleSystem(this.name, state.capacity, state.scene, null, false, undefined, true);\r\n system.particleEmitterType = new PointParticleEmitter();\r\n\r\n // Creation\r\n system._lifeTimeCreation.process = (particle: Particle, system: ThinParticleSystem) => {\r\n state.particleContext = particle;\r\n particle.lifeTime = this.lifeTime.getConnectedValue(state);\r\n system._emitPower = this.emitPower.getConnectedValue(state);\r\n };\r\n\r\n system._colorCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n particle.color.copyFrom(this.color.getConnectedValue(state));\r\n };\r\n\r\n system._sizeCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n particle.size = 1;\r\n particle.scale.copyFrom(this.scale.getConnectedValue(state));\r\n };\r\n\r\n system._angleCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n particle.angle = this.angle.getConnectedValue(state);\r\n };\r\n\r\n this.particle._storedValue = system;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CreateParticleBlock\", CreateParticleBlock);\r\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { NodeParticleConnectionPoint } from "../../nodeParticleBlockConnectionPoint.js";
|
|
2
|
+
import type { NodeParticleBuildState } from "../../nodeParticleBuildState.js";
|
|
3
|
+
import { NodeParticleBlock } from "../../nodeParticleBlock.js";
|
|
4
|
+
/**
|
|
5
|
+
* Block used to provide a flow of particles emitted from a custom position.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CustomShapeBlock extends NodeParticleBlock {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new CustomShapeBlock
|
|
10
|
+
* @param name defines the block name
|
|
11
|
+
*/
|
|
12
|
+
constructor(name: string);
|
|
13
|
+
/**
|
|
14
|
+
* Gets the current class name
|
|
15
|
+
* @returns the class name
|
|
16
|
+
*/
|
|
17
|
+
getClassName(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the particle component
|
|
20
|
+
*/
|
|
21
|
+
get particle(): NodeParticleConnectionPoint;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the position input component
|
|
24
|
+
*/
|
|
25
|
+
get position(): NodeParticleConnectionPoint;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the direction input component
|
|
28
|
+
*/
|
|
29
|
+
get direction(): NodeParticleConnectionPoint;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the output component
|
|
32
|
+
*/
|
|
33
|
+
get output(): NodeParticleConnectionPoint;
|
|
34
|
+
/**
|
|
35
|
+
* Builds the block
|
|
36
|
+
* @param state defines the build state
|
|
37
|
+
*/
|
|
38
|
+
_build(state: NodeParticleBuildState): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
2
|
+
import { NodeParticleBlockConnectionPointTypes } from "../../Enums/nodeParticleBlockConnectionPointTypes.js";
|
|
3
|
+
import { Vector3 } from "../../../../Maths/math.vector.js";
|
|
4
|
+
import { NodeParticleBlock } from "../../nodeParticleBlock.js";
|
|
5
|
+
/**
|
|
6
|
+
* Block used to provide a flow of particles emitted from a custom position.
|
|
7
|
+
*/
|
|
8
|
+
export class CustomShapeBlock extends NodeParticleBlock {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new CustomShapeBlock
|
|
11
|
+
* @param name defines the block name
|
|
12
|
+
*/
|
|
13
|
+
constructor(name) {
|
|
14
|
+
super(name);
|
|
15
|
+
this.registerInput("particle", NodeParticleBlockConnectionPointTypes.Particle);
|
|
16
|
+
this.registerInput("position", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0));
|
|
17
|
+
this.registerInput("direction", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 1.0, 0));
|
|
18
|
+
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.Particle);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Gets the current class name
|
|
22
|
+
* @returns the class name
|
|
23
|
+
*/
|
|
24
|
+
getClassName() {
|
|
25
|
+
return "CustomShapeBlock";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Gets the particle component
|
|
29
|
+
*/
|
|
30
|
+
get particle() {
|
|
31
|
+
return this._inputs[0];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Gets the position input component
|
|
35
|
+
*/
|
|
36
|
+
get position() {
|
|
37
|
+
return this._inputs[1];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Gets the direction input component
|
|
41
|
+
*/
|
|
42
|
+
get direction() {
|
|
43
|
+
return this._inputs[2];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Gets the output component
|
|
47
|
+
*/
|
|
48
|
+
get output() {
|
|
49
|
+
return this._outputs[0];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Builds the block
|
|
53
|
+
* @param state defines the build state
|
|
54
|
+
*/
|
|
55
|
+
_build(state) {
|
|
56
|
+
const system = this.particle.getConnectedValue(state);
|
|
57
|
+
system._directionCreation.process = (particle) => {
|
|
58
|
+
state.particleContext = particle;
|
|
59
|
+
state.systemContext = system;
|
|
60
|
+
const direction = this.direction.getConnectedValue(state);
|
|
61
|
+
if (state.isEmitterTransformNode) {
|
|
62
|
+
Vector3.TransformNormalToRef(direction, state.emitterWorldMatrix, particle.direction);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
particle.direction.copyFrom(direction);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
system._positionCreation.process = (particle) => {
|
|
69
|
+
state.particleContext = particle;
|
|
70
|
+
state.systemContext = system;
|
|
71
|
+
const position = this.position.getConnectedValue(state);
|
|
72
|
+
if (state.isEmitterTransformNode) {
|
|
73
|
+
Vector3.TransformCoordinatesToRef(position, state.emitterWorldMatrix, particle.position);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
particle.position.copyFrom(position);
|
|
77
|
+
particle.position.addInPlace(state.emitterPosition);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
this.output._storedValue = system;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
RegisterClass("BABYLON.CustomShapeBlock", CustomShapeBlock);
|
|
84
|
+
//# sourceMappingURL=customShapeBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customShapeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Particles/Node/Blocks/Emitters/customShapeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAE1G,OAAO,EAAE,OAAO,EAAE,yCAA+B;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IACnD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1G,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,C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kB,EAAE,EAAE;YACtD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;YACjC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;YAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAExD,IAAI,KAAK,CAAC,sBAAsB,EAAE,CAAC;gBAC/B,OAAO,CAAC,yBAAyB,CAAC,QAAQ,EAAE,KAAK,CAAC,kBAAmB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC9F,CAAC;iBAAM,CAAC;gBACJ,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBACrC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,eAAgB,CAAC,CAAC;YACzD,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC;IACtC,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport type { NodeParticleConnectionPoint } from \"../../nodeParticleBlockConnectionPoint\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport type { NodeParticleBuildState } from \"../../nodeParticleBuildState\";\r\nimport { NodeParticleBlock } from \"../../nodeParticleBlock\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\n\r\n/**\r\n * Block used to provide a flow of particles emitted from a custom position.\r\n */\r\nexport class CustomShapeBlock extends NodeParticleBlock {\r\n /**\r\n * Create a new CustomShapeBlock\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(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\r\n this.registerInput(\"position\", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0));\r\n this.registerInput(\"direction\", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 1.0, 0));\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.Particle);\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 \"CustomShapeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the particle component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the position input component\r\n */\r\n public get position(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the direction input component\r\n */\r\n public get direction(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Builds the block\r\n * @param state defines the build state\r\n */\r\n public override _build(state: NodeParticleBuildState) {\r\n const system = this.particle.getConnectedValue(state);\r\n\r\n system._directionCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n state.systemContext = system;\r\n\r\n const direction = this.direction.getConnectedValue(state);\r\n\r\n if (state.isEmitterTransformNode) {\r\n Vector3.TransformNormalToRef(direction, state.emitterWorldMatrix!, particle.direction);\r\n } else {\r\n particle.direction.copyFrom(direction);\r\n }\r\n };\r\n\r\n system._positionCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n state.systemContext = system;\r\n const position = this.position.getConnectedValue(state);\r\n\r\n if (state.isEmitterTransformNode) {\r\n Vector3.TransformCoordinatesToRef(position, state.emitterWorldMatrix!, particle.position);\r\n } else {\r\n particle.position.copyFrom(position);\r\n particle.position.addInPlace(state.emitterPosition!);\r\n }\r\n };\r\n\r\n this.output._storedValue = system;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CustomShapeBlock\", CustomShapeBlock);\r\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { NodeParticleBlock } from "../../nodeParticleBlock.js";
|
|
2
|
+
import type { NodeParticleConnectionPoint } from "../../nodeParticleBlockConnectionPoint.js";
|
|
3
|
+
import type { NodeParticleBuildState } from "../../nodeParticleBuildState.js";
|
|
4
|
+
/**
|
|
5
|
+
* Block used to provide a flow of particles emitted from a cylinder shape.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CylinderShapeBlock extends NodeParticleBlock {
|
|
8
|
+
private _tempVector;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new CylinderShapeBlock
|
|
11
|
+
* @param name defines the block name
|
|
12
|
+
*/
|
|
13
|
+
constructor(name: string);
|
|
14
|
+
/**
|
|
15
|
+
* Gets the current class name
|
|
16
|
+
* @returns the class name
|
|
17
|
+
*/
|
|
18
|
+
getClassName(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the particle component
|
|
21
|
+
*/
|
|
22
|
+
get particle(): NodeParticleConnectionPoint;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the radius input component
|
|
25
|
+
*/
|
|
26
|
+
get radius(): NodeParticleConnectionPoint;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the height input component
|
|
29
|
+
*/
|
|
30
|
+
get height(): NodeParticleConnectionPoint;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the radiusRange input component
|
|
33
|
+
*/
|
|
34
|
+
get radiusRange(): NodeParticleConnectionPoint;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the directionRandomizer input component
|
|
37
|
+
*/
|
|
38
|
+
get directionRandomizer(): NodeParticleConnectionPoint;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the output component
|
|
41
|
+
*/
|
|
42
|
+
get output(): NodeParticleConnectionPoint;
|
|
43
|
+
/**
|
|
44
|
+
* Builds the block
|
|
45
|
+
* @param state defines the build state
|
|
46
|
+
*/
|
|
47
|
+
_build(state: NodeParticleBuildState): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { RandomRange } from "../../../../Maths/math.scalar.functions.js";
|
|
2
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
3
|
+
import { NodeParticleBlockConnectionPointTypes } from "../../Enums/nodeParticleBlockConnectionPointTypes.js";
|
|
4
|
+
import { NodeParticleBlock } from "../../nodeParticleBlock.js";
|
|
5
|
+
import { Vector3 } from "../../../../Maths/math.vector.js";
|
|
6
|
+
/**
|
|
7
|
+
* Block used to provide a flow of particles emitted from a cylinder shape.
|
|
8
|
+
*/
|
|
9
|
+
export class CylinderShapeBlock extends NodeParticleBlock {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new CylinderShapeBlock
|
|
12
|
+
* @param name defines the block name
|
|
13
|
+
*/
|
|
14
|
+
constructor(name) {
|
|
15
|
+
super(name);
|
|
16
|
+
this._tempVector = Vector3.Zero();
|
|
17
|
+
this.registerInput("particle", NodeParticleBlockConnectionPointTypes.Particle);
|
|
18
|
+
this.registerInput("radius", NodeParticleBlockConnectionPointTypes.Float, true, 1);
|
|
19
|
+
this.registerInput("height", NodeParticleBlockConnectionPointTypes.Float, true, 1, 0);
|
|
20
|
+
this.registerInput("radiusRange", NodeParticleBlockConnectionPointTypes.Float, true, 1, 0, 1);
|
|
21
|
+
this.registerInput("directionRandomizer", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0, 1);
|
|
22
|
+
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.Particle);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Gets the current class name
|
|
26
|
+
* @returns the class name
|
|
27
|
+
*/
|
|
28
|
+
getClassName() {
|
|
29
|
+
return "CylinderShapeBlock";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets the particle component
|
|
33
|
+
*/
|
|
34
|
+
get particle() {
|
|
35
|
+
return this._inputs[0];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gets the radius input component
|
|
39
|
+
*/
|
|
40
|
+
get radius() {
|
|
41
|
+
return this._inputs[1];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Gets the height input component
|
|
45
|
+
*/
|
|
46
|
+
get height() {
|
|
47
|
+
return this._inputs[2];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets the radiusRange input component
|
|
51
|
+
*/
|
|
52
|
+
get radiusRange() {
|
|
53
|
+
return this._inputs[3];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Gets the directionRandomizer input component
|
|
57
|
+
*/
|
|
58
|
+
get directionRandomizer() {
|
|
59
|
+
return this._inputs[4];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Gets the output component
|
|
63
|
+
*/
|
|
64
|
+
get output() {
|
|
65
|
+
return this._outputs[0];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Builds the block
|
|
69
|
+
* @param state defines the build state
|
|
70
|
+
*/
|
|
71
|
+
_build(state) {
|
|
72
|
+
const system = this.particle.getConnectedValue(state);
|
|
73
|
+
system._directionCreation.process = (particle) => {
|
|
74
|
+
state.particleContext = particle;
|
|
75
|
+
state.systemContext = system;
|
|
76
|
+
const directionRandomizer = this.directionRandomizer.getConnectedValue(state);
|
|
77
|
+
particle.position.subtractToRef(state.emitterPosition, this._tempVector);
|
|
78
|
+
this._tempVector.normalize();
|
|
79
|
+
if (state.isEmitterTransformNode) {
|
|
80
|
+
Vector3.TransformNormalToRef(this._tempVector, state.emitterInverseWorldMatrix, this._tempVector);
|
|
81
|
+
}
|
|
82
|
+
const randY = RandomRange(-directionRandomizer / 2, directionRandomizer / 2);
|
|
83
|
+
let angle = Math.atan2(this._tempVector.x, this._tempVector.z);
|
|
84
|
+
angle += RandomRange(-Math.PI / 2, Math.PI / 2) * directionRandomizer;
|
|
85
|
+
this._tempVector.y = randY; // set direction y to rand y to mirror normal of cylinder surface
|
|
86
|
+
this._tempVector.x = Math.sin(angle);
|
|
87
|
+
this._tempVector.z = Math.cos(angle);
|
|
88
|
+
this._tempVector.normalize();
|
|
89
|
+
if (state.isEmitterTransformNode) {
|
|
90
|
+
Vector3.TransformNormalFromFloatsToRef(this._tempVector.x, this._tempVector.y, this._tempVector.z, state.emitterWorldMatrix, particle.direction);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
particle.direction.copyFrom(this._tempVector);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
system._positionCreation.process = (particle) => {
|
|
97
|
+
state.particleContext = particle;
|
|
98
|
+
state.systemContext = system;
|
|
99
|
+
const height = this.height.getConnectedValue(state);
|
|
100
|
+
const radiusRange = this.radiusRange.getConnectedValue(state);
|
|
101
|
+
const radius = this.radius.getConnectedValue(state);
|
|
102
|
+
const yPos = RandomRange(-height / 2, height / 2);
|
|
103
|
+
const angle = RandomRange(0, 2 * Math.PI);
|
|
104
|
+
const radiusDistribution = RandomRange((1 - radiusRange) * (1 - radiusRange), 1);
|
|
105
|
+
const positionRadius = Math.sqrt(radiusDistribution) * radius;
|
|
106
|
+
const xPos = positionRadius * Math.cos(angle);
|
|
107
|
+
const zPos = positionRadius * Math.sin(angle);
|
|
108
|
+
if (state.isEmitterTransformNode) {
|
|
109
|
+
Vector3.TransformCoordinatesFromFloatsToRef(xPos, yPos, zPos, state.emitterWorldMatrix, particle.position);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
particle.position.copyFromFloats(xPos, yPos, zPos);
|
|
113
|
+
particle.position.addInPlace(state.emitterPosition);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
this.output._storedValue = system;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
RegisterClass("BABYLON.CylinderShapeBlock", CylinderShapeBlock);
|
|
120
|
+
//# sourceMappingURL=cylinderShapeBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cylinderShapeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Particles/Node/Blocks/Emitters/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alar.functions\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleBlock } from \"../../nodeParticleBlock\";\r\nimport type { NodeParticleConnectionPoint } from \"../../nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"../../nodeParticleBuildState\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block used to provide a flow of particles emitted from a cylinder shape.\r\n */\r\nexport class CylinderShapeBlock extends NodeParticleBlock {\r\n private _tempVector = Vector3.Zero();\r\n /**\r\n * Create a new CylinderShapeBlock\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(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\r\n this.registerInput(\"radius\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"height\", NodeParticleBlockConnectionPointTypes.Float, true, 1, 0);\r\n this.registerInput(\"radiusRange\", NodeParticleBlockConnectionPointTypes.Float, true, 1, 0, 1);\r\n this.registerInput(\"directionRandomizer\", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0, 1);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.Particle);\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 \"CylinderShapeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the particle component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the radius input component\r\n */\r\n public get radius(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the height input component\r\n */\r\n public get height(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the radiusRange input component\r\n */\r\n public get radiusRange(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the directionRandomizer input component\r\n */\r\n public get directionRandomizer(): NodeParticleConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Builds the block\r\n * @param state defines the build state\r\n */\r\n public override _build(state: NodeParticleBuildState) {\r\n const system = this.particle.getConnectedValue(state);\r\n\r\n system._directionCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n state.systemContext = system;\r\n\r\n const directionRandomizer = this.directionRandomizer.getConnectedValue(state);\r\n particle.position.subtractToRef(state.emitterPosition!, this._tempVector);\r\n\r\n this._tempVector.normalize();\r\n\r\n if (state.isEmitterTransformNode) {\r\n Vector3.TransformNormalToRef(this._tempVector, state.emitterInverseWorldMatrix!, this._tempVector);\r\n }\r\n\r\n const randY = RandomRange(-directionRandomizer / 2, directionRandomizer / 2);\r\n\r\n let angle = Math.atan2(this._tempVector.x, this._tempVector.z);\r\n angle += RandomRange(-Math.PI / 2, Math.PI / 2) * directionRandomizer;\r\n\r\n this._tempVector.y = randY; // set direction y to rand y to mirror normal of cylinder surface\r\n this._tempVector.x = Math.sin(angle);\r\n this._tempVector.z = Math.cos(angle);\r\n this._tempVector.normalize();\r\n\r\n if (state.isEmitterTransformNode) {\r\n Vector3.TransformNormalFromFloatsToRef(this._tempVector.x, this._tempVector.y, this._tempVector.z, state.emitterWorldMatrix!, particle.direction);\r\n } else {\r\n particle.direction.copyFrom(this._tempVector);\r\n }\r\n };\r\n\r\n system._positionCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n state.systemContext = system;\r\n\r\n const height = this.height.getConnectedValue(state);\r\n const radiusRange = this.radiusRange.getConnectedValue(state);\r\n const radius = this.radius.getConnectedValue(state);\r\n const yPos = RandomRange(-height / 2, height / 2);\r\n const angle = RandomRange(0, 2 * Math.PI);\r\n\r\n const radiusDistribution = RandomRange((1 - radiusRange) * (1 - radiusRange), 1);\r\n const positionRadius = Math.sqrt(radiusDistribution) * radius;\r\n const xPos = positionRadius * Math.cos(angle);\r\n const zPos = positionRadius * Math.sin(angle);\r\n\r\n if (state.isEmitterTransformNode) {\r\n Vector3.TransformCoordinatesFromFloatsToRef(xPos, yPos, zPos, state.emitterWorldMatrix!, particle.position);\r\n } else {\r\n particle.position.copyFromFloats(xPos, yPos, zPos);\r\n particle.position.addInPlace(state.emitterPosition!);\r\n }\r\n };\r\n\r\n this.output._storedValue = system;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CylinderShapeBlock\", CylinderShapeBlock);\r\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./boxShapeBlock.js";
|
|
2
|
+
export * from "./sphereShapeBlock.js";
|
|
3
|
+
export * from "./pointShapeBlock.js";
|
|
4
|
+
export * from "./customShapeBlock.js";
|
|
5
|
+
export * from "./cylinderShapeBlock.js";
|
|
6
|
+
export * from "./setupSpriteSheetBlock.js";
|
|
7
|
+
export * from "./createParticleBlock.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./boxShapeBlock.js";
|
|
2
|
+
export * from "./sphereShapeBlock.js";
|
|
3
|
+
export * from "./pointShapeBlock.js";
|
|
4
|
+
export * from "./customShapeBlock.js";
|
|
5
|
+
export * from "./cylinderShapeBlock.js";
|
|
6
|
+
export * from "./setupSpriteSheetBlock.js";
|
|
7
|
+
export * from "./createParticleBlock.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Particles/Node/Blocks/Emitters/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./boxShapeBlock\";\r\nexport * from \"./sphereShapeBlock\";\r\nexport * from \"./pointShapeBlock\";\r\nexport * from \"./customShapeBlock\";\r\nexport * from \"./cylinderShapeBlock\";\r\nexport * from \"./setupSpriteSheetBlock\";\r\nexport * from \"./createParticleBlock\";\r\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { NodeParticleConnectionPoint } from "../../nodeParticleBlockConnectionPoint.js";
|
|
2
|
+
import type { NodeParticleBuildState } from "../../nodeParticleBuildState.js";
|
|
3
|
+
import { NodeParticleBlock } from "../../nodeParticleBlock.js";
|
|
4
|
+
/**
|
|
5
|
+
* Block used to provide a flow of particles emitted from a point.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PointShapeBlock extends NodeParticleBlock {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new PointShapeBlock
|
|
10
|
+
* @param name defines the block name
|
|
11
|
+
*/
|
|
12
|
+
constructor(name: string);
|
|
13
|
+
/**
|
|
14
|
+
* Gets the current class name
|
|
15
|
+
* @returns the class name
|
|
16
|
+
*/
|
|
17
|
+
getClassName(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the particle component
|
|
20
|
+
*/
|
|
21
|
+
get particle(): NodeParticleConnectionPoint;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the direction1 input component
|
|
24
|
+
*/
|
|
25
|
+
get direction1(): NodeParticleConnectionPoint;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the direction2 input component
|
|
28
|
+
*/
|
|
29
|
+
get direction2(): NodeParticleConnectionPoint;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the output component
|
|
32
|
+
*/
|
|
33
|
+
get output(): NodeParticleConnectionPoint;
|
|
34
|
+
/**
|
|
35
|
+
* Builds the block
|
|
36
|
+
* @param state defines the build state
|
|
37
|
+
*/
|
|
38
|
+
_build(state: NodeParticleBuildState): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
2
|
+
import { NodeParticleBlockConnectionPointTypes } from "../../Enums/nodeParticleBlockConnectionPointTypes.js";
|
|
3
|
+
import { Vector3 } from "../../../../Maths/math.vector.js";
|
|
4
|
+
import { NodeParticleBlock } from "../../nodeParticleBlock.js";
|
|
5
|
+
import { RandomRange } from "../../../../Maths/math.scalar.functions.js";
|
|
6
|
+
/**
|
|
7
|
+
* Block used to provide a flow of particles emitted from a point.
|
|
8
|
+
*/
|
|
9
|
+
export class PointShapeBlock extends NodeParticleBlock {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new PointShapeBlock
|
|
12
|
+
* @param name defines the block name
|
|
13
|
+
*/
|
|
14
|
+
constructor(name) {
|
|
15
|
+
super(name);
|
|
16
|
+
this.registerInput("particle", NodeParticleBlockConnectionPointTypes.Particle);
|
|
17
|
+
this.registerInput("direction1", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 1.0, 0));
|
|
18
|
+
this.registerInput("direction2", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 1.0, 0));
|
|
19
|
+
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.Particle);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets the current class name
|
|
23
|
+
* @returns the class name
|
|
24
|
+
*/
|
|
25
|
+
getClassName() {
|
|
26
|
+
return "PointShapeBlock";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets the particle component
|
|
30
|
+
*/
|
|
31
|
+
get particle() {
|
|
32
|
+
return this._inputs[0];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets the direction1 input component
|
|
36
|
+
*/
|
|
37
|
+
get direction1() {
|
|
38
|
+
return this._inputs[1];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Gets the direction2 input component
|
|
42
|
+
*/
|
|
43
|
+
get direction2() {
|
|
44
|
+
return this._inputs[2];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Gets the output component
|
|
48
|
+
*/
|
|
49
|
+
get output() {
|
|
50
|
+
return this._outputs[0];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Builds the block
|
|
54
|
+
* @param state defines the build state
|
|
55
|
+
*/
|
|
56
|
+
_build(state) {
|
|
57
|
+
const system = this.particle.getConnectedValue(state);
|
|
58
|
+
system._directionCreation.process = (particle) => {
|
|
59
|
+
state.particleContext = particle;
|
|
60
|
+
state.systemContext = system;
|
|
61
|
+
const direction1 = this.direction1.getConnectedValue(state);
|
|
62
|
+
const direction2 = this.direction2.getConnectedValue(state);
|
|
63
|
+
const randX = RandomRange(direction1.x, direction2.x);
|
|
64
|
+
const randY = RandomRange(direction1.y, direction2.y);
|
|
65
|
+
const randZ = RandomRange(direction1.z, direction2.z);
|
|
66
|
+
if (state.isEmitterTransformNode) {
|
|
67
|
+
Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, state.emitterWorldMatrix, particle.direction);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
particle.direction.copyFromFloats(randX, randY, randZ);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
system._positionCreation.process = (particle) => {
|
|
74
|
+
state.systemContext = system;
|
|
75
|
+
if (state.isEmitterTransformNode) {
|
|
76
|
+
Vector3.TransformCoordinatesFromFloatsToRef(0, 0, 0, state.emitterWorldMatrix, particle.position);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
particle.position.copyFrom(state.emitterPosition);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.output._storedValue = system;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
RegisterClass("BABYLON.PointShapeBlock", PointShapeBlock);
|
|
86
|
+
//# sourceMappingURL=pointShapeBlock.js.map
|