Table of Contents

Class UpdaterCollider

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

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

bool

FieldShape

The type of the shape which defines this collider

[DataMember(10)]
[Display("Shape", null)]
public FieldShape FieldShape { get; set; }

Property Value

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

float

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

bool

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

bool

KillParticles

Kill particles when they collide with the shape

[DataMember(60)]
[Display("Kill particles", null)]
public bool KillParticles { get; set; }

Property Value

bool

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

float

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

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