@babylonjs/core 8.45.1 → 8.45.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioV2/webAudio/components/webAudioParameterComponent.js +1 -3
- package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +4 -0
- package/Cameras/Inputs/geospatialCameraPointersInput.js +56 -3
- package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/index.d.ts +1 -0
- package/Cameras/Inputs/index.js +1 -0
- package/Cameras/Inputs/index.js.map +1 -1
- package/Cameras/geospatialCamera.d.ts +3 -2
- package/Cameras/geospatialCamera.js +4 -4
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Engines/Extensions/engine.debugging.d.ts +4 -0
- package/Engines/Extensions/engine.debugging.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +1 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -1
- package/FrameGraph/frameGraphContext.js +3 -3
- package/FrameGraph/frameGraphContext.js.map +1 -1
- package/FrameGraph/frameGraphTask.js +4 -4
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +3 -3
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/lightingVolume.js +6 -6
- package/Lights/lightingVolume.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +2 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +2 -0
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +8 -4
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +2 -2
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +2 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Misc/minMaxReducer.js +2 -2
- package/Misc/minMaxReducer.js.map +1 -1
- package/Particles/Node/Blocks/Conditions/particleConditionBlock.js +2 -0
- package/Particles/Node/Blocks/Conditions/particleConditionBlock.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateRemapBlock.d.ts +39 -0
- package/Particles/Node/Blocks/Update/updateRemapBlock.js +93 -0
- package/Particles/Node/Blocks/Update/updateRemapBlock.js.map +1 -0
- package/Particles/Node/Blocks/index.d.ts +2 -1
- package/Particles/Node/Blocks/index.js +2 -1
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleLocalVariableBlock.d.ts +2 -0
- package/Particles/Node/Blocks/particleLocalVariableBlock.js +22 -10
- package/Particles/Node/Blocks/particleLocalVariableBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleMathBlock.d.ts +4 -0
- package/Particles/Node/Blocks/particleMathBlock.js +4 -0
- package/Particles/Node/Blocks/particleMathBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleNumberMathBlock.d.ts +60 -0
- package/Particles/Node/Blocks/particleNumberMathBlock.js +149 -0
- package/Particles/Node/Blocks/particleNumberMathBlock.js.map +1 -0
- package/Particles/Node/Blocks/{particleModuloBlock.d.ts → particleVectorMathBlock.d.ts} +25 -4
- package/Particles/Node/Blocks/{particleModuloBlock.js → particleVectorMathBlock.js} +59 -24
- package/Particles/Node/Blocks/particleVectorMathBlock.js.map +1 -0
- package/Particles/Node/Blocks/systemBlock.d.ts +4 -0
- package/Particles/Node/Blocks/systemBlock.js +25 -5
- package/Particles/Node/Blocks/systemBlock.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +71 -0
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/baseParticleSystem.d.ts +1 -1
- package/Particles/baseParticleSystem.js +1 -1
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/particle.d.ts +4 -0
- package/Particles/particle.js +3 -0
- package/Particles/particle.js.map +1 -1
- package/Probes/reflectionProbe.js +2 -2
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/depthRenderer.js +2 -2
- package/Rendering/depthRenderer.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.d.ts +30 -1
- package/XR/features/WebXRControllerPhysics.js +269 -16
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +36 -2
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +1 -1
- 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"],"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AC;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"]}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import { NodeParticleBlock } from "../nodeParticleBlock.js";
|
|
2
1
|
import type { NodeParticleConnectionPoint } from "../nodeParticleBlockConnectionPoint.js";
|
|
3
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
|
+
}
|
|
4
11
|
/**
|
|
5
|
-
* Block used to apply
|
|
12
|
+
* Block used to apply math operations that only apply to vectors
|
|
6
13
|
*/
|
|
7
|
-
export declare class
|
|
14
|
+
export declare class ParticleVectorMathBlock extends NodeParticleBlock {
|
|
15
|
+
/**
|
|
16
|
+
* Gets or sets the operation applied by the block
|
|
17
|
+
*/
|
|
18
|
+
operation: ParticleVectorMathBlockOperations;
|
|
8
19
|
private readonly _connectionObservers;
|
|
9
20
|
/**
|
|
10
|
-
* Create a new
|
|
21
|
+
* Create a new ParticleVectorMathBlock
|
|
11
22
|
* @param name defines the block name
|
|
12
23
|
*/
|
|
13
24
|
constructor(name: string);
|
|
@@ -34,4 +45,14 @@ export declare class ParticleModuloBlock extends NodeParticleBlock {
|
|
|
34
45
|
* Release resources
|
|
35
46
|
*/
|
|
36
47
|
dispose(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Serializes this block in a JSON representation
|
|
50
|
+
* @returns the serialized block object
|
|
51
|
+
*/
|
|
52
|
+
serialize(): any;
|
|
53
|
+
/**
|
|
54
|
+
* Deserializes the block from a JSON object
|
|
55
|
+
* @param serializationObject the JSON object to deserialize from
|
|
56
|
+
*/
|
|
57
|
+
_deserialize(serializationObject: any): void;
|
|
37
58
|
}
|
|
@@ -1,24 +1,37 @@
|
|
|
1
|
+
import { __decorate } from "../../../tslib.es6.js";
|
|
1
2
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
3
|
import { NodeParticleBlock } from "../nodeParticleBlock.js";
|
|
3
4
|
import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
|
|
5
|
+
import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
|
|
6
|
+
import { Vector3 } from "../../../Maths/math.vector.js";
|
|
4
7
|
/**
|
|
5
|
-
*
|
|
8
|
+
* Operations supported by the Vector Math block
|
|
6
9
|
*/
|
|
7
|
-
export
|
|
10
|
+
export var ParticleVectorMathBlockOperations;
|
|
11
|
+
(function (ParticleVectorMathBlockOperations) {
|
|
12
|
+
/** Dot product */
|
|
13
|
+
ParticleVectorMathBlockOperations[ParticleVectorMathBlockOperations["Dot"] = 0] = "Dot";
|
|
14
|
+
})(ParticleVectorMathBlockOperations || (ParticleVectorMathBlockOperations = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Block used to apply math operations that only apply to vectors
|
|
17
|
+
*/
|
|
18
|
+
export class ParticleVectorMathBlock extends NodeParticleBlock {
|
|
8
19
|
/**
|
|
9
|
-
* Create a new
|
|
20
|
+
* Create a new ParticleVectorMathBlock
|
|
10
21
|
* @param name defines the block name
|
|
11
22
|
*/
|
|
12
23
|
constructor(name) {
|
|
13
24
|
super(name);
|
|
25
|
+
/**
|
|
26
|
+
* Gets or sets the operation applied by the block
|
|
27
|
+
*/
|
|
28
|
+
this.operation = ParticleVectorMathBlockOperations.Dot;
|
|
14
29
|
this.registerInput("left", NodeParticleBlockConnectionPointTypes.AutoDetect);
|
|
15
30
|
this.registerInput("right", NodeParticleBlockConnectionPointTypes.AutoDetect);
|
|
16
31
|
this.registerOutput("output", NodeParticleBlockConnectionPointTypes.BasedOnInput);
|
|
17
32
|
this.output._typeConnectionSource = this.left;
|
|
18
|
-
this.left.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.
|
|
19
|
-
this.
|
|
20
|
-
this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);
|
|
21
|
-
this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Float);
|
|
33
|
+
this.left.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3);
|
|
34
|
+
this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3);
|
|
22
35
|
this._linkConnectionTypes(0, 1);
|
|
23
36
|
this._connectionObservers = [
|
|
24
37
|
this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
@@ -32,7 +45,7 @@ export class ParticleModuloBlock extends NodeParticleBlock {
|
|
|
32
45
|
* @returns the class name
|
|
33
46
|
*/
|
|
34
47
|
getClassName() {
|
|
35
|
-
return "
|
|
48
|
+
return "ParticleVectorMathBlock";
|
|
36
49
|
}
|
|
37
50
|
/**
|
|
38
51
|
* Gets the left input component
|
|
@@ -53,6 +66,7 @@ export class ParticleModuloBlock extends NodeParticleBlock {
|
|
|
53
66
|
return this._outputs[0];
|
|
54
67
|
}
|
|
55
68
|
_build(state) {
|
|
69
|
+
let func;
|
|
56
70
|
const left = this.left;
|
|
57
71
|
const right = this.right;
|
|
58
72
|
if (!left.isConnected || !right.isConnected) {
|
|
@@ -60,27 +74,24 @@ export class ParticleModuloBlock extends NodeParticleBlock {
|
|
|
60
74
|
this.output._storedValue = null;
|
|
61
75
|
return;
|
|
62
76
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
switch (this.operation) {
|
|
78
|
+
case ParticleVectorMathBlockOperations.Dot: {
|
|
79
|
+
func = (state) => {
|
|
80
|
+
return Vector3.Dot(left.getConnectedValue(state), right.getConnectedValue(state));
|
|
81
|
+
};
|
|
82
|
+
break;
|
|
69
83
|
}
|
|
84
|
+
}
|
|
85
|
+
this.output._storedFunction = (state) => {
|
|
70
86
|
return func(state);
|
|
71
87
|
};
|
|
72
88
|
}
|
|
73
89
|
_updateInputOutputTypes() {
|
|
74
90
|
// First update the output type with the initial assumption that we'll base it on the left input.
|
|
75
91
|
this.output._typeConnectionSource = this.left;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else if (this.left.isConnected !== this.right.isConnected) {
|
|
82
|
-
// Only one input is connected, so we need to determine the output type based on the connected input.
|
|
83
|
-
this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;
|
|
92
|
+
// If left is not connected, then instead use the type of right if it's connected.
|
|
93
|
+
if (!this.left.isConnected && this.right.isConnected) {
|
|
94
|
+
this.output._typeConnectionSource = this.right;
|
|
84
95
|
}
|
|
85
96
|
}
|
|
86
97
|
/**
|
|
@@ -93,6 +104,30 @@ export class ParticleModuloBlock extends NodeParticleBlock {
|
|
|
93
104
|
}
|
|
94
105
|
this._connectionObservers.length = 0;
|
|
95
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Serializes this block in a JSON representation
|
|
109
|
+
* @returns the serialized block object
|
|
110
|
+
*/
|
|
111
|
+
serialize() {
|
|
112
|
+
const serializationObject = super.serialize();
|
|
113
|
+
serializationObject.operation = this.operation;
|
|
114
|
+
return serializationObject;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Deserializes the block from a JSON object
|
|
118
|
+
* @param serializationObject the JSON object to deserialize from
|
|
119
|
+
*/
|
|
120
|
+
_deserialize(serializationObject) {
|
|
121
|
+
super._deserialize(serializationObject);
|
|
122
|
+
this.operation = serializationObject.operation;
|
|
123
|
+
}
|
|
96
124
|
}
|
|
97
|
-
|
|
98
|
-
|
|
125
|
+
__decorate([
|
|
126
|
+
editableInPropertyPage("Operation", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
127
|
+
notifiers: { rebuild: true },
|
|
128
|
+
embedded: true,
|
|
129
|
+
options: [{ label: "Dot", value: ParticleVectorMathBlockOperations.Dot }],
|
|
130
|
+
})
|
|
131
|
+
], ParticleVectorMathBlock.prototype, "operation", void 0);
|
|
132
|
+
RegisterClass("BABYLON.ParticleVectorMathBlock", ParticleVectorMathBlock);
|
|
133
|
+
//# 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":";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;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD;;GAEG;AACH,MAAM,CAAN,IAAY,iCAGX;AAHD,WAAY,iCAAiC;IACzC,kBAAkB;IAClB,uFAAG,CAAA;AACP,CAAC,EAHW,iCAAiC,KAAjC,iCAAiC,QAG5C;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAY1D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAhBhB;;WAEG;QAMI,cAAS,GAAG,iCAAiC,CAAC,GAAG,CAA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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;AA9HU;IALN,sBAAsB,CAAC,WAAW,uCAA+B,UAAU,EAAE;QAC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iCAAiC,CAAC,GAAG,EAAE,CAAC;KAC5E,CAAC;0DACuD;AAgI7D,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\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}\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: [{ label: \"Dot\", value: ParticleVectorMathBlockOperations.Dot }],\r\n })\r\n public operation = ParticleVectorMathBlockOperations.Dot;\r\n private readonly _connectionObservers: Observer<NodeParticleConnectionPoint>[];\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.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.Vector3);\r\n this.right.acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3);\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 \"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 }\r\n\r\n this.output._storedFunction = (state) => {\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.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
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
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
5
|
import { Vector2 } from "../../../Maths/math.vector.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
|
*/
|
|
@@ -164,6 +169,7 @@ export class SystemBlock extends NodeParticleBlock {
|
|
|
164
169
|
particleSystem._targetStopDuration = this.targetStopDuration.getConnectedValue(state) ?? 0;
|
|
165
170
|
particleSystem.startDelay = this.startDelay;
|
|
166
171
|
particleSystem.isBillboardBased = this.isBillboardBased;
|
|
172
|
+
particleSystem.billboardMode = this.billBoardMode;
|
|
167
173
|
particleSystem.translationPivot = this.translationPivot.getConnectedValue(state) || Vector2.Zero();
|
|
168
174
|
particleSystem.textureMask = this.textureMask.getConnectedValue(state) ?? new Color4(1, 1, 1, 1);
|
|
169
175
|
particleSystem.isLocal = this.isLocal;
|
|
@@ -244,6 +250,7 @@ export class SystemBlock extends NodeParticleBlock {
|
|
|
244
250
|
serializationObject.preWarmCycles = this.preWarmCycles;
|
|
245
251
|
serializationObject.preWarmStepOffset = this.preWarmStepOffset;
|
|
246
252
|
serializationObject.isBillboardBased = this.isBillboardBased;
|
|
253
|
+
serializationObject.billBoardMode = this.billBoardMode;
|
|
247
254
|
serializationObject.isLocal = this.isLocal;
|
|
248
255
|
serializationObject.disposeOnStop = this.disposeOnStop;
|
|
249
256
|
serializationObject.doNoStart = this.doNoStart;
|
|
@@ -262,6 +269,7 @@ export class SystemBlock extends NodeParticleBlock {
|
|
|
262
269
|
this.preWarmCycles = serializationObject.preWarmCycles ?? 0;
|
|
263
270
|
this.preWarmStepOffset = serializationObject.preWarmStepOffset ?? 0;
|
|
264
271
|
this.isBillboardBased = serializationObject.isBillboardBased ?? true;
|
|
272
|
+
this.billBoardMode = serializationObject.billBoardMode ?? 7;
|
|
265
273
|
this.isLocal = serializationObject.isLocal ?? false;
|
|
266
274
|
this.disposeOnStop = serializationObject.disposeOnStop ?? false;
|
|
267
275
|
this.doNoStart = !!serializationObject.doNoStart;
|
|
@@ -282,11 +290,11 @@ __decorate([
|
|
|
282
290
|
notifiers: { rebuild: true },
|
|
283
291
|
embedded: true,
|
|
284
292
|
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 },
|
|
293
|
+
{ label: "Blend Mode OneOne", value: BaseParticleSystem.BLENDMODE_ONEONE },
|
|
294
|
+
{ label: "Blend Mode Standard", value: BaseParticleSystem.BLENDMODE_STANDARD },
|
|
295
|
+
{ label: "Blend Mode Add", value: BaseParticleSystem.BLENDMODE_ADD },
|
|
296
|
+
{ label: "Blend Mode Multiply", value: BaseParticleSystem.BLENDMODE_MULTIPLY },
|
|
297
|
+
{ label: "Blend Mode MultiplyAdd", value: BaseParticleSystem.BLENDMODE_MULTIPLYADD },
|
|
290
298
|
],
|
|
291
299
|
})
|
|
292
300
|
], SystemBlock.prototype, "blendMode", void 0);
|
|
@@ -311,6 +319,18 @@ __decorate([
|
|
|
311
319
|
__decorate([
|
|
312
320
|
editableInPropertyPage("Is billboard based", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
|
|
313
321
|
], SystemBlock.prototype, "isBillboardBased", void 0);
|
|
322
|
+
__decorate([
|
|
323
|
+
editableInPropertyPage("Billboard mode", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
324
|
+
notifiers: { rebuild: true },
|
|
325
|
+
embedded: true,
|
|
326
|
+
options: [
|
|
327
|
+
{ label: "Billboard Mode All", value: 7 },
|
|
328
|
+
{ label: "Billboard Mode Y", value: 2 },
|
|
329
|
+
{ label: "Billboard Mode Stretched", value: 8 },
|
|
330
|
+
{ label: "Billboard Mode Stretched Local", value: 9 },
|
|
331
|
+
],
|
|
332
|
+
})
|
|
333
|
+
], SystemBlock.prototype, "billBoardMode", void 0);
|
|
314
334
|
__decorate([
|
|
315
335
|
editableInPropertyPage("Is local", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
|
|
316
336
|
], 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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N,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;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,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;AACxH,OAAO,EAAE,qBAAqB,EAAE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,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;AAqQ7B,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 } 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.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.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\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"]}
|