Class UpdaterForceField
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
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
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
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
ForceDirected
The force ALONG the bounding shape's axis.
[DataMember(60)]
[Display("Directed force", null)]
public float ForceDirected { get; set; }
Property Value
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
ForceRepulsive
The force AWAY from the bounding shape's axis.
[DataMember(80)]
[Display("Repulsive force", null)]
public float ForceRepulsive { get; set; }
Property Value
ForceVortex
The force AROUND the bounding shape's axis.
[DataMember(70)]
[Display("Vortex force", null)]
public float ForceVortex { get; set; }
Property Value
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
ParticleTransformParticleSystem's transform (from the Transform component) or identity if local space is used
parent
ParticleSystemThe 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
DebugDrawShapeType of the debug draw shape
translation
Vector3Translation of the shape
rotation
QuaternionRotation of the shape
scale
Vector3Scaling of the shape
Returns
Update(float, ParticlePool)
Updates all particles in the ParticlePool using this updater
public override void Update(float dt, ParticlePool pool)
Parameters
dt
floatDelta time in seconds which has passed since the last update call
pool
ParticlePoolThe target ParticlePool which needs to be updated