@onerjs/core 8.27.2 → 8.27.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.
- package/Cameras/arcRotateCamera.js +7 -5
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/targetCamera.d.ts +12 -0
- package/Cameras/targetCamera.js +19 -5
- package/Cameras/targetCamera.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +7 -5
- package/Decorators/nodeDecorator.js +7 -5
- package/Decorators/nodeDecorator.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +1 -1
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +2 -2
- package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.js +3 -3
- package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +3 -3
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +22 -22
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.js +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +2 -1
- package/FrameGraph/Node/nodeRenderGraph.js +8 -8
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Passes/renderPass.js +3 -3
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +7 -7
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +4 -0
- package/FrameGraph/frameGraph.js +8 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +2 -1
- package/FrameGraph/frameGraphRenderContext.js +10 -3
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +32 -2
- package/FrameGraph/frameGraphTextureManager.js +139 -9
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +4 -4
- package/Materials/Node/Blocks/conditionalBlock.js +1 -1
- package/Materials/Node/Blocks/curveBlock.js +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +1 -1
- package/Materials/Node/Blocks/trigonometryBlock.js +1 -1
- package/Materials/Node/Blocks/waveBlock.js +1 -1
- package/Materials/PBR/openPbrMaterial.d.ts +2 -0
- package/Materials/PBR/openPbrMaterial.js +3 -1
- package/Materials/PBR/openPbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +2 -0
- package/Materials/PBR/pbrBaseMaterial.js +3 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/texture.js +13 -3
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/floatingOriginMatrixOverrides.js +11 -6
- package/Materials/floatingOriginMatrixOverrides.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +3 -3
- package/Materials/materialHelper.functions.js +3 -3
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/standardMaterial.d.ts +2 -0
- package/Materials/standardMaterial.js +3 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.vector.functions.d.ts +17 -0
- package/Maths/math.vector.functions.js +27 -0
- package/Maths/math.vector.functions.js.map +1 -1
- package/Meshes/Node/Blocks/Set/aggregatorBlock.js +1 -1
- package/Meshes/Node/Blocks/Set/setUVsBlock.js +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.js +1 -1
- package/Meshes/Node/Blocks/conditionBlock.js +1 -1
- package/Meshes/Node/Blocks/geometryCurveBlock.js +1 -1
- package/Meshes/Node/Blocks/geometryEaseBlock.js +1 -1
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +1 -1
- package/Meshes/Node/Blocks/mappingBlock.js +1 -1
- package/Meshes/Node/Blocks/mathBlock.js +1 -1
- package/Meshes/Node/Blocks/randomBlock.js +1 -1
- package/Meshes/abstractMesh.d.ts +4 -0
- package/Meshes/abstractMesh.js +7 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.js +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Misc/screenshotTools.d.ts +63 -1
- package/Misc/screenshotTools.js +207 -4
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.d.ts +6 -0
- package/Misc/textureTools.js +6 -1
- package/Misc/textureTools.js.map +1 -1
- package/Particles/Node/Blocks/Conditions/particleConditionBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js +1 -0
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/customShapeBlock.js +1 -0
- package/Particles/Node/Blocks/Emitters/customShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js +1 -0
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js +1 -0
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js +1 -0
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +1 -0
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/index.d.ts +1 -0
- package/Particles/Node/Blocks/index.js +1 -0
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleFresnelBlock.d.ts +34 -0
- package/Particles/Node/Blocks/particleFresnelBlock.js +74 -0
- package/Particles/Node/Blocks/particleFresnelBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleInputBlock.js +2 -0
- package/Particles/Node/Blocks/particleInputBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleLerpBlock.d.ts +1 -1
- package/Particles/Node/Blocks/particleLerpBlock.js +1 -1
- package/Particles/Node/Blocks/particleLerpBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleLocalVariableBlock.js +1 -1
- package/Particles/Node/Blocks/particleMathBlock.js +1 -1
- package/Particles/Node/Blocks/particleRandomBlock.js +1 -1
- package/Particles/Node/Blocks/particleTrigonometryBlock.js +1 -1
- package/Particles/Node/Blocks/systemBlock.js +1 -1
- package/Particles/Node/Enums/nodeParticleContextualSources.d.ts +3 -1
- package/Particles/Node/Enums/nodeParticleContextualSources.js +2 -0
- package/Particles/Node/Enums/nodeParticleContextualSources.js.map +1 -1
- package/Particles/Node/Enums/nodeParticleSystemSources.d.ts +3 -1
- package/Particles/Node/Enums/nodeParticleSystemSources.js +2 -0
- package/Particles/Node/Enums/nodeParticleSystemSources.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.d.ts +1 -1
- package/Particles/Node/nodeParticleBuildState.js +4 -0
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/gpuParticleSystem.js +1 -0
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +1 -1
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrFragmentExtraDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrFragmentExtraDeclaration.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +1 -1
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/default.vertex.js +2 -2
- package/ShadersWGSL/default.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +2 -2
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/node.js +4 -1
- package/node.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particleLerpBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleLerpBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,MAAM,EAAE,qCAA8B;AAC/C;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAA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AI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC1H,CAAC;gBACD,KAAK,qCAAqC,CAAC,MAAM,CAAC,CAAC,CAAC;oBAChD,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC1J,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\n/**\r\n * Block used to lerp between 2 values\r\n */\r\nexport class ParticleLerpBlock extends NodeParticleBlock {\r\n /**\r\n * Creates a new
|
|
1
|
+
{"version":3,"file":"particleLerpBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Bloc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esContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\n/**\r\n * Block used to lerp between 2 values\r\n */\r\nexport class ParticleLerpBlock extends NodeParticleBlock {\r\n /**\r\n * Creates a new ParticleLerpBlock\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 this.registerInput(\"gradient\", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0, 1);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeParticleBlockConnectionPointTypes.Float |\r\n NodeParticleBlockConnectionPointTypes.Int |\r\n NodeParticleBlockConnectionPointTypes.Vector2 |\r\n NodeParticleBlockConnectionPointTypes.Vector3 |\r\n NodeParticleBlockConnectionPointTypes.Color4\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 \"ParticleLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand 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 operand 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 gradient operand input component\r\n */\r\n public get gradient(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build() {\r\n if (!this.left.isConnected || !this.right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (gradient: number, left: number, right: number) => {\r\n return (1 - gradient) * left + gradient * right;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n const gradient = this.gradient.getConnectedValue(state);\r\n switch (this.left.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(gradient, left, right);\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(gradient, left.x, right.x), func(gradient, left.y, right.y));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(gradient, left.x, right.x), func(gradient, left.y, right.y), func(gradient, left.z, right.z));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n return new Color4(func(gradient, left.r, right.r), func(gradient, left.g, right.g), func(gradient, left.b, right.b), func(gradient, left.a, right.a));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleLerpBlock\", ParticleLerpBlock);\r\n"]}
|
|
@@ -95,7 +95,7 @@ export class ParticleLocalVariableBlock extends NodeParticleBlock {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
__decorate([
|
|
98
|
-
editableInPropertyPage("Scope",
|
|
98
|
+
editableInPropertyPage("Scope", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
99
99
|
embedded: true,
|
|
100
100
|
notifiers: { rebuild: true },
|
|
101
101
|
options: [
|
|
@@ -304,7 +304,7 @@ export class ParticleMathBlock extends NodeParticleBlock {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
__decorate([
|
|
307
|
-
editableInPropertyPage("Operation",
|
|
307
|
+
editableInPropertyPage("Operation", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
308
308
|
notifiers: { rebuild: true },
|
|
309
309
|
embedded: true,
|
|
310
310
|
options: [
|
|
@@ -147,7 +147,7 @@ export class ParticleRandomBlock extends NodeParticleBlock {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
__decorate([
|
|
150
|
-
editableInPropertyPage("LockMode",
|
|
150
|
+
editableInPropertyPage("LockMode", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
151
151
|
notifiers: { rebuild: true },
|
|
152
152
|
embedded: true,
|
|
153
153
|
options: [
|
|
@@ -240,7 +240,7 @@ export class ParticleTrigonometryBlock extends NodeParticleBlock {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
__decorate([
|
|
243
|
-
editableInPropertyPage("Operation",
|
|
243
|
+
editableInPropertyPage("Operation", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
244
244
|
embedded: true,
|
|
245
245
|
notifiers: { rebuild: true },
|
|
246
246
|
options: [
|
|
@@ -164,7 +164,7 @@ export class SystemBlock extends NodeParticleBlock {
|
|
|
164
164
|
}
|
|
165
165
|
SystemBlock._IdCounter = 0;
|
|
166
166
|
__decorate([
|
|
167
|
-
editableInPropertyPage("Blend mode",
|
|
167
|
+
editableInPropertyPage("Blend mode", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
|
|
168
168
|
notifiers: { rebuild: true },
|
|
169
169
|
embedded: true,
|
|
170
170
|
options: [
|
|
@@ -34,5 +34,7 @@ export var NodeParticleContextualSources;
|
|
|
34
34
|
NodeParticleContextualSources[NodeParticleContextualSources["InitialColor"] = 19] = "InitialColor";
|
|
35
35
|
/** Color Dead*/
|
|
36
36
|
NodeParticleContextualSources[NodeParticleContextualSources["ColorDead"] = 20] = "ColorDead";
|
|
37
|
+
/** Initial Direction */
|
|
38
|
+
NodeParticleContextualSources[NodeParticleContextualSources["InitialDirection"] = 21] = "InitialDirection";
|
|
37
39
|
})(NodeParticleContextualSources || (NodeParticleContextualSources = {}));
|
|
38
40
|
//# sourceMappingURL=nodeParticleContextualSources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeParticleContextualSources.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Enums/nodeParticleContextualSources.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD;;GAEG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"nodeParticleContextualSources.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Enums/nodeParticleContextualSources.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD;;GAEG;AACH,MAAM,CAAN,IAAY,6BAiCX;AAjCD,WAAY,6BAA6B;IACrC,WAAW;IACX,iFAAa,CAAA;IACb,eAAe;IACf,yFAAiB,CAAA;IACjB,gBAAgB;IAChB,2FAAkB,CAAA;IAClB,UAAU;IACV,+EAAY,CAAA;IACZ,eAAe;IACf,yFAAiB,CAAA;IACjB,YAAY;IACZ,mFAAc,CAAA;IACd,sBAAsB;IACtB,uGAAwB,CAAA;IACxB,YAAY;IACZ,mFAAc,CAAA;IACd,kBAAkB;IAClB,+FAAoB,CAAA;IACpB,YAAY;IACZ,mFAAc,CAAA;IACd,sBAAsB;IACtB,wGAAwB,CAAA;IACxB,sBAAsB;IACtB,wGAAwB,CAAA;IACxB,oBAAoB;IACpB,oGAAsB,CAAA;IACtB,oBAAoB;IACpB,kGAAqB,CAAA;IACrB,gBAAgB;IAChB,4FAAkB,CAAA;IAClB,wBAAwB;IACxB,0GAAyB,CAAA;AAC7B,CAAC,EAjCW,6BAA6B,KAA7B,6BAA6B,QAiCxC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\n/**\r\n * Defines the kind of contextual sources for node particles\r\n */\r\nexport enum NodeParticleContextualSources {\r\n /** None */\r\n None = 0x0000,\r\n /** Position */\r\n Position = 0x0001,\r\n /** Direction */\r\n Direction = 0x0002,\r\n /** Age */\r\n Age = 0x0003,\r\n /** Lifetime */\r\n Lifetime = 0x0004,\r\n /** Color */\r\n Color = 0x0005,\r\n /** ScaledDirection */\r\n ScaledDirection = 0x0006,\r\n /** Scale */\r\n Scale = 0x0007,\r\n /** AgeGradient */\r\n AgeGradient = 0x0008,\r\n /** Angle */\r\n Angle = 0x0009,\r\n /** SpriteCellIndex */\r\n SpriteCellIndex = 0x0010,\r\n /** SpriteCellStart */\r\n SpriteCellStart = 0x0011,\r\n /** SpriteCellEnd */\r\n SpriteCellEnd = 0x0012,\r\n /** Initial Color */\r\n InitialColor = 0x0013,\r\n /** Color Dead*/\r\n ColorDead = 0x0014,\r\n /** Initial Direction */\r\n InitialDirection = 0x0015,\r\n}\r\n"]}
|
|
@@ -11,5 +11,7 @@ export var NodeParticleSystemSources;
|
|
|
11
11
|
NodeParticleSystemSources[NodeParticleSystemSources["Delta"] = 2] = "Delta";
|
|
12
12
|
/** Emitter */
|
|
13
13
|
NodeParticleSystemSources[NodeParticleSystemSources["Emitter"] = 3] = "Emitter";
|
|
14
|
+
/** Camera position */
|
|
15
|
+
NodeParticleSystemSources[NodeParticleSystemSources["CameraPosition"] = 4] = "CameraPosition";
|
|
14
16
|
})(NodeParticleSystemSources || (NodeParticleSystemSources = {}));
|
|
15
17
|
//# sourceMappingURL=nodeParticleSystemSources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeParticleSystemSources.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Enums/nodeParticleSystemSources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"nodeParticleSystemSources.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Enums/nodeParticleSystemSources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,yBAWX;AAXD,WAAY,yBAAyB;IACjC,WAAW;IACX,yEAAQ,CAAA;IACR,WAAW;IACX,yEAAQ,CAAA;IACR,iBAAiB;IACjB,2EAAS,CAAA;IACT,cAAc;IACd,+EAAW,CAAA;IACX,sBAAsB;IACtB,6FAAkB,CAAA;AACtB,CAAC,EAXW,yBAAyB,KAAzB,yBAAyB,QAWpC","sourcesContent":["/**\r\n * Enum used to define system values e.g. values automatically provided by the system\r\n */\r\nexport enum NodeParticleSystemSources {\r\n /** None */\r\n None = 0,\r\n /** Time */\r\n Time = 1,\r\n /** Delta time */\r\n Delta = 2,\r\n /** Emitter */\r\n Emitter = 3,\r\n /** Camera position */\r\n CameraPosition = 4,\r\n}\r\n"]}
|
|
@@ -63,7 +63,7 @@ export declare class NodeParticleBuildState {
|
|
|
63
63
|
* @param source Source of the contextual value
|
|
64
64
|
* @returns the value associated with the source
|
|
65
65
|
*/
|
|
66
|
-
getContextualValue(source: NodeParticleContextualSources): number |
|
|
66
|
+
getContextualValue(source: NodeParticleContextualSources): number | Color4 | Nullable<Vector3> | Vector2;
|
|
67
67
|
/**
|
|
68
68
|
* Gets a boolean indicating if the emitter is a transform node (or a simple vector3)
|
|
69
69
|
*/
|
|
@@ -100,6 +100,8 @@ export class NodeParticleBuildState {
|
|
|
100
100
|
return this.particleContext.cellIndex;
|
|
101
101
|
case NodeParticleContextualSources.SpriteCellStart:
|
|
102
102
|
return this.systemContext.startSpriteCellID;
|
|
103
|
+
case NodeParticleContextualSources.InitialDirection:
|
|
104
|
+
return this.particleContext._initialDirection;
|
|
103
105
|
}
|
|
104
106
|
return null;
|
|
105
107
|
}
|
|
@@ -167,6 +169,8 @@ export class NodeParticleBuildState {
|
|
|
167
169
|
else {
|
|
168
170
|
return this.systemContext.emitter;
|
|
169
171
|
}
|
|
172
|
+
case NodeParticleSystemSources.CameraPosition:
|
|
173
|
+
return this.scene.activeCamera?.globalPosition || Vector3.Zero();
|
|
170
174
|
}
|
|
171
175
|
return null;
|
|
172
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeParticleBuildState.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleBuildState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAGtF,OAAO,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAE1D,OAAO,EAAE,MAAM,EAAE,kCAA8B;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAG9E;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAAnC;QAcI,8DAA8D;QACvD,kCAA6B,GAAkC,EAAE,CAAC;QAKzE;;WAEG;QACI,oBAAe,GAAuB,IAAI,CAAC;QAElD;;WAEG;QACI,kBAAa,GAAiC,IAAI,CAAC;QAE1D;;WAEG;QACI,kBAAa,GAAW,CAAC,CAAC;QACjC;;WAEG;QACI,sBAAiB,GAAW,CAAC,CAAC;IA0KzC,CAAC;IApKG;;OAEG;IACI,UAAU;QACb,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,KAAK,MAAM,iBAAiB,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACjE,YAAY,IAAI,SAAS,iBAAiB,CAAC,IAAI,eAC3C,iBAAiB,CAAC,UAAU,CAAC,IACjC,IAAI,iBAAiB,CAAC,UAAU,CAAC,YAAY,EAAE,2CAA2C,CAAC;QAC/F,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACf,4CAA4C;YAC5C,MAAM,6CAA6C,GAAG,YAAY,CAAC;QACvE,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAmC,EAAE,UAAiD;QACxF,MAAM,KAAK,GAAG,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI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type { NodeParticleConnectionPoint } from \"./nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport type { Particle } from \"../particle\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"./Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport type { ThinParticleSystem } from \"../thinParticleSystem\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { NodeParticleSystemSources } from \"./Enums/nodeParticleSystemSources\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\n\r\n/**\r\n * Class used to store node based geometry build state\r\n */\r\nexport class NodeParticleBuildState {\r\n /**\r\n * Gets the capactity of the particle system to build\r\n */\r\n public capacity: number;\r\n\r\n /**\r\n * Gets the scene where the particle system is built\r\n */\r\n public scene: Scene;\r\n\r\n /** Gets or sets the build identifier */\r\n public buildId: number;\r\n\r\n /** Gets or sets the list of non connected mandatory inputs */\r\n public notConnectedNonOptionalInputs: NodeParticleConnectionPoint[] = [];\r\n\r\n /** Gets or sets a boolean indicating that verbose mode is on */\r\n public verbose: boolean;\r\n\r\n /**\r\n * Gets or sets the particle context for contextual data\r\n */\r\n public particleContext: Nullable<Particle> = null;\r\n\r\n /**\r\n * Gets or sets the system context for contextual data\r\n */\r\n public systemContext: Nullable<ThinParticleSystem> = null;\r\n\r\n /**\r\n * Gets or sets the index of the gradient to use\r\n */\r\n public gradientIndex: number = 0;\r\n /**\r\n * Gets or sets next gradient in line\r\n */\r\n public nextGradientIndex: number = 0;\r\n /**\r\n * Gets or sets the next gradient value\r\n */\r\n public nextGradientValue: any;\r\n\r\n /**\r\n * Emits errors if any\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n for (const notConnectedInput of this.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Build of Node Particle System Set failed:\\n\" + errorMessage;\r\n }\r\n }\r\n\r\n /**\r\n * Adapt a value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @returns the adapted value\r\n */\r\n adapt(source: NodeParticleConnectionPoint, targetType: NodeParticleBlockConnectionPointTypes) {\r\n const value = source.getConnectedValue(this) || 0;\r\n\r\n if (source.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeParticleBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeParticleBlockConnectionPointTypes.Color4:\r\n return new Color4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual source\r\n * @param source Source of the contextual value\r\n * @returns the value associated with the source\r\n */\r\n public getContextualValue(source: NodeParticleContextualSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleContextualSources.Position:\r\n return this.particleContext.position;\r\n case NodeParticleContextualSources.Direction:\r\n return this.particleContext.direction;\r\n case NodeParticleContextualSources.ScaledDirection:\r\n this.particleContext.direction.scaleToRef(this.systemContext._directionScale, this.systemContext._scaledDirection);\r\n return this.systemContext._scaledDirection;\r\n case NodeParticleContextualSources.Color:\r\n return this.particleContext.color;\r\n case NodeParticleContextualSources.InitialColor:\r\n return this.particleContext.initialColor;\r\n case NodeParticleContextualSources.ColorDead:\r\n return this.particleContext.colorDead;\r\n case NodeParticleContextualSources.Age:\r\n return this.particleContext.age;\r\n case NodeParticleContextualSources.Lifetime:\r\n return this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.Angle:\r\n return this.particleContext.angle;\r\n case NodeParticleContextualSources.Scale:\r\n return this.particleContext.scale;\r\n case NodeParticleContextualSources.AgeGradient:\r\n return this.particleContext.age / this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.SpriteCellEnd:\r\n return this.systemContext.endSpriteCellID;\r\n case NodeParticleContextualSources.SpriteCellIndex:\r\n return this.particleContext.cellIndex;\r\n case NodeParticleContextualSources.SpriteCellStart:\r\n return this.systemContext.startSpriteCellID;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the emitter is a transform node (or a simple vector3)\r\n */\r\n public get isEmitterTransformNode() {\r\n if (!this.systemContext) {\r\n return false;\r\n }\r\n\r\n if ((<AbstractMesh>this.systemContext.emitter).position) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets the emitter world matrix\r\n */\r\n public get emitterWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter inverse world matrix\r\n */\r\n public get emitterInverseWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterInverseWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter position\r\n */\r\n public get emitterPosition() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n\r\n if (this.isEmitterTransformNode) {\r\n return (<AbstractMesh>this.systemContext.emitter).absolutePosition;\r\n }\r\n\r\n return this.systemContext.emitter as Vector3;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a system source\r\n * @param source Source of the system value\r\n * @returns the value associated with the source\r\n */\r\n public getSystemValue(source: NodeParticleSystemSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleSystemSources.Time:\r\n return this.systemContext._actualFrame;\r\n case NodeParticleSystemSources.Delta:\r\n return this.systemContext._scaledUpdateSpeed;\r\n case NodeParticleSystemSources.Emitter:\r\n if (this.isEmitterTransformNode) {\r\n const emitterMesh = <AbstractMesh>this.systemContext.emitter;\r\n return emitterMesh.absolutePosition;\r\n } else {\r\n return this.systemContext.emitter;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeParticleBuildState.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleBuildState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAGtF,OAAO,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAE1D,OAAO,EAAE,MAAM,EAAE,kCAA8B;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAG9E;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAAnC;QAcI,8DAA8D;QACvD,kCAA6B,GAAkC,EAAE,CAAC;QAKzE;;WAEG;QACI,oBAAe,GAAuB,IAAI,CAAC;QAElD;;WAEG;QACI,kBAAa,GAAiC,IAAI,CAAC;QAE1D;;WAEG;QACI,kBAAa,GAAW,CAAC,CAAC;QACjC;;WAEG;QACI,sBAAiB,GAAW,CAAC,CAAC;IA8KzC,CAAC;IAxKG;;OAEG;IACI,UAAU;QACb,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,KAAK,MAAM,iBAAiB,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACjE,YAAY,IAAI,SAAS,iBAAiB,CAAC,IAAI,eAC3C,iBAAiB,CAAC,UAAU,CAAC,IACjC,IAAI,iBAAiB,CAAC,UAAU,CAAC,YAAY,EAAE,2CAA2C,CAAC;QAC/F,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACf,4CAA4C;YAC5C,MAAM,6CAA6C,GAAG,YAAY,CAAC;QACvE,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAmC,EAAE,UAAiD;QACxF,MA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J,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;gBACtC,CAAC;YACL,KAAK,yBAAyB,CAAC,cAAc;gBACzC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,cAAc,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACzE,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { NodeParticleConnectionPoint } from \"./nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport type { Particle } from \"../particle\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"./Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport type { ThinParticleSystem } from \"../thinParticleSystem\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { NodeParticleSystemSources } from \"./Enums/nodeParticleSystemSources\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\n\r\n/**\r\n * Class used to store node based geometry build state\r\n */\r\nexport class NodeParticleBuildState {\r\n /**\r\n * Gets the capactity of the particle system to build\r\n */\r\n public capacity: number;\r\n\r\n /**\r\n * Gets the scene where the particle system is built\r\n */\r\n public scene: Scene;\r\n\r\n /** Gets or sets the build identifier */\r\n public buildId: number;\r\n\r\n /** Gets or sets the list of non connected mandatory inputs */\r\n public notConnectedNonOptionalInputs: NodeParticleConnectionPoint[] = [];\r\n\r\n /** Gets or sets a boolean indicating that verbose mode is on */\r\n public verbose: boolean;\r\n\r\n /**\r\n * Gets or sets the particle context for contextual data\r\n */\r\n public particleContext: Nullable<Particle> = null;\r\n\r\n /**\r\n * Gets or sets the system context for contextual data\r\n */\r\n public systemContext: Nullable<ThinParticleSystem> = null;\r\n\r\n /**\r\n * Gets or sets the index of the gradient to use\r\n */\r\n public gradientIndex: number = 0;\r\n /**\r\n * Gets or sets next gradient in line\r\n */\r\n public nextGradientIndex: number = 0;\r\n /**\r\n * Gets or sets the next gradient value\r\n */\r\n public nextGradientValue: any;\r\n\r\n /**\r\n * Emits errors if any\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n for (const notConnectedInput of this.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Build of Node Particle System Set failed:\\n\" + errorMessage;\r\n }\r\n }\r\n\r\n /**\r\n * Adapt a value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @returns the adapted value\r\n */\r\n adapt(source: NodeParticleConnectionPoint, targetType: NodeParticleBlockConnectionPointTypes) {\r\n const value = source.getConnectedValue(this) || 0;\r\n\r\n if (source.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeParticleBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeParticleBlockConnectionPointTypes.Color4:\r\n return new Color4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual source\r\n * @param source Source of the contextual value\r\n * @returns the value associated with the source\r\n */\r\n public getContextualValue(source: NodeParticleContextualSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleContextualSources.Position:\r\n return this.particleContext.position;\r\n case NodeParticleContextualSources.Direction:\r\n return this.particleContext.direction;\r\n case NodeParticleContextualSources.ScaledDirection:\r\n this.particleContext.direction.scaleToRef(this.systemContext._directionScale, this.systemContext._scaledDirection);\r\n return this.systemContext._scaledDirection;\r\n case NodeParticleContextualSources.Color:\r\n return this.particleContext.color;\r\n case NodeParticleContextualSources.InitialColor:\r\n return this.particleContext.initialColor;\r\n case NodeParticleContextualSources.ColorDead:\r\n return this.particleContext.colorDead;\r\n case NodeParticleContextualSources.Age:\r\n return this.particleContext.age;\r\n case NodeParticleContextualSources.Lifetime:\r\n return this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.Angle:\r\n return this.particleContext.angle;\r\n case NodeParticleContextualSources.Scale:\r\n return this.particleContext.scale;\r\n case NodeParticleContextualSources.AgeGradient:\r\n return this.particleContext.age / this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.SpriteCellEnd:\r\n return this.systemContext.endSpriteCellID;\r\n case NodeParticleContextualSources.SpriteCellIndex:\r\n return this.particleContext.cellIndex;\r\n case NodeParticleContextualSources.SpriteCellStart:\r\n return this.systemContext.startSpriteCellID;\r\n case NodeParticleContextualSources.InitialDirection:\r\n return this.particleContext._initialDirection;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the emitter is a transform node (or a simple vector3)\r\n */\r\n public get isEmitterTransformNode() {\r\n if (!this.systemContext) {\r\n return false;\r\n }\r\n\r\n if ((<AbstractMesh>this.systemContext.emitter).position) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets the emitter world matrix\r\n */\r\n public get emitterWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter inverse world matrix\r\n */\r\n public get emitterInverseWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterInverseWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter position\r\n */\r\n public get emitterPosition() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n\r\n if (this.isEmitterTransformNode) {\r\n return (<AbstractMesh>this.systemContext.emitter).absolutePosition;\r\n }\r\n\r\n return this.systemContext.emitter as Vector3;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a system source\r\n * @param source Source of the system value\r\n * @returns the value associated with the source\r\n */\r\n public getSystemValue(source: NodeParticleSystemSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleSystemSources.Time:\r\n return this.systemContext._actualFrame;\r\n case NodeParticleSystemSources.Delta:\r\n return this.systemContext._scaledUpdateSpeed;\r\n case NodeParticleSystemSources.Emitter:\r\n if (this.isEmitterTransformNode) {\r\n const emitterMesh = <AbstractMesh>this.systemContext.emitter;\r\n return emitterMesh.absolutePosition;\r\n } else {\r\n return this.systemContext.emitter;\r\n }\r\n case NodeParticleSystemSources.CameraPosition:\r\n return this.scene.activeCamera?.globalPosition || Vector3.Zero();\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
|
|
@@ -260,6 +260,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
260
260
|
}
|
|
261
261
|
this._started = true;
|
|
262
262
|
this._stopped = false;
|
|
263
|
+
this._actualFrame = 0;
|
|
263
264
|
this._preWarmDone = false;
|
|
264
265
|
// Animations
|
|
265
266
|
if (this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene) {
|