Class EmitterSimulator
An class that manages a single particle emiter simulator.
Inherited Members
Namespace: Evergine.Framework.Particles
Assembly: Evergine.Framework.dll
Syntax
public abstract class EmitterSimulator
Constructors
EmitterSimulator(ParticlesComponent, ParticlesEmitter)
Initializes a new instance of the EmitterSimulator class.
Declaration
public EmitterSimulator(ParticlesComponent component, ParticlesEmitter emitter)
Parameters
Type | Name | Description |
---|---|---|
ParticlesComponent | component | The particle system component. |
ParticlesEmitter | emitter | The particle emitter. |
Fields
assets
The assets scene manager.
Declaration
protected AssetSceneManager assets
Field Value
Type | Description |
---|---|
AssetSceneManager |
clock
The app clock.
Declaration
protected Clock clock
Field Value
Type | Description |
---|---|
Clock |
deadParticles
The number of dead particles in this frame.
Declaration
protected uint deadParticles
Field Value
Type | Description |
---|---|
uint |
description
The particle system description.
Declaration
protected ParticleEmitterDescription description
Field Value
Type | Description |
---|---|
ParticleEmitterDescription |
emitter
the emitter from the asset.
Declaration
protected ParticlesEmitter emitter
Field Value
Type | Description |
---|---|
ParticlesEmitter |
forceComputeDictionary
The dictionary of compute forces.
Declaration
protected Dictionary<BaseForce, ComputeTaskDecorator> forceComputeDictionary
Field Value
Type | Description |
---|---|
Dictionary<BaseForce, ComputeTaskDecorator> |
forceMask
The force mask.
Declaration
protected List<uint> forceMask
Field Value
Type | Description |
---|---|
List<uint> |
forcesDirty
If the forces values are dirty.
Declaration
protected bool forcesDirty
Field Value
Type | Description |
---|---|
bool |
forcesList
The forces list.
Declaration
protected List<BaseForce> forcesList
Field Value
Type | Description |
---|---|
List<BaseForce> |
graphicsContext
The graphics content.
Declaration
protected GraphicsContext graphicsContext
Field Value
Type | Description |
---|---|
GraphicsContext |
initColorLineal
The init color value.
Declaration
protected Vector4 initColorLineal
Field Value
Type | Description |
---|---|
Vector4 |
initColorLineal2
The initColor 2 value.
Declaration
protected Vector4 initColorLineal2
Field Value
Type | Description |
---|---|
Vector4 |
invNoiseSize
The inverse of the noise size.
Declaration
protected float invNoiseSize
Field Value
Type | Description |
---|---|
float |
isRefreshingResources
If the particle system is refreshing resources.
Declaration
protected bool isRefreshingResources
Field Value
Type | Description |
---|---|
bool |
isSizeDirty
If the particle size is dirty.
Declaration
protected bool isSizeDirty
Field Value
Type | Description |
---|---|
bool |
lifeFactor
The life factor.
Declaration
protected float lifeFactor
Field Value
Type | Description |
---|---|
float |
materialDirectivesDirty
If we need to update the material directives.
Declaration
protected bool materialDirectivesDirty
Field Value
Type | Description |
---|---|
bool |
maxParticles
The maximum particles.
Declaration
protected uint maxParticles
Field Value
Type | Description |
---|---|
uint |
mesh
The particle system mesh.
Declaration
protected Mesh mesh
Field Value
Type | Description |
---|---|
Mesh |
mustResetData
If the data must be reset.
Declaration
protected bool mustResetData
Field Value
Type | Description |
---|---|
bool |
newParticles
The number of new particles to be emitted in this frame.
Declaration
protected uint newParticles
Field Value
Type | Description |
---|---|
uint |
particleBufferA
The particle buffer.
Declaration
protected Buffer particleBufferA
Field Value
Type | Description |
---|---|
Buffer |
particleBufferQuad
The quad buffer of the particles.
Declaration
protected Buffer particleBufferQuad
Field Value
Type | Description |
---|---|
Buffer |
particlesComponent
The particle system component.
Declaration
protected ParticlesComponent particlesComponent
Field Value
Type | Description |
---|---|
ParticlesComponent |
particlesManager
The particles manager.
Declaration
protected ParticlesManager particlesManager
Field Value
Type | Description |
---|---|
ParticlesManager |
propertiesDirty
If the properties of the emitter have changed.
Declaration
protected bool propertiesDirty
Field Value
Type | Description |
---|---|
bool |
renderManager
The render manager.
Declaration
protected RenderManager renderManager
Field Value
Type | Description |
---|---|
RenderManager |
timeFactor
The time factor.
Declaration
protected float timeFactor
Field Value
Type | Description |
---|---|
float |
Properties
Component
Gets the particles component.
Declaration
public ParticlesComponent Component { get; }
Property Value
Type | Description |
---|---|
ParticlesComponent |
ComputeResolved
Gets a value indicating whether the emitter is using compute shader.
Declaration
public abstract bool ComputeResolved { get; }
Property Value
Type | Description |
---|---|
bool |
Info
Gets the particle system emitter.
Declaration
public ParticlesEmitter Info { get; }
Property Value
Type | Description |
---|---|
ParticlesEmitter |
IsEmitting
Gets a value indicating whether the particle system is emitting or not.
Declaration
public bool IsEmitting { get; }
Property Value
Type | Description |
---|---|
bool |
IsInitialized
Gets a value indicating whether the emitter has been initialized.
Declaration
public bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
bool |
IsSimulating
Gets a value indicating whether the particle system is emiting particles this frame or has some alive particles.
Declaration
public bool IsSimulating { get; }
Property Value
Type | Description |
---|---|
bool |
Material
Gets the particle material.
Declaration
public ParticlesEffect Material { get; }
Property Value
Type | Description |
---|---|
ParticlesEffect |
Mesh
Gets or sets the particle mesh.
Declaration
public Mesh Mesh { get; protected set; }
Property Value
Type | Description |
---|---|
Mesh |
Methods
BaseUnitialize()
uninitalizes the emitter.
Declaration
public void BaseUnitialize()
ClearResources()
Clears the emitter resources.
Declaration
protected abstract void ClearResources()
CreateResources()
Creates the emitter resources.
Declaration
protected abstract void CreateResources()
Initialize(ParticlesManager, RenderManager, AssetSceneManager)
Initializes the emitter.
Declaration
public void Initialize(ParticlesManager particlesManager, RenderManager renderManager, AssetSceneManager assets)
Parameters
Type | Name | Description |
---|---|---|
ParticlesManager | particlesManager | The scene manager. |
RenderManager | renderManager | The render manager. |
AssetSceneManager | assets | The assets scene manager. |
RefreshCounters()
Refreshes all the counters the emitter may have.
Declaration
protected abstract void RefreshCounters()
RefreshParticles()
Refreshes the particles.
Declaration
protected virtual void RefreshParticles()
RefreshProperties()
Refreshes the particles properties.
Declaration
protected virtual void RefreshProperties()
RefreshResources()
Refreshes the emitter resources.
Declaration
protected void RefreshResources()
Reset()
Resets the state of the particle system.
Declaration
public void Reset()
ResetData(CommandBuffer)
Resets the emitter data.
Declaration
protected abstract void ResetData(CommandBuffer commandBuffer)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | commandBuffer | The command buffer. |
StartEmitting()
Starts the particles emission.
Declaration
public void StartEmitting()
StopEmitting()
Stop the particles emission.
Declaration
public void StopEmitting()
Unitialize()
uninitalizes the emitter.
Declaration
protected abstract void Unitialize()
UpdateParticlesMethod(CommandBuffer, TimeSpan)
The method that updates the particle system.
Declaration
protected abstract void UpdateParticlesMethod(CommandBuffer commandBuffer, TimeSpan ellapsedTime)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | commandBuffer | The command buffer. |
TimeSpan | ellapsedTime | The ellapsed time. |
Events
MeshChanged
Event raised when the mesh has changed.
Declaration
public event EventHandler<Mesh> MeshChanged
Event Type
Type | Description |
---|---|
EventHandler<Mesh> |