Class BaseForce
Particle force.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Particles.Forces
Assembly: Evergine.Framework.dll
Syntax
public abstract class BaseForce : Component, IDependencyObject
Fields
Transform
The transformation of the force.
Declaration
[BindComponent(true, true, BindComponentSource.Owner, null, true)]
public Transform3D Transform
Field Value
Type | Description |
---|---|
Transform3D |
assets
Manages the asset scene.
Declaration
[BindSceneManager(false, true)]
protected AssetSceneManager assets
Field Value
Type | Description |
---|---|
AssetSceneManager |
particlesManager
The particle scene manager that is bound.
Declaration
[BindSceneManager(false, false)]
protected ParticlesManager particlesManager
Field Value
Type | Description |
---|---|
ParticlesManager |
Properties
DecayEnabled
Gets or sets a value indicating whether the force strength decays over distance.
Declaration
public bool DecayEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
ForceCategory
Gets or sets the force category.
Declaration
public CollisionCategory3D ForceCategory { get; set; }
Property Value
Type | Description |
---|---|
CollisionCategory3D |
ForceType
Gets the force type.
Declaration
public abstract ForceTypes ForceType { get; }
Property Value
Type | Description |
---|---|
ForceTypes |
Range
Gets or sets the particle force range.
Declaration
[RenderProperty(AttachToTag = 1, AttachToValue = true, CustomPropertyName = "Range", Tooltip = "The range of this force in meters.")]
public float Range { get; set; }
Property Value
Type | Description |
---|---|
float |
RangeEnabled
Gets or sets a value indicating whether the force has a range.
Declaration
[RenderProperty(Tag = 1)]
public bool RangeEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
RangeSqr
Gets the squared particle force range.
Declaration
public float RangeSqr { get; }
Property Value
Type | Description |
---|---|
float |
Strength
Gets or sets the range of the particle force.
Declaration
public float Strength { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
ApplyForce(int, ref ParticleVertex, ref ParticleStateB, float)
Apply force to a single particle.
Declaration
protected abstract void ApplyForce(int id, ref ParticleVertex p, ref ParticleStateB pB, float elapsedTime)
Parameters
Type | Name | Description |
---|---|---|
int | id | The ID of the particle. |
ParticleVertex | p | The particle pointer. |
ParticleStateB | pB | The particle struct B pointer. |
float | elapsedTime | The elapsed time in seconds. |
CreateComputeTask(ComputeEmitterSimulator)
Creates a compute task for a particle system.
Declaration
public abstract ComputeTaskDecorator CreateComputeTask(ComputeEmitterSimulator particleSystem)
Parameters
Type | Name | Description |
---|---|---|
ComputeEmitterSimulator | particleSystem | The particle system. |
Returns
Type | Description |
---|---|
ComputeTaskDecorator | The compute task. |
OnActivated()
Invoked when the object is activated once it is attached.
Declaration
protected override void OnActivated()
Overrides
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if everything is OK. |
Overrides
OnDeactivated()
Invoked when the object is deactivated.
Declaration
protected override void OnDeactivated()
Overrides
RefreshComputeMatrices(ComputeTaskDecorator, CommandBuffer, ComputeEmitterSimulator, TimeSpan)
Refreshes a compute task matrices for a particle system.
Declaration
public abstract void RefreshComputeMatrices(ComputeTaskDecorator computeTask, CommandBuffer commandBuffer, ComputeEmitterSimulator particleSystem, TimeSpan elapsedTime)
Parameters
Type | Name | Description |
---|---|---|
ComputeTaskDecorator | computeTask | The compute task to refresh. |
CommandBuffer | commandBuffer | The command buffer. |
ComputeEmitterSimulator | particleSystem | The particle system. |
TimeSpan | elapsedTime | The elapsed time. |
RefreshComputeParams(ComputeTaskDecorator, ComputeEmitterSimulator)
Refreshes a compute task for a particle system.
Declaration
public abstract void RefreshComputeParams(ComputeTaskDecorator computeTask, ComputeEmitterSimulator particleSystem)
Parameters
Type | Name | Description |
---|---|---|
ComputeTaskDecorator | computeTask | The compute task to refresh. |
ComputeEmitterSimulator | particleSystem | The particle system. |
UpdateParticles(CPUEmitterSimulator, float)
Updates the particles of the particle system by CPU.
Declaration
public void UpdateParticles(CPUEmitterSimulator emitter, float time)
Parameters
Type | Name | Description |
---|---|---|
CPUEmitterSimulator | emitter | The particle system to update. |
float | time | The elapsed seconds. |