Table of Contents

Class UpdaterForceField

Namespace
Stride.Particles.Modules
Assembly
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
Inheritance
UpdaterForceField
Inherited Members

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

bool

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

float

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

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

FieldShape

ForceDirected

The force ALONG the bounding shape's axis.

[DataMember(60)]
[Display("Directed force", null)]
public float ForceDirected { get; set; }

Property Value

float

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

Vector3

ForceRepulsive

The force AWAY from the bounding shape's axis.

[DataMember(80)]
[Display("Repulsive force", null)]
public float ForceRepulsive { get; set; }

Property Value

float

ForceVortex

The force AROUND the bounding shape's axis.

[DataMember(70)]
[Display("Vortex force", null)]
public float ForceVortex { get; set; }

Property Value

float

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

transform ParticleTransform

ParticleSystem's transform (from the Transform component) or identity if local space is used

parent ParticleSystem

The parent ParticleSystem

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

debugDrawShape DebugDrawShape

Type of the debug draw shape

translation Vector3

Translation of the shape

rotation Quaternion

Rotation of the shape

scale Vector3

Scaling of the shape

Returns

bool

Update(float, ParticlePool)

Updates all particles in the ParticlePool using this updater

public override void Update(float dt, ParticlePool pool)

Parameters

dt float

Delta time in seconds which has passed since the last update call

pool ParticlePool

The target ParticlePool which needs to be updated