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 transform of the force.
Declaration
[BindComponent(true, true, BindComponentSource.Owner, null, true)]
public Transform3D Transform
Field Value
Type | Description |
---|---|
Transform3D |
assets
The asset scene manager.
Declaration
[BindSceneManager(false, true)]
protected AssetSceneManager assets
Field Value
Type | Description |
---|---|
AssetSceneManager |
particlesManager
The bound particle scene manager.
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 the 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 particle force range squared.
Declaration
public float RangeSqr { get; }
Property Value
Type | Description |
---|---|
float |
Strength
Gets or sets the particle force range.
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 ellapsedTime)
Parameters
Type | Name | Description |
---|---|---|
int | id | The id of the particle. |
ParticleVertex | p | The particle pointer. |
ParticleStateB | pB | The particle struct B pointer. |
float | ellapsedTime | The ellapsed 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 systme. |
Returns
Type | Description |
---|---|
ComputeTaskDecorator | The compute task. |
OnActivated()
Invoked when the object is activated once 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 all 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 ellapsedTime)
Parameters
Type | Name | Description |
---|---|---|
ComputeTaskDecorator | computeTask | The compute task to refresh. |
CommandBuffer | commandBuffer | The command buffer. |
ComputeEmitterSimulator | particleSystem | The particle systme. |
TimeSpan | ellapsedTime | The ellapsed 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 systme. |
UpdateParticles(CPUEmitterSimulator, float)
Updates the particles of the particleSystem by CPU.
Declaration
public void UpdateParticles(CPUEmitterSimulator emitter, float time)
Parameters
Type | Name | Description |
---|---|---|
CPUEmitterSimulator | emitter | The particle system to update. |
float | time | The ellapsed seconds. |