@babylonjs/core 8.45.2 → 8.45.4

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 (78) hide show
  1. package/AudioV2/webAudio/components/webAudioParameterComponent.js +1 -3
  2. package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
  3. package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +4 -0
  4. package/Cameras/Inputs/geospatialCameraPointersInput.js +56 -3
  5. package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
  6. package/Cameras/geospatialCamera.d.ts +3 -2
  7. package/Cameras/geospatialCamera.js +4 -4
  8. package/Cameras/geospatialCamera.js.map +1 -1
  9. package/Cameras/touchCamera.js +1 -1
  10. package/Cameras/touchCamera.js.map +1 -1
  11. package/Engines/Native/nativeHelpers.js +7 -0
  12. package/Engines/Native/nativeHelpers.js.map +1 -1
  13. package/Engines/Native/nativeInterfaces.d.ts +2 -0
  14. package/Engines/Native/nativeInterfaces.js.map +1 -1
  15. package/Engines/abstractEngine.js +2 -2
  16. package/Engines/abstractEngine.js.map +1 -1
  17. package/FrameGraph/Node/nodeRenderGraph.d.ts +0 -5
  18. package/FrameGraph/Node/nodeRenderGraph.js +0 -7
  19. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  20. package/FrameGraph/frameGraph.d.ts +0 -6
  21. package/FrameGraph/frameGraph.js +0 -23
  22. package/FrameGraph/frameGraph.js.map +1 -1
  23. package/FrameGraph/frameGraphObjectList.d.ts +0 -1
  24. package/FrameGraph/frameGraphObjectList.js +0 -1
  25. package/FrameGraph/frameGraphObjectList.js.map +1 -1
  26. package/FrameGraph/frameGraphRenderContext.d.ts +0 -1
  27. package/FrameGraph/frameGraphRenderContext.js +0 -1
  28. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  29. package/FrameGraph/frameGraphRenderTarget.d.ts +0 -1
  30. package/FrameGraph/frameGraphRenderTarget.js +0 -1
  31. package/FrameGraph/frameGraphRenderTarget.js.map +1 -1
  32. package/FrameGraph/frameGraphTask.d.ts +0 -1
  33. package/FrameGraph/frameGraphTask.js +0 -1
  34. package/FrameGraph/frameGraphTask.js.map +1 -1
  35. package/FrameGraph/frameGraphTextureManager.d.ts +0 -1
  36. package/FrameGraph/frameGraphTextureManager.js +0 -1
  37. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  38. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +6 -0
  39. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +100 -41
  40. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  41. package/Particles/Node/Blocks/Update/updateFlowMapBlock.d.ts +4 -14
  42. package/Particles/Node/Blocks/Update/updateFlowMapBlock.js +9 -27
  43. package/Particles/Node/Blocks/Update/updateFlowMapBlock.js.map +1 -1
  44. package/Particles/Node/Blocks/index.d.ts +2 -1
  45. package/Particles/Node/Blocks/index.js +2 -1
  46. package/Particles/Node/Blocks/index.js.map +1 -1
  47. package/Particles/Node/Blocks/particleLocalVariableBlock.d.ts +2 -0
  48. package/Particles/Node/Blocks/particleLocalVariableBlock.js +22 -10
  49. package/Particles/Node/Blocks/particleLocalVariableBlock.js.map +1 -1
  50. package/Particles/Node/Blocks/particleMathBlock.d.ts +4 -0
  51. package/Particles/Node/Blocks/particleMathBlock.js +4 -0
  52. package/Particles/Node/Blocks/particleMathBlock.js.map +1 -1
  53. package/Particles/Node/Blocks/{particleModuloBlock.d.ts → particleNumberMathBlock.d.ts} +27 -4
  54. package/Particles/Node/Blocks/particleNumberMathBlock.js +149 -0
  55. package/Particles/Node/Blocks/particleNumberMathBlock.js.map +1 -0
  56. package/Particles/Node/Blocks/particleVectorMathBlock.d.ts +54 -0
  57. package/Particles/Node/Blocks/particleVectorMathBlock.js +116 -0
  58. package/Particles/Node/Blocks/particleVectorMathBlock.js.map +1 -0
  59. package/Particles/Node/Blocks/systemBlock.d.ts +8 -0
  60. package/Particles/Node/Blocks/systemBlock.js +34 -6
  61. package/Particles/Node/Blocks/systemBlock.js.map +1 -1
  62. package/Particles/Node/nodeParticleSystemSet.helper.js +63 -4
  63. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  64. package/Particles/baseParticleSystem.d.ts +8 -1
  65. package/Particles/baseParticleSystem.js +8 -1
  66. package/Particles/baseParticleSystem.js.map +1 -1
  67. package/Particles/particle.d.ts +4 -0
  68. package/Particles/particle.js +3 -0
  69. package/Particles/particle.js.map +1 -1
  70. package/Particles/particleSystem.d.ts +12 -0
  71. package/Particles/particleSystem.js +12 -0
  72. package/Particles/particleSystem.js.map +1 -1
  73. package/Particles/thinParticleSystem.d.ts +10 -0
  74. package/Particles/thinParticleSystem.js +10 -1
  75. package/Particles/thinParticleSystem.js.map +1 -1
  76. package/package.json +1 -1
  77. package/Particles/Node/Blocks/particleModuloBlock.js +0 -98
  78. package/Particles/Node/Blocks/particleModuloBlock.js.map +0 -1
@@ -0,0 +1,149 @@
1
+ import { __decorate } from "../../../tslib.es6.js";
2
+ import { RegisterClass } from "../../../Misc/typeStore.js";
3
+ import { NodeParticleBlock } from "../nodeParticleBlock.js";
4
+ import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
5
+ import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
6
+ /**
7
+ * Operations supported by the Number Math block
8
+ */
9
+ export var ParticleNumberMathBlockOperations;
10
+ (function (ParticleNumberMathBlockOperations) {
11
+ /** Modulo */
12
+ ParticleNumberMathBlockOperations[ParticleNumberMathBlockOperations["Modulo"] = 0] = "Modulo";
13
+ /** Power */
14
+ ParticleNumberMathBlockOperations[ParticleNumberMathBlockOperations["Pow"] = 1] = "Pow";
15
+ })(ParticleNumberMathBlockOperations || (ParticleNumberMathBlockOperations = {}));
16
+ /**
17
+ * Block used to apply math operations that only appply to numbers (int/float)
18
+ */
19
+ export class ParticleNumberMathBlock extends NodeParticleBlock {
20
+ /**
21
+ * Create a new ParticleNumberMathBlock
22
+ * @param name defines the block name
23
+ */
24
+ constructor(name) {
25
+ super(name);
26
+ /**
27
+ * Gets or sets the operation applied by the block
28
+ */
29
+ this.operation = ParticleNumberMathBlockOperations.Modulo;
30
+ this.registerInput("left", NodeParticleBlockConnectionPointTypes.AutoDetect);
31
+ this.registerInput("right", NodeParticleBlockConnectionPointTypes.AutoDetect);
32
+ this.registerOutput("output", NodeParticleBlockConnectionPointTypes.BasedOnInput);
33
+ this.output._typeConnectionSource = this.left;
34
+ this.left.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);
35
+ this.left.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Float);
36
+ this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);
37
+ this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Float);
38
+ this._linkConnectionTypes(0, 1);
39
+ this._connectionObservers = [
40
+ this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),
41
+ this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
42
+ this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),
43
+ this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
44
+ ];
45
+ }
46
+ /**
47
+ * Gets the current class name
48
+ * @returns the class name
49
+ */
50
+ getClassName() {
51
+ return "ParticleNumberMathBlock";
52
+ }
53
+ /**
54
+ * Gets the left input component
55
+ */
56
+ get left() {
57
+ return this._inputs[0];
58
+ }
59
+ /**
60
+ * Gets the right input component
61
+ */
62
+ get right() {
63
+ return this._inputs[1];
64
+ }
65
+ /**
66
+ * Gets the geometry output component
67
+ */
68
+ get output() {
69
+ return this._outputs[0];
70
+ }
71
+ _build(state) {
72
+ let func;
73
+ const left = this.left;
74
+ const right = this.right;
75
+ if (!left.isConnected || !right.isConnected) {
76
+ this.output._storedFunction = null;
77
+ this.output._storedValue = null;
78
+ return;
79
+ }
80
+ switch (this.operation) {
81
+ case ParticleNumberMathBlockOperations.Modulo: {
82
+ func = (state) => {
83
+ return left.getConnectedValue(state) % right.getConnectedValue(state);
84
+ };
85
+ break;
86
+ }
87
+ case ParticleNumberMathBlockOperations.Pow: {
88
+ func = (state) => {
89
+ return Math.pow(left.getConnectedValue(state), right.getConnectedValue(state));
90
+ };
91
+ break;
92
+ }
93
+ }
94
+ this.output._storedFunction = (state) => {
95
+ // We use the left type to determine if we need to cast to int
96
+ if (left.type === NodeParticleBlockConnectionPointTypes.Int) {
97
+ return func(state) | 0;
98
+ }
99
+ return func(state);
100
+ };
101
+ }
102
+ _updateInputOutputTypes() {
103
+ // First update the output type with the initial assumption that we'll base it on the left input.
104
+ this.output._typeConnectionSource = this.left;
105
+ // If left is not connected, then instead use the type of right if it's connected.
106
+ if (!this.left.isConnected && this.right.isConnected) {
107
+ this.output._typeConnectionSource = this.right;
108
+ }
109
+ }
110
+ /**
111
+ * Release resources
112
+ */
113
+ dispose() {
114
+ super.dispose();
115
+ for (const observer of this._connectionObservers) {
116
+ observer.remove();
117
+ }
118
+ this._connectionObservers.length = 0;
119
+ }
120
+ /**
121
+ * Serializes this block in a JSON representation
122
+ * @returns the serialized block object
123
+ */
124
+ serialize() {
125
+ const serializationObject = super.serialize();
126
+ serializationObject.operation = this.operation;
127
+ return serializationObject;
128
+ }
129
+ /**
130
+ * Deserializes the block from a JSON object
131
+ * @param serializationObject the JSON object to deserialize from
132
+ */
133
+ _deserialize(serializationObject) {
134
+ super._deserialize(serializationObject);
135
+ this.operation = serializationObject.operation;
136
+ }
137
+ }
138
+ __decorate([
139
+ editableInPropertyPage("Operation", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
140
+ notifiers: { rebuild: true },
141
+ embedded: true,
142
+ options: [
143
+ { label: "Modulo", value: ParticleNumberMathBlockOperations.Modulo },
144
+ { label: "Power", value: ParticleNumberMathBlockOperations.Pow },
145
+ ],
146
+ })
147
+ ], ParticleNumberMathBlock.prototype, "operation", void 0);
148
+ RegisterClass("BABYLON.ParticleNumberMathBlock", ParticleNumberMathBlock);
149
+ //# sourceMappingURL=particleNumberMathBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particleNumberMathBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleNumberMathBlock.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEnG;;GAEG;AACH,MAAM,CAAN,IAAY,iCAKX;AALD,WAAY,iCAAiC;IACzC,aAAa;IACb,6FAAM,CAAA;IACN,YAAY;IACZ,uFAAG,CAAA;AACP,CAAC,EALW,iCAAiC,KAAjC,iCAAiC,QAK5C;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAgB1D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QApBhB;;WAEG;QASI,cAAS,GAAG,iCAAiC,CAAC,MAAM,CAAC;QAWxD,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAE9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,MAAM,CAAC,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC;QAE9C,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,GAAG,CAAC,CAAC;QACvF,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC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AI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC;QACnD,CAAC;IACL,CAAC;IAED;;OAEG;IACa,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC/C,QAAQ,CAAC,MAAM,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAE/C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACa,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;IACnD,CAAC;CACJ;AA3IU;IARN,sBAAsB,CAAC,WAAW,uCAA+B,UAAU,EAAE;QAC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,iCAAiC,CAAC,MAAM,EAAE;YACpE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,iCAAiC,CAAC,GAAG,EAAE;SACnE;KACJ,CAAC;0DAC0D;AA6IhE,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import type { Observer } from \"core/Misc/observable\";\r\nimport type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\n\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Operations supported by the Number Math block\r\n */\r\nexport enum ParticleNumberMathBlockOperations {\r\n /** Modulo */\r\n Modulo,\r\n /** Power */\r\n Pow,\r\n}\r\n\r\n/**\r\n * Block used to apply math operations that only appply to numbers (int/float)\r\n */\r\nexport class ParticleNumberMathBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Modulo\", value: ParticleNumberMathBlockOperations.Modulo },\r\n { label: \"Power\", value: ParticleNumberMathBlockOperations.Pow },\r\n ],\r\n })\r\n public operation = ParticleNumberMathBlockOperations.Modulo;\r\n\r\n private readonly _connectionObservers: Observer<NodeParticleConnectionPoint>[];\r\n\r\n /**\r\n * Create a new ParticleNumberMathBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = this.left;\r\n\r\n this.left.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);\r\n this.left.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Float);\r\n this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);\r\n this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Float);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._connectionObservers = [\r\n this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n ];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"ParticleNumberMathBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build(state: NodeParticleBuildState) {\r\n let func: (state: NodeParticleBuildState) => any;\r\n const left = this.left;\r\n const right = this.right;\r\n\r\n if (!left.isConnected || !right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n switch (this.operation) {\r\n case ParticleNumberMathBlockOperations.Modulo: {\r\n func = (state) => {\r\n return left.getConnectedValue(state) % right.getConnectedValue(state);\r\n };\r\n break;\r\n }\r\n case ParticleNumberMathBlockOperations.Pow: {\r\n func = (state) => {\r\n return Math.pow(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n break;\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n // We use the left type to determine if we need to cast to int\r\n if (left.type === NodeParticleBlockConnectionPointTypes.Int) {\r\n return func(state) | 0;\r\n }\r\n return func(state);\r\n };\r\n }\r\n\r\n private _updateInputOutputTypes() {\r\n // First update the output type with the initial assumption that we'll base it on the left input.\r\n this.output._typeConnectionSource = this.left;\r\n\r\n // If left is not connected, then instead use the type of right if it's connected.\r\n if (!this.left.isConnected && this.right.isConnected) {\r\n this.output._typeConnectionSource = this.right;\r\n }\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n for (const observer of this._connectionObservers) {\r\n observer.remove();\r\n }\r\n this._connectionObservers.length = 0;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the block from a JSON object\r\n * @param serializationObject the JSON object to deserialize from\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleNumberMathBlock\", ParticleNumberMathBlock);\r\n"]}
@@ -0,0 +1,54 @@
1
+ import type { NodeParticleConnectionPoint } from "../nodeParticleBlockConnectionPoint.js";
2
+ import type { NodeParticleBuildState } from "../nodeParticleBuildState.js";
3
+ import { NodeParticleBlock } from "../nodeParticleBlock.js";
4
+ /**
5
+ * Operations supported by the Vector Math block
6
+ */
7
+ export declare enum ParticleVectorMathBlockOperations {
8
+ /** Dot product */
9
+ Dot = 0,
10
+ /** Distance between two vectors */
11
+ Distance = 1
12
+ }
13
+ /**
14
+ * Block used to apply math operations that only apply to vectors
15
+ */
16
+ export declare class ParticleVectorMathBlock extends NodeParticleBlock {
17
+ /**
18
+ * Gets or sets the operation applied by the block
19
+ */
20
+ operation: ParticleVectorMathBlockOperations;
21
+ /**
22
+ * Create a new ParticleVectorMathBlock
23
+ * @param name defines the block name
24
+ */
25
+ constructor(name: string);
26
+ /**
27
+ * Gets the current class name
28
+ * @returns the class name
29
+ */
30
+ getClassName(): string;
31
+ /**
32
+ * Gets the left input component
33
+ */
34
+ get left(): NodeParticleConnectionPoint;
35
+ /**
36
+ * Gets the right input component
37
+ */
38
+ get right(): NodeParticleConnectionPoint;
39
+ /**
40
+ * Gets the geometry output component
41
+ */
42
+ get output(): NodeParticleConnectionPoint;
43
+ _build(state: NodeParticleBuildState): void;
44
+ /**
45
+ * Serializes this block in a JSON representation
46
+ * @returns the serialized block object
47
+ */
48
+ serialize(): any;
49
+ /**
50
+ * Deserializes the block from a JSON object
51
+ * @param serializationObject the JSON object to deserialize from
52
+ */
53
+ _deserialize(serializationObject: any): void;
54
+ }
@@ -0,0 +1,116 @@
1
+ import { __decorate } from "../../../tslib.es6.js";
2
+ import { RegisterClass } from "../../../Misc/typeStore.js";
3
+ import { NodeParticleBlock } from "../nodeParticleBlock.js";
4
+ import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
5
+ import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
6
+ import { Vector3 } from "../../../Maths/math.vector.js";
7
+ /**
8
+ * Operations supported by the Vector Math block
9
+ */
10
+ export var ParticleVectorMathBlockOperations;
11
+ (function (ParticleVectorMathBlockOperations) {
12
+ /** Dot product */
13
+ ParticleVectorMathBlockOperations[ParticleVectorMathBlockOperations["Dot"] = 0] = "Dot";
14
+ /** Distance between two vectors */
15
+ ParticleVectorMathBlockOperations[ParticleVectorMathBlockOperations["Distance"] = 1] = "Distance";
16
+ })(ParticleVectorMathBlockOperations || (ParticleVectorMathBlockOperations = {}));
17
+ /**
18
+ * Block used to apply math operations that only apply to vectors
19
+ */
20
+ export class ParticleVectorMathBlock extends NodeParticleBlock {
21
+ /**
22
+ * Create a new ParticleVectorMathBlock
23
+ * @param name defines the block name
24
+ */
25
+ constructor(name) {
26
+ super(name);
27
+ /**
28
+ * Gets or sets the operation applied by the block
29
+ */
30
+ this.operation = ParticleVectorMathBlockOperations.Dot;
31
+ this.registerInput("left", NodeParticleBlockConnectionPointTypes.Vector3);
32
+ this.registerInput("right", NodeParticleBlockConnectionPointTypes.Vector3);
33
+ this.registerOutput("output", NodeParticleBlockConnectionPointTypes.Float);
34
+ }
35
+ /**
36
+ * Gets the current class name
37
+ * @returns the class name
38
+ */
39
+ getClassName() {
40
+ return "ParticleVectorMathBlock";
41
+ }
42
+ /**
43
+ * Gets the left input component
44
+ */
45
+ get left() {
46
+ return this._inputs[0];
47
+ }
48
+ /**
49
+ * Gets the right input component
50
+ */
51
+ get right() {
52
+ return this._inputs[1];
53
+ }
54
+ /**
55
+ * Gets the geometry output component
56
+ */
57
+ get output() {
58
+ return this._outputs[0];
59
+ }
60
+ _build(state) {
61
+ let func;
62
+ const left = this.left;
63
+ const right = this.right;
64
+ if (!left.isConnected || !right.isConnected) {
65
+ this.output._storedFunction = null;
66
+ this.output._storedValue = null;
67
+ return;
68
+ }
69
+ switch (this.operation) {
70
+ case ParticleVectorMathBlockOperations.Dot: {
71
+ func = (state) => {
72
+ return Vector3.Dot(left.getConnectedValue(state), right.getConnectedValue(state));
73
+ };
74
+ break;
75
+ }
76
+ case ParticleVectorMathBlockOperations.Distance: {
77
+ func = (state) => {
78
+ return Vector3.Distance(left.getConnectedValue(state), right.getConnectedValue(state));
79
+ };
80
+ break;
81
+ }
82
+ }
83
+ this.output._storedFunction = (state) => {
84
+ return func(state);
85
+ };
86
+ }
87
+ /**
88
+ * Serializes this block in a JSON representation
89
+ * @returns the serialized block object
90
+ */
91
+ serialize() {
92
+ const serializationObject = super.serialize();
93
+ serializationObject.operation = this.operation;
94
+ return serializationObject;
95
+ }
96
+ /**
97
+ * Deserializes the block from a JSON object
98
+ * @param serializationObject the JSON object to deserialize from
99
+ */
100
+ _deserialize(serializationObject) {
101
+ super._deserialize(serializationObject);
102
+ this.operation = serializationObject.operation;
103
+ }
104
+ }
105
+ __decorate([
106
+ editableInPropertyPage("Operation", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
107
+ notifiers: { rebuild: true },
108
+ embedded: true,
109
+ options: [
110
+ { label: "Dot", value: ParticleVectorMathBlockOperations.Dot },
111
+ { label: "Distance", value: ParticleVectorMathBlockOperations.Distance },
112
+ ],
113
+ })
114
+ ], ParticleVectorMathBlock.prototype, "operation", void 0);
115
+ RegisterClass("BABYLON.ParticleVectorMathBlock", ParticleVectorMathBlock);
116
+ //# sourceMappingURL=particleVectorMathBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particleVectorMathBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleVectorMathBlock.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD;;GAEG;AACH,MAAM,CAAN,IAAY,iCAKX;AALD,WAAY,iCAAiC;IACzC,kBAAkB;IAClB,uFAAG,CAAA;IACH,mCAAmC;IACnC,iGAAQ,CAAA;AACZ,CAAC,EALW,iCAAiC,KAAjC,iCAAiC,QAK5C;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAc1D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAlBhB;;WAEG;QASI,cAAS,GAAG,iCAAiC,CAAC,GAAG,CAAC;QASrD,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAC1E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAC3E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,yBAAyB,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,C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AAC,KAAK,EAAE,EAAE;YACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC;IACN,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAE/C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACa,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;IACnD,CAAC;CACJ;AA/FU;IARN,sBAAsB,CAAC,WAAW,uCAA+B,UAAU,EAAE;QAC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iCAAiC,CAAC,GAAG,EAAE;YAC9D,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,iCAAiC,CAAC,QAAQ,EAAE;SAC3E;KACJ,CAAC;0DACuD;AAiG7D,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\n\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { Vector3 } from \"../../../Maths/math.vector\";\r\n\r\n/**\r\n * Operations supported by the Vector Math block\r\n */\r\nexport enum ParticleVectorMathBlockOperations {\r\n /** Dot product */\r\n Dot,\r\n /** Distance between two vectors */\r\n Distance,\r\n}\r\n\r\n/**\r\n * Block used to apply math operations that only apply to vectors\r\n */\r\nexport class ParticleVectorMathBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Dot\", value: ParticleVectorMathBlockOperations.Dot },\r\n { label: \"Distance\", value: ParticleVectorMathBlockOperations.Distance },\r\n ],\r\n })\r\n public operation = ParticleVectorMathBlockOperations.Dot;\r\n\r\n /**\r\n * Create a new ParticleVectorMathBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeParticleBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.Vector3);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"ParticleVectorMathBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build(state: NodeParticleBuildState) {\r\n let func: (state: NodeParticleBuildState) => any;\r\n const left = this.left;\r\n const right = this.right;\r\n\r\n if (!left.isConnected || !right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n switch (this.operation) {\r\n case ParticleVectorMathBlockOperations.Dot: {\r\n func = (state) => {\r\n return Vector3.Dot(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n break;\r\n }\r\n case ParticleVectorMathBlockOperations.Distance: {\r\n func = (state) => {\r\n return Vector3.Distance(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n break;\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n return func(state);\r\n };\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the block from a JSON object\r\n * @param serializationObject the JSON object to deserialize from\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleVectorMathBlock\", ParticleVectorMathBlock);\r\n"]}
@@ -39,6 +39,10 @@ export declare class SystemBlock extends NodeParticleBlock {
39
39
  * Gets or sets a boolean indicating if the system is billboard based
40
40
  */
41
41
  isBillboardBased: boolean;
42
+ /**
43
+ * Gets or sets the billboard mode for the particle system
44
+ */
45
+ billBoardMode: number;
42
46
  /**
43
47
  * Gets or sets a boolean indicating if the system coordinate space is local or global
44
48
  */
@@ -99,6 +103,10 @@ export declare class SystemBlock extends NodeParticleBlock {
99
103
  * Gets the rampGradient input component
100
104
  */
101
105
  get rampGradient(): NodeParticleConnectionPoint;
106
+ /**
107
+ * Gets the emitterPosition input component
108
+ */
109
+ get emitterPosition(): NodeParticleConnectionPoint;
102
110
  /**
103
111
  * Gets the system output component
104
112
  */
@@ -1,7 +1,8 @@
1
1
  import { __decorate } from "../../../tslib.es6.js";
2
+
2
3
  import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
3
4
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
- import { Vector2 } from "../../../Maths/math.vector.js";
5
+ import { Vector2, Vector3 } from "../../../Maths/math.vector.js";
5
6
  import { Color3, Color4 } from "../../../Maths/math.color.js";
6
7
  import { BaseParticleSystem } from "../../baseParticleSystem.js";
7
8
  import { NodeParticleBlock } from "../nodeParticleBlock.js";
@@ -50,6 +51,10 @@ export class SystemBlock extends NodeParticleBlock {
50
51
  * Gets or sets a boolean indicating if the system is billboard based
51
52
  */
52
53
  this.isBillboardBased = true;
54
+ /**
55
+ * Gets or sets the billboard mode for the particle system
56
+ */
57
+ this.billBoardMode = 7;
53
58
  /**
54
59
  * Gets or sets a boolean indicating if the system coordinate space is local or global
55
60
  */
@@ -74,6 +79,7 @@ export class SystemBlock extends NodeParticleBlock {
74
79
  this.registerInput("onStart", NodeParticleBlockConnectionPointTypes.System, true);
75
80
  this.registerInput("onEnd", NodeParticleBlockConnectionPointTypes.System, true);
76
81
  this.registerInput("rampGradient", NodeParticleBlockConnectionPointTypes.Color4, true);
82
+ this.registerInput("emitterPosition", NodeParticleBlockConnectionPointTypes.Vector3, true, Vector3.Zero());
77
83
  this.registerOutput("system", NodeParticleBlockConnectionPointTypes.System);
78
84
  }
79
85
  /**
@@ -137,6 +143,12 @@ export class SystemBlock extends NodeParticleBlock {
137
143
  get rampGradient() {
138
144
  return this._inputs[8];
139
145
  }
146
+ /**
147
+ * Gets the emitterPosition input component
148
+ */
149
+ get emitterPosition() {
150
+ return this._inputs[9];
151
+ }
140
152
  /**
141
153
  * Gets the system output component
142
154
  */
@@ -164,10 +176,12 @@ export class SystemBlock extends NodeParticleBlock {
164
176
  particleSystem._targetStopDuration = this.targetStopDuration.getConnectedValue(state) ?? 0;
165
177
  particleSystem.startDelay = this.startDelay;
166
178
  particleSystem.isBillboardBased = this.isBillboardBased;
179
+ particleSystem.billboardMode = this.billBoardMode;
167
180
  particleSystem.translationPivot = this.translationPivot.getConnectedValue(state) || Vector2.Zero();
168
181
  particleSystem.textureMask = this.textureMask.getConnectedValue(state) ?? new Color4(1, 1, 1, 1);
169
182
  particleSystem.isLocal = this.isLocal;
170
183
  particleSystem.disposeOnStop = this.disposeOnStop;
184
+ particleSystem.emitter = this.emitterPosition.getConnectedValue(state) ?? Vector3.Zero();
171
185
  // The emit rate can vary if it is connected to another block like a gradient
172
186
  particleSystem._calculateEmitRate = () => {
173
187
  state.systemContext = particleSystem;
@@ -244,6 +258,7 @@ export class SystemBlock extends NodeParticleBlock {
244
258
  serializationObject.preWarmCycles = this.preWarmCycles;
245
259
  serializationObject.preWarmStepOffset = this.preWarmStepOffset;
246
260
  serializationObject.isBillboardBased = this.isBillboardBased;
261
+ serializationObject.billBoardMode = this.billBoardMode;
247
262
  serializationObject.isLocal = this.isLocal;
248
263
  serializationObject.disposeOnStop = this.disposeOnStop;
249
264
  serializationObject.doNoStart = this.doNoStart;
@@ -262,6 +277,7 @@ export class SystemBlock extends NodeParticleBlock {
262
277
  this.preWarmCycles = serializationObject.preWarmCycles ?? 0;
263
278
  this.preWarmStepOffset = serializationObject.preWarmStepOffset ?? 0;
264
279
  this.isBillboardBased = serializationObject.isBillboardBased ?? true;
280
+ this.billBoardMode = serializationObject.billBoardMode ?? 7;
265
281
  this.isLocal = serializationObject.isLocal ?? false;
266
282
  this.disposeOnStop = serializationObject.disposeOnStop ?? false;
267
283
  this.doNoStart = !!serializationObject.doNoStart;
@@ -282,11 +298,11 @@ __decorate([
282
298
  notifiers: { rebuild: true },
283
299
  embedded: true,
284
300
  options: [
285
- { label: "OneOne", value: BaseParticleSystem.BLENDMODE_ONEONE },
286
- { label: "Standard", value: BaseParticleSystem.BLENDMODE_STANDARD },
287
- { label: "Add", value: BaseParticleSystem.BLENDMODE_ADD },
288
- { label: "Multiply", value: BaseParticleSystem.BLENDMODE_MULTIPLY },
289
- { label: "MultiplyAdd", value: BaseParticleSystem.BLENDMODE_MULTIPLYADD },
301
+ { label: "Blend Mode OneOne", value: BaseParticleSystem.BLENDMODE_ONEONE },
302
+ { label: "Blend Mode Standard", value: BaseParticleSystem.BLENDMODE_STANDARD },
303
+ { label: "Blend Mode Add", value: BaseParticleSystem.BLENDMODE_ADD },
304
+ { label: "Blend Mode Multiply", value: BaseParticleSystem.BLENDMODE_MULTIPLY },
305
+ { label: "Blend Mode MultiplyAdd", value: BaseParticleSystem.BLENDMODE_MULTIPLYADD },
290
306
  ],
291
307
  })
292
308
  ], SystemBlock.prototype, "blendMode", void 0);
@@ -311,6 +327,18 @@ __decorate([
311
327
  __decorate([
312
328
  editableInPropertyPage("Is billboard based", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
313
329
  ], SystemBlock.prototype, "isBillboardBased", void 0);
330
+ __decorate([
331
+ editableInPropertyPage("Billboard mode", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
332
+ notifiers: { rebuild: true },
333
+ embedded: true,
334
+ options: [
335
+ { label: "Billboard Mode All", value: 7 },
336
+ { label: "Billboard Mode Y", value: 2 },
337
+ { label: "Billboard Mode Stretched", value: 8 },
338
+ { label: "Billboard Mode Stretched Local", value: 9 },
339
+ ],
340
+ })
341
+ ], SystemBlock.prototype, "billBoardMode", void 0);
314
342
  __decorate([
315
343
  editableInPropertyPage("Is local", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
316
344
  ], SystemBlock.prototype, "isLocal", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"systemBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/systemBlock.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,sBAAsB,EAA0B,6CAAsC;AAC/F,OAAO,EAAE,aAAa,EAAE,mCAA4B;AACpD,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,qCAA8B;AACvD,OAAO,EAAE,kBAAkB,EAAE,oCAA0C;AACvE,OAAO,EAAE,iBAAiB,EAAE,gCAA8C;AAC1E,OAAO,EAAE,kBAAkB,EAAE,mCAAyD;AACtF,OAAO,EAAE,qCAAqC,EAAE,0DAAwE;AACx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,EAAE,IAAI,EAAE,EAAE,CAAC;8CAC3G;AAkQ7B,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import type { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"core/Particles/Node/nodeParticleBuildState\";\r\nimport type { ParticleGradientValueBlock } from \"./particleGradientValueBlock\";\r\n\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"core/Decorators/nodeDecorator\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { BaseParticleSystem } from \"core/Particles/baseParticleSystem\";\r\nimport { NodeParticleBlock } from \"core/Particles/Node/nodeParticleBlock\";\r\nimport { _TriggerSubEmitter } from \"core/Particles/Node/Blocks/Triggers/triggerTools\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { ParticleGradientBlock } from \"./particleGradientBlock\";\r\n\r\n/**\r\n * Block used to get a system of particles\r\n */\r\nexport class SystemBlock extends NodeParticleBlock {\r\n private static _IdCounter = 0;\r\n\r\n /**\r\n * Gets or sets the blend mode for the particle system\r\n */\r\n @editableInPropertyPage(\"Blend mode\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"OneOne\", value: BaseParticleSystem.BLENDMODE_ONEONE },\r\n { label: \"Standard\", value: BaseParticleSystem.BLENDMODE_STANDARD },\r\n { label: \"Add\", value: BaseParticleSystem.BLENDMODE_ADD },\r\n { label: \"Multiply\", value: BaseParticleSystem.BLENDMODE_MULTIPLY },\r\n { label: \"MultiplyAdd\", value: BaseParticleSystem.BLENDMODE_MULTIPLYADD },\r\n ],\r\n })\r\n public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;\r\n\r\n /**\r\n * Gets or sets the epsilon value used for comparison\r\n */\r\n @editableInPropertyPage(\"Capacity\", PropertyTypeForEdition.Int, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0, max: 10000 })\r\n public capacity = 1000;\r\n\r\n /**\r\n * Gets or sets the manual emit count\r\n */\r\n @editableInPropertyPage(\"Manual emit count\", PropertyTypeForEdition.Int, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: -1 })\r\n public manualEmitCount = -1;\r\n\r\n /**\r\n * Gets or sets the target stop duration for the particle system\r\n */\r\n @editableInPropertyPage(\"Delay start(ms)\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public startDelay = 0;\r\n\r\n /**\r\n * Gets or sets the target stop duration for the particle system\r\n */\r\n @editableInPropertyPage(\"updateSpeed\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0, max: 0.1 })\r\n public updateSpeed = 0.0167;\r\n\r\n /**\r\n * Gets or sets the number of pre-warm cycles before rendering the particle system\r\n */\r\n @editableInPropertyPage(\"Pre-warm cycles\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public preWarmCycles = 0;\r\n\r\n /**\r\n * Gets or sets the time step multiplier used for pre-warm\r\n */\r\n @editableInPropertyPage(\"Pre-warm step multiplier\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public preWarmStepOffset = 0;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system is billboard based\r\n */\r\n @editableInPropertyPage(\"Is billboard based\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public isBillboardBased = true;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system coordinate space is local or global\r\n */\r\n @editableInPropertyPage(\"Is local\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public isLocal = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system should be disposed when stopped\r\n */\r\n @editableInPropertyPage(\"Dispose on stop\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public disposeOnStop = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system should not start automatically\r\n */\r\n @editableInPropertyPage(\"Do no start\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public doNoStart = false;\r\n\r\n /** @internal */\r\n public _internalId = SystemBlock._IdCounter++;\r\n\r\n /**\r\n * Create a new SystemBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this._isSystem = true;\r\n\r\n this.registerInput(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\r\n this.registerInput(\"emitRate\", NodeParticleBlockConnectionPointTypes.Int, true, 10, 0);\r\n this.registerInput(\"texture\", NodeParticleBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"translationPivot\", NodeParticleBlockConnectionPointTypes.Vector2, true);\r\n this.registerInput(\"textureMask\", NodeParticleBlockConnectionPointTypes.Color4, true);\r\n this.registerInput(\"targetStopDuration\", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0);\r\n this.registerInput(\"onStart\", NodeParticleBlockConnectionPointTypes.System, true);\r\n this.registerInput(\"onEnd\", NodeParticleBlockConnectionPointTypes.System, true);\r\n this.registerInput(\"rampGradient\", NodeParticleBlockConnectionPointTypes.Color4, true);\r\n this.registerOutput(\"system\", NodeParticleBlockConnectionPointTypes.System);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"SystemBlock\";\r\n }\r\n\r\n /**\r\n * Gets the particle input component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the emitRate input component\r\n */\r\n public get emitRate(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the texture input component\r\n */\r\n public get texture(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the translationPivot input component\r\n */\r\n public get translationPivot(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the textureMask input component\r\n */\r\n public get textureMask(): NodeParticleConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the targetStopDuration input component\r\n */\r\n public get targetStopDuration(): NodeParticleConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the onStart input component\r\n */\r\n public get onStart(): NodeParticleConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the onEnd input component\r\n */\r\n public get onEnd(): NodeParticleConnectionPoint {\r\n return this._inputs[7];\r\n }\r\n\r\n /**\r\n * Gets the rampGradient input component\r\n */\r\n public get rampGradient(): NodeParticleConnectionPoint {\r\n return this._inputs[8];\r\n }\r\n\r\n /**\r\n * Gets the system output component\r\n */\r\n public get system(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Builds the block and return a functional particle system\r\n * @param state defines the building state\r\n * @returns the built particle system\r\n */\r\n public createSystem(state: NodeParticleBuildState): ParticleSystem {\r\n state.capacity = this.capacity;\r\n state.buildId = this._buildId++;\r\n\r\n this.build(state);\r\n\r\n const particleSystem = this.particle.getConnectedValue(state) as ParticleSystem;\r\n particleSystem.particleTexture = this.texture.getConnectedValue(state);\r\n particleSystem.emitRate = this.emitRate.getConnectedValue(state) as number;\r\n particleSystem.manualEmitCount = this.manualEmitCount;\r\n particleSystem.updateSpeed = this.updateSpeed;\r\n particleSystem.preWarmCycles = this.preWarmCycles;\r\n particleSystem.preWarmStepOffset = this.preWarmStepOffset;\r\n particleSystem.blendMode = this.blendMode;\r\n particleSystem.name = this.name;\r\n particleSystem._targetStopDuration = (this.targetStopDuration.getConnectedValue(state) as number) ?? 0;\r\n particleSystem.startDelay = this.startDelay;\r\n particleSystem.isBillboardBased = this.isBillboardBased;\r\n particleSystem.translationPivot = (this.translationPivot.getConnectedValue(state) as Vector2) || Vector2.Zero();\r\n particleSystem.textureMask = this.textureMask.getConnectedValue(state) ?? new Color4(1, 1, 1, 1);\r\n particleSystem.isLocal = this.isLocal;\r\n particleSystem.disposeOnStop = this.disposeOnStop;\r\n\r\n // The emit rate can vary if it is connected to another block like a gradient\r\n particleSystem._calculateEmitRate = () => {\r\n state.systemContext = particleSystem;\r\n return this.emitRate.getConnectedValue(state) as number;\r\n };\r\n\r\n // Get the ramp gradients\r\n particleSystem.useRampGradients = false;\r\n if (this.rampGradient.isConnected) {\r\n if (this.rampGradient.connectedPoint?.ownerBlock instanceof ParticleGradientBlock) {\r\n // We have a possible gradient, loop through its entries\r\n const gradientInputs = this.rampGradient.connectedPoint?.ownerBlock.inputs;\r\n\r\n // Skip the first input which is the gradient selector, and we only care about the gradient values\r\n for (let i = 1; i < gradientInputs.length; i++) {\r\n if (gradientInputs[i].isConnected) {\r\n const rampEntry = gradientInputs[i].connectedPoint?.ownerBlock as ParticleGradientValueBlock;\r\n const color = rampEntry._inputs[0].getConnectedValue(state) as Color4;\r\n particleSystem.addRampGradient(rampEntry.reference, new Color3(color.r, color.g, color.b));\r\n particleSystem.useRampGradients = true;\r\n }\r\n }\r\n } else {\r\n // We have a single value, add it as ramp gradient\r\n const color = this.rampGradient.getConnectedValue(state) as Color4;\r\n particleSystem.addRampGradient(0, new Color3(color.r, color.g, color.b));\r\n particleSystem.useRampGradients = true;\r\n }\r\n }\r\n\r\n this.system._storedValue = this;\r\n\r\n particleSystem.canStart = () => {\r\n return !this.doNoStart;\r\n };\r\n\r\n particleSystem.onStartedObservable.add((system) => {\r\n // Triggers\r\n const onStartSystem = this.onStart.getConnectedValue(state);\r\n if (onStartSystem) {\r\n system.onStartedObservable.addOnce(() => {\r\n state.systemContext = particleSystem;\r\n const clone = _TriggerSubEmitter(onStartSystem, state.scene, state.emitterPosition!);\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n // Clean up the cloned system when the original system is disposed\r\n clone.dispose();\r\n });\r\n });\r\n }\r\n\r\n const onEndSystem = this.onEnd.getConnectedValue(state);\r\n if (onEndSystem) {\r\n system.onStoppedObservable.addOnce(() => {\r\n state.systemContext = particleSystem;\r\n const clone = _TriggerSubEmitter(onEndSystem, state.scene, state.emitterPosition!);\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n // Clean up the cloned system when the original system is disposed\r\n clone.dispose();\r\n });\r\n });\r\n }\r\n });\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n particleSystem.dispose();\r\n });\r\n\r\n // Return\r\n return particleSystem;\r\n }\r\n\r\n /**\r\n * Serializes the system block\r\n * @returns The serialized object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.capacity = this.capacity;\r\n serializationObject.manualEmitCount = this.manualEmitCount;\r\n serializationObject.blendMode = this.blendMode;\r\n serializationObject.updateSpeed = this.updateSpeed;\r\n serializationObject.preWarmCycles = this.preWarmCycles;\r\n serializationObject.preWarmStepOffset = this.preWarmStepOffset;\r\n serializationObject.isBillboardBased = this.isBillboardBased;\r\n serializationObject.isLocal = this.isLocal;\r\n serializationObject.disposeOnStop = this.disposeOnStop;\r\n serializationObject.doNoStart = this.doNoStart;\r\n serializationObject.startDelay = this.startDelay;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the system block\r\n * @param serializationObject The serialized system\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.capacity = serializationObject.capacity;\r\n this.manualEmitCount = serializationObject.manualEmitCount ?? -1;\r\n this.updateSpeed = serializationObject.updateSpeed ?? 0.0167;\r\n this.preWarmCycles = serializationObject.preWarmCycles ?? 0;\r\n this.preWarmStepOffset = serializationObject.preWarmStepOffset ?? 0;\r\n this.isBillboardBased = serializationObject.isBillboardBased ?? true;\r\n this.isLocal = serializationObject.isLocal ?? false;\r\n this.disposeOnStop = serializationObject.disposeOnStop ?? false;\r\n this.doNoStart = !!serializationObject.doNoStart;\r\n\r\n if (serializationObject.emitRate !== undefined) {\r\n this.emitRate.value = serializationObject.emitRate;\r\n }\r\n\r\n if (serializationObject.blendMode !== undefined) {\r\n this.blendMode = serializationObject.blendMode;\r\n }\r\n\r\n if (serializationObject.startDelay !== undefined) {\r\n this.startDelay = serializationObject.startDelay;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SystemBlock\", SystemBlock);\r\n"]}
1
+ {"version":3,"file":"systemBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/systemBlock.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAA0B,6CAAsC;AAC/F,OAAO,EAAE,aAAa,EAAE,mCAA4B;AACpD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,qCAA8B;AACvD,OAAO,EAAE,kBAAkB,EAAE,oCAA0C;AACvE,OAAO,EAAE,iBAAiB,EAAE,gCAA8C;AAC1E,OAAO,EAAE,kBAAkB,EAAE,mCAAyD;AACtF,OAAO,EAAE,qCAAqC,EAAE,0DAAwE;AACxH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAiG9C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAnGhB;;WAEG;QAYI,cAAS,GAAG,kBAAkB,CAAC,gBAAgB,CAAC;QAEvD;;WAEG;QAEI,aAAQ,GAA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AE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,SAAS,CAAC,2BAA2B,EAAE;YAC7E,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,yBAAyB,EAAE;YACzE,EAAE,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,SAAS,CAAC,iCAAiC,EAAE;YACzF,EAAE,KAAK,EAAE,gCAAgC,EAAE,KAAK,EAAE,SAAS,CAAC,uCAAuC,EAAE;SACxG;KACJ,CAAC;kDAC2D;AAMtD;IADN,sBAAsB,CAAC,UAAU,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;4CAC1G;AAMhB;IADN,sBAAsB,CAAC,iBAAiB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;kDAC3G;AAMtB;IADN,sBAAsB,CAAC,aAAa,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;8CAC3G;AA8Q7B,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import type { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"core/Particles/Node/nodeParticleBuildState\";\r\nimport type { ParticleGradientValueBlock } from \"./particleGradientValueBlock\";\r\n\r\nimport { Constants } from \"../../../Engines/constants\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"core/Decorators/nodeDecorator\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { BaseParticleSystem } from \"core/Particles/baseParticleSystem\";\r\nimport { NodeParticleBlock } from \"core/Particles/Node/nodeParticleBlock\";\r\nimport { _TriggerSubEmitter } from \"core/Particles/Node/Blocks/Triggers/triggerTools\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { ParticleGradientBlock } from \"./particleGradientBlock\";\r\n\r\n/**\r\n * Block used to get a system of particles\r\n */\r\nexport class SystemBlock extends NodeParticleBlock {\r\n private static _IdCounter = 0;\r\n\r\n /**\r\n * Gets or sets the blend mode for the particle system\r\n */\r\n @editableInPropertyPage(\"Blend mode\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Blend Mode OneOne\", value: BaseParticleSystem.BLENDMODE_ONEONE },\r\n { label: \"Blend Mode Standard\", value: BaseParticleSystem.BLENDMODE_STANDARD },\r\n { label: \"Blend Mode Add\", value: BaseParticleSystem.BLENDMODE_ADD },\r\n { label: \"Blend Mode Multiply\", value: BaseParticleSystem.BLENDMODE_MULTIPLY },\r\n { label: \"Blend Mode MultiplyAdd\", value: BaseParticleSystem.BLENDMODE_MULTIPLYADD },\r\n ],\r\n })\r\n public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;\r\n\r\n /**\r\n * Gets or sets the epsilon value used for comparison\r\n */\r\n @editableInPropertyPage(\"Capacity\", PropertyTypeForEdition.Int, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0, max: 10000 })\r\n public capacity = 1000;\r\n\r\n /**\r\n * Gets or sets the manual emit count\r\n */\r\n @editableInPropertyPage(\"Manual emit count\", PropertyTypeForEdition.Int, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: -1 })\r\n public manualEmitCount = -1;\r\n\r\n /**\r\n * Gets or sets the target stop duration for the particle system\r\n */\r\n @editableInPropertyPage(\"Delay start(ms)\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public startDelay = 0;\r\n\r\n /**\r\n * Gets or sets the target stop duration for the particle system\r\n */\r\n @editableInPropertyPage(\"updateSpeed\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0, max: 0.1 })\r\n public updateSpeed = 0.0167;\r\n\r\n /**\r\n * Gets or sets the number of pre-warm cycles before rendering the particle system\r\n */\r\n @editableInPropertyPage(\"Pre-warm cycles\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public preWarmCycles = 0;\r\n\r\n /**\r\n * Gets or sets the time step multiplier used for pre-warm\r\n */\r\n @editableInPropertyPage(\"Pre-warm step multiplier\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true }, min: 0 })\r\n public preWarmStepOffset = 0;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system is billboard based\r\n */\r\n @editableInPropertyPage(\"Is billboard based\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public isBillboardBased = true;\r\n\r\n /**\r\n * Gets or sets the billboard mode for the particle system\r\n */\r\n @editableInPropertyPage(\"Billboard mode\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Billboard Mode All\", value: Constants.PARTICLES_BILLBOARDMODE_ALL },\r\n { label: \"Billboard Mode Y\", value: Constants.PARTICLES_BILLBOARDMODE_Y },\r\n { label: \"Billboard Mode Stretched\", value: Constants.PARTICLES_BILLBOARDMODE_STRETCHED },\r\n { label: \"Billboard Mode Stretched Local\", value: Constants.PARTICLES_BILLBOARDMODE_STRETCHED_LOCAL },\r\n ],\r\n })\r\n public billBoardMode = Constants.PARTICLES_BILLBOARDMODE_ALL;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system coordinate space is local or global\r\n */\r\n @editableInPropertyPage(\"Is local\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public isLocal = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system should be disposed when stopped\r\n */\r\n @editableInPropertyPage(\"Dispose on stop\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public disposeOnStop = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the system should not start automatically\r\n */\r\n @editableInPropertyPage(\"Do no start\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public doNoStart = false;\r\n\r\n /** @internal */\r\n public _internalId = SystemBlock._IdCounter++;\r\n\r\n /**\r\n * Create a new SystemBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this._isSystem = true;\r\n\r\n this.registerInput(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\r\n this.registerInput(\"emitRate\", NodeParticleBlockConnectionPointTypes.Int, true, 10, 0);\r\n this.registerInput(\"texture\", NodeParticleBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"translationPivot\", NodeParticleBlockConnectionPointTypes.Vector2, true);\r\n this.registerInput(\"textureMask\", NodeParticleBlockConnectionPointTypes.Color4, true);\r\n this.registerInput(\"targetStopDuration\", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0);\r\n this.registerInput(\"onStart\", NodeParticleBlockConnectionPointTypes.System, true);\r\n this.registerInput(\"onEnd\", NodeParticleBlockConnectionPointTypes.System, true);\r\n this.registerInput(\"rampGradient\", NodeParticleBlockConnectionPointTypes.Color4, true);\r\n this.registerInput(\"emitterPosition\", NodeParticleBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerOutput(\"system\", NodeParticleBlockConnectionPointTypes.System);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"SystemBlock\";\r\n }\r\n\r\n /**\r\n * Gets the particle input component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the emitRate input component\r\n */\r\n public get emitRate(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the texture input component\r\n */\r\n public get texture(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the translationPivot input component\r\n */\r\n public get translationPivot(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the textureMask input component\r\n */\r\n public get textureMask(): NodeParticleConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the targetStopDuration input component\r\n */\r\n public get targetStopDuration(): NodeParticleConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the onStart input component\r\n */\r\n public get onStart(): NodeParticleConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the onEnd input component\r\n */\r\n public get onEnd(): NodeParticleConnectionPoint {\r\n return this._inputs[7];\r\n }\r\n\r\n /**\r\n * Gets the rampGradient input component\r\n */\r\n public get rampGradient(): NodeParticleConnectionPoint {\r\n return this._inputs[8];\r\n }\r\n\r\n /**\r\n * Gets the emitterPosition input component\r\n */\r\n public get emitterPosition(): NodeParticleConnectionPoint {\r\n return this._inputs[9];\r\n }\r\n\r\n /**\r\n * Gets the system output component\r\n */\r\n public get system(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Builds the block and return a functional particle system\r\n * @param state defines the building state\r\n * @returns the built particle system\r\n */\r\n public createSystem(state: NodeParticleBuildState): ParticleSystem {\r\n state.capacity = this.capacity;\r\n state.buildId = this._buildId++;\r\n\r\n this.build(state);\r\n\r\n const particleSystem = this.particle.getConnectedValue(state) as ParticleSystem;\r\n particleSystem.particleTexture = this.texture.getConnectedValue(state);\r\n particleSystem.emitRate = this.emitRate.getConnectedValue(state) as number;\r\n particleSystem.manualEmitCount = this.manualEmitCount;\r\n particleSystem.updateSpeed = this.updateSpeed;\r\n particleSystem.preWarmCycles = this.preWarmCycles;\r\n particleSystem.preWarmStepOffset = this.preWarmStepOffset;\r\n particleSystem.blendMode = this.blendMode;\r\n particleSystem.name = this.name;\r\n particleSystem._targetStopDuration = (this.targetStopDuration.getConnectedValue(state) as number) ?? 0;\r\n particleSystem.startDelay = this.startDelay;\r\n particleSystem.isBillboardBased = this.isBillboardBased;\r\n particleSystem.billboardMode = this.billBoardMode;\r\n particleSystem.translationPivot = (this.translationPivot.getConnectedValue(state) as Vector2) || Vector2.Zero();\r\n particleSystem.textureMask = this.textureMask.getConnectedValue(state) ?? new Color4(1, 1, 1, 1);\r\n particleSystem.isLocal = this.isLocal;\r\n particleSystem.disposeOnStop = this.disposeOnStop;\r\n particleSystem.emitter = (this.emitterPosition.getConnectedValue(state) as Vector3) ?? Vector3.Zero();\r\n\r\n // The emit rate can vary if it is connected to another block like a gradient\r\n particleSystem._calculateEmitRate = () => {\r\n state.systemContext = particleSystem;\r\n return this.emitRate.getConnectedValue(state) as number;\r\n };\r\n\r\n // Get the ramp gradients\r\n particleSystem.useRampGradients = false;\r\n if (this.rampGradient.isConnected) {\r\n if (this.rampGradient.connectedPoint?.ownerBlock instanceof ParticleGradientBlock) {\r\n // We have a possible gradient, loop through its entries\r\n const gradientInputs = this.rampGradient.connectedPoint?.ownerBlock.inputs;\r\n\r\n // Skip the first input which is the gradient selector, and we only care about the gradient values\r\n for (let i = 1; i < gradientInputs.length; i++) {\r\n if (gradientInputs[i].isConnected) {\r\n const rampEntry = gradientInputs[i].connectedPoint?.ownerBlock as ParticleGradientValueBlock;\r\n const color = rampEntry._inputs[0].getConnectedValue(state) as Color4;\r\n particleSystem.addRampGradient(rampEntry.reference, new Color3(color.r, color.g, color.b));\r\n particleSystem.useRampGradients = true;\r\n }\r\n }\r\n } else {\r\n // We have a single value, add it as ramp gradient\r\n const color = this.rampGradient.getConnectedValue(state) as Color4;\r\n particleSystem.addRampGradient(0, new Color3(color.r, color.g, color.b));\r\n particleSystem.useRampGradients = true;\r\n }\r\n }\r\n\r\n this.system._storedValue = this;\r\n\r\n particleSystem.canStart = () => {\r\n return !this.doNoStart;\r\n };\r\n\r\n particleSystem.onStartedObservable.add((system) => {\r\n // Triggers\r\n const onStartSystem = this.onStart.getConnectedValue(state);\r\n if (onStartSystem) {\r\n system.onStartedObservable.addOnce(() => {\r\n state.systemContext = particleSystem;\r\n const clone = _TriggerSubEmitter(onStartSystem, state.scene, state.emitterPosition!);\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n // Clean up the cloned system when the original system is disposed\r\n clone.dispose();\r\n });\r\n });\r\n }\r\n\r\n const onEndSystem = this.onEnd.getConnectedValue(state);\r\n if (onEndSystem) {\r\n system.onStoppedObservable.addOnce(() => {\r\n state.systemContext = particleSystem;\r\n const clone = _TriggerSubEmitter(onEndSystem, state.scene, state.emitterPosition!);\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n // Clean up the cloned system when the original system is disposed\r\n clone.dispose();\r\n });\r\n });\r\n }\r\n });\r\n\r\n this.onDisposeObservable.addOnce(() => {\r\n particleSystem.dispose();\r\n });\r\n\r\n // Return\r\n return particleSystem;\r\n }\r\n\r\n /**\r\n * Serializes the system block\r\n * @returns The serialized object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.capacity = this.capacity;\r\n serializationObject.manualEmitCount = this.manualEmitCount;\r\n serializationObject.blendMode = this.blendMode;\r\n serializationObject.updateSpeed = this.updateSpeed;\r\n serializationObject.preWarmCycles = this.preWarmCycles;\r\n serializationObject.preWarmStepOffset = this.preWarmStepOffset;\r\n serializationObject.isBillboardBased = this.isBillboardBased;\r\n serializationObject.billBoardMode = this.billBoardMode;\r\n serializationObject.isLocal = this.isLocal;\r\n serializationObject.disposeOnStop = this.disposeOnStop;\r\n serializationObject.doNoStart = this.doNoStart;\r\n serializationObject.startDelay = this.startDelay;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the system block\r\n * @param serializationObject The serialized system\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.capacity = serializationObject.capacity;\r\n this.manualEmitCount = serializationObject.manualEmitCount ?? -1;\r\n this.updateSpeed = serializationObject.updateSpeed ?? 0.0167;\r\n this.preWarmCycles = serializationObject.preWarmCycles ?? 0;\r\n this.preWarmStepOffset = serializationObject.preWarmStepOffset ?? 0;\r\n this.isBillboardBased = serializationObject.isBillboardBased ?? true;\r\n this.billBoardMode = serializationObject.billBoardMode ?? Constants.PARTICLES_BILLBOARDMODE_ALL;\r\n this.isLocal = serializationObject.isLocal ?? false;\r\n this.disposeOnStop = serializationObject.disposeOnStop ?? false;\r\n this.doNoStart = !!serializationObject.doNoStart;\r\n\r\n if (serializationObject.emitRate !== undefined) {\r\n this.emitRate.value = serializationObject.emitRate;\r\n }\r\n\r\n if (serializationObject.blendMode !== undefined) {\r\n this.blendMode = serializationObject.blendMode;\r\n }\r\n\r\n if (serializationObject.startDelay !== undefined) {\r\n this.startDelay = serializationObject.startDelay;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SystemBlock\", SystemBlock);\r\n"]}