ParticleSystem Class
Namespace: Stride.ParticlesAssembly: Stride.Particles.dll
[DataContract("ParticleSystem")]
public class ParticleSystem : IDisposable
Name | Description | |
---|---|---|
Constructors | ||
ParticleSystem() | Default constructor |
|
Fields | ||
Rotation | Rotation of the ParticleSystem, expressed as a quaternion rotation. Usually inherited directly from the ParticleSystemComponent or can be directly set. |
|
Translation | Translation of the ParticleSystem. Usually inherited directly from the ParticleSystemComponent or can be directly set. |
|
UniformScale | Scale of the ParticleSystem. Only uniform scale is supported. Usually inherited directly from the ParticleSystemComponent or can be directly set. |
|
Properties | ||
BoundingShape | AABB of this Particle System |
|
Emitters | List of Emitters in this ParticleSystem. Each Emitter has a separate ParticlePool (group) of Particles in it |
|
Enabled | Gets or sets a value indicating whether this ParticleSystem is enabled. |
|
IsPaused | ||
Settings | Settings class which contains miscellaneous settings for the particle system |
|
Methods | ||
Dispose() | ||
Dispose(Boolean) | ||
Finalize() | ||
GetAABB() | Gets the current AABB of the ParticleSystem |
|
GetEmitterByName(String) | Gets the first emitter with matching name which is contained in this ParticleSystem |
|
InvalidateRelations() | Invalidates relation of this emitter to any other emitters that might be referenced |
|
Pause() | Pauses the particle system simulation |
|
Play() | Use to both start a new simulation or continue a paused one |
|
ResetSimulation() | Resets the particle system, resetting all values to their initial state |
|
Stop() | Stops the particle simulation by resetting it to its initial state and pausing it |
|
StopEmitters() | Use to stop emitting new particles, but continue updating existing ones |
|
Timeout(Single) | Disables emission of new particles and sets a time limit on the system. After the time expires, the system stops. |
|
TryGetDebugDrawShape(ref DebugDrawShape, ref Vector3, ref Quaternion, ref Vector3) | Tries to acquire and draw a debug shape for better feedback and visualization. |
|
Update(Single) | Updates the particles |
Constructors
ParticleSystem()
Default constructor
public ParticleSystem()
Fields
Rotation
Rotation of the ParticleSystem, expressed as a quaternion rotation. Usually inherited directly from the ParticleSystemComponent or can be directly set.
public Quaternion Rotation
Field Value
Type | Description |
---|---|
Quaternion |
Translation
Translation of the ParticleSystem. Usually inherited directly from the ParticleSystemComponent or can be directly set.
public Vector3 Translation
Field Value
Type | Description |
---|---|
Vector3 |
UniformScale
Scale of the ParticleSystem. Only uniform scale is supported. Usually inherited directly from the ParticleSystemComponent or can be directly set.
public float UniformScale
Field Value
Type | Description |
---|---|
System.Single |
Properties
BoundingShape
AABB of this Particle System
[DataMember(5)]
[Display("Culling AABB", null)]
public BoundingShape BoundingShape { get; set; }
Property Value
Type | Description |
---|---|
BoundingShape |
Emitters
List of Emitters in this ParticleSystem. Each Emitter has a separate ParticlePool (group) of Particles in it
[DataMember(10)]
[Display("Emitters", null)]
public SafeList<ParticleEmitter> Emitters { get; }
Property Value
Type | Description |
---|---|
SafeList<ParticleEmitter> |
Enabled
Gets or sets a value indicating whether this ParticleSystem is enabled.
[DataMember(-10)]
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsPaused
public bool IsPaused { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Settings
Settings class which contains miscellaneous settings for the particle system
[DataMember(3)]
[Display("Settings", null)]
public ParticleSystemSettings Settings { get; set; }
Property Value
Type | Description |
---|---|
ParticleSystemSettings |
Methods
Dispose()
public void Dispose()
Dispose(Boolean)
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Finalize()
protected void Finalize()
GetAABB()
Gets the current AABB of the ParticleSystem
public BoundingBox GetAABB()
Returns
Type | Description |
---|---|
BoundingBox |
GetEmitterByName(String)
Gets the first emitter with matching name which is contained in this ParticleSystem
public ParticleEmitter GetEmitterByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the emitter. Some emitters might not have a name and cannot be referenced |
Returns
Type | Description |
---|---|
ParticleEmitter | ParticleEmitter with the same EmitterName or |
InvalidateRelations()
Invalidates relation of this emitter to any other emitters that might be referenced
public void InvalidateRelations()
Pause()
Pauses the particle system simulation
public void Pause()
Play()
Use to both start a new simulation or continue a paused one
public void Play()
ResetSimulation()
Resets the particle system, resetting all values to their initial state
public void ResetSimulation()
Stop()
Stops the particle simulation by resetting it to its initial state and pausing it
public void Stop()
StopEmitters()
Use to stop emitting new particles, but continue updating existing ones
public void StopEmitters()
Timeout(Single)
Disables emission of new particles and sets a time limit on the system. After the time expires, the system stops.
public void Timeout(float timeLimit)
Parameters
Type | Name | Description |
---|---|---|
System.Single | timeLimit |
TryGetDebugDrawShape(ref DebugDrawShape, ref Vector3, ref Quaternion, ref Vector3)
Tries to acquire and draw a debug shape for better feedback and visualization.
public bool TryGetDebugDrawShape(ref DebugDrawShape debugDrawShape, ref Vector3 translation, ref Quaternion rotation, ref Vector3 scale)
Parameters
Type | Name | Description |
---|---|---|
DebugDrawShape | debugDrawShape | The type of the debug shape (sphere, cone, etc.) |
Vector3 | translation | The shape's translation |
Quaternion | rotation | The shape's rotation |
Vector3 | scale | The shape's non-uniform scaling |
Returns
Type | Description |
---|---|
System.Boolean |
|
Update(Single)
Updates the particles
public void Update(float dt)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dt | Delta time - time, in seconds, elapsed since the last Update call to this particle system |