UpdaterCollider Class
Namespace: Stride.Particles.ModulesAssembly: Stride.Particles.dll
The UpdaterCollider is an updater which tests the particles against a preset surface or shape, making them bounce off it when they collide
[DataContract("UpdaterCollider")]
[Display("Collider", null)]
public class UpdaterCollider : ParticleUpdater
Name | Description | |
---|---|---|
Constructors | ||
UpdaterCollider() | 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 |
|
FieldShape | The type of the shape which defines this collider |
|
Friction | How much of the horizontal (normal-perpendicular) kinetic energy is lost after impact |
|
IsHollow | Shows if the collider shape is hollow on the inside or solid |
|
IsPostUpdater | All updaters are called exactly once during each ParticleEmitter's update. Most updaters are called before spawning the new particles for the frame, but post updaters are called after that. |
|
KillParticles | Kill particles when they collide with the shape |
|
Restitution | How much of the vertical (normal-oriented) kinetic energy is preserved after impact |
|
Methods | ||
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
UpdaterCollider()
Default constructor which also registers the fields required by this updater
public UpdaterCollider()
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 |
FieldShape
The type of the shape which defines this collider
[DataMember(10)]
[Display("Shape", null)]
public FieldShape FieldShape { get; set; }
Property Value
Type | Description |
---|---|
FieldShape |
Friction
How much of the horizontal (normal-perpendicular) kinetic energy is lost after impact
[DataMember(90)]
[DataMemberRange(0, 1, 0.01, 0.1, 3)]
[Display("Friction", null)]
public float Friction { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
IsHollow
Shows if the collider shape is hollow on the inside or solid
[DataMember(50)]
[Display("Is hollow", null)]
public bool IsHollow { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsPostUpdater
All updaters are called exactly once during each ParticleEmitter's update. Most updaters are called before spawning the new particles for the frame, but post updaters are called after that.
public override bool IsPostUpdater { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
KillParticles
Kill particles when they collide with the shape
[DataMember(60)]
[Display("Kill particles", null)]
public bool KillParticles { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Restitution
How much of the vertical (normal-oriented) kinetic energy is preserved after impact
[DataMember(70)]
[DataMemberRange(0, 1, 0.01, 0.1, 3)]
[Display("Restitution", null)]
public float Restitution { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
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 |