UpdaterForceField Class
Namespace: Stride.Particles.ModulesAssembly: Stride.Particles.dll
The UpdaterForceField updates the particles' positions and velocity based on proximity and relative position to a bounding force field
[DataContract("UpdaterForceField")]
[Display("Force Field", null)]
public class UpdaterForceField : ParticleUpdater
Name | Description | |
---|---|---|
Constructors | ||
UpdaterForceField() | Default constructor which also registers the fields required by this updater |
|
Properties | ||
DebugDraw | Should this Particle Module's bounds be displayed as a debug draw |
|
EnergyConservation | How much of the force should be applied as conserved energy (acceleration) |
|
FieldFalloff | Defines how and if the total magnitude of the force should change depending of how far away the particle is from the central axis |
|
FieldShape | The shape defines the force field's bounding shape, which influences the force vectors and magnitude for every given particle |
|
ForceDirected | The force ALONG the bounding shape's axis. |
|
ForceFixed | The fixed force doesn't scale or rotate with the the bounding shape |
|
ForceRepulsive | The force AWAY from the bounding shape's axis. |
|
ForceVortex | The force AROUND the bounding shape's axis. |
|
Methods | ||
SetParentTRS(ParticleTransform, ParticleSystem) | Sets the parent (particle system's) translation, rotation and scale (uniform) The module can choose to inherit, use or ignore any of the elements |
|
TryGetDebugDrawShape(out DebugDrawShape, out Vector3, out Quaternion, out Vector3) | Attepmts to get a debug shape (shape type and location matrix) for the current module in order to display its boundaries better |
|
Update(Single, ParticlePool) | Updates all particles in the ParticlePool using this updater |
Constructors
UpdaterForceField()
Default constructor which also registers the fields required by this updater
public UpdaterForceField()
Properties
DebugDraw
Should this Particle Module's bounds be displayed as a debug draw
[DataMember(-1)]
public bool DebugDraw { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EnergyConservation
How much of the force should be applied as conserved energy (acceleration)
[DataMember(50)]
[DataMemberRange(0, 1, 0.01, 0.1, 3)]
[Display("Energy conservation", null)]
public float EnergyConservation { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
FieldFalloff
Defines how and if the total magnitude of the force should change depending of how far away the particle is from the central axis
[DataMember(40)]
[Display("Falloff", null)]
public FieldFalloff FieldFalloff { get; set; }
Property Value
Type | Description |
---|---|
FieldFalloff |
FieldShape
The shape defines the force field's bounding shape, which influences the force vectors and magnitude for every given particle
[DataMember(10)]
[Display("Shape", null)]
public FieldShape FieldShape { get; set; }
Property Value
Type | Description |
---|---|
FieldShape |
ForceDirected
The force ALONG the bounding shape's axis.
[DataMember(60)]
[Display("Directed force", null)]
public float ForceDirected { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ForceFixed
The fixed force doesn't scale or rotate with the the bounding shape
[DataMember(100)]
[Display("Fixed force", null)]
public Vector3 ForceFixed { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
ForceRepulsive
The force AWAY from the bounding shape's axis.
[DataMember(80)]
[Display("Repulsive force", null)]
public float ForceRepulsive { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ForceVortex
The force AROUND the bounding shape's axis.
[DataMember(70)]
[Display("Vortex force", null)]
public float ForceVortex { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
SetParentTRS(ParticleTransform, ParticleSystem)
Sets the parent (particle system's) translation, rotation and scale (uniform) The module can choose to inherit, use or ignore any of the elements
public override void SetParentTRS(ParticleTransform transform, ParticleSystem parent)
Parameters
Type | Name | Description |
---|---|---|
ParticleTransform | transform | ParticleSystem's transform (from the Transform component) or identity if local space is used |
ParticleSystem | parent | The parent ParticleSystem |
Overrides
TryGetDebugDrawShape(out DebugDrawShape, out Vector3, out Quaternion, out Vector3)
Attepmts to get a debug shape (shape type and location matrix) for the current module in order to display its boundaries better
public override bool TryGetDebugDrawShape(out DebugDrawShape debugDrawShape, out Vector3 translation, out Quaternion rotation, out Vector3 scale)
Parameters
Type | Name | Description |
---|---|---|
DebugDrawShape | debugDrawShape | Type of the debug draw shape |
Vector3 | translation | Translation of the shape |
Quaternion | rotation | Rotation of the shape |
Vector3 | scale | Scaling of the shape |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Update(Single, ParticlePool)
Updates all particles in the ParticlePool using this updater
public override void Update(float dt, ParticlePool pool)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dt | Delta time in seconds which has passed since the last update call |
ParticlePool | pool | The target ParticlePool which needs to be updated |