@onerjs/core 8.29.2 → 8.29.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +15 -1
  2. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  3. package/FrameGraph/Node/nodeRenderGraph.d.ts +3 -1
  4. package/FrameGraph/Node/nodeRenderGraph.js +3 -0
  5. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  6. package/Materials/Textures/baseTexture.d.ts +5 -0
  7. package/Materials/Textures/baseTexture.js +18 -1
  8. package/Materials/Textures/baseTexture.js.map +1 -1
  9. package/Materials/Textures/texture.js +5 -1
  10. package/Materials/Textures/texture.js.map +1 -1
  11. package/Misc/sceneSerializer.js +3 -2
  12. package/Misc/sceneSerializer.js.map +1 -1
  13. package/Particles/IParticleSystem.d.ts +4 -6
  14. package/Particles/IParticleSystem.js.map +1 -1
  15. package/Particles/gpuParticleSystem.d.ts +4 -4
  16. package/Particles/gpuParticleSystem.js +4 -4
  17. package/Particles/gpuParticleSystem.js.map +1 -1
  18. package/Particles/particleSystem.d.ts +4 -0
  19. package/Particles/particleSystem.js +7 -1
  20. package/Particles/particleSystem.js.map +1 -1
  21. package/Particles/particleSystemSet.js +3 -1
  22. package/Particles/particleSystemSet.js.map +1 -1
  23. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +4 -2
  24. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +64 -37
  25. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
  26. package/Rendering/utilityLayerRenderer.js +1 -1
  27. package/Rendering/utilityLayerRenderer.js.map +1 -1
  28. package/ShadersWGSL/iblVoxelGrid.fragment.js +6 -7
  29. package/ShadersWGSL/iblVoxelGrid.fragment.js.map +1 -1
  30. package/ShadersWGSL/iblVoxelGrid.vertex.d.ts +0 -8
  31. package/ShadersWGSL/iblVoxelGrid.vertex.js +33 -22
  32. package/ShadersWGSL/iblVoxelGrid.vertex.js.map +1 -1
  33. package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js +1 -2
  34. package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js.map +1 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sceneSerializer.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/sceneSerializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAKxD,OAAO,EAAE,MAAM,EAAE,oBAAyB;AAE1C,IAAI,oBAAoB,GAAe,EAAE,CAAC;AAC1C,MAAM,iBAAiB,GAAG,CAAC,QAAkB,EAAE,uBAA4B,EAAO,EAAE;IAChF,IAAI,QAAQ,CAAC,cAAc,EAAE,CAAC;QAC1B,OAAO;IACX,CAAC;IAED,uBAAuB,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAEnE,oBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,IAAU,EAAE,kBAAuB,EAAO,EAAE;IAC/D,MAAM,mBAAmB,GAAQ,EAAE,CAAC;IAEpC,WAAW;IACX,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;IAChC,IAAI,QAAQ,EAAE,CAAC;QACX,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;YAChD,+IAA+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AAI,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC;oBACL,CAAC;gBACL,CAAC;gBACD,wDAAwD;gBACxD,IAAI,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;oBAClI,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBAC5C,CAAC;YACL,CAAC;QACL,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC7B,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;CACJ","sourcesContent":["import type { Geometry } from \"../Meshes/geometry\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { MultiMaterial } from \"../Materials/multiMaterial\";\r\nimport type { Material } from \"../Materials/material\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { Light } from \"../Lights/light\";\r\nimport { SerializationHelper } from \"./decorators.serialization\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport type { Node } from \"../node\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\nlet SerializedGeometries: Geometry[] = [];\r\nconst SerializeGeometry = (geometry: Geometry, serializationGeometries: any): any => {\r\n if (geometry.doNotSerialize) {\r\n return;\r\n }\r\n\r\n serializationGeometries.vertexData.push(geometry.serializeVerticeData());\r\n\r\n (<any>SerializedGeometries)[geometry.id] = true;\r\n};\r\n\r\nconst SerializeMesh = (mesh: Mesh, serializationScene: any): any => {\r\n const serializationObject: any = {};\r\n\r\n // Geometry\r\n const geometry = mesh._geometry;\r\n if (geometry) {\r\n if (!mesh.getScene().getGeometryById(geometry.id)) {\r\n // Geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry\r\n SerializeGeometry(geometry, serializationScene.geometries);\r\n }\r\n }\r\n\r\n // Custom\r\n if (mesh.serialize) {\r\n mesh.serialize(serializationObject);\r\n }\r\n\r\n return serializationObject;\r\n};\r\n\r\nconst FinalizeSingleNode = (node: Node, serializationObject: any) => {\r\n if ((node as Mesh)._isMesh) {\r\n const mesh = node as Mesh;\r\n //only works if the mesh is already loaded\r\n if (mesh.delayLoadState === Constants.DELAYLOADSTATE_LOADED || mesh.delayLoadState === Constants.DELAYLOADSTATE_NONE) {\r\n const serializeMaterial = (material: Material) => {\r\n serializationObject.materials = serializationObject.materials || [];\r\n if (mesh.material && !serializationObject.materials.some((mat: Material) => mat.id === (<Material>mesh.material).id)) {\r\n serializationObject.materials.push(material.serialize());\r\n }\r\n };\r\n\r\n //serialize material\r\n if (mesh.material && !mesh.material.doNotSerialize) {\r\n if (mesh.material instanceof MultiMaterial) {\r\n serializationObject.multiMaterials = serializationObject.multiMaterials || [];\r\n if (!serializationObject.multiMaterials.some((mat: Material) => mat.id === (<Material>mesh.material).id)) {\r\n serializationObject.multiMaterials.push(mesh.material.serialize());\r\n for (const submaterial of mesh.material.subMaterials) {\r\n if (submaterial) {\r\n serializeMaterial(submaterial);\r\n }\r\n }\r\n }\r\n } else {\r\n serializeMaterial(mesh.material);\r\n }\r\n } else if (!mesh.material) {\r\n serializeMaterial(mesh.getScene().defaultMaterial);\r\n }\r\n\r\n //serialize geometry\r\n const geometry = mesh._geometry;\r\n if (geometry) {\r\n if (!serializationObject.geometries) {\r\n serializationObject.geometries = {};\r\n\r\n serializationObject.geometries.boxes = [];\r\n serializationObject.geometries.spheres = [];\r\n serializationObject.geometries.cylinders = [];\r\n serializationObject.geometries.toruses = [];\r\n serializationObject.geometries.grounds = [];\r\n serializationObject.geometries.planes = [];\r\n serializationObject.geometries.torusKnots = [];\r\n serializationObject.geometries.vertexData = [];\r\n }\r\n\r\n SerializeGeometry(geometry, serializationObject.geometries);\r\n }\r\n // Skeletons\r\n if (mesh.skeleton && !mesh.skeleton.doNotSerialize) {\r\n serializationObject.skeletons = serializationObject.skeletons || [];\r\n serializationObject.skeletons.push(mesh.skeleton.serialize());\r\n }\r\n\r\n //serialize the actual mesh\r\n serializationObject.meshes = serializationObject.meshes || [];\r\n serializationObject.meshes.push(SerializeMesh(mesh, serializationObject));\r\n }\r\n } else if (node.getClassName() === \"TransformNode\") {\r\n const transformNode = node as TransformNode;\r\n serializationObject.transformNodes.push(transformNode.serialize());\r\n } else if (node.getClassName().indexOf(\"Camera\") !== -1) {\r\n const camera = node as Camera;\r\n serializationObject.cameras.push(camera.serialize());\r\n } else if (node.getClassName().indexOf(\"Light\") !== -1) {\r\n const light = node as Light;\r\n serializationObject.lights.push(light.serialize());\r\n }\r\n};\r\n\r\n/**\r\n * Class used to serialize a scene into a string\r\n */\r\nexport class SceneSerializer {\r\n /**\r\n * Clear cache used by a previous serialization\r\n */\r\n public static ClearCache(): void {\r\n SerializedGeometries = [];\r\n }\r\n\r\n /**\r\n * Serialize a scene into a JSON compatible object\r\n * Note that if the current engine does not support synchronous texture reading (like WebGPU), you should use SerializeAsync instead\r\n * as else you may not retrieve the proper base64 encoded texture data (when using the Texture.ForceSerializeBuffers flag)\r\n * @param scene defines the scene to serialize\r\n * @returns a JSON compatible object\r\n */\r\n public static Serialize(scene: Scene): any {\r\n return SceneSerializer._Serialize(scene);\r\n }\r\n\r\n private static _Serialize(scene: Scene, checkSyncReadSupported = true): any {\r\n const serializationObject: any = {};\r\n\r\n if (checkSyncReadSupported && !scene.getEngine()._features.supportSyncTextureRead && Texture.ForceSerializeBuffers) {\r\n Logger.Warn(\"The serialization object may not contain the proper base64 encoded texture data! You should use the SerializeAsync method instead.\");\r\n }\r\n\r\n SceneSerializer.ClearCache();\r\n\r\n // Scene\r\n serializationObject.useDelayedTextureLoading = scene.useDelayedTextureLoading;\r\n serializationObject.autoClear = scene.autoClear;\r\n serializationObject.clearColor = scene.clearColor.asArray();\r\n serializationObject.ambientColor = scene.ambientColor.asArray();\r\n serializationObject.gravity = scene.gravity.asArray();\r\n serializationObject.collisionsEnabled = scene.collisionsEnabled;\r\n serializationObject.useRightHandedSystem = scene.useRightHandedSystem;\r\n\r\n // Fog\r\n if (scene.fogMode !== undefined && scene.fogMode !== null) {\r\n serializationObject.fogMode = scene.fogMode;\r\n }\r\n if (scene.fogColor !== undefined && scene.fogColor !== null) {\r\n serializationObject.fogColor = scene.fogColor.asArray();\r\n }\r\n if (scene.fogStart !== undefined && scene.fogStart !== null) {\r\n serializationObject.fogStart = scene.fogStart;\r\n }\r\n if (scene.fogEnd !== undefined && scene.fogEnd !== null) {\r\n serializationObject.fogEnd = scene.fogEnd;\r\n }\r\n if (scene.fogDensity !== undefined && scene.fogDensity !== null) {\r\n serializationObject.fogDensity = scene.fogDensity;\r\n }\r\n\r\n //Physics\r\n if (scene.isPhysicsEnabled && scene.isPhysicsEnabled()) {\r\n const physicEngine = scene.getPhysicsEngine();\r\n\r\n if (physicEngine) {\r\n serializationObject.physicsEnabled = true;\r\n serializationObject.physicsGravity = physicEngine.gravity.asArray();\r\n serializationObject.physicsEngine = physicEngine.getPhysicsPluginName();\r\n }\r\n }\r\n\r\n // Metadata\r\n if (scene.metadata) {\r\n serializationObject.metadata = scene.metadata;\r\n }\r\n\r\n // Morph targets\r\n serializationObject.morphTargetManagers = [];\r\n for (const abstractMesh of scene.meshes) {\r\n const manager = (<Mesh>abstractMesh).morphTargetManager;\r\n\r\n if (manager) {\r\n serializationObject.morphTargetManagers.push(manager.serialize());\r\n }\r\n }\r\n\r\n // Lights\r\n serializationObject.lights = [];\r\n let index: number;\r\n let light: Light;\r\n for (index = 0; index < scene.lights.length; index++) {\r\n light = scene.lights[index];\r\n\r\n if (!light.doNotSerialize) {\r\n serializationObject.lights.push(light.serialize());\r\n }\r\n }\r\n\r\n // Cameras\r\n serializationObject.cameras = [];\r\n for (index = 0; index < scene.cameras.length; index++) {\r\n const camera = scene.cameras[index];\r\n\r\n if (!camera.doNotSerialize) {\r\n serializationObject.cameras.push(camera.serialize());\r\n }\r\n }\r\n\r\n if (scene.activeCamera) {\r\n serializationObject.activeCameraID = scene.activeCamera.id;\r\n }\r\n\r\n // Animations\r\n SerializationHelper.AppendSerializedAnimations(scene, serializationObject);\r\n\r\n // Animation Groups\r\n if (scene.animationGroups && scene.animationGroups.length > 0) {\r\n serializationObject.animationGroups = [];\r\n for (let animationGroupIndex = 0; animationGroupIndex < scene.animationGroups.length; animationGroupIndex++) {\r\n const animationGroup = scene.animationGroups[animationGroupIndex];\r\n if (!animationGroup.doNotSerialize) {\r\n serializationObject.animationGroups.push(animationGroup.serialize());\r\n }\r\n }\r\n }\r\n\r\n // Reflection probes\r\n if (scene.reflectionProbes && scene.reflectionProbes.length > 0) {\r\n serializationObject.reflectionProbes = [];\r\n\r\n for (index = 0; index < scene.reflectionProbes.length; index++) {\r\n const reflectionProbe = scene.reflectionProbes[index];\r\n serializationObject.reflectionProbes.push(reflectionProbe.serialize());\r\n }\r\n }\r\n\r\n // Materials\r\n serializationObject.materials = [];\r\n serializationObject.multiMaterials = [];\r\n let material: Material;\r\n for (index = 0; index < scene.materials.length; index++) {\r\n material = scene.materials[index];\r\n if (!material.doNotSerialize) {\r\n serializationObject.materials.push(material.serialize());\r\n }\r\n }\r\n\r\n // MultiMaterials\r\n serializationObject.multiMaterials = [];\r\n for (index = 0; index < scene.multiMaterials.length; index++) {\r\n const multiMaterial = scene.multiMaterials[index];\r\n serializationObject.multiMaterials.push(multiMaterial.serialize());\r\n }\r\n\r\n // Environment texture\r\n if (scene.environmentTexture) {\r\n if ((scene.environmentTexture as CubeTexture)._files) {\r\n serializationObject.environmentTexture = scene.environmentTexture.serialize();\r\n } else {\r\n serializationObject.environmentTexture = scene.environmentTexture.name;\r\n serializationObject.environmentTextureRotationY = (scene.environmentTexture as CubeTexture).rotationY;\r\n }\r\n }\r\n\r\n // Environment Intensity\r\n serializationObject.environmentIntensity = scene.environmentIntensity;\r\n\r\n // IBL Intensity\r\n serializationObject.iblIntensity = scene.iblIntensity;\r\n\r\n // Skeletons\r\n serializationObject.skeletons = [];\r\n for (index = 0; index < scene.skeletons.length; index++) {\r\n const skeleton = scene.skeletons[index];\r\n if (!skeleton.doNotSerialize) {\r\n serializationObject.skeletons.push(skeleton.serialize());\r\n }\r\n }\r\n\r\n // Transform nodes\r\n serializationObject.transformNodes = [];\r\n for (index = 0; index < scene.transformNodes.length; index++) {\r\n if (!scene.transformNodes[index].doNotSerialize) {\r\n serializationObject.transformNodes.push(scene.transformNodes[index].serialize());\r\n }\r\n }\r\n\r\n // Geometries\r\n serializationObject.geometries = {};\r\n\r\n serializationObject.geometries.boxes = [];\r\n serializationObject.geometries.spheres = [];\r\n serializationObject.geometries.cylinders = [];\r\n serializationObject.geometries.toruses = [];\r\n serializationObject.geometries.grounds = [];\r\n serializationObject.geometries.planes = [];\r\n serializationObject.geometries.torusKnots = [];\r\n serializationObject.geometries.vertexData = [];\r\n\r\n SerializedGeometries = [];\r\n const geometries = scene.getGeometries();\r\n for (index = 0; index < geometries.length; index++) {\r\n const geometry = geometries[index];\r\n\r\n if (geometry.isReady()) {\r\n SerializeGeometry(geometry, serializationObject.geometries);\r\n }\r\n }\r\n\r\n // Meshes\r\n serializationObject.meshes = [];\r\n for (index = 0; index < scene.meshes.length; index++) {\r\n const abstractMesh = scene.meshes[index];\r\n\r\n if (abstractMesh instanceof Mesh) {\r\n const mesh = abstractMesh;\r\n if (!mesh.doNotSerialize) {\r\n if (mesh.delayLoadState === Constants.DELAYLOADSTATE_LOADED || mesh.delayLoadState === Constants.DELAYLOADSTATE_NONE) {\r\n serializationObject.meshes.push(SerializeMesh(mesh, serializationObject));\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Particles Systems\r\n serializationObject.particleSystems = [];\r\n for (index = 0; index < scene.particleSystems.length; index++) {\r\n if (!scene.particleSystems[index].doNotSerialize) {\r\n serializationObject.particleSystems.push(scene.particleSystems[index].serialize(false));\r\n }\r\n }\r\n\r\n // Post processes\r\n serializationObject.postProcesses = [];\r\n for (index = 0; index < scene.postProcesses.length; index++) {\r\n serializationObject.postProcesses.push(scene.postProcesses[index].serialize());\r\n }\r\n\r\n // Action Manager\r\n if (scene.actionManager) {\r\n serializationObject.actions = scene.actionManager.serialize(\"scene\");\r\n }\r\n\r\n // Components\r\n for (const component of scene._serializableComponents) {\r\n component.serialize(serializationObject);\r\n }\r\n\r\n // Sprites\r\n if (scene.spriteManagers) {\r\n serializationObject.spriteManagers = [];\r\n for (index = 0; index < scene.spriteManagers.length; index++) {\r\n serializationObject.spriteManagers.push(scene.spriteManagers[index].serialize(true));\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Serialize a scene into a JSON compatible object\r\n * @param scene defines the scene to serialize\r\n * @returns a JSON promise compatible object\r\n */\r\n public static async SerializeAsync(scene: Scene): Promise<any> {\r\n const serializationObject = SceneSerializer._Serialize(scene, false);\r\n\r\n const promises: Array<Promise<any>> = [];\r\n\r\n this._CollectPromises(serializationObject, promises);\r\n\r\n await Promise.all(promises);\r\n return serializationObject;\r\n }\r\n\r\n private static _CollectPromises(obj: any, promises: Array<Promise<any>>): void {\r\n if (Array.isArray(obj)) {\r\n for (let i = 0; i < obj.length; ++i) {\r\n const o = obj[i];\r\n if (o instanceof Promise) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, github/no-then\r\n promises.push(o.then((res: any) => (obj[i] = res)));\r\n } else if (o instanceof Object || Array.isArray(o)) {\r\n this._CollectPromises(o, promises);\r\n }\r\n }\r\n } else if (obj instanceof Object) {\r\n for (const name in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, name)) {\r\n const o = obj[name];\r\n if (o instanceof Promise) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, github/no-then\r\n promises.push(o.then((res: any) => (obj[name] = res)));\r\n } else if (o instanceof Object || Array.isArray(o)) {\r\n this._CollectPromises(o, promises);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serialize a mesh into a JSON compatible object\r\n * @param toSerialize defines the mesh to serialize\r\n * @param withParents defines if parents must be serialized as well\r\n * @param withChildren defines if children must be serialized as well\r\n * @returns a JSON compatible object\r\n */\r\n public static SerializeMesh(toSerialize: any /* Mesh || Mesh[] */, withParents: boolean = false, withChildren: boolean = false): any {\r\n const serializationObject: any = {};\r\n serializationObject.meshes = [];\r\n serializationObject.transformNodes = [];\r\n serializationObject.cameras = [];\r\n serializationObject.lights = [];\r\n\r\n SceneSerializer.ClearCache();\r\n\r\n toSerialize = toSerialize instanceof Array ? toSerialize : [toSerialize];\r\n\r\n if (withParents || withChildren) {\r\n //deliberate for loop! not for each, appended should be processed as well.\r\n for (let i = 0; i < toSerialize.length; ++i) {\r\n if (withChildren) {\r\n const descendants = toSerialize[i].getDescendants();\r\n for (const node of descendants) {\r\n if (toSerialize.indexOf(node) < 0 && !node.doNotSerialize) {\r\n toSerialize.push(node);\r\n }\r\n }\r\n }\r\n //make sure the array doesn't contain the object already\r\n if (withParents && toSerialize[i].parent && toSerialize.indexOf(toSerialize[i].parent) < 0 && !toSerialize[i].parent.doNotSerialize) {\r\n toSerialize.push(toSerialize[i].parent);\r\n }\r\n }\r\n }\r\n\r\n for (const mesh of toSerialize) {\r\n FinalizeSingleNode(mesh, serializationObject);\r\n }\r\n\r\n return serializationObject;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"sceneSerializer.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/sceneSerializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OA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ACL,CAAC;QACL,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC7B,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;CACJ","sourcesContent":["import type { Geometry } from \"../Meshes/geometry\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { MultiMaterial } from \"../Materials/multiMaterial\";\r\nimport type { Material } from \"../Materials/material\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { Light } from \"../Lights/light\";\r\nimport { SerializationHelper } from \"./decorators.serialization\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport type { Node } from \"../node\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\nlet SerializedGeometries: Geometry[] = [];\r\nconst SerializeGeometry = (geometry: Geometry, serializationGeometries: any): any => {\r\n if (geometry.doNotSerialize) {\r\n return;\r\n }\r\n\r\n serializationGeometries.vertexData.push(geometry.serializeVerticeData());\r\n\r\n (<any>SerializedGeometries)[geometry.id] = true;\r\n};\r\n\r\nconst SerializeMesh = (mesh: Mesh, serializationScene: any): any => {\r\n const serializationObject: any = {};\r\n\r\n // Geometry\r\n const geometry = mesh._geometry;\r\n if (geometry) {\r\n if (!mesh.getScene().getGeometryById(geometry.id)) {\r\n // Geometry was in the memory but not added to the scene, nevertheless it's better to serialize to be able to reload the mesh with its geometry\r\n SerializeGeometry(geometry, serializationScene.geometries);\r\n }\r\n }\r\n\r\n // Custom\r\n if (mesh.serialize) {\r\n mesh.serialize(serializationObject);\r\n }\r\n\r\n return serializationObject;\r\n};\r\n\r\nconst FinalizeSingleNode = (node: Node, serializationObject: any) => {\r\n if ((node as Mesh)._isMesh) {\r\n const mesh = node as Mesh;\r\n //only works if the mesh is already loaded\r\n if (mesh.delayLoadState === Constants.DELAYLOADSTATE_LOADED || mesh.delayLoadState === Constants.DELAYLOADSTATE_NONE) {\r\n const serializeMaterial = (material: Material) => {\r\n serializationObject.materials = serializationObject.materials || [];\r\n if (mesh.material && !serializationObject.materials.some((mat: Material) => mat.id === (<Material>mesh.material).id)) {\r\n serializationObject.materials.push(material.serialize());\r\n }\r\n };\r\n\r\n //serialize material\r\n if (mesh.material && !mesh.material.doNotSerialize) {\r\n if (mesh.material instanceof MultiMaterial) {\r\n serializationObject.multiMaterials = serializationObject.multiMaterials || [];\r\n if (!serializationObject.multiMaterials.some((mat: Material) => mat.id === (<Material>mesh.material).id)) {\r\n serializationObject.multiMaterials.push(mesh.material.serialize());\r\n for (const submaterial of mesh.material.subMaterials) {\r\n if (submaterial) {\r\n serializeMaterial(submaterial);\r\n }\r\n }\r\n }\r\n } else {\r\n serializeMaterial(mesh.material);\r\n }\r\n } else if (!mesh.material) {\r\n serializeMaterial(mesh.getScene().defaultMaterial);\r\n }\r\n\r\n //serialize geometry\r\n const geometry = mesh._geometry;\r\n if (geometry) {\r\n if (!serializationObject.geometries) {\r\n serializationObject.geometries = {};\r\n\r\n serializationObject.geometries.boxes = [];\r\n serializationObject.geometries.spheres = [];\r\n serializationObject.geometries.cylinders = [];\r\n serializationObject.geometries.toruses = [];\r\n serializationObject.geometries.grounds = [];\r\n serializationObject.geometries.planes = [];\r\n serializationObject.geometries.torusKnots = [];\r\n serializationObject.geometries.vertexData = [];\r\n }\r\n\r\n SerializeGeometry(geometry, serializationObject.geometries);\r\n }\r\n // Skeletons\r\n if (mesh.skeleton && !mesh.skeleton.doNotSerialize) {\r\n serializationObject.skeletons = serializationObject.skeletons || [];\r\n serializationObject.skeletons.push(mesh.skeleton.serialize());\r\n }\r\n\r\n //serialize the actual mesh\r\n serializationObject.meshes = serializationObject.meshes || [];\r\n serializationObject.meshes.push(SerializeMesh(mesh, serializationObject));\r\n }\r\n } else if (node.getClassName() === \"TransformNode\") {\r\n const transformNode = node as TransformNode;\r\n serializationObject.transformNodes.push(transformNode.serialize());\r\n } else if (node.getClassName().indexOf(\"Camera\") !== -1) {\r\n const camera = node as Camera;\r\n serializationObject.cameras.push(camera.serialize());\r\n } else if (node.getClassName().indexOf(\"Light\") !== -1) {\r\n const light = node as Light;\r\n serializationObject.lights.push(light.serialize());\r\n }\r\n};\r\n\r\n/**\r\n * Class used to serialize a scene into a string\r\n */\r\nexport class SceneSerializer {\r\n /**\r\n * Clear cache used by a previous serialization\r\n */\r\n public static ClearCache(): void {\r\n SerializedGeometries = [];\r\n }\r\n\r\n /**\r\n * Serialize a scene into a JSON compatible object\r\n * Note that if the current engine does not support synchronous texture reading (like WebGPU), you should use SerializeAsync instead\r\n * as else you may not retrieve the proper base64 encoded texture data (when using the Texture.ForceSerializeBuffers flag)\r\n * @param scene defines the scene to serialize\r\n * @returns a JSON compatible object\r\n */\r\n public static Serialize(scene: Scene): any {\r\n return SceneSerializer._Serialize(scene);\r\n }\r\n\r\n private static _Serialize(scene: Scene, checkSyncReadSupported = true): any {\r\n const serializationObject: any = {};\r\n\r\n if (checkSyncReadSupported && !scene.getEngine()._features.supportSyncTextureRead && Texture.ForceSerializeBuffers) {\r\n Logger.Warn(\"The serialization object may not contain the proper base64 encoded texture data! You should use the SerializeAsync method instead.\");\r\n }\r\n\r\n SceneSerializer.ClearCache();\r\n\r\n // Scene\r\n serializationObject.useDelayedTextureLoading = scene.useDelayedTextureLoading;\r\n serializationObject.autoClear = scene.autoClear;\r\n serializationObject.clearColor = scene.clearColor.asArray();\r\n serializationObject.ambientColor = scene.ambientColor.asArray();\r\n serializationObject.gravity = scene.gravity.asArray();\r\n serializationObject.collisionsEnabled = scene.collisionsEnabled;\r\n serializationObject.useRightHandedSystem = scene.useRightHandedSystem;\r\n\r\n // Fog\r\n if (scene.fogMode !== undefined && scene.fogMode !== null) {\r\n serializationObject.fogMode = scene.fogMode;\r\n }\r\n if (scene.fogColor !== undefined && scene.fogColor !== null) {\r\n serializationObject.fogColor = scene.fogColor.asArray();\r\n }\r\n if (scene.fogStart !== undefined && scene.fogStart !== null) {\r\n serializationObject.fogStart = scene.fogStart;\r\n }\r\n if (scene.fogEnd !== undefined && scene.fogEnd !== null) {\r\n serializationObject.fogEnd = scene.fogEnd;\r\n }\r\n if (scene.fogDensity !== undefined && scene.fogDensity !== null) {\r\n serializationObject.fogDensity = scene.fogDensity;\r\n }\r\n\r\n //Physics\r\n if (scene.isPhysicsEnabled && scene.isPhysicsEnabled()) {\r\n const physicEngine = scene.getPhysicsEngine();\r\n\r\n if (physicEngine) {\r\n serializationObject.physicsEnabled = true;\r\n serializationObject.physicsGravity = physicEngine.gravity.asArray();\r\n serializationObject.physicsEngine = physicEngine.getPhysicsPluginName();\r\n }\r\n }\r\n\r\n // Metadata\r\n if (scene.metadata) {\r\n serializationObject.metadata = scene.metadata;\r\n }\r\n\r\n // Morph targets\r\n serializationObject.morphTargetManagers = [];\r\n for (const abstractMesh of scene.meshes) {\r\n const manager = (<Mesh>abstractMesh).morphTargetManager;\r\n\r\n if (manager) {\r\n serializationObject.morphTargetManagers.push(manager.serialize());\r\n }\r\n }\r\n\r\n // Lights\r\n serializationObject.lights = [];\r\n let index: number;\r\n let light: Light;\r\n for (index = 0; index < scene.lights.length; index++) {\r\n light = scene.lights[index];\r\n\r\n if (!light.doNotSerialize) {\r\n serializationObject.lights.push(light.serialize());\r\n }\r\n }\r\n\r\n // Cameras\r\n serializationObject.cameras = [];\r\n for (index = 0; index < scene.cameras.length; index++) {\r\n const camera = scene.cameras[index];\r\n\r\n if (!camera.doNotSerialize) {\r\n serializationObject.cameras.push(camera.serialize());\r\n }\r\n }\r\n\r\n if (scene.activeCamera) {\r\n serializationObject.activeCameraID = scene.activeCamera.id;\r\n }\r\n\r\n // Animations\r\n SerializationHelper.AppendSerializedAnimations(scene, serializationObject);\r\n\r\n // Animation Groups\r\n if (scene.animationGroups && scene.animationGroups.length > 0) {\r\n serializationObject.animationGroups = [];\r\n for (let animationGroupIndex = 0; animationGroupIndex < scene.animationGroups.length; animationGroupIndex++) {\r\n const animationGroup = scene.animationGroups[animationGroupIndex];\r\n if (!animationGroup.doNotSerialize) {\r\n serializationObject.animationGroups.push(animationGroup.serialize());\r\n }\r\n }\r\n }\r\n\r\n // Reflection probes\r\n if (scene.reflectionProbes && scene.reflectionProbes.length > 0) {\r\n serializationObject.reflectionProbes = [];\r\n\r\n for (index = 0; index < scene.reflectionProbes.length; index++) {\r\n const reflectionProbe = scene.reflectionProbes[index];\r\n serializationObject.reflectionProbes.push(reflectionProbe.serialize());\r\n }\r\n }\r\n\r\n // Materials\r\n serializationObject.materials = [];\r\n serializationObject.multiMaterials = [];\r\n let material: Material;\r\n for (index = 0; index < scene.materials.length; index++) {\r\n material = scene.materials[index];\r\n if (!material.doNotSerialize) {\r\n serializationObject.materials.push(material.serialize());\r\n }\r\n }\r\n\r\n // MultiMaterials\r\n serializationObject.multiMaterials = [];\r\n for (index = 0; index < scene.multiMaterials.length; index++) {\r\n const multiMaterial = scene.multiMaterials[index];\r\n serializationObject.multiMaterials.push(multiMaterial.serialize());\r\n }\r\n\r\n // Environment texture\r\n if (scene.environmentTexture) {\r\n if ((scene.environmentTexture as CubeTexture)._files) {\r\n serializationObject.environmentTexture = scene.environmentTexture.serialize();\r\n } else {\r\n serializationObject.environmentTexture = scene.environmentTexture.name;\r\n serializationObject.environmentTextureRotationY = (scene.environmentTexture as CubeTexture).rotationY;\r\n }\r\n }\r\n\r\n // Environment Intensity\r\n serializationObject.environmentIntensity = scene.environmentIntensity;\r\n\r\n // IBL Intensity\r\n serializationObject.iblIntensity = scene.iblIntensity;\r\n\r\n // Skeletons\r\n serializationObject.skeletons = [];\r\n for (index = 0; index < scene.skeletons.length; index++) {\r\n const skeleton = scene.skeletons[index];\r\n if (!skeleton.doNotSerialize) {\r\n serializationObject.skeletons.push(skeleton.serialize());\r\n }\r\n }\r\n\r\n // Transform nodes\r\n serializationObject.transformNodes = [];\r\n for (index = 0; index < scene.transformNodes.length; index++) {\r\n if (!scene.transformNodes[index].doNotSerialize) {\r\n serializationObject.transformNodes.push(scene.transformNodes[index].serialize());\r\n }\r\n }\r\n\r\n // Geometries\r\n serializationObject.geometries = {};\r\n\r\n serializationObject.geometries.boxes = [];\r\n serializationObject.geometries.spheres = [];\r\n serializationObject.geometries.cylinders = [];\r\n serializationObject.geometries.toruses = [];\r\n serializationObject.geometries.grounds = [];\r\n serializationObject.geometries.planes = [];\r\n serializationObject.geometries.torusKnots = [];\r\n serializationObject.geometries.vertexData = [];\r\n\r\n SerializedGeometries = [];\r\n const geometries = scene.getGeometries();\r\n for (index = 0; index < geometries.length; index++) {\r\n const geometry = geometries[index];\r\n\r\n if (geometry.isReady()) {\r\n SerializeGeometry(geometry, serializationObject.geometries);\r\n }\r\n }\r\n\r\n // Meshes\r\n serializationObject.meshes = [];\r\n for (index = 0; index < scene.meshes.length; index++) {\r\n const abstractMesh = scene.meshes[index];\r\n\r\n if (abstractMesh instanceof Mesh) {\r\n const mesh = abstractMesh;\r\n if (!mesh.doNotSerialize) {\r\n if (mesh.delayLoadState === Constants.DELAYLOADSTATE_LOADED || mesh.delayLoadState === Constants.DELAYLOADSTATE_NONE) {\r\n serializationObject.meshes.push(SerializeMesh(mesh, serializationObject));\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Particles Systems\r\n serializationObject.particleSystems = [];\r\n for (index = 0; index < scene.particleSystems.length; index++) {\r\n const particleSystem = scene.particleSystems[index];\r\n if (!particleSystem.doNotSerialize) {\r\n serializationObject.particleSystems.push(particleSystem.serialize(false));\r\n }\r\n }\r\n\r\n // Post processes\r\n serializationObject.postProcesses = [];\r\n for (index = 0; index < scene.postProcesses.length; index++) {\r\n serializationObject.postProcesses.push(scene.postProcesses[index].serialize());\r\n }\r\n\r\n // Action Manager\r\n if (scene.actionManager) {\r\n serializationObject.actions = scene.actionManager.serialize(\"scene\");\r\n }\r\n\r\n // Components\r\n for (const component of scene._serializableComponents) {\r\n component.serialize(serializationObject);\r\n }\r\n\r\n // Sprites\r\n if (scene.spriteManagers) {\r\n serializationObject.spriteManagers = [];\r\n for (index = 0; index < scene.spriteManagers.length; index++) {\r\n serializationObject.spriteManagers.push(scene.spriteManagers[index].serialize(true));\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Serialize a scene into a JSON compatible object\r\n * @param scene defines the scene to serialize\r\n * @returns a JSON promise compatible object\r\n */\r\n public static async SerializeAsync(scene: Scene): Promise<any> {\r\n const serializationObject = SceneSerializer._Serialize(scene, false);\r\n\r\n const promises: Array<Promise<any>> = [];\r\n\r\n this._CollectPromises(serializationObject, promises);\r\n\r\n await Promise.all(promises);\r\n return serializationObject;\r\n }\r\n\r\n private static _CollectPromises(obj: any, promises: Array<Promise<any>>): void {\r\n if (Array.isArray(obj)) {\r\n for (let i = 0; i < obj.length; ++i) {\r\n const o = obj[i];\r\n if (o instanceof Promise) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, github/no-then\r\n promises.push(o.then((res: any) => (obj[i] = res)));\r\n } else if (o instanceof Object || Array.isArray(o)) {\r\n this._CollectPromises(o, promises);\r\n }\r\n }\r\n } else if (obj instanceof Object) {\r\n for (const name in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, name)) {\r\n const o = obj[name];\r\n if (o instanceof Promise) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, github/no-then\r\n promises.push(o.then((res: any) => (obj[name] = res)));\r\n } else if (o instanceof Object || Array.isArray(o)) {\r\n this._CollectPromises(o, promises);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serialize a mesh into a JSON compatible object\r\n * @param toSerialize defines the mesh to serialize\r\n * @param withParents defines if parents must be serialized as well\r\n * @param withChildren defines if children must be serialized as well\r\n * @returns a JSON compatible object\r\n */\r\n public static SerializeMesh(toSerialize: any /* Mesh || Mesh[] */, withParents: boolean = false, withChildren: boolean = false): any {\r\n const serializationObject: any = {};\r\n serializationObject.meshes = [];\r\n serializationObject.transformNodes = [];\r\n serializationObject.cameras = [];\r\n serializationObject.lights = [];\r\n\r\n SceneSerializer.ClearCache();\r\n\r\n toSerialize = toSerialize instanceof Array ? toSerialize : [toSerialize];\r\n\r\n if (withParents || withChildren) {\r\n //deliberate for loop! not for each, appended should be processed as well.\r\n for (let i = 0; i < toSerialize.length; ++i) {\r\n if (withChildren) {\r\n const descendants = toSerialize[i].getDescendants();\r\n for (const node of descendants) {\r\n if (toSerialize.indexOf(node) < 0 && !node.doNotSerialize) {\r\n toSerialize.push(node);\r\n }\r\n }\r\n }\r\n //make sure the array doesn't contain the object already\r\n if (withParents && toSerialize[i].parent && toSerialize.indexOf(toSerialize[i].parent) < 0 && !toSerialize[i].parent.doNotSerialize) {\r\n toSerialize.push(toSerialize[i].parent);\r\n }\r\n }\r\n }\r\n\r\n for (const mesh of toSerialize) {\r\n FinalizeSingleNode(mesh, serializationObject);\r\n }\r\n\r\n return serializationObject;\r\n }\r\n}\r\n"]}
@@ -17,12 +17,6 @@ import type { AbstractMesh } from "../Meshes/abstractMesh.js";
17
17
  * A particle system represents a way to manage particles from their emission to their animation and rendering.
18
18
  */
19
19
  export interface IParticleSystem {
20
- /**
21
- * A flag indicating whether the object or its properties should not be serialized.
22
- * When set to true, the object or its properties will be excluded from serialization processes.
23
- * This is useful for preventing sensitive information or unnecessary data from being included in serialized output.
24
- */
25
- doNotSerialize: boolean;
26
20
  /**
27
21
  * Gets or sets the unique id of the particle system.
28
22
  */
@@ -259,6 +253,10 @@ export interface IParticleSystem {
259
253
  * Returns true if the particle system was generated by a node particle system set
260
254
  */
261
255
  isNodeGenerated: boolean;
256
+ /**
257
+ * Specifies if the particle system should be serialized
258
+ */
259
+ doNotSerialize?: boolean;
262
260
  /**
263
261
  * Gets the maximum number of particles active at the same time.
264
262
  * @returns The max number of active particles.
@@ -1 +1 @@
1
- {"version":3,"file":"IParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/IParticleSystem.ts"],"names":[],"mappings":"","sourcesContent":["import type { Immutable, Nullable } from \"../types\";\r\nimport type { Vector2, Vector3, Matrix } from \"../Maths/math.vector\";\r\nimport type { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport type {\r\n BoxParticleEmitter,\r\n IParticleEmitterType,\r\n PointParticleEmitter,\r\n HemisphericParticleEmitter,\r\n SphereParticleEmitter,\r\n SphereDirectedParticleEmitter,\r\n CylinderParticleEmitter,\r\n CylinderDirectedParticleEmitter,\r\n ConeParticleEmitter,\r\n ConeDirectedParticleEmitter,\r\n} from \"../Particles/EmitterTypes/index\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient } from \"../Misc/gradients\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Observable } from \"../Misc/observable\";\r\nimport type { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { DataBuffer } from \"../Buffers/dataBuffer\";\r\n\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\n\r\n/**\r\n * Interface representing a particle system in Babylon.js.\r\n * This groups the common functionalities that needs to be implemented in order to create a particle system.\r\n * A particle system represents a way to manage particles from their emission to their animation and rendering.\r\n */\r\nexport interface IParticleSystem {\r\n /**\r\n * A flag indicating whether the object or its properties should not be serialized.\r\n * When set to true, the object or its properties will be excluded from serialization processes.\r\n * This is useful for preventing sensitive information or unnecessary data from being included in serialized output.\r\n */\r\n doNotSerialize: boolean;\r\n /**\r\n * Gets or sets the unique id of the particle system.\r\n */\r\n uniqueId: number;\r\n /**\r\n * Particle system metadata.\r\n */\r\n metadata: Nullable<any>;\r\n\r\n /**\r\n * List of animations used by the particle system.\r\n */\r\n animations: Animation[];\r\n /**\r\n * The id of the Particle system.\r\n */\r\n id: string;\r\n /**\r\n * The name of the Particle system.\r\n */\r\n name: string;\r\n /**\r\n * The emitter represents the Mesh or position we are attaching the particle system to.\r\n */\r\n emitter: Nullable<AbstractMesh | Vector3>;\r\n /**\r\n * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction\r\n */\r\n isBillboardBased: boolean;\r\n /**\r\n * The rendering group used by the Particle system to chose when to render.\r\n */\r\n renderingGroupId: number;\r\n /**\r\n * The layer mask we are rendering the particles through.\r\n */\r\n layerMask: number;\r\n\r\n /**\r\n * The overall motion speed (0.01 is default update speed, faster updates = faster animation)\r\n */\r\n updateSpeed: number;\r\n\r\n /**\r\n * The amount of time the particle system is running (depends of the overall update speed).\r\n */\r\n targetStopDuration: number;\r\n\r\n /**\r\n * The texture used to render each particle. (this can be a spritesheet)\r\n */\r\n particleTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Blend mode use to render the particle. It can be any of the ParticleSystem.BLENDMODE_* constants\r\n */\r\n blendMode: number;\r\n\r\n /**\r\n * Minimum life time of emitting particles.\r\n */\r\n minLifeTime: number;\r\n /**\r\n * Maximum life time of emitting particles.\r\n */\r\n maxLifeTime: number;\r\n\r\n /**\r\n * Minimum Size of emitting particles.\r\n */\r\n minSize: number;\r\n /**\r\n * Maximum Size of emitting particles.\r\n */\r\n maxSize: number;\r\n\r\n /**\r\n * Minimum scale of emitting particles on X axis.\r\n */\r\n minScaleX: number;\r\n /**\r\n * Maximum scale of emitting particles on X axis.\r\n */\r\n maxScaleX: number;\r\n\r\n /**\r\n * Minimum scale of emitting particles on Y axis.\r\n */\r\n minScaleY: number;\r\n /**\r\n * Maximum scale of emitting particles on Y axis.\r\n */\r\n maxScaleY: number;\r\n\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors.\r\n */\r\n color1: Color4;\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors.\r\n */\r\n color2: Color4;\r\n\r\n /**\r\n * Color the particle will have at the end of its lifetime.\r\n */\r\n colorDead: Color4;\r\n\r\n /**\r\n * The maximum number of particles to emit per frame until we reach the activeParticleCount value\r\n */\r\n emitRate: number;\r\n\r\n /**\r\n * You can use gravity if you want to give an orientation to your particles.\r\n */\r\n gravity: Vector3;\r\n\r\n /**\r\n * Minimum power of emitting particles.\r\n */\r\n minEmitPower: number;\r\n /**\r\n * Maximum power of emitting particles.\r\n */\r\n maxEmitPower: number;\r\n /**\r\n * Minimum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n minAngularSpeed: number;\r\n /**\r\n * Maximum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n maxAngularSpeed: number;\r\n /**\r\n * Gets or sets the minimal initial rotation in radians.\r\n */\r\n minInitialRotation: number;\r\n /**\r\n * Gets or sets the maximal initial rotation in radians.\r\n */\r\n maxInitialRotation: number;\r\n /**\r\n * The particle emitter type defines the emitter used by the particle system.\r\n * It can be for example box, sphere, or cone...\r\n */\r\n particleEmitterType: Nullable<IParticleEmitterType>;\r\n /**\r\n * Defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n startDelay: number;\r\n /**\r\n * Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0\r\n */\r\n preWarmCycles: number;\r\n /**\r\n * Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1)\r\n */\r\n preWarmStepOffset: number;\r\n\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)\r\n */\r\n spriteCellChangeSpeed: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n startSpriteCellID: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n endSpriteCellID: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines whether the sprite animation is looping\r\n */\r\n spriteCellLoop: boolean;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use\r\n */\r\n spriteCellWidth: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use\r\n */\r\n spriteCellHeight: number;\r\n /**\r\n * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID\r\n */\r\n spriteRandomStartCell: boolean;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if a spritesheet is used to animate the particles texture\r\n */\r\n isAnimationSheetEnabled: boolean;\r\n\r\n /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */\r\n translationPivot: Vector2;\r\n\r\n /**\r\n * Gets or sets a texture used to add random noise to particle positions\r\n */\r\n noiseTexture: Nullable<BaseTexture>;\r\n\r\n /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */\r\n noiseStrength: Vector3;\r\n\r\n /**\r\n * Gets or sets the billboard mode to use when isBillboardBased = true.\r\n * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED\r\n */\r\n billboardMode: number;\r\n\r\n /**\r\n * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.\r\n */\r\n useLogarithmicDepth: boolean;\r\n\r\n /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */\r\n limitVelocityDamping: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called\r\n */\r\n beginAnimationOnStart: boolean;\r\n\r\n /**\r\n * Gets or sets the frame to start the animation from when beginAnimationOnStart is true\r\n */\r\n beginAnimationFrom: number;\r\n\r\n /**\r\n * Gets or sets the frame to end the animation on when beginAnimationOnStart is true\r\n */\r\n beginAnimationTo: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true\r\n */\r\n beginAnimationLoop: boolean;\r\n\r\n /**\r\n * Specifies whether the particle system will be disposed once it reaches the end of the animation.\r\n */\r\n disposeOnStop: boolean;\r\n\r\n /**\r\n * If you want to launch only a few particles at once, that can be done, as well.\r\n */\r\n manualEmitCount: number;\r\n\r\n /**\r\n * Specifies if the particles are updated in emitter local space or world space\r\n */\r\n isLocal: boolean;\r\n\r\n /** Snippet ID if the particle system was created from the snippet server */\r\n snippetId: string;\r\n\r\n /** Gets or sets a matrix to use to compute projection */\r\n defaultProjectionMatrix: Matrix;\r\n\r\n /** Indicates that the update of particles is done in the animate function (and not in render) */\r\n updateInAnimate: boolean;\r\n\r\n /** @internal */\r\n _wasDispatched: boolean;\r\n\r\n /**\r\n * Returns true if the particle system was generated by a node particle system set\r\n */\r\n isNodeGenerated: boolean;\r\n\r\n /**\r\n * Gets the maximum number of particles active at the same time.\r\n * @returns The max number of active particles.\r\n */\r\n getCapacity(): number;\r\n\r\n /**\r\n * Gets the number of particles active at the same time.\r\n * @returns The number of active particles.\r\n */\r\n getActiveCount(): number;\r\n\r\n /**\r\n * Gets if the system has been started. (Note: this will still be true after stop is called)\r\n * @returns True if it has been started, otherwise false.\r\n */\r\n isStarted(): boolean;\r\n\r\n /**\r\n * Animates the particle system for this frame.\r\n */\r\n animate(): void;\r\n /**\r\n * Renders the particle system in its current state.\r\n * @returns the current number of particles\r\n */\r\n render(): number;\r\n /**\r\n * Dispose the particle system and frees its associated resources.\r\n * @param disposeTexture defines if the particle texture must be disposed as well (true by default)\r\n * @param disposeAttachedSubEmitters defines if the attached sub-emitters must be disposed as well (false by default)\r\n * @param disposeEndSubEmitters defines if the end type sub-emitters must be disposed as well (false by default)\r\n */\r\n dispose(disposeTexture?: boolean, disposeAttachedSubEmitters?: boolean, disposeEndSubEmitters?: boolean): void;\r\n /**\r\n * An event triggered when the system is disposed\r\n */\r\n onDisposeObservable: Observable<IParticleSystem>;\r\n /**\r\n * An event triggered when the system is stopped\r\n */\r\n onStoppedObservable: Observable<IParticleSystem>;\r\n /**\r\n * An event triggered when the system is started\r\n */\r\n onStartedObservable: Observable<IParticleSystem>;\r\n /**\r\n * Clones the particle system.\r\n * @param name The name of the cloned object\r\n * @param newEmitter The new emitter to use\r\n * @returns the cloned particle system\r\n */\r\n clone(name: string, newEmitter: any): Nullable<IParticleSystem>;\r\n /**\r\n * Serializes the particle system to a JSON object\r\n * @param serializeTexture defines if the texture must be serialized as well\r\n * @returns the JSON object\r\n */\r\n serialize(serializeTexture: boolean): any;\r\n /**\r\n * Rebuild the particle system\r\n */\r\n rebuild(): void;\r\n\r\n /** Force the system to rebuild all gradients that need to be resync */\r\n forceRefreshGradients(): void;\r\n\r\n /**\r\n * Starts the particle system and begins to emit\r\n * @param delay defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n start(delay?: number): void;\r\n\r\n /**\r\n * Stops the particle system.\r\n */\r\n stop(): void;\r\n\r\n /**\r\n * Remove all active particles\r\n */\r\n reset(): void;\r\n\r\n /**\r\n * Gets a boolean indicating that the system is stopping\r\n * @returns true if the system is currently stopping\r\n */\r\n isStopping(): boolean;\r\n\r\n /**\r\n * Is this system ready to be used/rendered\r\n * @returns true if the system is ready\r\n */\r\n isReady(): boolean;\r\n /**\r\n * Returns the string \"ParticleSystem\"\r\n * @returns a string containing the class name\r\n */\r\n getClassName(): string;\r\n /**\r\n * Gets the custom effect used to render the particles\r\n * @param blendMode Blend mode for which the effect should be retrieved\r\n * @returns The effect\r\n */\r\n getCustomEffect(blendMode: number): Nullable<Effect>;\r\n /**\r\n * Sets the custom effect used to render the particles\r\n * @param effect The effect to set\r\n * @param blendMode Blend mode for which the effect should be set\r\n */\r\n setCustomEffect(effect: Nullable<Effect>, blendMode: number): void;\r\n\r\n /**\r\n * Fill the defines array according to the current settings of the particle system\r\n * @param defines Array to be updated\r\n * @param blendMode blend mode to take into account when updating the array\r\n * @param fillImageProcessing fills the image processing defines\r\n */\r\n fillDefines(defines: Array<string>, blendMode: number, fillImageProcessing?: boolean): void;\r\n /**\r\n * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system\r\n * @param uniforms Uniforms array to fill\r\n * @param attributes Attributes array to fill\r\n * @param samplers Samplers array to fill\r\n */\r\n fillUniformsAttributesAndSamplerNames(uniforms: Array<string>, attributes: Array<string>, samplers: Array<string>): void;\r\n /**\r\n * Observable that will be called just before the particles are drawn\r\n */\r\n onBeforeDrawParticlesObservable: Observable<Nullable<Effect>>;\r\n /**\r\n * Gets the name of the particle vertex shader\r\n */\r\n vertexShaderName: string;\r\n\r\n /**\r\n * Gets the vertex buffers used by the particle system\r\n */\r\n vertexBuffers: Immutable<{ [key: string]: VertexBuffer }>;\r\n /**\r\n * Gets the index buffer used by the particle system (or null if no index buffer is used)\r\n */\r\n indexBuffer: Nullable<DataBuffer>;\r\n\r\n /**\r\n * Adds a new color gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param color1 defines the color to affect to the specified gradient\r\n * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from\r\n * @returns the current particle system\r\n */\r\n addColorGradient(gradient: number, color1: Color4, color2?: Color4): IParticleSystem;\r\n /**\r\n * Remove a specific color gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeColorGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Adds a new size gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the size factor to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific size gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeSizeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n getColorGradients(): Nullable<Array<ColorGradient>>;\r\n /**\r\n * Gets the current list of size gradients.\r\n * You must use addSizeGradient and removeSizeGradient to update this list\r\n * @returns the list of size gradients\r\n */\r\n getSizeGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Gets the current list of angular speed gradients.\r\n * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list\r\n * @returns the list of angular speed gradients\r\n */\r\n getAngularSpeedGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new angular speed gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the angular speed to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addAngularSpeedGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific angular speed gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeAngularSpeedGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of velocity gradients.\r\n * You must use addVelocityGradient and removeVelocityGradient to update this list\r\n * @returns the list of velocity gradients\r\n */\r\n getVelocityGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new velocity gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the velocity to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific velocity gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeVelocityGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of limit velocity gradients.\r\n * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list\r\n * @returns the list of limit velocity gradients\r\n */\r\n getLimitVelocityGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new limit velocity gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the limit velocity to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addLimitVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific limit velocity gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeLimitVelocityGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Adds a new drag gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the drag to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addDragGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific drag gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeDragGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of drag gradients.\r\n * You must use addDragGradient and removeDragGradient to update this list\r\n * @returns the list of drag gradients\r\n */\r\n getDragGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property)\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the emit rate to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addEmitRateGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific emit rate gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeEmitRateGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of emit rate gradients.\r\n * You must use addEmitRateGradient and removeEmitRateGradient to update this list\r\n * @returns the list of emit rate gradients\r\n */\r\n getEmitRateGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property)\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the start size to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addStartSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific start size gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeStartSizeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of start size gradients.\r\n * You must use addStartSizeGradient and removeStartSizeGradient to update this list\r\n * @returns the list of start size gradients\r\n */\r\n getStartSizeGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new life time gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the life time factor to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addLifeTimeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific life time gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeLifeTimeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of life time gradients.\r\n * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list\r\n * @returns the list of life time gradients\r\n */\r\n getLifeTimeGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n getColorGradients(): Nullable<Array<ColorGradient>>;\r\n\r\n /**\r\n * Adds a new ramp gradient used to remap particle colors\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param color defines the color to affect to the specified gradient\r\n * @returns the current particle system\r\n */\r\n addRampGradient(gradient: number, color: Color3): IParticleSystem;\r\n /**\r\n * Gets the current list of ramp gradients.\r\n * You must use addRampGradient and removeRampGradient to update this list\r\n * @returns the list of ramp gradients\r\n */\r\n getRampGradients(): Nullable<Array<Color3Gradient>>;\r\n\r\n /** Gets or sets a boolean indicating that ramp gradients must be used\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends\r\n */\r\n useRampGradients: boolean;\r\n\r\n /**\r\n * Adds a new color remap gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param min defines the color remap minimal range\r\n * @param max defines the color remap maximal range\r\n * @returns the current particle system\r\n */\r\n addColorRemapGradient(gradient: number, min: number, max: number): IParticleSystem;\r\n /**\r\n * Gets the current list of color remap gradients.\r\n * You must use addColorRemapGradient and removeColorRemapGradient to update this list\r\n * @returns the list of color remap gradients\r\n */\r\n getColorRemapGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new alpha remap gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param min defines the alpha remap minimal range\r\n * @param max defines the alpha remap maximal range\r\n * @returns the current particle system\r\n */\r\n addAlphaRemapGradient(gradient: number, min: number, max: number): IParticleSystem;\r\n /**\r\n * Gets the current list of alpha remap gradients.\r\n * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list\r\n * @returns the list of alpha remap gradients\r\n */\r\n getAlphaRemapGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Creates a Point Emitter for the particle system (emits directly from the emitter position)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @returns the emitter\r\n */\r\n createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter;\r\n\r\n /**\r\n * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)\r\n * @param radius The radius of the hemisphere to emit from\r\n * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n createHemisphericEmitter(radius: number, radiusRange: number): HemisphericParticleEmitter;\r\n\r\n /**\r\n * Creates a Sphere Emitter for the particle system (emits along the sphere radius)\r\n * @param radius The radius of the sphere to emit from\r\n * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n createSphereEmitter(radius: number, radiusRange: number): SphereParticleEmitter;\r\n\r\n /**\r\n * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the sphere to emit from\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @returns the emitter\r\n */\r\n createDirectedSphereEmitter(radius: number, direction1: Vector3, direction2: Vector3): SphereDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)\r\n * @param radius The radius of the emission cylinder\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius\r\n * @param directionRandomizer How much to randomize the particle direction [0-1]\r\n * @returns the emitter\r\n */\r\n createCylinderEmitter(radius: number, height: number, radiusRange: number, directionRandomizer: number): CylinderParticleEmitter;\r\n\r\n /**\r\n * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the cylinder to emit from\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @returns the emitter\r\n */\r\n createDirectedCylinderEmitter(radius: number, height: number, radiusRange: number, direction1: Vector3, direction2: Vector3): CylinderDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)\r\n * @param radius The radius of the cone to emit from\r\n * @param angle The base angle of the cone\r\n * @returns the emitter\r\n */\r\n createConeEmitter(radius: number, angle: number): ConeParticleEmitter;\r\n\r\n createDirectedConeEmitter(radius: number, angle: number, direction1: Vector3, direction2: Vector3): ConeDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @returns the emitter\r\n */\r\n createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter;\r\n\r\n /**\r\n * Get hosting scene\r\n * @returns the scene\r\n */\r\n getScene(): Nullable<Scene>;\r\n}\r\n"]}
1
+ {"version":3,"file":"IParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/IParticleSystem.ts"],"names":[],"mappings":"","sourcesContent":["import type { Immutable, Nullable } from \"../types\";\r\nimport type { Vector2, Vector3, Matrix } from \"../Maths/math.vector\";\r\nimport type { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport type {\r\n BoxParticleEmitter,\r\n IParticleEmitterType,\r\n PointParticleEmitter,\r\n HemisphericParticleEmitter,\r\n SphereParticleEmitter,\r\n SphereDirectedParticleEmitter,\r\n CylinderParticleEmitter,\r\n CylinderDirectedParticleEmitter,\r\n ConeParticleEmitter,\r\n ConeDirectedParticleEmitter,\r\n} from \"../Particles/EmitterTypes/index\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient } from \"../Misc/gradients\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Observable } from \"../Misc/observable\";\r\nimport type { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { DataBuffer } from \"../Buffers/dataBuffer\";\r\n\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\n\r\n/**\r\n * Interface representing a particle system in Babylon.js.\r\n * This groups the common functionalities that needs to be implemented in order to create a particle system.\r\n * A particle system represents a way to manage particles from their emission to their animation and rendering.\r\n */\r\nexport interface IParticleSystem {\r\n /**\r\n * Gets or sets the unique id of the particle system.\r\n */\r\n uniqueId: number;\r\n /**\r\n * Particle system metadata.\r\n */\r\n metadata: Nullable<any>;\r\n\r\n /**\r\n * List of animations used by the particle system.\r\n */\r\n animations: Animation[];\r\n /**\r\n * The id of the Particle system.\r\n */\r\n id: string;\r\n /**\r\n * The name of the Particle system.\r\n */\r\n name: string;\r\n /**\r\n * The emitter represents the Mesh or position we are attaching the particle system to.\r\n */\r\n emitter: Nullable<AbstractMesh | Vector3>;\r\n /**\r\n * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction\r\n */\r\n isBillboardBased: boolean;\r\n /**\r\n * The rendering group used by the Particle system to chose when to render.\r\n */\r\n renderingGroupId: number;\r\n /**\r\n * The layer mask we are rendering the particles through.\r\n */\r\n layerMask: number;\r\n\r\n /**\r\n * The overall motion speed (0.01 is default update speed, faster updates = faster animation)\r\n */\r\n updateSpeed: number;\r\n\r\n /**\r\n * The amount of time the particle system is running (depends of the overall update speed).\r\n */\r\n targetStopDuration: number;\r\n\r\n /**\r\n * The texture used to render each particle. (this can be a spritesheet)\r\n */\r\n particleTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Blend mode use to render the particle. It can be any of the ParticleSystem.BLENDMODE_* constants\r\n */\r\n blendMode: number;\r\n\r\n /**\r\n * Minimum life time of emitting particles.\r\n */\r\n minLifeTime: number;\r\n /**\r\n * Maximum life time of emitting particles.\r\n */\r\n maxLifeTime: number;\r\n\r\n /**\r\n * Minimum Size of emitting particles.\r\n */\r\n minSize: number;\r\n /**\r\n * Maximum Size of emitting particles.\r\n */\r\n maxSize: number;\r\n\r\n /**\r\n * Minimum scale of emitting particles on X axis.\r\n */\r\n minScaleX: number;\r\n /**\r\n * Maximum scale of emitting particles on X axis.\r\n */\r\n maxScaleX: number;\r\n\r\n /**\r\n * Minimum scale of emitting particles on Y axis.\r\n */\r\n minScaleY: number;\r\n /**\r\n * Maximum scale of emitting particles on Y axis.\r\n */\r\n maxScaleY: number;\r\n\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors.\r\n */\r\n color1: Color4;\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors.\r\n */\r\n color2: Color4;\r\n\r\n /**\r\n * Color the particle will have at the end of its lifetime.\r\n */\r\n colorDead: Color4;\r\n\r\n /**\r\n * The maximum number of particles to emit per frame until we reach the activeParticleCount value\r\n */\r\n emitRate: number;\r\n\r\n /**\r\n * You can use gravity if you want to give an orientation to your particles.\r\n */\r\n gravity: Vector3;\r\n\r\n /**\r\n * Minimum power of emitting particles.\r\n */\r\n minEmitPower: number;\r\n /**\r\n * Maximum power of emitting particles.\r\n */\r\n maxEmitPower: number;\r\n /**\r\n * Minimum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n minAngularSpeed: number;\r\n /**\r\n * Maximum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n maxAngularSpeed: number;\r\n /**\r\n * Gets or sets the minimal initial rotation in radians.\r\n */\r\n minInitialRotation: number;\r\n /**\r\n * Gets or sets the maximal initial rotation in radians.\r\n */\r\n maxInitialRotation: number;\r\n /**\r\n * The particle emitter type defines the emitter used by the particle system.\r\n * It can be for example box, sphere, or cone...\r\n */\r\n particleEmitterType: Nullable<IParticleEmitterType>;\r\n /**\r\n * Defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n startDelay: number;\r\n /**\r\n * Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0\r\n */\r\n preWarmCycles: number;\r\n /**\r\n * Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1)\r\n */\r\n preWarmStepOffset: number;\r\n\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)\r\n */\r\n spriteCellChangeSpeed: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n startSpriteCellID: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n endSpriteCellID: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines whether the sprite animation is looping\r\n */\r\n spriteCellLoop: boolean;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use\r\n */\r\n spriteCellWidth: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use\r\n */\r\n spriteCellHeight: number;\r\n /**\r\n * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID\r\n */\r\n spriteRandomStartCell: boolean;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if a spritesheet is used to animate the particles texture\r\n */\r\n isAnimationSheetEnabled: boolean;\r\n\r\n /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */\r\n translationPivot: Vector2;\r\n\r\n /**\r\n * Gets or sets a texture used to add random noise to particle positions\r\n */\r\n noiseTexture: Nullable<BaseTexture>;\r\n\r\n /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */\r\n noiseStrength: Vector3;\r\n\r\n /**\r\n * Gets or sets the billboard mode to use when isBillboardBased = true.\r\n * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED\r\n */\r\n billboardMode: number;\r\n\r\n /**\r\n * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.\r\n */\r\n useLogarithmicDepth: boolean;\r\n\r\n /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */\r\n limitVelocityDamping: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called\r\n */\r\n beginAnimationOnStart: boolean;\r\n\r\n /**\r\n * Gets or sets the frame to start the animation from when beginAnimationOnStart is true\r\n */\r\n beginAnimationFrom: number;\r\n\r\n /**\r\n * Gets or sets the frame to end the animation on when beginAnimationOnStart is true\r\n */\r\n beginAnimationTo: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true\r\n */\r\n beginAnimationLoop: boolean;\r\n\r\n /**\r\n * Specifies whether the particle system will be disposed once it reaches the end of the animation.\r\n */\r\n disposeOnStop: boolean;\r\n\r\n /**\r\n * If you want to launch only a few particles at once, that can be done, as well.\r\n */\r\n manualEmitCount: number;\r\n\r\n /**\r\n * Specifies if the particles are updated in emitter local space or world space\r\n */\r\n isLocal: boolean;\r\n\r\n /** Snippet ID if the particle system was created from the snippet server */\r\n snippetId: string;\r\n\r\n /** Gets or sets a matrix to use to compute projection */\r\n defaultProjectionMatrix: Matrix;\r\n\r\n /** Indicates that the update of particles is done in the animate function (and not in render) */\r\n updateInAnimate: boolean;\r\n\r\n /** @internal */\r\n _wasDispatched: boolean;\r\n\r\n /**\r\n * Returns true if the particle system was generated by a node particle system set\r\n */\r\n isNodeGenerated: boolean;\r\n\r\n /**\r\n * Specifies if the particle system should be serialized\r\n */\r\n doNotSerialize?: boolean;\r\n\r\n /**\r\n * Gets the maximum number of particles active at the same time.\r\n * @returns The max number of active particles.\r\n */\r\n getCapacity(): number;\r\n\r\n /**\r\n * Gets the number of particles active at the same time.\r\n * @returns The number of active particles.\r\n */\r\n getActiveCount(): number;\r\n\r\n /**\r\n * Gets if the system has been started. (Note: this will still be true after stop is called)\r\n * @returns True if it has been started, otherwise false.\r\n */\r\n isStarted(): boolean;\r\n\r\n /**\r\n * Animates the particle system for this frame.\r\n */\r\n animate(): void;\r\n /**\r\n * Renders the particle system in its current state.\r\n * @returns the current number of particles\r\n */\r\n render(): number;\r\n /**\r\n * Dispose the particle system and frees its associated resources.\r\n * @param disposeTexture defines if the particle texture must be disposed as well (true by default)\r\n * @param disposeAttachedSubEmitters defines if the attached sub-emitters must be disposed as well (false by default)\r\n * @param disposeEndSubEmitters defines if the end type sub-emitters must be disposed as well (false by default)\r\n */\r\n dispose(disposeTexture?: boolean, disposeAttachedSubEmitters?: boolean, disposeEndSubEmitters?: boolean): void;\r\n /**\r\n * An event triggered when the system is disposed\r\n */\r\n onDisposeObservable: Observable<IParticleSystem>;\r\n /**\r\n * An event triggered when the system is stopped\r\n */\r\n onStoppedObservable: Observable<IParticleSystem>;\r\n /**\r\n * An event triggered when the system is started\r\n */\r\n onStartedObservable: Observable<IParticleSystem>;\r\n /**\r\n * Clones the particle system.\r\n * @param name The name of the cloned object\r\n * @param newEmitter The new emitter to use\r\n * @returns the cloned particle system\r\n */\r\n clone(name: string, newEmitter: any): Nullable<IParticleSystem>;\r\n /**\r\n * Serializes the particle system to a JSON object\r\n * @param serializeTexture defines if the texture must be serialized as well\r\n * @returns the JSON object\r\n */\r\n serialize(serializeTexture: boolean): any;\r\n /**\r\n * Rebuild the particle system\r\n */\r\n rebuild(): void;\r\n\r\n /** Force the system to rebuild all gradients that need to be resync */\r\n forceRefreshGradients(): void;\r\n\r\n /**\r\n * Starts the particle system and begins to emit\r\n * @param delay defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n start(delay?: number): void;\r\n\r\n /**\r\n * Stops the particle system.\r\n */\r\n stop(): void;\r\n\r\n /**\r\n * Remove all active particles\r\n */\r\n reset(): void;\r\n\r\n /**\r\n * Gets a boolean indicating that the system is stopping\r\n * @returns true if the system is currently stopping\r\n */\r\n isStopping(): boolean;\r\n\r\n /**\r\n * Is this system ready to be used/rendered\r\n * @returns true if the system is ready\r\n */\r\n isReady(): boolean;\r\n /**\r\n * Returns the string \"ParticleSystem\"\r\n * @returns a string containing the class name\r\n */\r\n getClassName(): string;\r\n /**\r\n * Gets the custom effect used to render the particles\r\n * @param blendMode Blend mode for which the effect should be retrieved\r\n * @returns The effect\r\n */\r\n getCustomEffect(blendMode: number): Nullable<Effect>;\r\n /**\r\n * Sets the custom effect used to render the particles\r\n * @param effect The effect to set\r\n * @param blendMode Blend mode for which the effect should be set\r\n */\r\n setCustomEffect(effect: Nullable<Effect>, blendMode: number): void;\r\n\r\n /**\r\n * Fill the defines array according to the current settings of the particle system\r\n * @param defines Array to be updated\r\n * @param blendMode blend mode to take into account when updating the array\r\n * @param fillImageProcessing fills the image processing defines\r\n */\r\n fillDefines(defines: Array<string>, blendMode: number, fillImageProcessing?: boolean): void;\r\n /**\r\n * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system\r\n * @param uniforms Uniforms array to fill\r\n * @param attributes Attributes array to fill\r\n * @param samplers Samplers array to fill\r\n */\r\n fillUniformsAttributesAndSamplerNames(uniforms: Array<string>, attributes: Array<string>, samplers: Array<string>): void;\r\n /**\r\n * Observable that will be called just before the particles are drawn\r\n */\r\n onBeforeDrawParticlesObservable: Observable<Nullable<Effect>>;\r\n /**\r\n * Gets the name of the particle vertex shader\r\n */\r\n vertexShaderName: string;\r\n\r\n /**\r\n * Gets the vertex buffers used by the particle system\r\n */\r\n vertexBuffers: Immutable<{ [key: string]: VertexBuffer }>;\r\n /**\r\n * Gets the index buffer used by the particle system (or null if no index buffer is used)\r\n */\r\n indexBuffer: Nullable<DataBuffer>;\r\n\r\n /**\r\n * Adds a new color gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param color1 defines the color to affect to the specified gradient\r\n * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from\r\n * @returns the current particle system\r\n */\r\n addColorGradient(gradient: number, color1: Color4, color2?: Color4): IParticleSystem;\r\n /**\r\n * Remove a specific color gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeColorGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Adds a new size gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the size factor to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific size gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeSizeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n getColorGradients(): Nullable<Array<ColorGradient>>;\r\n /**\r\n * Gets the current list of size gradients.\r\n * You must use addSizeGradient and removeSizeGradient to update this list\r\n * @returns the list of size gradients\r\n */\r\n getSizeGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Gets the current list of angular speed gradients.\r\n * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list\r\n * @returns the list of angular speed gradients\r\n */\r\n getAngularSpeedGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new angular speed gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the angular speed to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addAngularSpeedGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific angular speed gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeAngularSpeedGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of velocity gradients.\r\n * You must use addVelocityGradient and removeVelocityGradient to update this list\r\n * @returns the list of velocity gradients\r\n */\r\n getVelocityGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new velocity gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the velocity to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific velocity gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeVelocityGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of limit velocity gradients.\r\n * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list\r\n * @returns the list of limit velocity gradients\r\n */\r\n getLimitVelocityGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new limit velocity gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the limit velocity to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addLimitVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific limit velocity gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeLimitVelocityGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Adds a new drag gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the drag to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addDragGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific drag gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeDragGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of drag gradients.\r\n * You must use addDragGradient and removeDragGradient to update this list\r\n * @returns the list of drag gradients\r\n */\r\n getDragGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property)\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the emit rate to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addEmitRateGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific emit rate gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeEmitRateGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of emit rate gradients.\r\n * You must use addEmitRateGradient and removeEmitRateGradient to update this list\r\n * @returns the list of emit rate gradients\r\n */\r\n getEmitRateGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property)\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the start size to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addStartSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific start size gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeStartSizeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of start size gradients.\r\n * You must use addStartSizeGradient and removeStartSizeGradient to update this list\r\n * @returns the list of start size gradients\r\n */\r\n getStartSizeGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new life time gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the life time factor to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addLifeTimeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific life time gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeLifeTimeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of life time gradients.\r\n * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list\r\n * @returns the list of life time gradients\r\n */\r\n getLifeTimeGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n getColorGradients(): Nullable<Array<ColorGradient>>;\r\n\r\n /**\r\n * Adds a new ramp gradient used to remap particle colors\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param color defines the color to affect to the specified gradient\r\n * @returns the current particle system\r\n */\r\n addRampGradient(gradient: number, color: Color3): IParticleSystem;\r\n /**\r\n * Gets the current list of ramp gradients.\r\n * You must use addRampGradient and removeRampGradient to update this list\r\n * @returns the list of ramp gradients\r\n */\r\n getRampGradients(): Nullable<Array<Color3Gradient>>;\r\n\r\n /** Gets or sets a boolean indicating that ramp gradients must be used\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends\r\n */\r\n useRampGradients: boolean;\r\n\r\n /**\r\n * Adds a new color remap gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param min defines the color remap minimal range\r\n * @param max defines the color remap maximal range\r\n * @returns the current particle system\r\n */\r\n addColorRemapGradient(gradient: number, min: number, max: number): IParticleSystem;\r\n /**\r\n * Gets the current list of color remap gradients.\r\n * You must use addColorRemapGradient and removeColorRemapGradient to update this list\r\n * @returns the list of color remap gradients\r\n */\r\n getColorRemapGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new alpha remap gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param min defines the alpha remap minimal range\r\n * @param max defines the alpha remap maximal range\r\n * @returns the current particle system\r\n */\r\n addAlphaRemapGradient(gradient: number, min: number, max: number): IParticleSystem;\r\n /**\r\n * Gets the current list of alpha remap gradients.\r\n * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list\r\n * @returns the list of alpha remap gradients\r\n */\r\n getAlphaRemapGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Creates a Point Emitter for the particle system (emits directly from the emitter position)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @returns the emitter\r\n */\r\n createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter;\r\n\r\n /**\r\n * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)\r\n * @param radius The radius of the hemisphere to emit from\r\n * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n createHemisphericEmitter(radius: number, radiusRange: number): HemisphericParticleEmitter;\r\n\r\n /**\r\n * Creates a Sphere Emitter for the particle system (emits along the sphere radius)\r\n * @param radius The radius of the sphere to emit from\r\n * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n createSphereEmitter(radius: number, radiusRange: number): SphereParticleEmitter;\r\n\r\n /**\r\n * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the sphere to emit from\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @returns the emitter\r\n */\r\n createDirectedSphereEmitter(radius: number, direction1: Vector3, direction2: Vector3): SphereDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)\r\n * @param radius The radius of the emission cylinder\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius\r\n * @param directionRandomizer How much to randomize the particle direction [0-1]\r\n * @returns the emitter\r\n */\r\n createCylinderEmitter(radius: number, height: number, radiusRange: number, directionRandomizer: number): CylinderParticleEmitter;\r\n\r\n /**\r\n * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the cylinder to emit from\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @returns the emitter\r\n */\r\n createDirectedCylinderEmitter(radius: number, height: number, radiusRange: number, direction1: Vector3, direction2: Vector3): CylinderDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)\r\n * @param radius The radius of the cone to emit from\r\n * @param angle The base angle of the cone\r\n * @returns the emitter\r\n */\r\n createConeEmitter(radius: number, angle: number): ConeParticleEmitter;\r\n\r\n createDirectedConeEmitter(radius: number, angle: number, direction1: Vector3, direction2: Vector3): ConeDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @returns the emitter\r\n */\r\n createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter;\r\n\r\n /**\r\n * Get hosting scene\r\n * @returns the scene\r\n */\r\n getScene(): Nullable<Scene>;\r\n}\r\n"]}
@@ -34,10 +34,6 @@ export declare class GPUParticleSystem extends BaseParticleSystem implements IDi
34
34
  * The layer mask we are rendering the particles through.
35
35
  */
36
36
  layerMask: number;
37
- /**
38
- * Serialize control
39
- */
40
- doNotSerialize: boolean;
41
37
  private _capacity;
42
38
  private _maxActiveParticleCount;
43
39
  private _currentActiveCount;
@@ -71,6 +67,10 @@ export declare class GPUParticleSystem extends BaseParticleSystem implements IDi
71
67
  private readonly _rawTextureWidth;
72
68
  private _platform;
73
69
  private _rebuildingAfterContextLost;
70
+ /**
71
+ * Specifies if the particle system should be serialized
72
+ */
73
+ doNotSerialize: boolean;
74
74
  /**
75
75
  * Gets a boolean indicating if the GPU particles can be rendered on current browser
76
76
  */
@@ -696,10 +696,6 @@ export class GPUParticleSystem extends BaseParticleSystem {
696
696
  * The layer mask we are rendering the particles through.
697
697
  */
698
698
  this.layerMask = 0x0fffffff;
699
- /**
700
- * Serialize control
701
- */
702
- this.doNotSerialize = false;
703
699
  this._accumulatedCount = 0;
704
700
  this._renderVertexBuffers = [];
705
701
  this._targetIndex = 0;
@@ -713,6 +709,10 @@ export class GPUParticleSystem extends BaseParticleSystem {
713
709
  this._actualFrame = 0;
714
710
  this._rawTextureWidth = 256;
715
711
  this._rebuildingAfterContextLost = false;
712
+ /**
713
+ * Specifies if the particle system should be serialized
714
+ */
715
+ this.doNotSerialize = false;
716
716
  /**
717
717
  * An event triggered when the system is disposed.
718
718
  */