@onerjs/core 8.30.6 → 8.30.8
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/AudioV2/abstractAudio/audioEngineV2.d.ts +0 -4
- package/AudioV2/abstractAudio/audioEngineV2.js +0 -4
- package/AudioV2/abstractAudio/audioEngineV2.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/volumeAudioSubNode.js +1 -1
- package/AudioV2/abstractAudio/subNodes/volumeAudioSubNode.js.map +1 -1
- package/AudioV2/audioParameter.d.ts +5 -1
- package/AudioV2/audioParameter.js +4 -0
- package/AudioV2/audioParameter.js.map +1 -1
- package/AudioV2/webAudio/components/webAudioParameterComponent.d.ts +0 -18
- package/AudioV2/webAudio/components/webAudioParameterComponent.js +7 -67
- package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +4 -0
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.d.ts +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +1 -1
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +1 -1
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +3 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +13 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +4 -4
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +3 -4
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +2 -3
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +1 -2
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +3 -1
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +11 -1
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +4 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +7 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +2 -1
- package/FrameGraph/frameGraphRenderContext.js +22 -3
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.js +2 -1
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Meshes/Node/Blocks/randomBlock.js +11 -11
- package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +8 -1
- package/Misc/copyTextureToTexture.js +16 -2
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Particles/EmitterTypes/sphereParticleEmitter.d.ts +3 -1
- package/Particles/EmitterTypes/sphereParticleEmitter.js +7 -1
- package/Particles/EmitterTypes/sphereParticleEmitter.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.d.ts +1 -1
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js +2 -1
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.d.ts +10 -1
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js +50 -17
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/emitters.functions.d.ts +6 -0
- package/Particles/Node/Blocks/Emitters/emitters.functions.js +13 -0
- package/Particles/Node/Blocks/Emitters/emitters.functions.js.map +1 -0
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.d.ts +2 -2
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js +5 -1
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.d.ts +1 -1
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js +3 -1
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.d.ts +10 -1
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +45 -13
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleInputBlock.js +1 -0
- package/Particles/Node/Blocks/particleInputBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleRandomBlock.js +10 -10
- package/Particles/Node/Blocks/particleRandomBlock.js.map +1 -1
- package/Particles/Node/Blocks/systemBlock.d.ts +4 -0
- package/Particles/Node/Blocks/systemBlock.js +9 -0
- package/Particles/Node/Blocks/systemBlock.js.map +1 -1
- package/Particles/Node/Enums/nodeParticleContextualSources.d.ts +3 -1
- package/Particles/Node/Enums/nodeParticleContextualSources.js +2 -0
- package/Particles/Node/Enums/nodeParticleContextualSources.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.js +5 -0
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +40 -12
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.js +1 -1
- package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
- package/Particles/thinParticleSystem.function.d.ts +2 -2
- package/Particles/thinParticleSystem.function.js +2 -2
- package/Particles/thinParticleSystem.function.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +2 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/prePassRenderer.js +4 -1
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Shaders/copyTextureToTexture.fragment.js +2 -2
- package/Shaders/copyTextureToTexture.fragment.js.map +1 -1
- package/ShadersWGSL/copyTextureToTexture.fragment.js +3 -3
- package/ShadersWGSL/copyTextureToTexture.fragment.js.map +1 -1
- package/XR/webXRSessionManager.js +4 -0
- package/XR/webXRSessionManager.js.map +1 -1
- package/package.json +1 -1
|
@@ -61,8 +61,8 @@ async function _ExtractDatafromParticleSystemAsync(newSet, oldSystem) {
|
|
|
61
61
|
}
|
|
62
62
|
function _CreateSystemBlock(oldSystem) {
|
|
63
63
|
const newSystem = new SystemBlock(oldSystem.name);
|
|
64
|
-
// Translation pivot
|
|
65
64
|
_CreateAndConnectInput("Translation pivot", oldSystem.translationPivot, newSystem.translationPivot);
|
|
65
|
+
_CreateAndConnectInput("Texture mask", oldSystem.textureMask, newSystem.textureMask);
|
|
66
66
|
newSystem.emitRate = oldSystem.emitRate;
|
|
67
67
|
newSystem.manualEmitCount = oldSystem.manualEmitCount;
|
|
68
68
|
newSystem.blendMode = oldSystem.blendMode;
|
|
@@ -164,6 +164,17 @@ function _CreateEmitterShapeBlock(oldSystem) {
|
|
|
164
164
|
_CreateAndConnectInput("Direction Randomizer", source.directionRandomizer, target.directionRandomizer);
|
|
165
165
|
break;
|
|
166
166
|
}
|
|
167
|
+
case "CylinderDirectedParticleEmitter": {
|
|
168
|
+
const source = emitter;
|
|
169
|
+
shapeBlock = new CylinderShapeBlock("Cylinder Shape");
|
|
170
|
+
const target = shapeBlock;
|
|
171
|
+
_CreateAndConnectInput("Height", source.height, target.height);
|
|
172
|
+
_CreateAndConnectInput("Radius", source.radius, target.radius);
|
|
173
|
+
_CreateAndConnectInput("Radius Range", source.radiusRange, target.radiusRange);
|
|
174
|
+
_CreateAndConnectInput("Direction 1", source.direction1, target.direction1);
|
|
175
|
+
_CreateAndConnectInput("Direction 2", source.direction2, target.direction2);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
167
178
|
case "HemisphericParticleEmitter": {
|
|
168
179
|
// Hemispheric emitter is not supported in nodes yet
|
|
169
180
|
throw new Error("HemisphericParticleEmitter is not supported in Node Particle System.");
|
|
@@ -172,6 +183,7 @@ function _CreateEmitterShapeBlock(oldSystem) {
|
|
|
172
183
|
const source = emitter;
|
|
173
184
|
shapeBlock = new MeshShapeBlock("Mesh Shape");
|
|
174
185
|
const target = shapeBlock;
|
|
186
|
+
target.useMeshNormalsForDirection = source.useMeshNormalsForDirection;
|
|
175
187
|
_CreateAndConnectInput("Direction 1", source.direction1, target.direction1);
|
|
176
188
|
_CreateAndConnectInput("Direction 2", source.direction2, target.direction2);
|
|
177
189
|
target.mesh = source.mesh;
|
|
@@ -194,6 +206,16 @@ function _CreateEmitterShapeBlock(oldSystem) {
|
|
|
194
206
|
_CreateAndConnectInput("Direction Randomizer", source.directionRandomizer, target.directionRandomizer);
|
|
195
207
|
break;
|
|
196
208
|
}
|
|
209
|
+
case "SphereDirectedParticleEmitter": {
|
|
210
|
+
const source = emitter;
|
|
211
|
+
shapeBlock = new SphereShapeBlock("Sphere Shape");
|
|
212
|
+
const target = shapeBlock;
|
|
213
|
+
_CreateAndConnectInput("Radius", source.radius, target.radius);
|
|
214
|
+
_CreateAndConnectInput("Radius Range", source.radiusRange, target.radiusRange);
|
|
215
|
+
_CreateAndConnectInput("Direction1", source.direction1, target.direction1);
|
|
216
|
+
_CreateAndConnectInput("Direction2", source.direction2, target.direction2);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
197
219
|
}
|
|
198
220
|
if (!shapeBlock) {
|
|
199
221
|
throw new Error(`Unsupported particle emitter type: ${emitter.getClassName()}`);
|
|
@@ -205,7 +227,7 @@ function _CreateUpdateSystem(inputParticle, oldSystem) {
|
|
|
205
227
|
if (oldSystem.minAngularSpeed !== 0 || oldSystem.maxAngularSpeed !== 0) {
|
|
206
228
|
outputUpdate = _CreateAngularSpeedUpdate(outputUpdate, oldSystem.minAngularSpeed, oldSystem.maxAngularSpeed);
|
|
207
229
|
}
|
|
208
|
-
outputUpdate = _CreatePositionUpdate(outputUpdate);
|
|
230
|
+
outputUpdate = _CreatePositionUpdate(outputUpdate, oldSystem.isLocal);
|
|
209
231
|
if (oldSystem.gravity.equalsToFloats(0, 0, 0) === false) {
|
|
210
232
|
outputUpdate = _CreateGravityUpdate(outputUpdate, oldSystem.gravity);
|
|
211
233
|
}
|
|
@@ -229,16 +251,21 @@ function _CreateAngularSpeedUpdate(inputParticle, minAngularSpeed, maxAngularSpe
|
|
|
229
251
|
addAngle.output.connectTo(updateAngle.angle);
|
|
230
252
|
return updateAngle.output;
|
|
231
253
|
}
|
|
232
|
-
function _CreatePositionUpdate(inputParticle) {
|
|
233
|
-
// Calculate the new position
|
|
234
|
-
const addPositionBlock = new ParticleMathBlock("Add Position");
|
|
235
|
-
addPositionBlock.operation = ParticleMathBlockOperations.Add;
|
|
236
|
-
_CreateAndConnectContextualSource("Position", NodeParticleContextualSources.Position, addPositionBlock.left);
|
|
237
|
-
_CreateAndConnectContextualSource("Scaled Direction", NodeParticleContextualSources.ScaledDirection, addPositionBlock.right);
|
|
254
|
+
function _CreatePositionUpdate(inputParticle, isLocal) {
|
|
238
255
|
// Update the particle position
|
|
239
256
|
const updatePosition = new UpdatePositionBlock("Position Update");
|
|
240
257
|
inputParticle.connectTo(updatePosition.particle);
|
|
241
|
-
|
|
258
|
+
if (isLocal) {
|
|
259
|
+
_CreateAndConnectContextualSource("Local Position Updated", NodeParticleContextualSources.LocalPositionUpdated, updatePosition.position);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
// Calculate the new position
|
|
263
|
+
const addPositionBlock = new ParticleMathBlock("Add Position");
|
|
264
|
+
addPositionBlock.operation = ParticleMathBlockOperations.Add;
|
|
265
|
+
_CreateAndConnectContextualSource("Position", NodeParticleContextualSources.Position, addPositionBlock.left);
|
|
266
|
+
_CreateAndConnectContextualSource("Scaled Direction", NodeParticleContextualSources.ScaledDirection, addPositionBlock.right);
|
|
267
|
+
addPositionBlock.output.connectTo(updatePosition.position);
|
|
268
|
+
}
|
|
242
269
|
return updatePosition.output;
|
|
243
270
|
}
|
|
244
271
|
function _CreateGravityUpdate(inputParticle, gravity) {
|
|
@@ -266,7 +293,7 @@ function _CreateColorUpdateBlock(oldSystem, createParticleBlock) {
|
|
|
266
293
|
colorBlock = _CreateGradientColorUpdate(oldSystem, colorGradients, createParticleBlock);
|
|
267
294
|
}
|
|
268
295
|
else {
|
|
269
|
-
colorBlock = _CreateBasicColorUpdate();
|
|
296
|
+
colorBlock = _CreateBasicColorUpdate(oldSystem, createParticleBlock);
|
|
270
297
|
}
|
|
271
298
|
// Clamp alpha >= 0
|
|
272
299
|
const clampedColor = _ClampUpdateColorAlpha(colorBlock);
|
|
@@ -312,11 +339,12 @@ function _CreateGradientColorUpdate(oldSystem, gradient, createParticleBlock) {
|
|
|
312
339
|
_UpdateCreateParticleColor(oldSystem, colorStart, colorEnd, createParticleBlock);
|
|
313
340
|
return colorGradientBlock;
|
|
314
341
|
}
|
|
315
|
-
function _CreateBasicColorUpdate() {
|
|
342
|
+
function _CreateBasicColorUpdate(oldSystem, createParticleBlock) {
|
|
316
343
|
const addColorBlock = new ParticleMathBlock("Add Color");
|
|
317
344
|
addColorBlock.operation = ParticleMathBlockOperations.Add;
|
|
318
345
|
_CreateAndConnectContextualSource("Color", NodeParticleContextualSources.Color, addColorBlock.left);
|
|
319
346
|
_CreateAndConnectContextualSource("Scaled Color Step", NodeParticleContextualSources.ScaledColorStep, addColorBlock.right);
|
|
347
|
+
_UpdateCreateParticleColor(oldSystem, null, null, createParticleBlock);
|
|
320
348
|
return addColorBlock;
|
|
321
349
|
}
|
|
322
350
|
function _UpdateCreateParticleColor(oldSystem, colorStart, colorEnd, createParticleBlock) {
|
|
@@ -329,7 +357,7 @@ function _UpdateCreateParticleColor(oldSystem, colorStart, colorEnd, createParti
|
|
|
329
357
|
colorEnd.value = oldSystem.color2;
|
|
330
358
|
}
|
|
331
359
|
const randomColorBlock = new ParticleRandomBlock("Random color");
|
|
332
|
-
randomColorBlock.lockMode = ParticleRandomBlockLocks.
|
|
360
|
+
randomColorBlock.lockMode = ParticleRandomBlockLocks.PerParticle;
|
|
333
361
|
colorStart.output.connectTo(randomColorBlock.min);
|
|
334
362
|
colorEnd.output.connectTo(randomColorBlock.max);
|
|
335
363
|
randomColorBlock.output.connectTo(createParticleBlock.color);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeParticleSystemSet.helper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.helper.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAC1D,OAAO,EAAE,qCAAqC,EAAE,yDAAwE;AACxH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAA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AAC,KAAK,CAAC,CAAC;IAE7F,OAAO,aAAa,CAAC,MAAM,CAAC;AAChC,CAAC;AAED,SAAS,sBAAsB,CAC3B,cAAsB,EACtB,KAA0C,EAC1C,iBAA8C,EAC9C,SAAiD;IAEjD,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAChE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,iCAAiC,CAAC,mBAA2B,EAAE,aAA4C,EAAE,iBAA8C;IAChK,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAC1D,KAAK,CAAC,eAAe,GAAG,aAAa,CAAC;IACtC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,6BAA6B,CAAC,eAAuB,EAAE,YAAuC,EAAE,iBAA8C;IACnJ,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACtD,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;IAClC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { ColorGradient } from \"core/Misc\";\r\nimport type { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { IParticleSystem } from \"core/Particles/IParticleSystem\";\r\nimport type { BoxParticleEmitter } from \"core/Particles/EmitterTypes/boxParticleEmitter\";\r\nimport type { ConeParticleEmitter } from \"core/Particles/EmitterTypes/coneParticleEmitter\";\r\nimport type { CylinderParticleEmitter } from \"core/Particles/EmitterTypes/cylinderParticleEmitter\";\r\nimport type { MeshParticleEmitter } from \"core/Particles/EmitterTypes/meshParticleEmitter\";\r\nimport type { PointParticleEmitter } from \"core/Particles/EmitterTypes/pointParticleEmitter\";\r\nimport type { SphereParticleEmitter } from \"core/Particles/EmitterTypes/sphereParticleEmitter\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { IShapeBlock } from \"core/Particles/Node/Blocks/Emitters/IShapeBlock\";\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleSystemSet } from \"./nodeParticleSystemSet\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { NodeParticleSystemSources } from \"./Enums/nodeParticleSystemSources\";\r\nimport { ParticleConverterBlock } from \"./Blocks/particleConverterBlock\";\r\nimport { ParticleGradientBlock } from \"./Blocks/particleGradientBlock\";\r\nimport { ParticleGradientValueBlock } from \"./Blocks/particleGradientValueBlock\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport { ParticleRandomBlock, ParticleRandomBlockLocks } from \"./Blocks/particleRandomBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { ConeShapeBlock } from \"./Blocks/Emitters/coneShapeBlock\";\r\nimport { CylinderShapeBlock } from \"./Blocks/Emitters/cylinderShapeBlock\";\r\nimport { MeshShapeBlock } from \"./Blocks/Emitters/meshShapeBlock\";\r\nimport { PointShapeBlock } from \"./Blocks/Emitters/pointShapeBlock\";\r\nimport { SphereShapeBlock } from \"./Blocks/Emitters/sphereShapeBlock\";\r\nimport { UpdateAngleBlock } from \"./Blocks/Update/updateAngleBlock\";\r\nimport { UpdateColorBlock } from \"./Blocks/Update/updateColorBlock\";\r\nimport { UpdateDirectionBlock } from \"./Blocks/Update/updateDirectionBlock\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\n\r\n/**\r\n * Converts a ParticleSystem to a NodeParticleSystemSet.\r\n * @param name The name of the node particle system set.\r\n * @param particleSystemsList The particle systems to convert.\r\n * @returns The converted node particle system set or null if conversion failed.\r\n * #0K3AQ2#3672\r\n * #7J0NXA#4\r\n */\r\nexport async function ConvertToNodeParticleSystemSetAsync(name: string, particleSystemsList: ParticleSystem[]): Promise<Nullable<NodeParticleSystemSet>> {\r\n if (!particleSystemsList || !particleSystemsList.length) {\r\n return null;\r\n }\r\n\r\n const nodeParticleSystemSet = new NodeParticleSystemSet(name);\r\n const promises: Promise<void>[] = [];\r\n\r\n for (const particleSystem of particleSystemsList) {\r\n promises.push(_ExtractDatafromParticleSystemAsync(nodeParticleSystemSet, particleSystem));\r\n }\r\n\r\n await Promise.all(promises);\r\n return nodeParticleSystemSet;\r\n}\r\n\r\nasync function _ExtractDatafromParticleSystemAsync(newSet: NodeParticleSystemSet, oldSystem: ParticleSystem): Promise<void> {\r\n // CreateParticle block\r\n const createParticleBlock = _CreateCreateParticleBlock(oldSystem);\r\n\r\n // Emitter Shape block\r\n const shapeBlock = _CreateEmitterShapeBlock(oldSystem);\r\n createParticleBlock.particle.connectTo(shapeBlock.particle);\r\n\r\n // Update the particle position\r\n const positionUpdatedParticle = _CreateUpdateSystem(shapeBlock.output, oldSystem);\r\n\r\n // Color update\r\n const colorUpdateBlock = _CreateColorUpdateBlock(oldSystem, createParticleBlock);\r\n positionUpdatedParticle.connectTo(colorUpdateBlock.particle);\r\n\r\n // System block\r\n const newSystem = _CreateSystemBlock(oldSystem);\r\n colorUpdateBlock.output.connectTo(newSystem.particle);\r\n\r\n // Register\r\n newSet.systemBlocks.push(newSystem);\r\n}\r\n\r\nfunction _CreateSystemBlock(oldSystem: IParticleSystem): SystemBlock {\r\n const newSystem = new SystemBlock(oldSystem.name);\r\n\r\n // Translation pivot\r\n _CreateAndConnectInput(\"Translation pivot\", oldSystem.translationPivot, newSystem.translationPivot);\r\n\r\n newSystem.emitRate = oldSystem.emitRate;\r\n newSystem.manualEmitCount = oldSystem.manualEmitCount;\r\n\r\n newSystem.blendMode = oldSystem.blendMode;\r\n newSystem.capacity = oldSystem.getCapacity();\r\n newSystem.targetStopDuration = oldSystem.targetStopDuration;\r\n newSystem.startDelay = oldSystem.startDelay;\r\n newSystem.targetStopDuration = oldSystem.targetStopDuration;\r\n newSystem.updateSpeed = oldSystem.updateSpeed;\r\n newSystem.preWarmCycles = oldSystem.preWarmCycles;\r\n newSystem.preWarmStepOffset = oldSystem.preWarmStepOffset;\r\n newSystem.isBillboardBased = oldSystem.isBillboardBased;\r\n newSystem.isLocal = oldSystem.isLocal;\r\n newSystem.disposeOnStop = oldSystem.disposeOnStop;\r\n\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n const url = (oldSystem.particleTexture as Texture).url || \"\";\r\n if (url) {\r\n textureBlock.url = url;\r\n } else {\r\n textureBlock.sourceTexture = oldSystem.particleTexture;\r\n }\r\n textureBlock.texture.connectTo(newSystem.texture);\r\n\r\n return newSystem;\r\n}\r\n\r\nfunction _CreateCreateParticleBlock(oldSystem: ParticleSystem): CreateParticleBlock {\r\n // Create particle\r\n const createParticleBlock = new CreateParticleBlock(\"Create Particle\");\r\n\r\n // Size\r\n const randomSizeBlock = new ParticleRandomBlock(\"Random size\");\r\n _CreateAndConnectInput(\"Min size\", oldSystem.minSize, randomSizeBlock.min);\r\n _CreateAndConnectInput(\"Max size\", oldSystem.maxSize, randomSizeBlock.max);\r\n randomSizeBlock.output.connectTo(createParticleBlock.size);\r\n\r\n // Scale\r\n const randomScaleBlock = new ParticleRandomBlock(\"Random Scale\");\r\n _CreateAndConnectInput(\"Min Scale\", new Vector2(oldSystem.minScaleX, oldSystem.minScaleY), randomScaleBlock.min);\r\n _CreateAndConnectInput(\"Max Scale\", new Vector2(oldSystem.maxScaleX, oldSystem.maxScaleY), randomScaleBlock.max);\r\n randomScaleBlock.output.connectTo(createParticleBlock.scale);\r\n\r\n // Color is handled when we do the color update block to manage gradients\r\n\r\n // Dead color\r\n _CreateAndConnectInput(\"Dead Color\", oldSystem.colorDead, createParticleBlock.colorDead);\r\n\r\n // Emit power (Speed)\r\n const randomEmitPowerBlock = new ParticleRandomBlock(\"Random Emit Power\");\r\n _CreateAndConnectInput(\"Min Emit Power\", oldSystem.minEmitPower, randomEmitPowerBlock.min);\r\n _CreateAndConnectInput(\"Max Emit Power\", oldSystem.maxEmitPower, randomEmitPowerBlock.max);\r\n randomEmitPowerBlock.output.connectTo(createParticleBlock.emitPower);\r\n\r\n // Angle (rotation)\r\n const randomRotationBlock = new ParticleRandomBlock(\"Random Rotation\");\r\n _CreateAndConnectInput(\"Min Rotation\", oldSystem.minInitialRotation, randomRotationBlock.min);\r\n _CreateAndConnectInput(\"Max Rotation\", oldSystem.maxInitialRotation, randomRotationBlock.max);\r\n randomRotationBlock.output.connectTo(createParticleBlock.angle);\r\n\r\n // Lifetime\r\n const randomLifetimeBlock = new ParticleRandomBlock(\"Random Lifetime\");\r\n _CreateAndConnectInput(\"Min Lifetime\", oldSystem.minLifeTime, randomLifetimeBlock.min);\r\n _CreateAndConnectInput(\"Max Lifetime\", oldSystem.maxLifeTime, randomLifetimeBlock.max);\r\n randomLifetimeBlock.output.connectTo(createParticleBlock.lifeTime);\r\n\r\n return createParticleBlock;\r\n}\r\n\r\nfunction _CreateEmitterShapeBlock(oldSystem: IParticleSystem): IShapeBlock {\r\n const emitter = oldSystem.particleEmitterType;\r\n if (!emitter) {\r\n throw new Error(\"Particle system has no emitter type.\");\r\n }\r\n\r\n let shapeBlock: Nullable<IShapeBlock> = null;\r\n switch (emitter.getClassName()) {\r\n case \"BoxParticleEmitter\": {\r\n const source = emitter as BoxParticleEmitter;\r\n shapeBlock = new BoxShapeBlock(\"Box Shape\");\r\n\r\n const target = shapeBlock as BoxShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n _CreateAndConnectInput(\"Min Emit Box\", source.minEmitBox, target.minEmitBox);\r\n _CreateAndConnectInput(\"Max Emit Box\", source.maxEmitBox, target.maxEmitBox);\r\n break;\r\n }\r\n case \"ConeParticleEmitter\": {\r\n const source = emitter as ConeParticleEmitter;\r\n shapeBlock = new ConeShapeBlock(\"Cone Shape\");\r\n\r\n const target = shapeBlock as ConeShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Angle\", source.angle, target.angle);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Height Range\", source.heightRange, target.heightRange);\r\n _CreateAndConnectInput(\"Emit From Spawn Point Only\", source.emitFromSpawnPointOnly ? 1 : 0, target.emitFromSpawnPointOnly, NodeParticleBlockConnectionPointTypes.Int);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"CustomParticleEmitter\": {\r\n // Custom emitter is not supported in nodes yet\r\n throw new Error(\"CustomParticleEmitter is not supported in Node Particle System.\");\r\n }\r\n case \"CylinderParticleEmitter\": {\r\n const source = emitter as CylinderParticleEmitter;\r\n shapeBlock = new CylinderShapeBlock(\"Cylinder Shape\");\r\n\r\n const target = shapeBlock as CylinderShapeBlock;\r\n _CreateAndConnectInput(\"Height\", source.height, target.height);\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"HemisphericParticleEmitter\": {\r\n // Hemispheric emitter is not supported in nodes yet\r\n throw new Error(\"HemisphericParticleEmitter is not supported in Node Particle System.\");\r\n }\r\n case \"MeshParticleEmitter\": {\r\n const source = emitter as MeshParticleEmitter;\r\n shapeBlock = new MeshShapeBlock(\"Mesh Shape\");\r\n\r\n const target = shapeBlock as MeshShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n\r\n target.mesh = source.mesh as Mesh;\r\n break;\r\n }\r\n case \"PointParticleEmitter\": {\r\n const source = emitter as PointParticleEmitter;\r\n shapeBlock = new PointShapeBlock(\"Point Shape\");\r\n\r\n const target = shapeBlock as PointShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"SphereParticleEmitter\": {\r\n const source = emitter as SphereParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n }\r\n\r\n if (!shapeBlock) {\r\n throw new Error(`Unsupported particle emitter type: ${emitter.getClassName()}`);\r\n }\r\n\r\n return shapeBlock;\r\n}\r\n\r\nfunction _CreateUpdateSystem(inputParticle: NodeParticleConnectionPoint, oldSystem: IParticleSystem): NodeParticleConnectionPoint {\r\n let outputUpdate: NodeParticleConnectionPoint = inputParticle;\r\n\r\n if (oldSystem.minAngularSpeed !== 0 || oldSystem.maxAngularSpeed !== 0) {\r\n outputUpdate = _CreateAngularSpeedUpdate(outputUpdate, oldSystem.minAngularSpeed, oldSystem.maxAngularSpeed);\r\n }\r\n\r\n outputUpdate = _CreatePositionUpdate(outputUpdate);\r\n\r\n if (oldSystem.gravity.equalsToFloats(0, 0, 0) === false) {\r\n outputUpdate = _CreateGravityUpdate(outputUpdate, oldSystem.gravity);\r\n }\r\n\r\n return outputUpdate;\r\n}\r\n\r\nfunction _CreateAngularSpeedUpdate(inputParticle: NodeParticleConnectionPoint, minAngularSpeed: number, maxAngularSpeed: number): NodeParticleConnectionPoint {\r\n // Random value between for the angular speed of the particle\r\n const randomAngularSpeedBlock = new ParticleRandomBlock(\"Random Angular Speed\");\r\n _CreateAndConnectInput(\"Min Angular Speed\", minAngularSpeed, randomAngularSpeedBlock.min);\r\n _CreateAndConnectInput(\"Max Angular Speed\", maxAngularSpeed, randomAngularSpeedBlock.max);\r\n\r\n // Create the angular speed delta\r\n const angleSpeedDeltaOutput = _CreateDeltaModifiedInput(\"Angular Speed\", randomAngularSpeedBlock.output);\r\n\r\n // Add it to the angle\r\n const addAngle = new ParticleMathBlock(\"Add Angular Speed to Angle\");\r\n addAngle.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Angle\", NodeParticleContextualSources.Angle, addAngle.left);\r\n angleSpeedDeltaOutput.connectTo(addAngle.right);\r\n\r\n // Update the particle angle\r\n const updateAngle = new UpdateAngleBlock(\"Angle Update with Angular Speed\");\r\n inputParticle.connectTo(updateAngle.particle);\r\n addAngle.output.connectTo(updateAngle.angle);\r\n\r\n return updateAngle.output;\r\n}\r\n\r\nfunction _CreatePositionUpdate(inputParticle: NodeParticleConnectionPoint): NodeParticleConnectionPoint {\r\n // Calculate the new position\r\n const addPositionBlock = new ParticleMathBlock(\"Add Position\");\r\n addPositionBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Position\", NodeParticleContextualSources.Position, addPositionBlock.left);\r\n _CreateAndConnectContextualSource(\"Scaled Direction\", NodeParticleContextualSources.ScaledDirection, addPositionBlock.right);\r\n\r\n // Update the particle position\r\n const updatePosition = new UpdatePositionBlock(\"Position Update\");\r\n inputParticle.connectTo(updatePosition.particle);\r\n addPositionBlock.output.connectTo(updatePosition.position);\r\n\r\n return updatePosition.output;\r\n}\r\n\r\nfunction _CreateGravityUpdate(inputParticle: NodeParticleConnectionPoint, gravity: Vector3): NodeParticleConnectionPoint {\r\n // Create the gravity delta\r\n const gravityDeltaOutput = _CreateDeltaModifiedInput(\"Gravity\", gravity);\r\n\r\n // Add it to the direction\r\n const addDirectionBlock = new ParticleMathBlock(\"Add Gravity to Direction\");\r\n addDirectionBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, addDirectionBlock.left);\r\n gravityDeltaOutput.connectTo(addDirectionBlock.right);\r\n\r\n // Update the particle direction\r\n const updateDirection = new UpdateDirectionBlock(\"Direction Update with Gravity\");\r\n inputParticle.connectTo(updateDirection.particle);\r\n addDirectionBlock.output.connectTo(updateDirection.direction);\r\n\r\n return updateDirection.output;\r\n}\r\n\r\nfunction _CreateColorUpdateBlock(oldSystem: IParticleSystem, createParticleBlock: CreateParticleBlock): UpdateColorBlock {\r\n if (!oldSystem) {\r\n throw new Error(\"Invalid particle system\");\r\n }\r\n\r\n // Calculate the color\r\n const colorGradients = oldSystem.getColorGradients();\r\n let colorBlock: Nullable<ParticleGradientBlock | ParticleMathBlock> = null;\r\n if (colorGradients && colorGradients.length > 0) {\r\n colorBlock = _CreateGradientColorUpdate(oldSystem, colorGradients, createParticleBlock);\r\n } else {\r\n colorBlock = _CreateBasicColorUpdate();\r\n }\r\n\r\n // Clamp alpha >= 0\r\n const clampedColor = _ClampUpdateColorAlpha(colorBlock);\r\n\r\n // Create the color update block\r\n const colorUpdateBlock = new UpdateColorBlock(\"Color update\");\r\n clampedColor.colorOut.connectTo(colorUpdateBlock.color);\r\n\r\n return colorUpdateBlock;\r\n}\r\n\r\nfunction _CreateGradientColorUpdate(oldSystem: IParticleSystem, gradient: Array<ColorGradient>, createParticleBlock: CreateParticleBlock): ParticleGradientBlock {\r\n const colorGradientBlock = new ParticleGradientBlock(\"Color Gradient\");\r\n _CreateAndConnectContextualSource(\"gradient\", NodeParticleContextualSources.Age, colorGradientBlock.gradient);\r\n\r\n let tempColor: Nullable<ParticleInputBlock | ParticleRandomBlock> = null;\r\n let colorStart: Nullable<ParticleInputBlock | ParticleRandomBlock> = null;\r\n let colorEnd: Nullable<ParticleInputBlock | ParticleRandomBlock> = null;\r\n for (let i = 0; i < gradient.length; i++) {\r\n const gradientStep = gradient[i];\r\n const gradientValueBlock = new ParticleGradientValueBlock(\"Color Gradient Value \" + i);\r\n gradientValueBlock.reference = gradientStep.gradient;\r\n\r\n if (gradientStep.color2) {\r\n // Create a random between color1 and color2\r\n const randomColorBlock = new ParticleRandomBlock(\"Random Color for Gradient \" + i);\r\n randomColorBlock.lockMode = ParticleRandomBlockLocks.PerSystem;\r\n _CreateAndConnectInput(\"Color 1\", gradientStep.color1, randomColorBlock.min);\r\n _CreateAndConnectInput(\"Color 2\", gradientStep.color2, randomColorBlock.max);\r\n randomColorBlock.output.connectTo(gradientValueBlock.value);\r\n tempColor = randomColorBlock;\r\n } else {\r\n // Single color\r\n const input = new ParticleInputBlock(\"Color \" + i);\r\n input.value = gradientStep.color1;\r\n input.output.connectTo(gradientValueBlock.value);\r\n tempColor = input;\r\n }\r\n\r\n if (gradientStep.gradient === 0) {\r\n colorStart = tempColor;\r\n } else if (gradientStep.gradient === 1) {\r\n colorEnd = tempColor;\r\n }\r\n\r\n gradientValueBlock.output.connectTo(colorGradientBlock.inputs[i + 1]);\r\n }\r\n\r\n _UpdateCreateParticleColor(oldSystem, colorStart, colorEnd, createParticleBlock);\r\n\r\n return colorGradientBlock;\r\n}\r\n\r\nfunction _CreateBasicColorUpdate(): ParticleMathBlock {\r\n const addColorBlock = new ParticleMathBlock(\"Add Color\");\r\n addColorBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Color\", NodeParticleContextualSources.Color, addColorBlock.left);\r\n _CreateAndConnectContextualSource(\"Scaled Color Step\", NodeParticleContextualSources.ScaledColorStep, addColorBlock.right);\r\n\r\n return addColorBlock;\r\n}\r\n\r\nfunction _UpdateCreateParticleColor(\r\n oldSystem: IParticleSystem,\r\n colorStart: Nullable<ParticleInputBlock | ParticleRandomBlock>,\r\n colorEnd: Nullable<ParticleInputBlock | ParticleRandomBlock>,\r\n createParticleBlock: CreateParticleBlock\r\n): void {\r\n if (colorStart === null) {\r\n colorStart = new ParticleInputBlock(\"Color Start\");\r\n colorStart.value = oldSystem.color1;\r\n }\r\n\r\n if (colorEnd === null) {\r\n colorEnd = new ParticleInputBlock(\"Color End\");\r\n colorEnd.value = oldSystem.color2;\r\n }\r\n\r\n const randomColorBlock = new ParticleRandomBlock(\"Random color\");\r\n randomColorBlock.lockMode = ParticleRandomBlockLocks.PerSystem;\r\n colorStart.output.connectTo(randomColorBlock.min);\r\n colorEnd.output.connectTo(randomColorBlock.max);\r\n randomColorBlock.output.connectTo(createParticleBlock.color);\r\n}\r\n\r\nfunction _ClampUpdateColorAlpha(colorBlock: ParticleMathBlock | ParticleGradientBlock): ParticleConverterBlock {\r\n // Decompose color to clamp alpha\r\n const decomposeColorBlock = new ParticleConverterBlock(\"Decompose Color\");\r\n colorBlock.outputs[0].connectTo(decomposeColorBlock.colorIn);\r\n\r\n // Clamp alpha to be >= 0\r\n const maxAlphaBlock = new ParticleMathBlock(\"Alpha >= 0\");\r\n maxAlphaBlock.operation = ParticleMathBlockOperations.Max;\r\n decomposeColorBlock.wOut.connectTo(maxAlphaBlock.left);\r\n _CreateAndConnectInput(\"Zero\", 0, maxAlphaBlock.right);\r\n\r\n // Recompose color\r\n const composeColorBlock = new ParticleConverterBlock(\"Compose Color\");\r\n decomposeColorBlock.xyzOut.connectTo(composeColorBlock.xyzIn);\r\n maxAlphaBlock.output.connectTo(composeColorBlock.wIn);\r\n\r\n return composeColorBlock;\r\n}\r\n\r\nfunction _CreateDeltaModifiedInput(name: string, value: Vector3 | NodeParticleConnectionPoint): NodeParticleConnectionPoint {\r\n const multiplyBlock = new ParticleMathBlock(\"Multiply by Delta\");\r\n multiplyBlock.operation = ParticleMathBlockOperations.Multiply;\r\n if (value instanceof Vector3) {\r\n _CreateAndConnectInput(name, value, multiplyBlock.left);\r\n } else {\r\n value.connectTo(multiplyBlock.left);\r\n }\r\n _CreateAndConnectSystemSource(\"Delta\", NodeParticleSystemSources.Delta, multiplyBlock.right);\r\n\r\n return multiplyBlock.output;\r\n}\r\n\r\nfunction _CreateAndConnectInput(\r\n inputBlockName: string,\r\n value: number | Vector2 | Vector3 | Color4,\r\n targetToConnectTo: NodeParticleConnectionPoint,\r\n inputType?: NodeParticleBlockConnectionPointTypes\r\n): void {\r\n const input = new ParticleInputBlock(inputBlockName, inputType);\r\n input.value = value;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\nfunction _CreateAndConnectContextualSource(contextualBlockName: string, contextSource: NodeParticleContextualSources, targetToConnectTo: NodeParticleConnectionPoint): void {\r\n const input = new ParticleInputBlock(contextualBlockName);\r\n input.contextualValue = contextSource;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\nfunction _CreateAndConnectSystemSource(systemBlockName: string, systemSource: NodeParticleSystemSources, targetToConnectTo: NodeParticleConnectionPoint): void {\r\n const input = new ParticleInputBlock(systemBlockName);\r\n input.systemSource = systemSource;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeParticleSystemSet.helper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.helper.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAC1D,OAAO,EAAE,qCAAqC,EAAE,yDAAwE;AACxH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAA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ED,SAAS,6BAA6B,CAAC,eAAuB,EAAE,YAAuC,EAAE,iBAA8C;IACnJ,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACtD,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;IAClC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { ColorGradient } from \"core/Misc\";\r\nimport type { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { IParticleSystem } from \"core/Particles/IParticleSystem\";\r\nimport type { BoxParticleEmitter } from \"core/Particles/EmitterTypes/boxParticleEmitter\";\r\nimport type { ConeParticleEmitter } from \"core/Particles/EmitterTypes/coneParticleEmitter\";\r\nimport type { CylinderDirectedParticleEmitter, CylinderParticleEmitter } from \"core/Particles/EmitterTypes/cylinderParticleEmitter\";\r\nimport type { MeshParticleEmitter } from \"core/Particles/EmitterTypes/meshParticleEmitter\";\r\nimport type { PointParticleEmitter } from \"core/Particles/EmitterTypes/pointParticleEmitter\";\r\nimport type { SphereDirectedParticleEmitter, SphereParticleEmitter } from \"core/Particles/EmitterTypes/sphereParticleEmitter\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { IShapeBlock } from \"core/Particles/Node/Blocks/Emitters/IShapeBlock\";\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleSystemSet } from \"./nodeParticleSystemSet\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { NodeParticleSystemSources } from \"./Enums/nodeParticleSystemSources\";\r\nimport { ParticleConverterBlock } from \"./Blocks/particleConverterBlock\";\r\nimport { ParticleGradientBlock } from \"./Blocks/particleGradientBlock\";\r\nimport { ParticleGradientValueBlock } from \"./Blocks/particleGradientValueBlock\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport { ParticleRandomBlock, ParticleRandomBlockLocks } from \"./Blocks/particleRandomBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { ConeShapeBlock } from \"./Blocks/Emitters/coneShapeBlock\";\r\nimport { CylinderShapeBlock } from \"./Blocks/Emitters/cylinderShapeBlock\";\r\nimport { MeshShapeBlock } from \"./Blocks/Emitters/meshShapeBlock\";\r\nimport { PointShapeBlock } from \"./Blocks/Emitters/pointShapeBlock\";\r\nimport { SphereShapeBlock } from \"./Blocks/Emitters/sphereShapeBlock\";\r\nimport { UpdateAngleBlock } from \"./Blocks/Update/updateAngleBlock\";\r\nimport { UpdateColorBlock } from \"./Blocks/Update/updateColorBlock\";\r\nimport { UpdateDirectionBlock } from \"./Blocks/Update/updateDirectionBlock\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\n\r\n/**\r\n * Converts a ParticleSystem to a NodeParticleSystemSet.\r\n * @param name The name of the node particle system set.\r\n * @param particleSystemsList The particle systems to convert.\r\n * @returns The converted node particle system set or null if conversion failed.\r\n * #0K3AQ2#3672\r\n * #7J0NXA#4\r\n */\r\nexport async function ConvertToNodeParticleSystemSetAsync(name: string, particleSystemsList: ParticleSystem[]): Promise<Nullable<NodeParticleSystemSet>> {\r\n if (!particleSystemsList || !particleSystemsList.length) {\r\n return null;\r\n }\r\n\r\n const nodeParticleSystemSet = new NodeParticleSystemSet(name);\r\n const promises: Promise<void>[] = [];\r\n\r\n for (const particleSystem of particleSystemsList) {\r\n promises.push(_ExtractDatafromParticleSystemAsync(nodeParticleSystemSet, particleSystem));\r\n }\r\n\r\n await Promise.all(promises);\r\n return nodeParticleSystemSet;\r\n}\r\n\r\nasync function _ExtractDatafromParticleSystemAsync(newSet: NodeParticleSystemSet, oldSystem: ParticleSystem): Promise<void> {\r\n // CreateParticle block\r\n const createParticleBlock = _CreateCreateParticleBlock(oldSystem);\r\n\r\n // Emitter Shape block\r\n const shapeBlock = _CreateEmitterShapeBlock(oldSystem);\r\n createParticleBlock.particle.connectTo(shapeBlock.particle);\r\n\r\n // Update the particle position\r\n const positionUpdatedParticle = _CreateUpdateSystem(shapeBlock.output, oldSystem);\r\n\r\n // Color update\r\n const colorUpdateBlock = _CreateColorUpdateBlock(oldSystem, createParticleBlock);\r\n positionUpdatedParticle.connectTo(colorUpdateBlock.particle);\r\n\r\n // System block\r\n const newSystem = _CreateSystemBlock(oldSystem);\r\n colorUpdateBlock.output.connectTo(newSystem.particle);\r\n\r\n // Register\r\n newSet.systemBlocks.push(newSystem);\r\n}\r\n\r\nfunction _CreateSystemBlock(oldSystem: ParticleSystem): SystemBlock {\r\n const newSystem = new SystemBlock(oldSystem.name);\r\n\r\n _CreateAndConnectInput(\"Translation pivot\", oldSystem.translationPivot, newSystem.translationPivot);\r\n _CreateAndConnectInput(\"Texture mask\", oldSystem.textureMask, newSystem.textureMask);\r\n\r\n newSystem.emitRate = oldSystem.emitRate;\r\n newSystem.manualEmitCount = oldSystem.manualEmitCount;\r\n\r\n newSystem.blendMode = oldSystem.blendMode;\r\n newSystem.capacity = oldSystem.getCapacity();\r\n newSystem.targetStopDuration = oldSystem.targetStopDuration;\r\n newSystem.startDelay = oldSystem.startDelay;\r\n newSystem.targetStopDuration = oldSystem.targetStopDuration;\r\n newSystem.updateSpeed = oldSystem.updateSpeed;\r\n newSystem.preWarmCycles = oldSystem.preWarmCycles;\r\n newSystem.preWarmStepOffset = oldSystem.preWarmStepOffset;\r\n newSystem.isBillboardBased = oldSystem.isBillboardBased;\r\n newSystem.isLocal = oldSystem.isLocal;\r\n newSystem.disposeOnStop = oldSystem.disposeOnStop;\r\n\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n const url = (oldSystem.particleTexture as Texture).url || \"\";\r\n if (url) {\r\n textureBlock.url = url;\r\n } else {\r\n textureBlock.sourceTexture = oldSystem.particleTexture;\r\n }\r\n textureBlock.texture.connectTo(newSystem.texture);\r\n\r\n return newSystem;\r\n}\r\n\r\nfunction _CreateCreateParticleBlock(oldSystem: ParticleSystem): CreateParticleBlock {\r\n // Create particle\r\n const createParticleBlock = new CreateParticleBlock(\"Create Particle\");\r\n\r\n // Size\r\n const randomSizeBlock = new ParticleRandomBlock(\"Random size\");\r\n _CreateAndConnectInput(\"Min size\", oldSystem.minSize, randomSizeBlock.min);\r\n _CreateAndConnectInput(\"Max size\", oldSystem.maxSize, randomSizeBlock.max);\r\n randomSizeBlock.output.connectTo(createParticleBlock.size);\r\n\r\n // Scale\r\n const randomScaleBlock = new ParticleRandomBlock(\"Random Scale\");\r\n _CreateAndConnectInput(\"Min Scale\", new Vector2(oldSystem.minScaleX, oldSystem.minScaleY), randomScaleBlock.min);\r\n _CreateAndConnectInput(\"Max Scale\", new Vector2(oldSystem.maxScaleX, oldSystem.maxScaleY), randomScaleBlock.max);\r\n randomScaleBlock.output.connectTo(createParticleBlock.scale);\r\n\r\n // Color is handled when we do the color update block to manage gradients\r\n\r\n // Dead color\r\n _CreateAndConnectInput(\"Dead Color\", oldSystem.colorDead, createParticleBlock.colorDead);\r\n\r\n // Emit power (Speed)\r\n const randomEmitPowerBlock = new ParticleRandomBlock(\"Random Emit Power\");\r\n _CreateAndConnectInput(\"Min Emit Power\", oldSystem.minEmitPower, randomEmitPowerBlock.min);\r\n _CreateAndConnectInput(\"Max Emit Power\", oldSystem.maxEmitPower, randomEmitPowerBlock.max);\r\n randomEmitPowerBlock.output.connectTo(createParticleBlock.emitPower);\r\n\r\n // Angle (rotation)\r\n const randomRotationBlock = new ParticleRandomBlock(\"Random Rotation\");\r\n _CreateAndConnectInput(\"Min Rotation\", oldSystem.minInitialRotation, randomRotationBlock.min);\r\n _CreateAndConnectInput(\"Max Rotation\", oldSystem.maxInitialRotation, randomRotationBlock.max);\r\n randomRotationBlock.output.connectTo(createParticleBlock.angle);\r\n\r\n // Lifetime\r\n const randomLifetimeBlock = new ParticleRandomBlock(\"Random Lifetime\");\r\n _CreateAndConnectInput(\"Min Lifetime\", oldSystem.minLifeTime, randomLifetimeBlock.min);\r\n _CreateAndConnectInput(\"Max Lifetime\", oldSystem.maxLifeTime, randomLifetimeBlock.max);\r\n randomLifetimeBlock.output.connectTo(createParticleBlock.lifeTime);\r\n\r\n return createParticleBlock;\r\n}\r\n\r\nfunction _CreateEmitterShapeBlock(oldSystem: IParticleSystem): IShapeBlock {\r\n const emitter = oldSystem.particleEmitterType;\r\n if (!emitter) {\r\n throw new Error(\"Particle system has no emitter type.\");\r\n }\r\n\r\n let shapeBlock: Nullable<IShapeBlock> = null;\r\n switch (emitter.getClassName()) {\r\n case \"BoxParticleEmitter\": {\r\n const source = emitter as BoxParticleEmitter;\r\n shapeBlock = new BoxShapeBlock(\"Box Shape\");\r\n\r\n const target = shapeBlock as BoxShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n _CreateAndConnectInput(\"Min Emit Box\", source.minEmitBox, target.minEmitBox);\r\n _CreateAndConnectInput(\"Max Emit Box\", source.maxEmitBox, target.maxEmitBox);\r\n break;\r\n }\r\n case \"ConeParticleEmitter\": {\r\n const source = emitter as ConeParticleEmitter;\r\n shapeBlock = new ConeShapeBlock(\"Cone Shape\");\r\n\r\n const target = shapeBlock as ConeShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Angle\", source.angle, target.angle);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Height Range\", source.heightRange, target.heightRange);\r\n _CreateAndConnectInput(\"Emit From Spawn Point Only\", source.emitFromSpawnPointOnly ? 1 : 0, target.emitFromSpawnPointOnly, NodeParticleBlockConnectionPointTypes.Int);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"CustomParticleEmitter\": {\r\n // Custom emitter is not supported in nodes yet\r\n throw new Error(\"CustomParticleEmitter is not supported in Node Particle System.\");\r\n }\r\n case \"CylinderParticleEmitter\": {\r\n const source = emitter as CylinderParticleEmitter;\r\n shapeBlock = new CylinderShapeBlock(\"Cylinder Shape\");\r\n\r\n const target = shapeBlock as CylinderShapeBlock;\r\n _CreateAndConnectInput(\"Height\", source.height, target.height);\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"CylinderDirectedParticleEmitter\": {\r\n const source = emitter as CylinderDirectedParticleEmitter;\r\n shapeBlock = new CylinderShapeBlock(\"Cylinder Shape\");\r\n\r\n const target = shapeBlock as CylinderShapeBlock;\r\n _CreateAndConnectInput(\"Height\", source.height, target.height);\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"HemisphericParticleEmitter\": {\r\n // Hemispheric emitter is not supported in nodes yet\r\n throw new Error(\"HemisphericParticleEmitter is not supported in Node Particle System.\");\r\n }\r\n case \"MeshParticleEmitter\": {\r\n const source = emitter as MeshParticleEmitter;\r\n shapeBlock = new MeshShapeBlock(\"Mesh Shape\");\r\n\r\n const target = shapeBlock as MeshShapeBlock;\r\n target.useMeshNormalsForDirection = source.useMeshNormalsForDirection;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n\r\n target.mesh = source.mesh as Mesh;\r\n break;\r\n }\r\n case \"PointParticleEmitter\": {\r\n const source = emitter as PointParticleEmitter;\r\n shapeBlock = new PointShapeBlock(\"Point Shape\");\r\n\r\n const target = shapeBlock as PointShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"SphereParticleEmitter\": {\r\n const source = emitter as SphereParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"SphereDirectedParticleEmitter\": {\r\n const source = emitter as SphereDirectedParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n }\r\n\r\n if (!shapeBlock) {\r\n throw new Error(`Unsupported particle emitter type: ${emitter.getClassName()}`);\r\n }\r\n\r\n return shapeBlock;\r\n}\r\n\r\nfunction _CreateUpdateSystem(inputParticle: NodeParticleConnectionPoint, oldSystem: IParticleSystem): NodeParticleConnectionPoint {\r\n let outputUpdate: NodeParticleConnectionPoint = inputParticle;\r\n\r\n if (oldSystem.minAngularSpeed !== 0 || oldSystem.maxAngularSpeed !== 0) {\r\n outputUpdate = _CreateAngularSpeedUpdate(outputUpdate, oldSystem.minAngularSpeed, oldSystem.maxAngularSpeed);\r\n }\r\n\r\n outputUpdate = _CreatePositionUpdate(outputUpdate, oldSystem.isLocal);\r\n\r\n if (oldSystem.gravity.equalsToFloats(0, 0, 0) === false) {\r\n outputUpdate = _CreateGravityUpdate(outputUpdate, oldSystem.gravity);\r\n }\r\n\r\n return outputUpdate;\r\n}\r\n\r\nfunction _CreateAngularSpeedUpdate(inputParticle: NodeParticleConnectionPoint, minAngularSpeed: number, maxAngularSpeed: number): NodeParticleConnectionPoint {\r\n // Random value between for the angular speed of the particle\r\n const randomAngularSpeedBlock = new ParticleRandomBlock(\"Random Angular Speed\");\r\n _CreateAndConnectInput(\"Min Angular Speed\", minAngularSpeed, randomAngularSpeedBlock.min);\r\n _CreateAndConnectInput(\"Max Angular Speed\", maxAngularSpeed, randomAngularSpeedBlock.max);\r\n\r\n // Create the angular speed delta\r\n const angleSpeedDeltaOutput = _CreateDeltaModifiedInput(\"Angular Speed\", randomAngularSpeedBlock.output);\r\n\r\n // Add it to the angle\r\n const addAngle = new ParticleMathBlock(\"Add Angular Speed to Angle\");\r\n addAngle.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Angle\", NodeParticleContextualSources.Angle, addAngle.left);\r\n angleSpeedDeltaOutput.connectTo(addAngle.right);\r\n\r\n // Update the particle angle\r\n const updateAngle = new UpdateAngleBlock(\"Angle Update with Angular Speed\");\r\n inputParticle.connectTo(updateAngle.particle);\r\n addAngle.output.connectTo(updateAngle.angle);\r\n\r\n return updateAngle.output;\r\n}\r\n\r\nfunction _CreatePositionUpdate(inputParticle: NodeParticleConnectionPoint, isLocal: boolean): NodeParticleConnectionPoint {\r\n // Update the particle position\r\n const updatePosition = new UpdatePositionBlock(\"Position Update\");\r\n inputParticle.connectTo(updatePosition.particle);\r\n\r\n if (isLocal) {\r\n _CreateAndConnectContextualSource(\"Local Position Updated\", NodeParticleContextualSources.LocalPositionUpdated, updatePosition.position);\r\n } else {\r\n // Calculate the new position\r\n const addPositionBlock = new ParticleMathBlock(\"Add Position\");\r\n addPositionBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Position\", NodeParticleContextualSources.Position, addPositionBlock.left);\r\n _CreateAndConnectContextualSource(\"Scaled Direction\", NodeParticleContextualSources.ScaledDirection, addPositionBlock.right);\r\n addPositionBlock.output.connectTo(updatePosition.position);\r\n }\r\n\r\n return updatePosition.output;\r\n}\r\n\r\nfunction _CreateGravityUpdate(inputParticle: NodeParticleConnectionPoint, gravity: Vector3): NodeParticleConnectionPoint {\r\n // Create the gravity delta\r\n const gravityDeltaOutput = _CreateDeltaModifiedInput(\"Gravity\", gravity);\r\n\r\n // Add it to the direction\r\n const addDirectionBlock = new ParticleMathBlock(\"Add Gravity to Direction\");\r\n addDirectionBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, addDirectionBlock.left);\r\n gravityDeltaOutput.connectTo(addDirectionBlock.right);\r\n\r\n // Update the particle direction\r\n const updateDirection = new UpdateDirectionBlock(\"Direction Update with Gravity\");\r\n inputParticle.connectTo(updateDirection.particle);\r\n addDirectionBlock.output.connectTo(updateDirection.direction);\r\n\r\n return updateDirection.output;\r\n}\r\n\r\nfunction _CreateColorUpdateBlock(oldSystem: IParticleSystem, createParticleBlock: CreateParticleBlock): UpdateColorBlock {\r\n if (!oldSystem) {\r\n throw new Error(\"Invalid particle system\");\r\n }\r\n\r\n // Calculate the color\r\n const colorGradients = oldSystem.getColorGradients();\r\n let colorBlock: Nullable<ParticleGradientBlock | ParticleMathBlock> = null;\r\n if (colorGradients && colorGradients.length > 0) {\r\n colorBlock = _CreateGradientColorUpdate(oldSystem, colorGradients, createParticleBlock);\r\n } else {\r\n colorBlock = _CreateBasicColorUpdate(oldSystem, createParticleBlock);\r\n }\r\n\r\n // Clamp alpha >= 0\r\n const clampedColor = _ClampUpdateColorAlpha(colorBlock);\r\n\r\n // Create the color update block\r\n const colorUpdateBlock = new UpdateColorBlock(\"Color update\");\r\n clampedColor.colorOut.connectTo(colorUpdateBlock.color);\r\n\r\n return colorUpdateBlock;\r\n}\r\n\r\nfunction _CreateGradientColorUpdate(oldSystem: IParticleSystem, gradient: Array<ColorGradient>, createParticleBlock: CreateParticleBlock): ParticleGradientBlock {\r\n const colorGradientBlock = new ParticleGradientBlock(\"Color Gradient\");\r\n _CreateAndConnectContextualSource(\"gradient\", NodeParticleContextualSources.Age, colorGradientBlock.gradient);\r\n\r\n let tempColor: Nullable<ParticleInputBlock | ParticleRandomBlock> = null;\r\n let colorStart: Nullable<ParticleInputBlock | ParticleRandomBlock> = null;\r\n let colorEnd: Nullable<ParticleInputBlock | ParticleRandomBlock> = null;\r\n for (let i = 0; i < gradient.length; i++) {\r\n const gradientStep = gradient[i];\r\n const gradientValueBlock = new ParticleGradientValueBlock(\"Color Gradient Value \" + i);\r\n gradientValueBlock.reference = gradientStep.gradient;\r\n\r\n if (gradientStep.color2) {\r\n // Create a random between color1 and color2\r\n const randomColorBlock = new ParticleRandomBlock(\"Random Color for Gradient \" + i);\r\n randomColorBlock.lockMode = ParticleRandomBlockLocks.PerSystem;\r\n _CreateAndConnectInput(\"Color 1\", gradientStep.color1, randomColorBlock.min);\r\n _CreateAndConnectInput(\"Color 2\", gradientStep.color2, randomColorBlock.max);\r\n randomColorBlock.output.connectTo(gradientValueBlock.value);\r\n tempColor = randomColorBlock;\r\n } else {\r\n // Single color\r\n const input = new ParticleInputBlock(\"Color \" + i);\r\n input.value = gradientStep.color1;\r\n input.output.connectTo(gradientValueBlock.value);\r\n tempColor = input;\r\n }\r\n\r\n if (gradientStep.gradient === 0) {\r\n colorStart = tempColor;\r\n } else if (gradientStep.gradient === 1) {\r\n colorEnd = tempColor;\r\n }\r\n\r\n gradientValueBlock.output.connectTo(colorGradientBlock.inputs[i + 1]);\r\n }\r\n\r\n _UpdateCreateParticleColor(oldSystem, colorStart, colorEnd, createParticleBlock);\r\n\r\n return colorGradientBlock;\r\n}\r\n\r\nfunction _CreateBasicColorUpdate(oldSystem: IParticleSystem, createParticleBlock: CreateParticleBlock): ParticleMathBlock {\r\n const addColorBlock = new ParticleMathBlock(\"Add Color\");\r\n addColorBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Color\", NodeParticleContextualSources.Color, addColorBlock.left);\r\n _CreateAndConnectContextualSource(\"Scaled Color Step\", NodeParticleContextualSources.ScaledColorStep, addColorBlock.right);\r\n\r\n _UpdateCreateParticleColor(oldSystem, null, null, createParticleBlock);\r\n\r\n return addColorBlock;\r\n}\r\n\r\nfunction _UpdateCreateParticleColor(\r\n oldSystem: IParticleSystem,\r\n colorStart: Nullable<ParticleInputBlock | ParticleRandomBlock>,\r\n colorEnd: Nullable<ParticleInputBlock | ParticleRandomBlock>,\r\n createParticleBlock: CreateParticleBlock\r\n): void {\r\n if (colorStart === null) {\r\n colorStart = new ParticleInputBlock(\"Color Start\");\r\n colorStart.value = oldSystem.color1;\r\n }\r\n\r\n if (colorEnd === null) {\r\n colorEnd = new ParticleInputBlock(\"Color End\");\r\n colorEnd.value = oldSystem.color2;\r\n }\r\n\r\n const randomColorBlock = new ParticleRandomBlock(\"Random color\");\r\n randomColorBlock.lockMode = ParticleRandomBlockLocks.PerParticle;\r\n colorStart.output.connectTo(randomColorBlock.min);\r\n colorEnd.output.connectTo(randomColorBlock.max);\r\n randomColorBlock.output.connectTo(createParticleBlock.color);\r\n}\r\n\r\nfunction _ClampUpdateColorAlpha(colorBlock: ParticleMathBlock | ParticleGradientBlock): ParticleConverterBlock {\r\n // Decompose color to clamp alpha\r\n const decomposeColorBlock = new ParticleConverterBlock(\"Decompose Color\");\r\n colorBlock.outputs[0].connectTo(decomposeColorBlock.colorIn);\r\n\r\n // Clamp alpha to be >= 0\r\n const maxAlphaBlock = new ParticleMathBlock(\"Alpha >= 0\");\r\n maxAlphaBlock.operation = ParticleMathBlockOperations.Max;\r\n decomposeColorBlock.wOut.connectTo(maxAlphaBlock.left);\r\n _CreateAndConnectInput(\"Zero\", 0, maxAlphaBlock.right);\r\n\r\n // Recompose color\r\n const composeColorBlock = new ParticleConverterBlock(\"Compose Color\");\r\n decomposeColorBlock.xyzOut.connectTo(composeColorBlock.xyzIn);\r\n maxAlphaBlock.output.connectTo(composeColorBlock.wIn);\r\n\r\n return composeColorBlock;\r\n}\r\n\r\nfunction _CreateDeltaModifiedInput(name: string, value: Vector3 | NodeParticleConnectionPoint): NodeParticleConnectionPoint {\r\n const multiplyBlock = new ParticleMathBlock(\"Multiply by Delta\");\r\n multiplyBlock.operation = ParticleMathBlockOperations.Multiply;\r\n if (value instanceof Vector3) {\r\n _CreateAndConnectInput(name, value, multiplyBlock.left);\r\n } else {\r\n value.connectTo(multiplyBlock.left);\r\n }\r\n _CreateAndConnectSystemSource(\"Delta\", NodeParticleSystemSources.Delta, multiplyBlock.right);\r\n\r\n return multiplyBlock.output;\r\n}\r\n\r\nfunction _CreateAndConnectInput(\r\n inputBlockName: string,\r\n value: number | Vector2 | Vector3 | Color4,\r\n targetToConnectTo: NodeParticleConnectionPoint,\r\n inputType?: NodeParticleBlockConnectionPointTypes\r\n): void {\r\n const input = new ParticleInputBlock(inputBlockName, inputType);\r\n input.value = value;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\nfunction _CreateAndConnectContextualSource(contextualBlockName: string, contextSource: NodeParticleContextualSources, targetToConnectTo: NodeParticleConnectionPoint): void {\r\n const input = new ParticleInputBlock(contextualBlockName);\r\n input.contextualValue = contextSource;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\nfunction _CreateAndConnectSystemSource(systemBlockName: string, systemSource: NodeParticleSystemSources, targetToConnectTo: NodeParticleConnectionPoint): void {\r\n const input = new ParticleInputBlock(systemBlockName);\r\n input.systemSource = systemSource;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n"]}
|
|
@@ -248,7 +248,7 @@ export class NodeParticleSystemSet {
|
|
|
248
248
|
// Texture
|
|
249
249
|
const textureBlock = new ParticleTextureSourceBlock("Texture");
|
|
250
250
|
textureBlock.texture.connectTo(system.texture);
|
|
251
|
-
textureBlock.url = "https://assets.babylonjs.com/textures/flare.png";
|
|
251
|
+
textureBlock.url = Tools.GetAssetUrl("https://assets.babylonjs.com/core/textures/flare.png");
|
|
252
252
|
this._systemBlocks.push(system);
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeParticleSystemSet.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iCAA6B;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,+CAA2C;AACzE,OAAO,EAAE,UAAU,EAAE,iCAA6B;AAClD,OAAO,EAAE,QAAQ,EAAE,gCAA4B;AAC/C,OAAO,EAAE,UAAU,EAAE,iCAA6B;AAClD,OAAO,EAAE,SAAS,EAAE,mCAA+B;AACnD,OAAO,EAAE,KAAK,EAAE,4BAAwB;AACxC,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE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";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { NodeParticleBuildState } from \"./nodeParticleBuildState\";\r\nimport type { NodeParticleBlock } from \"./nodeParticleBlock\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { GetClass } from \"core/Misc/typeStore\";\r\nimport { WebRequest } from \"core/Misc/webRequest\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport type { ParticleTeleportOutBlock } from \"./Blocks/Teleport/particleTeleportOutBlock\";\r\nimport type { ParticleTeleportInBlock } from \"./Blocks/Teleport/particleTeleportInBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\nimport type { Nullable } from \"../../types\";\r\n\r\n// declare NODEPARTICLEEDITOR namespace for compilation issue\r\ndeclare let NODEPARTICLEEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Interface used to configure the node particle editor\r\n */\r\nexport interface INodeParticleEditorOptions {\r\n /** Define the URL to load node editor script from */\r\n editorURL?: string;\r\n /** Additional configuration for the NPE */\r\n nodeEditorConfig?: {\r\n backgroundColor?: Color4;\r\n };\r\n}\r\n\r\n/**\r\n * Defines a set of particle systems defined as a node graph.\r\n * NPE: #K6F1ZB#1\r\n * PG: #ZT509U#1\r\n */\r\nexport class NodeParticleSystemSet {\r\n private _systemBlocks: SystemBlock[] = [];\r\n private _buildId: number = 0;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/nodeParticleEditor/babylon.nodeParticleEditor.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /**\r\n * Snippet ID if the material was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeParticleBlock[] = [];\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://npe.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Observable raised when the particle set is built\r\n */\r\n public onBuildObservable = new Observable<NodeParticleSystemSet>();\r\n\r\n /**\r\n * The name of the set\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the set\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n /**\r\n * Gets the system blocks\r\n */\r\n public get systemBlocks(): SystemBlock[] {\r\n return this._systemBlocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public get inputBlocks() {\r\n const blocks: ParticleInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as ParticleInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Get a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName(name: string) {\r\n let result = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate(predicate: (block: NodeParticleBlock) => boolean) {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get an input block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required input block or null if not found\r\n */\r\n public getInputBlockByPredicate(predicate: (block: ParticleInputBlock) => boolean): Nullable<ParticleInputBlock> {\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput && predicate(block as ParticleInputBlock)) {\r\n return block as ParticleInputBlock;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n /**\r\n * Creates a new set\r\n * @param name defines the name of the set\r\n */\r\n public constructor(name: string) {\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Gets the current class name of the node particle set e.g. \"NodeParticleSystemSet\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeParticleSystemSet\";\r\n }\r\n\r\n private _initializeBlock(node: NodeParticleBlock, autoConfigure = true) {\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block, autoConfigure);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private BJSNODEPARTICLEEDITOR = this._getGlobalNodeParticleEditor();\r\n\r\n /** Get the editor from bundle or global\r\n * @returns the global NPE\r\n */\r\n private _getGlobalNodeParticleEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODEPARTICLEEDITOR !== \"undefined\") {\r\n return NODEPARTICLEEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeParticleEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Creates the node editor window.\r\n * @param additionalConfig Define the configuration of the editor\r\n */\r\n private _createNodeParticleEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeParticleSet: this,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODEPARTICLEEDITOR.NodeParticleEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Launch the node particle editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n public async editAsync(config?: INodeParticleEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODEPARTICLEEDITOR = this.BJSNODEPARTICLEEDITOR || this._getGlobalNodeParticleEditor();\r\n if (typeof this.BJSNODEPARTICLEEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeParticleSystemSet.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODEPARTICLEEDITOR = this.BJSNODEPARTICLEEDITOR || this._getGlobalNodeParticleEditor();\r\n this._createNodeParticleEditor(config?.nodeEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeParticleEditor(config?.nodeEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Builds the particle system set from the defined blocks.\r\n * @param scene defines the hosting scene\r\n * @param verbose defines whether to log detailed information during the build process (false by default)\r\n * @returns a promise that resolves to the built particle system set\r\n */\r\n public async buildAsync(scene: Scene, verbose = false): Promise<ParticleSystemSet> {\r\n return await new Promise<ParticleSystemSet>((resolve) => {\r\n const output = new ParticleSystemSet();\r\n\r\n // Initialize all blocks\r\n for (const block of this._systemBlocks) {\r\n this._initializeBlock(block);\r\n }\r\n\r\n // Build the blocks\r\n for (const block of this.systemBlocks) {\r\n const state = new NodeParticleBuildState();\r\n state.buildId = this._buildId++;\r\n state.scene = scene;\r\n state.verbose = verbose;\r\n\r\n const system = block.createSystem(state);\r\n system._source = this;\r\n system._blockReference = block._internalId;\r\n\r\n // Errors\r\n state.emitErrors();\r\n\r\n output.systems.push(system);\r\n }\r\n\r\n this.onBuildObservable.notifyObservers(this);\r\n\r\n resolve(output);\r\n });\r\n }\r\n\r\n /**\r\n * Clear the current node particle set\r\n */\r\n public clear() {\r\n this.attachedBlocks.length = 0;\r\n this._systemBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Clear the current set and restore it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Main system\r\n const system = new SystemBlock(\"Particle system\");\r\n\r\n // Update position\r\n const updatePositionBlock = new UpdatePositionBlock(\"Update position\");\r\n updatePositionBlock.output.connectTo(system.particle);\r\n\r\n // Contextual inputs\r\n const positionBlock = new ParticleInputBlock(\"Position\");\r\n positionBlock.contextualValue = NodeParticleContextualSources.Position;\r\n const directionBlock = new ParticleInputBlock(\"Scaled direction\");\r\n directionBlock.contextualValue = NodeParticleContextualSources.ScaledDirection;\r\n\r\n // Add\r\n const addBlock = new ParticleMathBlock(\"Add\");\r\n addBlock.operation = ParticleMathBlockOperations.Add;\r\n positionBlock.output.connectTo(addBlock.left);\r\n directionBlock.output.connectTo(addBlock.right);\r\n addBlock.output.connectTo(updatePositionBlock.position);\r\n\r\n // Create particle\r\n const createParticleBlock = new CreateParticleBlock(\"Create particle\");\r\n\r\n // Shape\r\n const emitterShape = new BoxShapeBlock(\"Box shape\");\r\n createParticleBlock.particle.connectTo(emitterShape.particle);\r\n emitterShape.output.connectTo(updatePositionBlock.particle);\r\n\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n textureBlock.texture.connectTo(system.texture);\r\n textureBlock.url = \"https://assets.babylonjs.com/textures/flare.png\";\r\n\r\n this._systemBlocks.push(system);\r\n }\r\n\r\n /**\r\n * Remove a block from the current system set\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeParticleBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block.isSystem) {\r\n const index = this._systemBlocks.indexOf(block as SystemBlock);\r\n if (index > -1) {\r\n this._systemBlocks.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the particle set\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeParticleBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const block: NodeParticleBlock = new blockType();\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n\r\n if (block.isSystem) {\r\n this._systemBlocks.push(block as SystemBlock);\r\n }\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as ParticleTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as ParticleTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: { [key: number]: number } = {};\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeParticleBlock, source: any, map: { [key: number]: NodeParticleBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serializes this node particle set in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole node particle set will be saved)\r\n * @returns the serialized particle system set object\r\n */\r\n public serialize(selectedBlocks?: NodeParticleBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeParticleBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeParticleSystemSet\";\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current particle system set.\r\n * @param name defines the name to use for the new particle system set\r\n * @returns the cloned particle system set\r\n */\r\n public clone(name: string): NodeParticleSystemSet {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeParticleSystemSet(name), this);\r\n clone.name = name;\r\n clone.snippetId = this.snippetId;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node particle set set to default basic configuration\r\n * @param name defines the name of the particle set\r\n * @returns a new NodeParticleSystemSet\r\n */\r\n public static CreateDefault(name: string) {\r\n const nodeParticleSet = new NodeParticleSystemSet(name);\r\n\r\n nodeParticleSet.setToDefault();\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from parsed data\r\n * @param source defines the JSON representation of the particle set\r\n * @returns a new node particle set\r\n */\r\n public static Parse(source: any): NodeParticleSystemSet {\r\n const nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(source.name), source, null);\r\n\r\n nodeParticleSet.parseSerializedObject(source);\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from a snippet saved in a remote file\r\n * @param name defines the name of the node particle set to create\r\n * @param url defines the url to load from\r\n * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)\r\n * @returns a promise that will resolve to the new node particle set\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromFileAsync(name: string, url: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const serializationObject = JSON.parse(request.responseText);\r\n if (!nodeParticleSet) {\r\n nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(name), serializationObject, null);\r\n }\r\n\r\n nodeParticleSet.parseSerializedObject(serializationObject);\r\n\r\n resolve(nodeParticleSet);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the node particle system set\");\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates a node particle set from a snippet saved by the node particle editor\r\n * @param snippetId defines the snippet to load\r\n * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)\r\n * @returns a promise that will resolve to the new node particle set\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeParticleSystemSet.CreateDefault(\"blank\"));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeParticle);\r\n\r\n if (!nodeParticleSet) {\r\n nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(snippetId), serializationObject, null);\r\n }\r\n\r\n nodeParticleSet.parseSerializedObject(serializationObject);\r\n nodeParticleSet.snippetId = snippetId;\r\n\r\n try {\r\n resolve(nodeParticleSet);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeParticleSystemSet.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iCAA6B;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,+CAA2C;AACzE,OAAO,EAAE,UAAU,EAAE,iCAA6B;AAClD,OAAO,EAAE,QAAQ,EAAE,gCAA4B;AAC/C,OAAO,EAAE,UAAU,EAAE,iCAA6B;AAClD,OAAO,EAAE,SAAS,EAAE,mCAA+B;AACnD,OAAO,EAAE,KAAK,EAAE,4BAAwB;AACxC,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,q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BACzE,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;wBAE7D,IAAI,CAAC,eAAe,EAAE,CAAC;4BACnB,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,qBAAqB,CAAC,SAAS,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;wBACvH,CAAC;wBAED,eAAe,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;wBAC3D,eAAe,CAAC,SAAS,GAAG,SAAS,CAAC;wBAEtC,IAAI,CAAC;4BACD,OAAO,CAAC,eAAe,CAAC,CAAC;wBAC7B,CAAC;wBAAC,OAAO,GAAG,EAAE,CAAC;4BACX,2EAA2E;4BAC3E,MAAM,CAAC,GAAG,CAAC,CAAC;wBAChB,CAAC;oBACL,CAAC;yBAAM,CAAC;wBACJ,2EAA2E;wBAC3E,MAAM,CAAC,6BAA6B,GAAG,SAAS,CAAC,CAAC;oBACtD,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AArlBD,gDAAgD;AAClC,+BAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,cAAc,CAAC,OAAO,mDAAmD,AAAxG,CAAyG;AAEhI,sCAAsC;AACxB,gCAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AA2BzC;IADN,SAAS,EAAE;mDACQ;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;sDACE","sourcesContent":["import { serialize } from \"core/Misc/decorators\";\r\nimport { ParticleSystemSet } from \"../particleSystemSet\";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { NodeParticleBuildState } from \"./nodeParticleBuildState\";\r\nimport type { NodeParticleBlock } from \"./nodeParticleBlock\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { GetClass } from \"core/Misc/typeStore\";\r\nimport { WebRequest } from \"core/Misc/webRequest\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { AbstractEngine } from \"core/Engines/abstractEngine\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport type { ParticleTeleportOutBlock } from \"./Blocks/Teleport/particleTeleportOutBlock\";\r\nimport type { ParticleTeleportInBlock } from \"./Blocks/Teleport/particleTeleportInBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\nimport type { Nullable } from \"../../types\";\r\n\r\n// declare NODEPARTICLEEDITOR namespace for compilation issue\r\ndeclare let NODEPARTICLEEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Interface used to configure the node particle editor\r\n */\r\nexport interface INodeParticleEditorOptions {\r\n /** Define the URL to load node editor script from */\r\n editorURL?: string;\r\n /** Additional configuration for the NPE */\r\n nodeEditorConfig?: {\r\n backgroundColor?: Color4;\r\n };\r\n}\r\n\r\n/**\r\n * Defines a set of particle systems defined as a node graph.\r\n * NPE: #K6F1ZB#1\r\n * PG: #ZT509U#1\r\n */\r\nexport class NodeParticleSystemSet {\r\n private _systemBlocks: SystemBlock[] = [];\r\n private _buildId: number = 0;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${AbstractEngine.Version}/nodeParticleEditor/babylon.nodeParticleEditor.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /**\r\n * Snippet ID if the material was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeParticleBlock[] = [];\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://npe.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Observable raised when the particle set is built\r\n */\r\n public onBuildObservable = new Observable<NodeParticleSystemSet>();\r\n\r\n /**\r\n * The name of the set\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the set\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n /**\r\n * Gets the system blocks\r\n */\r\n public get systemBlocks(): SystemBlock[] {\r\n return this._systemBlocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public get inputBlocks() {\r\n const blocks: ParticleInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as ParticleInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Get a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName(name: string) {\r\n let result = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate(predicate: (block: NodeParticleBlock) => boolean) {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get an input block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required input block or null if not found\r\n */\r\n public getInputBlockByPredicate(predicate: (block: ParticleInputBlock) => boolean): Nullable<ParticleInputBlock> {\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput && predicate(block as ParticleInputBlock)) {\r\n return block as ParticleInputBlock;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n /**\r\n * Creates a new set\r\n * @param name defines the name of the set\r\n */\r\n public constructor(name: string) {\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Gets the current class name of the node particle set e.g. \"NodeParticleSystemSet\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeParticleSystemSet\";\r\n }\r\n\r\n private _initializeBlock(node: NodeParticleBlock, autoConfigure = true) {\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block, autoConfigure);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private BJSNODEPARTICLEEDITOR = this._getGlobalNodeParticleEditor();\r\n\r\n /** Get the editor from bundle or global\r\n * @returns the global NPE\r\n */\r\n private _getGlobalNodeParticleEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODEPARTICLEEDITOR !== \"undefined\") {\r\n return NODEPARTICLEEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeParticleEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Creates the node editor window.\r\n * @param additionalConfig Define the configuration of the editor\r\n */\r\n private _createNodeParticleEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeParticleSet: this,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODEPARTICLEEDITOR.NodeParticleEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Launch the node particle editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n public async editAsync(config?: INodeParticleEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODEPARTICLEEDITOR = this.BJSNODEPARTICLEEDITOR || this._getGlobalNodeParticleEditor();\r\n if (typeof this.BJSNODEPARTICLEEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeParticleSystemSet.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODEPARTICLEEDITOR = this.BJSNODEPARTICLEEDITOR || this._getGlobalNodeParticleEditor();\r\n this._createNodeParticleEditor(config?.nodeEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeParticleEditor(config?.nodeEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Builds the particle system set from the defined blocks.\r\n * @param scene defines the hosting scene\r\n * @param verbose defines whether to log detailed information during the build process (false by default)\r\n * @returns a promise that resolves to the built particle system set\r\n */\r\n public async buildAsync(scene: Scene, verbose = false): Promise<ParticleSystemSet> {\r\n return await new Promise<ParticleSystemSet>((resolve) => {\r\n const output = new ParticleSystemSet();\r\n\r\n // Initialize all blocks\r\n for (const block of this._systemBlocks) {\r\n this._initializeBlock(block);\r\n }\r\n\r\n // Build the blocks\r\n for (const block of this.systemBlocks) {\r\n const state = new NodeParticleBuildState();\r\n state.buildId = this._buildId++;\r\n state.scene = scene;\r\n state.verbose = verbose;\r\n\r\n const system = block.createSystem(state);\r\n system._source = this;\r\n system._blockReference = block._internalId;\r\n\r\n // Errors\r\n state.emitErrors();\r\n\r\n output.systems.push(system);\r\n }\r\n\r\n this.onBuildObservable.notifyObservers(this);\r\n\r\n resolve(output);\r\n });\r\n }\r\n\r\n /**\r\n * Clear the current node particle set\r\n */\r\n public clear() {\r\n this.attachedBlocks.length = 0;\r\n this._systemBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Clear the current set and restore it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Main system\r\n const system = new SystemBlock(\"Particle system\");\r\n\r\n // Update position\r\n const updatePositionBlock = new UpdatePositionBlock(\"Update position\");\r\n updatePositionBlock.output.connectTo(system.particle);\r\n\r\n // Contextual inputs\r\n const positionBlock = new ParticleInputBlock(\"Position\");\r\n positionBlock.contextualValue = NodeParticleContextualSources.Position;\r\n const directionBlock = new ParticleInputBlock(\"Scaled direction\");\r\n directionBlock.contextualValue = NodeParticleContextualSources.ScaledDirection;\r\n\r\n // Add\r\n const addBlock = new ParticleMathBlock(\"Add\");\r\n addBlock.operation = ParticleMathBlockOperations.Add;\r\n positionBlock.output.connectTo(addBlock.left);\r\n directionBlock.output.connectTo(addBlock.right);\r\n addBlock.output.connectTo(updatePositionBlock.position);\r\n\r\n // Create particle\r\n const createParticleBlock = new CreateParticleBlock(\"Create particle\");\r\n\r\n // Shape\r\n const emitterShape = new BoxShapeBlock(\"Box shape\");\r\n createParticleBlock.particle.connectTo(emitterShape.particle);\r\n emitterShape.output.connectTo(updatePositionBlock.particle);\r\n\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n textureBlock.texture.connectTo(system.texture);\r\n textureBlock.url = Tools.GetAssetUrl(\"https://assets.babylonjs.com/core/textures/flare.png\");\r\n\r\n this._systemBlocks.push(system);\r\n }\r\n\r\n /**\r\n * Remove a block from the current system set\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeParticleBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block.isSystem) {\r\n const index = this._systemBlocks.indexOf(block as SystemBlock);\r\n if (index > -1) {\r\n this._systemBlocks.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the particle set\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeParticleBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const block: NodeParticleBlock = new blockType();\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n\r\n if (block.isSystem) {\r\n this._systemBlocks.push(block as SystemBlock);\r\n }\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as ParticleTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as ParticleTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: { [key: number]: number } = {};\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeParticleBlock, source: any, map: { [key: number]: NodeParticleBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serializes this node particle set in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole node particle set will be saved)\r\n * @returns the serialized particle system set object\r\n */\r\n public serialize(selectedBlocks?: NodeParticleBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeParticleBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeParticleSystemSet\";\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current particle system set.\r\n * @param name defines the name to use for the new particle system set\r\n * @returns the cloned particle system set\r\n */\r\n public clone(name: string): NodeParticleSystemSet {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeParticleSystemSet(name), this);\r\n clone.name = name;\r\n clone.snippetId = this.snippetId;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node particle set set to default basic configuration\r\n * @param name defines the name of the particle set\r\n * @returns a new NodeParticleSystemSet\r\n */\r\n public static CreateDefault(name: string) {\r\n const nodeParticleSet = new NodeParticleSystemSet(name);\r\n\r\n nodeParticleSet.setToDefault();\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from parsed data\r\n * @param source defines the JSON representation of the particle set\r\n * @returns a new node particle set\r\n */\r\n public static Parse(source: any): NodeParticleSystemSet {\r\n const nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(source.name), source, null);\r\n\r\n nodeParticleSet.parseSerializedObject(source);\r\n\r\n return nodeParticleSet;\r\n }\r\n\r\n /**\r\n * Creates a node particle set from a snippet saved in a remote file\r\n * @param name defines the name of the node particle set to create\r\n * @param url defines the url to load from\r\n * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)\r\n * @returns a promise that will resolve to the new node particle set\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromFileAsync(name: string, url: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const serializationObject = JSON.parse(request.responseText);\r\n if (!nodeParticleSet) {\r\n nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(name), serializationObject, null);\r\n }\r\n\r\n nodeParticleSet.parseSerializedObject(serializationObject);\r\n\r\n resolve(nodeParticleSet);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the node particle system set\");\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates a node particle set from a snippet saved by the node particle editor\r\n * @param snippetId defines the snippet to load\r\n * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)\r\n * @returns a promise that will resolve to the new node particle set\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeParticleSystemSet.CreateDefault(\"blank\"));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeParticle);\r\n\r\n if (!nodeParticleSet) {\r\n nodeParticleSet = SerializationHelper.Parse(() => new NodeParticleSystemSet(snippetId), serializationObject, null);\r\n }\r\n\r\n nodeParticleSet.parseSerializedObject(serializationObject);\r\n nodeParticleSet.snippetId = snippetId;\r\n\r\n try {\r\n resolve(nodeParticleSet);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -47,7 +47,7 @@ export declare function _CreateDragData(particle: Particle, system: ThinParticle
|
|
|
47
47
|
export declare function _ProcessDragGradients(particle: Particle, system: ThinParticleSystem): void;
|
|
48
48
|
/** Noise */
|
|
49
49
|
/** @internal */
|
|
50
|
-
export declare function _CreateNoiseData(particle: Particle,
|
|
50
|
+
export declare function _CreateNoiseData(particle: Particle, _system: ThinParticleSystem): void;
|
|
51
51
|
/** @internal */
|
|
52
52
|
export declare function _ProcessNoise(particle: Particle, system: ThinParticleSystem): void;
|
|
53
53
|
/** Gravity */
|
|
@@ -64,7 +64,7 @@ export declare function _CreateStartSizeGradientsData(particle: Particle, system
|
|
|
64
64
|
export declare function _ProcessSizeGradients(particle: Particle, system: ThinParticleSystem): void;
|
|
65
65
|
/** Ramp */
|
|
66
66
|
/** @internal */
|
|
67
|
-
export declare function _CreateRampData(particle: Particle,
|
|
67
|
+
export declare function _CreateRampData(particle: Particle, _system: ThinParticleSystem): void;
|
|
68
68
|
/** Remap */
|
|
69
69
|
/** @internal */
|
|
70
70
|
export declare function _ProcessRemapGradients(particle: Particle, system: ThinParticleSystem): void;
|
|
@@ -177,7 +177,7 @@ export function _ProcessDragGradients(particle, system) {
|
|
|
177
177
|
}
|
|
178
178
|
/** Noise */
|
|
179
179
|
/** @internal */
|
|
180
|
-
export function _CreateNoiseData(particle,
|
|
180
|
+
export function _CreateNoiseData(particle, _system) {
|
|
181
181
|
if (particle._randomNoiseCoordinates1) {
|
|
182
182
|
particle._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random());
|
|
183
183
|
particle._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random());
|
|
@@ -253,7 +253,7 @@ export function _ProcessSizeGradients(particle, system) {
|
|
|
253
253
|
}
|
|
254
254
|
/** Ramp */
|
|
255
255
|
/** @internal */
|
|
256
|
-
export function _CreateRampData(particle,
|
|
256
|
+
export function _CreateRampData(particle, _system) {
|
|
257
257
|
particle.remapData = new Vector4(0, 1, 0, 1);
|
|
258
258
|
}
|
|
259
259
|
/** Remap */
|