C# Класс Axiom.ParticleSystems.ParticleEmitter

Abstract class defining the interface to be implemented by particle emitters.
Particle emitters are the sources of particles in a particle system. This class defines the ParticleEmitter interface, and provides a basic implementation for tasks which most emitters will do (these are of course overridable). Particle emitters can be grouped into types, e.g. 'point' emitters, 'box' emitters etc; each type will create particles with a different starting point, direction and velocity (although within the types you can configure the ranges of these parameters).

Because there are so many types of emitters you could use, the engine chooses not to dictate the available types. It comes with some in-built, but allows plugins or games to extend the emitter types available. This is done by subclassing ParticleEmitter to have the appropriate emission behavior you want, and also creating a subclass of ParticleEmitterFactory which is responsible for creating instances of your new emitter type. You register this factory with the ParticleSystemManager using AddEmitterFactory, and from then on emitters of this type can be created either from code or through XML particle scripts by naming the type.

This same approach is used for ParticleAffectors (which modify existing particles per frame). This means that the engine is particularly flexible when it comes to creating particle system effects, with literally infinite combinations of emitter and affector types, and parameters within those types.

Наследование: IConfigurable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
angle float
colorFixed ColorEx
colorRangeEnd ColorEx
colorRangeStart ColorEx
commandTable AxiomCollection
direction Vector3
durationFixed float
durationMax float
durationMin float
durationRemain float
emissionRate float
emitted bool
emittedEmitter string
fixedSpeed float
fixedTTL float
isEnabled bool
maxSpeed float
maxTTL float
minSpeed float
minTTL float
position Vector3
remainder float
repeatDelayFixed float
repeatDelayMax float
repeatDelayMin float
repeatDelayRemain float
startTime float
type string
up Vector3

Открытые методы

Метод Описание
CopyTo ( ParticleEmitter emitter ) : void

GenerateConstantEmissionCount ( float timeElapsed ) : ushort

Utility method for generating an emission count based on a constant emission rate.

GetEmissionCount ( float timeElapsed ) : ushort

Gets the number of particles which this emitter would like to emit based on the time elapsed.

For efficiency the emitter does not actually create new Particle instances (these are reused by the ParticleSystem as existing particles 'die'). The implementation for this method must return the number of particles the emitter would like to emit given the number of seconds which have elapsed (passed in as a parameter).

Based on the return value from this method, the ParticleSystem class will call InitParticle once for each particle it chooses to allow to be emitted by this emitter. The emitter should not track these InitParticle calls, it should assume all emissions requested were made (even if they could not be because of particle quotas).

InitParticle ( Particle particle ) : void

Initializes a particle based on the emitter's approach and parameters.

See the GetEmissionCount method for details of why there is a separation between 'requested' emissions and actual initialized particles.

Move ( float x, float y, float z ) : void
MoveTo ( float x, float y, float z ) : void
ParticleEmitter ( ParticleSystem ps ) : System

Default constructor.

ScaleVelocity ( float velocityMultiplier ) : void

Scales the velocity of the emitters by the float argument

SetDuration ( float min, float max ) : void

Sets the min/max duration range for this emitter.

SetParam ( string name, string val ) : bool

Защищенные методы

Метод Описание
GenerateEmissionColor ( ColorEx &color ) : void

Internal method for generating a color for a particle.

GenerateEmissionDirection ( Vector3 &dest ) : void

Utility method for generating particle exit direction

GenerateEmissionTTL ( ) : float

Utility method for generating a time-to-live for a particle.

GenerateEmissionVelocity ( Vector3 &dest ) : void

Utility method to apply velocity to a particle direction.

InitDurationRepeat ( ) : void

RegisterCommands ( ) : void

Registers all attribute names with their respective parser.

Methods meant to serve as attribute parsers should use a method attribute to

Описание методов

CopyTo() публичный Метод

public CopyTo ( ParticleEmitter emitter ) : void
emitter ParticleEmitter
Результат void

GenerateConstantEmissionCount() публичный Метод

Utility method for generating an emission count based on a constant emission rate.
public GenerateConstantEmissionCount ( float timeElapsed ) : ushort
timeElapsed float
Результат ushort

GenerateEmissionColor() защищенный Метод

Internal method for generating a color for a particle.
protected GenerateEmissionColor ( ColorEx &color ) : void
color ColorEx /// The color object that will be altered depending on the method of generating the particle color. ///
Результат void

GenerateEmissionDirection() защищенный Метод

Utility method for generating particle exit direction
protected GenerateEmissionDirection ( Vector3 &dest ) : void
dest Vector3 Normalized vector dictating new direction.
Результат void

GenerateEmissionTTL() защищенный Метод

Utility method for generating a time-to-live for a particle.
protected GenerateEmissionTTL ( ) : float
Результат float

GenerateEmissionVelocity() защищенный Метод

Utility method to apply velocity to a particle direction.
protected GenerateEmissionVelocity ( Vector3 &dest ) : void
dest Vector3 The normalized vector to scale by a randomly generated scale between min and max speed.
Результат void

GetEmissionCount() публичный абстрактный Метод

Gets the number of particles which this emitter would like to emit based on the time elapsed.
For efficiency the emitter does not actually create new Particle instances (these are reused by the ParticleSystem as existing particles 'die'). The implementation for this method must return the number of particles the emitter would like to emit given the number of seconds which have elapsed (passed in as a parameter).

Based on the return value from this method, the ParticleSystem class will call InitParticle once for each particle it chooses to allow to be emitted by this emitter. The emitter should not track these InitParticle calls, it should assume all emissions requested were made (even if they could not be because of particle quotas).

public abstract GetEmissionCount ( float timeElapsed ) : ushort
timeElapsed float
Результат ushort

InitDurationRepeat() защищенный Метод

protected InitDurationRepeat ( ) : void
Результат void

InitParticle() публичный Метод

Initializes a particle based on the emitter's approach and parameters.
See the GetEmissionCount method for details of why there is a separation between 'requested' emissions and actual initialized particles.
public InitParticle ( Particle particle ) : void
particle Particle Reference to a particle which must be initialized based on how this emitter starts particles
Результат void

Move() публичный Метод

public Move ( float x, float y, float z ) : void
x float
y float
z float
Результат void

MoveTo() публичный Метод

public MoveTo ( float x, float y, float z ) : void
x float
y float
z float
Результат void

ParticleEmitter() публичный Метод

Default constructor.
public ParticleEmitter ( ParticleSystem ps ) : System
ps ParticleSystem
Результат System

RegisterCommands() защищенный Метод

Registers all attribute names with their respective parser.
Methods meant to serve as attribute parsers should use a method attribute to
protected RegisterCommands ( ) : void
Результат void

ScaleVelocity() публичный Метод

Scales the velocity of the emitters by the float argument
public ScaleVelocity ( float velocityMultiplier ) : void
velocityMultiplier float
Результат void

SetDuration() публичный Метод

Sets the min/max duration range for this emitter.
public SetDuration ( float min, float max ) : void
min float
max float
Результат void

SetParam() публичный Метод

public SetParam ( string name, string val ) : bool
name string
val string
Результат bool

Описание свойств

angle защищенное свойство

Angle around direction which particles may be emitted, internally radians but degrees for interface.
protected float angle
Результат float

colorFixed защищенное свойство

Initial color of particles (fixed).
protected ColorEx colorFixed
Результат ColorEx

colorRangeEnd защищенное свойство

Initial color of particles (range end).
protected ColorEx colorRangeEnd
Результат ColorEx

colorRangeStart защищенное свойство

Initial color of particles (range start).
protected ColorEx colorRangeStart
Результат ColorEx

commandTable защищенное свойство

protected AxiomCollection commandTable
Результат AxiomCollection

direction защищенное свойство

Base direction of the emitter, may not be used by some emitters.
protected Vector3 direction
Результат Vector3

durationFixed защищенное свойство

Length of time emitter will run for (0 = forever).
protected float durationFixed
Результат float

durationMax защищенное свойство

Maximum length of time the emitter will run for (0 = forever).
protected float durationMax
Результат float

durationMin защищенное свойство

Minimum length of time emitter will run for (0 = forever).
protected float durationMin
Результат float

durationRemain защищенное свойство

Current duration remainder.
protected float durationRemain
Результат float

emissionRate защищенное свойство

Rate in particles per second at which this emitter wishes to emit particles.
protected float emissionRate
Результат float

emitted защищенное свойство

If 'true', this emitter is emitted by another emitter. NB. That doesn´t imply that the emitter itself emits other emitters (that could or could not be the case)
protected bool emitted
Результат bool

emittedEmitter защищенное свойство

The name of the emitter to be emitted (optional)
protected string emittedEmitter
Результат string

fixedSpeed защищенное свойство

Fixed speed of particles.
protected float fixedSpeed
Результат float

fixedTTL защищенное свойство

Initial time-to-live of particles (fixed).
protected float fixedTTL
Результат float

isEnabled защищенное свойство

Whether this emitter is currently enabled (defaults to true).
protected bool isEnabled
Результат bool

maxSpeed защищенное свойство

Max speed of particles.
protected float maxSpeed
Результат float

maxTTL защищенное свойство

Initial time-to-live of particles (max).
protected float maxTTL
Результат float

minSpeed защищенное свойство

Min speed of particles.
protected float minSpeed
Результат float

minTTL защищенное свойство

Initial time-to-live of particles (min).
protected float minTTL
Результат float

position защищенное свойство

Position relative to the center of the ParticleSystem.
protected Vector3 position
Результат Vector3

remainder защищенное свойство

protected float remainder
Результат float

repeatDelayFixed защищенное свойство

Fixed time between each repeat.
protected float repeatDelayFixed
Результат float

repeatDelayMax защищенное свойство

Maximum time between each repeat.
protected float repeatDelayMax
Результат float

repeatDelayMin защищенное свойство

Minimum time between each repeat.
protected float repeatDelayMin
Результат float

repeatDelayRemain защищенное свойство

Repeat delay left.
protected float repeatDelayRemain
Результат float

startTime защищенное свойство

Start time (in seconds from start of first call to ParticleSystem to update).
protected float startTime
Результат float

type защищенное свойство

Name of the type of emitter, MUST be initialized by subclasses.
protected string type
Результат string

up защищенное свойство

Notional up vector, just used to speed up generation of variant directions.
protected Vector3 up
Результат Vector3