@onerjs/core 8.30.8 → 8.30.9

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.
Files changed (98) hide show
  1. package/Cameras/camera.js +1 -0
  2. package/Cameras/camera.js.map +1 -1
  3. package/Cameras/targetCamera.js +0 -4
  4. package/Cameras/targetCamera.js.map +1 -1
  5. package/Culling/ray.core.js +1 -1
  6. package/Culling/ray.core.js.map +1 -1
  7. package/Decorators/nodeDecorator.d.ts +9 -7
  8. package/Decorators/nodeDecorator.js +9 -7
  9. package/Decorators/nodeDecorator.js.map +1 -1
  10. package/Engines/WebGPU/webgpuTextureManager.js +2 -2
  11. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  12. package/Engines/abstractEngine.js +2 -2
  13. package/Engines/abstractEngine.js.map +1 -1
  14. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +1 -1
  15. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  16. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +1 -1
  17. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
  18. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +1 -1
  19. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js +1 -1
  20. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +1 -1
  21. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.js +1 -1
  22. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +1 -1
  23. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.js +1 -1
  24. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.js +1 -1
  25. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.js +1 -1
  26. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.js.map +1 -1
  27. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js +1 -1
  28. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js.map +1 -1
  29. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +6 -0
  30. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +26 -0
  31. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  32. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
  33. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +48 -22
  34. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  35. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +3 -3
  36. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  37. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +1 -1
  38. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +1 -1
  39. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
  40. package/FrameGraph/Node/nodeRenderGraph.js +2 -1
  41. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  42. package/FrameGraph/Passes/{cullPass.d.ts → objectListPass.d.ts} +8 -8
  43. package/FrameGraph/Passes/{cullPass.js → objectListPass.js} +9 -9
  44. package/FrameGraph/Passes/objectListPass.js.map +1 -0
  45. package/FrameGraph/Passes/renderPass.d.ts +6 -2
  46. package/FrameGraph/Passes/renderPass.js +14 -2
  47. package/FrameGraph/Passes/renderPass.js.map +1 -1
  48. package/FrameGraph/Tasks/Misc/cullObjectsTask.js +2 -2
  49. package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
  50. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +8 -0
  51. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +10 -0
  52. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  53. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +8 -0
  54. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +13 -0
  55. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  56. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +1 -1
  57. package/FrameGraph/Tasks/Texture/clearTextureTask.js +7 -5
  58. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  59. package/FrameGraph/frameGraph.d.ts +10 -4
  60. package/FrameGraph/frameGraph.js +22 -9
  61. package/FrameGraph/frameGraph.js.map +1 -1
  62. package/FrameGraph/frameGraphTask.js +3 -3
  63. package/FrameGraph/frameGraphTask.js.map +1 -1
  64. package/FrameGraph/index.d.ts +1 -1
  65. package/FrameGraph/index.js +1 -1
  66. package/FrameGraph/index.js.map +1 -1
  67. package/Materials/floatingOriginMatrixOverrides.js +19 -0
  68. package/Materials/floatingOriginMatrixOverrides.js.map +1 -1
  69. package/Materials/shaderMaterial.d.ts +9 -0
  70. package/Materials/shaderMaterial.js +35 -0
  71. package/Materials/shaderMaterial.js.map +1 -1
  72. package/Particles/EmitterTypes/coneParticleEmitter.d.ts +6 -4
  73. package/Particles/EmitterTypes/coneParticleEmitter.js +18 -12
  74. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  75. package/Particles/EmitterTypes/customParticleEmitter.d.ts +5 -3
  76. package/Particles/EmitterTypes/customParticleEmitter.js +8 -6
  77. package/Particles/EmitterTypes/customParticleEmitter.js.map +1 -1
  78. package/Particles/Node/Blocks/Emitters/coneShapeBlock.d.ts +15 -4
  79. package/Particles/Node/Blocks/Emitters/coneShapeBlock.js +66 -36
  80. package/Particles/Node/Blocks/Emitters/coneShapeBlock.js.map +1 -1
  81. package/Particles/Node/Blocks/Emitters/customShapeBlock.d.ts +13 -9
  82. package/Particles/Node/Blocks/Emitters/customShapeBlock.js +36 -23
  83. package/Particles/Node/Blocks/Emitters/customShapeBlock.js.map +1 -1
  84. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.d.ts +6 -0
  85. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +22 -1
  86. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -1
  87. package/Particles/Node/Blocks/systemBlock.d.ts +4 -4
  88. package/Particles/Node/Blocks/systemBlock.js +8 -12
  89. package/Particles/Node/Blocks/systemBlock.js.map +1 -1
  90. package/Particles/Node/nodeParticleSystemSet.helper.js +153 -19
  91. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  92. package/Particles/thinParticleSystem.js +1 -1
  93. package/Particles/thinParticleSystem.js.map +1 -1
  94. package/package.json +1 -1
  95. package/scene.d.ts +1 -3
  96. package/scene.js +8 -7
  97. package/scene.js.map +1 -1
  98. package/FrameGraph/Passes/cullPass.js.map +0 -1
@@ -1,5 +1,4 @@
1
1
  import { Vector2, Vector3 } from "../../Maths/math.vector.js";
2
- import { NodeParticleBlockConnectionPointTypes } from "./Enums/nodeParticleBlockConnectionPointTypes.js";
3
2
  import { NodeParticleSystemSet } from "./nodeParticleSystemSet.js";
4
3
  import { NodeParticleContextualSources } from "./Enums/nodeParticleContextualSources.js";
5
4
  import { NodeParticleSystemSources } from "./Enums/nodeParticleSystemSources.js";
@@ -15,6 +14,7 @@ import { CreateParticleBlock } from "./Blocks/Emitters/createParticleBlock.js";
15
14
  import { BoxShapeBlock } from "./Blocks/Emitters/boxShapeBlock.js";
16
15
  import { ConeShapeBlock } from "./Blocks/Emitters/coneShapeBlock.js";
17
16
  import { CylinderShapeBlock } from "./Blocks/Emitters/cylinderShapeBlock.js";
17
+ import { CustomShapeBlock } from "./Blocks/Emitters/customShapeBlock.js";
18
18
  import { MeshShapeBlock } from "./Blocks/Emitters/meshShapeBlock.js";
19
19
  import { PointShapeBlock } from "./Blocks/Emitters/pointShapeBlock.js";
20
20
  import { SphereShapeBlock } from "./Blocks/Emitters/sphereShapeBlock.js";
@@ -37,14 +37,14 @@ export async function ConvertToNodeParticleSystemSetAsync(name, particleSystemsL
37
37
  const nodeParticleSystemSet = new NodeParticleSystemSet(name);
38
38
  const promises = [];
39
39
  for (const particleSystem of particleSystemsList) {
40
- promises.push(_ExtractDatafromParticleSystemAsync(nodeParticleSystemSet, particleSystem));
40
+ promises.push(_ExtractDatafromParticleSystemAsync(nodeParticleSystemSet, particleSystem, {}));
41
41
  }
42
42
  await Promise.all(promises);
43
43
  return nodeParticleSystemSet;
44
44
  }
45
- async function _ExtractDatafromParticleSystemAsync(newSet, oldSystem) {
45
+ async function _ExtractDatafromParticleSystemAsync(newSet, oldSystem, context) {
46
46
  // CreateParticle block
47
- const createParticleBlock = _CreateCreateParticleBlock(oldSystem);
47
+ const createParticleBlock = _CreateCreateParticleBlockGroup(oldSystem, context);
48
48
  // Emitter Shape block
49
49
  const shapeBlock = _CreateEmitterShapeBlock(oldSystem);
50
50
  createParticleBlock.particle.connectTo(shapeBlock.particle);
@@ -54,22 +54,22 @@ async function _ExtractDatafromParticleSystemAsync(newSet, oldSystem) {
54
54
  const colorUpdateBlock = _CreateColorUpdateBlock(oldSystem, createParticleBlock);
55
55
  positionUpdatedParticle.connectTo(colorUpdateBlock.particle);
56
56
  // System block
57
- const newSystem = _CreateSystemBlock(oldSystem);
57
+ const newSystem = _CreateSystemBlock(oldSystem, context);
58
58
  colorUpdateBlock.output.connectTo(newSystem.particle);
59
59
  // Register
60
60
  newSet.systemBlocks.push(newSystem);
61
61
  }
62
- function _CreateSystemBlock(oldSystem) {
62
+ function _CreateSystemBlock(oldSystem, context) {
63
63
  const newSystem = new SystemBlock(oldSystem.name);
64
64
  _CreateAndConnectInput("Translation pivot", oldSystem.translationPivot, newSystem.translationPivot);
65
65
  _CreateAndConnectInput("Texture mask", oldSystem.textureMask, newSystem.textureMask);
66
+ const targetStopDurationOutput = _CreateTargetStopDurationInputBlock(oldSystem, context);
67
+ targetStopDurationOutput.connectTo(newSystem.targetStopDuration);
66
68
  newSystem.emitRate = oldSystem.emitRate;
67
69
  newSystem.manualEmitCount = oldSystem.manualEmitCount;
68
70
  newSystem.blendMode = oldSystem.blendMode;
69
71
  newSystem.capacity = oldSystem.getCapacity();
70
- newSystem.targetStopDuration = oldSystem.targetStopDuration;
71
72
  newSystem.startDelay = oldSystem.startDelay;
72
- newSystem.targetStopDuration = oldSystem.targetStopDuration;
73
73
  newSystem.updateSpeed = oldSystem.updateSpeed;
74
74
  newSystem.preWarmCycles = oldSystem.preWarmCycles;
75
75
  newSystem.preWarmStepOffset = oldSystem.preWarmStepOffset;
@@ -88,9 +88,12 @@ function _CreateSystemBlock(oldSystem) {
88
88
  textureBlock.texture.connectTo(newSystem.texture);
89
89
  return newSystem;
90
90
  }
91
- function _CreateCreateParticleBlock(oldSystem) {
91
+ // Create Particle Block Group functions
92
+ function _CreateCreateParticleBlockGroup(oldSystem, context) {
92
93
  // Create particle
93
94
  const createParticleBlock = new CreateParticleBlock("Create Particle");
95
+ // Lifetime
96
+ _CreateParticleLifetimeBlockGroup(oldSystem, context).connectTo(createParticleBlock.lifeTime);
94
97
  // Size
95
98
  const randomSizeBlock = new ParticleRandomBlock("Random size");
96
99
  _CreateAndConnectInput("Min size", oldSystem.minSize, randomSizeBlock.min);
@@ -114,13 +117,27 @@ function _CreateCreateParticleBlock(oldSystem) {
114
117
  _CreateAndConnectInput("Min Rotation", oldSystem.minInitialRotation, randomRotationBlock.min);
115
118
  _CreateAndConnectInput("Max Rotation", oldSystem.maxInitialRotation, randomRotationBlock.max);
116
119
  randomRotationBlock.output.connectTo(createParticleBlock.angle);
117
- // Lifetime
118
- const randomLifetimeBlock = new ParticleRandomBlock("Random Lifetime");
119
- _CreateAndConnectInput("Min Lifetime", oldSystem.minLifeTime, randomLifetimeBlock.min);
120
- _CreateAndConnectInput("Max Lifetime", oldSystem.maxLifeTime, randomLifetimeBlock.max);
121
- randomLifetimeBlock.output.connectTo(createParticleBlock.lifeTime);
122
120
  return createParticleBlock;
123
121
  }
122
+ /**
123
+ * Creates the group of blocks that represent the particle lifetime
124
+ * @param oldSystem The old particle system to migrate
125
+ * @param context The system migration context
126
+ * @returns The output of the group of blocks that represent the particle lifetime
127
+ */
128
+ function _CreateParticleLifetimeBlockGroup(oldSystem, context) {
129
+ if (oldSystem.targetStopDuration && oldSystem._lifeTimeGradients && oldSystem._lifeTimeGradients.length > 0) {
130
+ context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);
131
+ const gradientBlockGroupOutput = _CreateGradientBlockGroup(context.timeToStopTimeRatioBlockGroupOutput, oldSystem._lifeTimeGradients);
132
+ return gradientBlockGroupOutput;
133
+ }
134
+ else {
135
+ const randomLifetimeBlock = new ParticleRandomBlock("Random Lifetime");
136
+ _CreateAndConnectInput("Min Lifetime", oldSystem.minLifeTime, randomLifetimeBlock.min);
137
+ _CreateAndConnectInput("Max Lifetime", oldSystem.maxLifeTime, randomLifetimeBlock.max);
138
+ return randomLifetimeBlock.output;
139
+ }
140
+ }
124
141
  function _CreateEmitterShapeBlock(oldSystem) {
125
142
  const emitter = oldSystem.particleEmitterType;
126
143
  if (!emitter) {
@@ -142,17 +159,35 @@ function _CreateEmitterShapeBlock(oldSystem) {
142
159
  const source = emitter;
143
160
  shapeBlock = new ConeShapeBlock("Cone Shape");
144
161
  const target = shapeBlock;
162
+ target.emitFromSpawnPointOnly = source.emitFromSpawnPointOnly;
145
163
  _CreateAndConnectInput("Radius", source.radius, target.radius);
146
164
  _CreateAndConnectInput("Angle", source.angle, target.angle);
147
165
  _CreateAndConnectInput("Radius Range", source.radiusRange, target.radiusRange);
148
166
  _CreateAndConnectInput("Height Range", source.heightRange, target.heightRange);
149
- _CreateAndConnectInput("Emit From Spawn Point Only", source.emitFromSpawnPointOnly ? 1 : 0, target.emitFromSpawnPointOnly, NodeParticleBlockConnectionPointTypes.Int);
150
167
  _CreateAndConnectInput("Direction Randomizer", source.directionRandomizer, target.directionRandomizer);
151
168
  break;
152
169
  }
170
+ case "ConeDirectedParticleEmitter": {
171
+ const source = emitter;
172
+ shapeBlock = new ConeShapeBlock("Cone Shape");
173
+ const target = shapeBlock;
174
+ target.emitFromSpawnPointOnly = source.emitFromSpawnPointOnly;
175
+ _CreateAndConnectInput("Radius", source.radius, target.radius);
176
+ _CreateAndConnectInput("Angle", source.angle, target.angle);
177
+ _CreateAndConnectInput("Radius Range", source.radiusRange, target.radiusRange);
178
+ _CreateAndConnectInput("Height Range", source.heightRange, target.heightRange);
179
+ _CreateAndConnectInput("Direction 1", source.direction1, target.direction1);
180
+ _CreateAndConnectInput("Direction 2", source.direction2, target.direction2);
181
+ break;
182
+ }
153
183
  case "CustomParticleEmitter": {
154
- // Custom emitter is not supported in nodes yet
155
- throw new Error("CustomParticleEmitter is not supported in Node Particle System.");
184
+ const source = emitter;
185
+ shapeBlock = new CustomShapeBlock("Custom Shape");
186
+ const target = shapeBlock;
187
+ target.particlePositionGenerator = source.particlePositionGenerator;
188
+ target.particleDestinationGenerator = source.particleDestinationGenerator;
189
+ target.particleDirectionGenerator = source.particleDirectionGenerator;
190
+ break;
156
191
  }
157
192
  case "CylinderParticleEmitter": {
158
193
  const source = emitter;
@@ -176,8 +211,14 @@ function _CreateEmitterShapeBlock(oldSystem) {
176
211
  break;
177
212
  }
178
213
  case "HemisphericParticleEmitter": {
179
- // Hemispheric emitter is not supported in nodes yet
180
- throw new Error("HemisphericParticleEmitter is not supported in Node Particle System.");
214
+ const source = emitter;
215
+ shapeBlock = new SphereShapeBlock("Sphere Shape");
216
+ const target = shapeBlock;
217
+ target.isHemispheric = true;
218
+ _CreateAndConnectInput("Radius", source.radius, target.radius);
219
+ _CreateAndConnectInput("Radius Range", source.radiusRange, target.radiusRange);
220
+ _CreateAndConnectInput("Direction Randomizer", source.directionRandomizer, target.directionRandomizer);
221
+ break;
181
222
  }
182
223
  case "MeshParticleEmitter": {
183
224
  const source = emitter;
@@ -404,4 +445,97 @@ function _CreateAndConnectSystemSource(systemBlockName, systemSource, targetToCo
404
445
  input.systemSource = systemSource;
405
446
  input.output.connectTo(targetToConnectTo);
406
447
  }
448
+ /**
449
+ * Creates the target stop duration input block, as it can be shared in multiple places
450
+ * This block is stored in the context so the same block is shared in the graph
451
+ * @param oldSystem The old particle system to migrate
452
+ * @param context The system migration context
453
+ * @returns
454
+ */
455
+ function _CreateTargetStopDurationInputBlock(oldSystem, context) {
456
+ // If we have already created the target stop duration input block, return it
457
+ if (context.targetStopDurationBlockOutput) {
458
+ return context.targetStopDurationBlockOutput;
459
+ }
460
+ // Create the target stop duration input block if not already created
461
+ const targetStopDurationInputBlock = new ParticleInputBlock("Target Stop Duration");
462
+ targetStopDurationInputBlock.value = oldSystem.targetStopDuration;
463
+ // Save the output in our context to avoid regenerating it again
464
+ context.targetStopDurationBlockOutput = targetStopDurationInputBlock.output;
465
+ return context.targetStopDurationBlockOutput;
466
+ }
467
+ /**
468
+ * Create a group of blocks that calculates the ratio between the actual frame and the target stop duration, clamped between 0 and 1.
469
+ * This is used to simulate the behavior of the old particle system where several particle gradient values are affected by the target stop duration.
470
+ * This block group is stored in the context so the same group is shared in the graph
471
+ * @param oldSystem The old particle system to migrate
472
+ * @param context The system migration context
473
+ * @returns The ratio block output connection point
474
+ */
475
+ function _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context) {
476
+ // If we have already generated this group, return it
477
+ if (context.timeToStopTimeRatioBlockGroupOutput) {
478
+ return context.timeToStopTimeRatioBlockGroupOutput;
479
+ }
480
+ context.targetStopDurationBlockOutput = _CreateTargetStopDurationInputBlock(oldSystem, context);
481
+ // Find the ratio between the actual frame and the target stop duration
482
+ const ratio = new ParticleMathBlock("Frame/Stop Ratio");
483
+ ratio.operation = ParticleMathBlockOperations.Divide;
484
+ _CreateAndConnectSystemSource("Actual Frame", NodeParticleSystemSources.Time, ratio.left);
485
+ context.targetStopDurationBlockOutput.connectTo(ratio.right);
486
+ // Make sure values is >=0
487
+ const clampMin = new ParticleMathBlock("Clamp Min 0");
488
+ clampMin.operation = ParticleMathBlockOperations.Max;
489
+ _CreateAndConnectInput("Zero", 0, clampMin.left);
490
+ ratio.output.connectTo(clampMin.right);
491
+ // Make sure values is <=1
492
+ const clampMax = new ParticleMathBlock("Clamp Max 1");
493
+ clampMax.operation = ParticleMathBlockOperations.Min;
494
+ _CreateAndConnectInput("One", 1, clampMax.left);
495
+ clampMin.output.connectTo(clampMax.right);
496
+ // Save the group output in our context to avoid regenerating it again
497
+ context.timeToStopTimeRatioBlockGroupOutput = clampMax.output;
498
+ return context.timeToStopTimeRatioBlockGroupOutput;
499
+ }
500
+ /**
501
+ * Creates the blocks that represent a gradient
502
+ * @param gradientSelector The value that determines which gradient to use
503
+ * @param gradientValues The list of gradient values
504
+ * @returns The output connection point of the gradient block
505
+ */
506
+ function _CreateGradientBlockGroup(gradientSelector, gradientValues) {
507
+ // Create the gradient block and connect the value that controls the gradient selection
508
+ const gradientBlock = new ParticleGradientBlock("Gradient Block");
509
+ gradientSelector.connectTo(gradientBlock.gradient);
510
+ // Create the gradient values
511
+ for (let i = 0; i < gradientValues.length; i++) {
512
+ const gradientValueBlockGroupOutput = _CreateGradientValueBlockGroup(gradientValues[i], i);
513
+ gradientValueBlockGroupOutput.connectTo(gradientBlock.inputs[i + 1]);
514
+ }
515
+ return gradientBlock.output;
516
+ }
517
+ /**
518
+ * Creates the blocks that represent a gradient value
519
+ * This can be either a single value or a random between two values
520
+ * @param gradientStep The gradient step data
521
+ * @param index The index of the gradient step
522
+ * @returns The output connection point of the gradient value block
523
+ */
524
+ function _CreateGradientValueBlockGroup(gradientStep, index) {
525
+ const gradientValueBlock = new ParticleGradientValueBlock("Gradient Value " + index);
526
+ gradientValueBlock.reference = gradientStep.gradient;
527
+ if (gradientStep.factor2 !== undefined) {
528
+ // Create a random between value1 and value2
529
+ const randomBlock = new ParticleRandomBlock("Random Gradient Value " + index);
530
+ randomBlock.lockMode = ParticleRandomBlockLocks.PerParticle;
531
+ _CreateAndConnectInput("Value 1", gradientStep.factor1, randomBlock.min);
532
+ _CreateAndConnectInput("Value 2", gradientStep.factor2, randomBlock.max);
533
+ randomBlock.output.connectTo(gradientValueBlock.value);
534
+ }
535
+ else {
536
+ // Single value
537
+ _CreateAndConnectInput("Value", gradientStep.factor1, gradientValueBlock.value);
538
+ }
539
+ return gradientValueBlock.output;
540
+ }
407
541
  //# sourceMappingURL=nodeParticleSystemSet.helper.js.map
@@ -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,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAA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AED,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 { 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"]}
1
+ {"version":3,"file":"nodeParticleSystemSet.helper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.helper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAC1D,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,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,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AC;IACpF,CAAC;IAED,OAAO,kBAAkB,CAAC,MAAM,CAAC;AACrC,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, FactorGradient } 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 { ConeDirectedParticleEmitter, ConeParticleEmitter } from \"core/Particles/EmitterTypes/coneParticleEmitter\";\r\nimport type { CustomParticleEmitter } from \"core/Particles/EmitterTypes/customParticleEmitter\";\r\nimport type { CylinderDirectedParticleEmitter, CylinderParticleEmitter } from \"core/Particles/EmitterTypes/cylinderParticleEmitter\";\r\nimport type { HemisphericParticleEmitter } from \"core/Particles/EmitterTypes/hemisphericParticleEmitter\";\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\nimport type { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\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 { CustomShapeBlock } from \"./Blocks/Emitters/customShapeBlock\";\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/** Represents blocks or groups of blocks that can be used in multiple places in the graph, so they are stored in this context to be reused */\r\ntype ConversionContext = {\r\n targetStopDurationBlockOutput: NodeParticleConnectionPoint;\r\n timeToStopTimeRatioBlockGroupOutput: NodeParticleConnectionPoint;\r\n};\r\n\r\ntype RuntimeConversionContext = Partial<ConversionContext>;\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, context: RuntimeConversionContext): Promise<void> {\r\n // CreateParticle block\r\n const createParticleBlock = _CreateCreateParticleBlockGroup(oldSystem, context);\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, context);\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, context: RuntimeConversionContext): 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 const targetStopDurationOutput = _CreateTargetStopDurationInputBlock(oldSystem, context);\r\n targetStopDurationOutput.connectTo(newSystem.targetStopDuration);\r\n\r\n newSystem.emitRate = oldSystem.emitRate;\r\n newSystem.manualEmitCount = oldSystem.manualEmitCount;\r\n newSystem.blendMode = oldSystem.blendMode;\r\n newSystem.capacity = oldSystem.getCapacity();\r\n newSystem.startDelay = oldSystem.startDelay;\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\n// Create Particle Block Group functions\r\n\r\nfunction _CreateCreateParticleBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): CreateParticleBlock {\r\n // Create particle\r\n const createParticleBlock = new CreateParticleBlock(\"Create Particle\");\r\n\r\n // Lifetime\r\n _CreateParticleLifetimeBlockGroup(oldSystem, context).connectTo(createParticleBlock.lifeTime);\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 return createParticleBlock;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle lifetime\r\n * @param oldSystem The old particle system to migrate\r\n * @param context The system migration context\r\n * @returns The output of the group of blocks that represent the particle lifetime\r\n */\r\nfunction _CreateParticleLifetimeBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n if (oldSystem.targetStopDuration && oldSystem._lifeTimeGradients && oldSystem._lifeTimeGradients.length > 0) {\r\n context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);\r\n const gradientBlockGroupOutput = _CreateGradientBlockGroup(context.timeToStopTimeRatioBlockGroupOutput, oldSystem._lifeTimeGradients);\r\n return gradientBlockGroupOutput;\r\n } else {\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 return randomLifetimeBlock.output;\r\n }\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 target.emitFromSpawnPointOnly = source.emitFromSpawnPointOnly;\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(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"ConeDirectedParticleEmitter\": {\r\n const source = emitter as ConeDirectedParticleEmitter;\r\n shapeBlock = new ConeShapeBlock(\"Cone Shape\");\r\n\r\n const target = shapeBlock as ConeShapeBlock;\r\n target.emitFromSpawnPointOnly = source.emitFromSpawnPointOnly;\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(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"CustomParticleEmitter\": {\r\n const source = emitter as CustomParticleEmitter;\r\n shapeBlock = new CustomShapeBlock(\"Custom Shape\");\r\n\r\n const target = shapeBlock as CustomShapeBlock;\r\n target.particlePositionGenerator = source.particlePositionGenerator;\r\n target.particleDestinationGenerator = source.particleDestinationGenerator;\r\n target.particleDirectionGenerator = source.particleDirectionGenerator;\r\n break;\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 const source = emitter as HemisphericParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n target.isHemispheric = true;\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 \"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\r\n/**\r\n * Creates the target stop duration input block, as it can be shared in multiple places\r\n * This block is stored in the context so the same block is shared in the graph\r\n * @param oldSystem The old particle system to migrate\r\n * @param context The system migration context\r\n * @returns\r\n */\r\nfunction _CreateTargetStopDurationInputBlock(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // If we have already created the target stop duration input block, return it\r\n if (context.targetStopDurationBlockOutput) {\r\n return context.targetStopDurationBlockOutput;\r\n }\r\n\r\n // Create the target stop duration input block if not already created\r\n const targetStopDurationInputBlock = new ParticleInputBlock(\"Target Stop Duration\");\r\n targetStopDurationInputBlock.value = oldSystem.targetStopDuration;\r\n\r\n // Save the output in our context to avoid regenerating it again\r\n context.targetStopDurationBlockOutput = targetStopDurationInputBlock.output;\r\n return context.targetStopDurationBlockOutput;\r\n}\r\n\r\n/**\r\n * Create a group of blocks that calculates the ratio between the actual frame and the target stop duration, clamped between 0 and 1.\r\n * This is used to simulate the behavior of the old particle system where several particle gradient values are affected by the target stop duration.\r\n * This block group is stored in the context so the same group is shared in the graph\r\n * @param oldSystem The old particle system to migrate\r\n * @param context The system migration context\r\n * @returns The ratio block output connection point\r\n */\r\nfunction _CreateTimeToStopTimeRatioBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // If we have already generated this group, return it\r\n if (context.timeToStopTimeRatioBlockGroupOutput) {\r\n return context.timeToStopTimeRatioBlockGroupOutput;\r\n }\r\n\r\n context.targetStopDurationBlockOutput = _CreateTargetStopDurationInputBlock(oldSystem, context);\r\n\r\n // Find the ratio between the actual frame and the target stop duration\r\n const ratio = new ParticleMathBlock(\"Frame/Stop Ratio\");\r\n ratio.operation = ParticleMathBlockOperations.Divide;\r\n _CreateAndConnectSystemSource(\"Actual Frame\", NodeParticleSystemSources.Time, ratio.left);\r\n context.targetStopDurationBlockOutput.connectTo(ratio.right);\r\n\r\n // Make sure values is >=0\r\n const clampMin = new ParticleMathBlock(\"Clamp Min 0\");\r\n clampMin.operation = ParticleMathBlockOperations.Max;\r\n _CreateAndConnectInput(\"Zero\", 0, clampMin.left);\r\n ratio.output.connectTo(clampMin.right);\r\n\r\n // Make sure values is <=1\r\n const clampMax = new ParticleMathBlock(\"Clamp Max 1\");\r\n clampMax.operation = ParticleMathBlockOperations.Min;\r\n _CreateAndConnectInput(\"One\", 1, clampMax.left);\r\n clampMin.output.connectTo(clampMax.right);\r\n\r\n // Save the group output in our context to avoid regenerating it again\r\n context.timeToStopTimeRatioBlockGroupOutput = clampMax.output;\r\n return context.timeToStopTimeRatioBlockGroupOutput;\r\n}\r\n\r\n/**\r\n * Creates the blocks that represent a gradient\r\n * @param gradientSelector The value that determines which gradient to use\r\n * @param gradientValues The list of gradient values\r\n * @returns The output connection point of the gradient block\r\n */\r\nfunction _CreateGradientBlockGroup(gradientSelector: NodeParticleConnectionPoint, gradientValues: Array<FactorGradient>): NodeParticleConnectionPoint {\r\n // Create the gradient block and connect the value that controls the gradient selection\r\n const gradientBlock = new ParticleGradientBlock(\"Gradient Block\");\r\n gradientSelector.connectTo(gradientBlock.gradient);\r\n\r\n // Create the gradient values\r\n for (let i = 0; i < gradientValues.length; i++) {\r\n const gradientValueBlockGroupOutput = _CreateGradientValueBlockGroup(gradientValues[i], i);\r\n gradientValueBlockGroupOutput.connectTo(gradientBlock.inputs[i + 1]);\r\n }\r\n\r\n return gradientBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the blocks that represent a gradient value\r\n * This can be either a single value or a random between two values\r\n * @param gradientStep The gradient step data\r\n * @param index The index of the gradient step\r\n * @returns The output connection point of the gradient value block\r\n */\r\nfunction _CreateGradientValueBlockGroup(gradientStep: FactorGradient, index: number): NodeParticleConnectionPoint {\r\n const gradientValueBlock = new ParticleGradientValueBlock(\"Gradient Value \" + index);\r\n gradientValueBlock.reference = gradientStep.gradient;\r\n\r\n if (gradientStep.factor2 !== undefined) {\r\n // Create a random between value1 and value2\r\n const randomBlock = new ParticleRandomBlock(\"Random Gradient Value \" + index);\r\n randomBlock.lockMode = ParticleRandomBlockLocks.PerParticle;\r\n _CreateAndConnectInput(\"Value 1\", gradientStep.factor1, randomBlock.min);\r\n _CreateAndConnectInput(\"Value 2\", gradientStep.factor2, randomBlock.max);\r\n randomBlock.output.connectTo(gradientValueBlock.value);\r\n } else {\r\n // Single value\r\n _CreateAndConnectInput(\"Value\", gradientStep.factor1, gradientValueBlock.value);\r\n }\r\n\r\n return gradientValueBlock.output;\r\n}\r\n"]}
@@ -351,7 +351,7 @@ export class ThinParticleSystem extends BaseParticleSystem {
351
351
  /** @internal */
352
352
  this._onBeforeDrawParticlesObservable = null;
353
353
  /** @internal */
354
- this._emitFromParticle = (particle) => {
354
+ this._emitFromParticle = (_particle) => {
355
355
  // Do nothing
356
356
  };
357
357
  // start of sub system methods