Class ParticleHelper
Hierarchy
- ParticleHelper
Index
Properties
Methods
Properties
Static Base Assets UrlSearch playground for BaseAssetsUrl
Gets or sets base Assets URL
Static Snippet UrlSearch playground for SnippetUrl
Define the Url to load snippets
Methods
Static Create AsyncSearch playground for CreateAsync
-
This is the main static method (one-liner) of this helper to create different particle systems
Parameters
-
type: string
This string represents the type to the particle system to create
-
scene: Nullable<Scene>
The scene where the particle system should live
-
Optional gpu: boolean
If the system will use gpu
Returns Promise<ParticleSystemSet>
the ParticleSystemSet created
-
Static Create DefaultSearch playground for CreateDefault
-
Create a default particle system that you can tweak
Parameters
-
emitter: Nullable<AbstractMesh | Vector3>
defines the emitter to use
-
Optional capacity: number
defines the system capacity (default is 500 particles)
-
Optional scene: Scene
defines the hosting scene
-
Optional useGPU: boolean
defines if a GPUParticleSystem must be created (default is false)
Returns IParticleSystem
the new Particle system
-
Static Create From Snippet AsyncSearch playground for CreateFromSnippetAsync
-
Creates a particle system from a snippet saved by the particle system editor
Parameters
-
snippetId: string
defines the snippet to load (can be set to _BLANK to create a default one)
-
scene: Scene
defines the hosting scene
-
Optional gpu: boolean
If the system will use gpu
-
Optional rootUrl: string
defines the root URL to use to load textures and relative dependencies
Returns Promise<IParticleSystem>
a promise that will resolve to the new particle system
-
Static Export SetSearch playground for ExportSet
-
Static function used to export a particle system to a ParticleSystemSet variable. Please note that the emitter shape is not exported
Parameters
-
systems: IParticleSystem[]
defines the particle systems to export
Returns ParticleSystemSet
the created particle system set
-
Static Parse From File AsyncSearch playground for ParseFromFileAsync
-
Creates a particle system from a snippet saved in a remote file
Parameters
-
name: Nullable<string>
defines the name of the particle system to create (can be null or empty to use the one from the json data)
-
url: string
defines the url to load from
-
scene: Scene
defines the hosting scene
-
Optional gpu: boolean
If the system will use gpu
-
Optional rootUrl: string
defines the root URL to use to load textures and relative dependencies
Returns Promise<IParticleSystem>
a promise that will resolve to the new particle system
-
This class is made for on one-liner static method to help creating particle system set.