|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CPSEmitter Class ReferenceBase class for all emitters in a particle system.
More...
#include <ps_emitter.h>
Inheritance diagram for NL3D::CPSEmitter:
List of all members.
Public Types |
enum | TEmissionType {
regular = 0,
onDeath = 1,
once = 2,
onBounce = 3,
externEmit = 4
} |
| The type of emission. More...
|
Public Methods |
uint32 | getType (void) const |
| Return this bindable type. More...
|
virtual uint32 | getPriority (void) const |
| Return priority for emitters. More...
|
virtual bool | hasEmitters (void) |
| Return true if this located bindable derived class holds alive emitters. More...
|
virtual void | step (TPSProcessPass pass, TAnimationTime ellapsedTime, TAnimationTime realEllapsedTime) |
| ==========================================================================. More...
|
virtual void | showTool (void) |
| ==========================================================================. More...
|
void | setEmittedType (CPSLocated *et) |
| ==========================================================================. More...
|
virtual void | notifyTargetRemoved (CPSLocated *ptr) |
| ==========================================================================. More...
|
CPSLocated * | getEmittedType (void) |
| Get emitted type. More...
|
const CPSLocated * | getEmittedType (void) const |
| Get const ptr on emitted type. More...
|
void | setEmissionType (TEmissionType freqType) |
| ==========================================================================. More...
|
TEmissionType | getEmissionType (void) const |
| Get the frequency type. More...
|
void | setPeriod (float period) |
| ==========================================================================. More...
|
float | getPeriod (void) const |
| Retrieve the period for emission, valid only if a period scheme is used. More...
|
bool | usePeriodScheme (void) |
| Indicate whether a period scheme is used or not. More...
|
void | setPeriodScheme (CPSAttribMaker< float > *scheme) |
| ==========================================================================. More...
|
CPSAttribMaker< float > * | getPeriodScheme (void) |
const CPSAttribMaker< float > * | getPeriodScheme (void) const |
void | setEmitDelay (float delay) |
| Set a delay in seconds before the first emission (regular emitter only). More...
|
float | getEmitDelay () const |
| Get the delay in seconds before the first emission (regular emitter only). More...
|
void | setMaxEmissionCount (uint8 count) |
| ==========================================================================. More...
|
uint8 | getMaxEmissionCount () const |
| Get the max. number of particle emission (0 means no limit and is the default). Applies with regular emitter only. More...
|
void | setGenNb (uint32 GenNb) |
| ==========================================================================. More...
|
uint | getGenNb (void) const |
| Retrieve the GenNb for emission, valid only if a GenNb scheme is used. More...
|
bool | useGenNbScheme (void) |
| Indicate whether a GenNb scheme is used or not. More...
|
void | setGenNbScheme (CPSAttribMaker< uint32 > *scheme) |
| ==========================================================================. More...
|
CPSAttribMaker< uint32 > * | getGenNbScheme (void) |
| Retrieve the GenNb scheme, or null, if there'isnt. More...
|
const CPSAttribMaker< uint32 > * | getGenNbScheme (void) const |
| Retrieve the GenNb scheme, or null, if there'isnt (const version). More...
|
void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| ==========================================================================. More...
|
void | singleEmit (uint32 index, uint quantity) |
| ==========================================================================. More...
|
void | enableConsistenEmission (bool enable) |
| Enable consistent emission. More...
|
bool | isConsistentEmissionEnabled () const |
virtual void | releaseRefTo (const CParticleSystemProcess *other) |
| ==========================================================================. More...
|
virtual void | releaseAllRef () |
| Release any reference this obj may have to other process of the system For example, this is used when detaching a located bindable from a system. More...
|
|
| CPSEmitter () |
| Constructor. More...
|
virtual | ~CPSEmitter () |
| ==========================================================================. More...
|
|
void | setSpeedInheritanceFactor (float fact) |
| Set a factor, to add the emitter speed to the emittee creation speed. More...
|
float | getSpeedInheritanceFactor (void) const |
| Get the speed Inheritance factor. More...
|
void | enableSpeedBasisEmission (bool enabled=true) |
| This use the speed of the emitter to create a basis (like with cameras), and express the emission speed in it. More...
|
bool | isSpeedBasisEmissionEnabled (void) const |
| Check if the speed basis emission is enabled. More...
|
void | setSpeedVectorInEmitterBasis (bool enable) |
| Set the basis for the direction of emission. More...
|
bool | isSpeedVectorInEmitterBasis (void) const |
| Test wether the emission direction is in the system basis. More...
|
Protected Methods |
void | processEmit (uint32 index, sint nbToGenerate) |
| ==========================================================================. More...
|
void | processEmitConsistent (const NLMISC::CVector &emitterPos, uint32 emitterIndex, sint nbToGenerate, TAnimationTime deltaT, TAnimationTime ellapsedTime, float realEllapsedTimeRatio) |
| ==========================================================================. More...
|
void | processRegularEmission (TAnimationTime ellapsedTime) |
| ==========================================================================. More...
|
void | processRegularEmissionConsistent (TAnimationTime ellapsedTime, float realEllapsedTimeRatio) |
| ==========================================================================. More...
|
virtual void | emit (const NLMISC::CVector &srcPos, uint32 index, NLMISC::CVector &pos, NLMISC::CVector &speed)=0 |
| This method is called each time one (and only one) located must be emitted. More...
|
virtual void | newElement (CPSLocated *emitterLocated, uint32 emitterIndex) |
| ==========================================================================. More...
|
virtual void | deleteElement (uint32 index) |
| ==========================================================================. More...
|
virtual void | resize (uint32 size) |
| ==========================================================================. More...
|
virtual void | bounceOccured (uint32 index) |
| ==========================================================================. More...
|
void | updateMaxCountVect () |
| ==========================================================================. More...
|
Protected Attributes |
CPSLocated * | _EmittedType |
| A pointer on the type to be emitted. More...
|
TPSAttribFloat | _Phase |
| The phase ( 0 < phase < period of emission). More...
|
TPSAttribUInt8 | _NumEmission |
float | _SpeedInheritanceFactor |
TEmissionType | _EmissionType |
float | _Period |
CPSAttribMaker< float > * | _PeriodScheme |
uint32 | _GenNb |
CPSAttribMaker< uint32 > * | _GenNbScheme |
float | _EmitDelay |
uint8 | _MaxEmissionCount |
bool | _SpeedBasisEmission |
bool | _EmitDirBasis |
bool | _ConsistentEmission |
Detailed Description
Base class for all emitters in a particle system.
Derivers should at least define the emit method which is called each time an emission is needed. Not sharable accross systems.
-
Author:
-
Nicolas Vizerie , Nevrax France
-
Date:
-
2001
Definition at line 49 of file ps_emitter.h.
Member Enumeration Documentation
enum NL3D::CPSEmitter::TEmissionType
|
|
|
The type of emission.
regular : means use Period, and generation number (the number of particle to generate when an emission occurs) onDeath : emit when the emitter is destroyed once : emit when the emitter is created onBounce : emit when the emitter bounce externEmit : emitted explicitly by the system user. A 4 letter id must be used to identify this kind of emitters the default ID is NONE -
Enumeration values:
-
regular |
|
onDeath |
|
once |
|
onBounce |
|
externEmit |
|
Definition at line 106 of file ps_emitter.h.
Referenced by getEmissionType. |
Constructor & Destructor Documentation
NL3D::CPSEmitter::CPSEmitter |
( |
|
) |
|
|
NL3D::CPSEmitter::~CPSEmitter |
( |
|
) |
[virtual] |
|
Member Function Documentation
void NL3D::CPSEmitter::bounceOccured |
( |
uint32 |
index |
) |
[protected, virtual] |
|
void NL3D::CPSEmitter::deleteElement |
( |
uint32 |
index |
) |
[protected, virtual] |
|
|
==========================================================================.
Implements NL3D::CPSLocatedBindable.
Reimplemented in NL3D::CPSEmitterDirectionnal.
Definition at line 965 of file ps_emitter.cpp.
References _EmissionType, _EmittedType, _GenNb, _GenNbScheme, _MaxEmissionCount, _NumEmission, NL3D::CPSLocatedBindable::_Owner, _PeriodScheme, _Phase, index, and processEmit. |
|
This method is called each time one (and only one) located must be emitted.
DERIVERS MUST DEFINE THIS -
Parameters:
-
srcPos |
the source position of the emitter (with eventually a correction) |
index |
the index of the emitter in the tab that generated a located |
pos |
the resulting pos of the particle, expressed in the emitter basis |
speed |
the reulting speed of the emitter, expressed in the emitter basis |
Implemented in NL3D::CPSEmitterDirectionnal.
Referenced by processEmit, and processEmitConsistent. |
void NL3D::CPSEmitter::enableConsistenEmission |
( |
bool |
enable |
) |
[inline] |
|
|
Enable consistent emission.
The default is false. This try to keep the number of emitted particle constant, by allowing more than one emission cycle per iteration. This is useful to deal with poor frmerate. This has several drawbacks though :
- collisions are not properly supported in this case (may be resolved later).
- The motion is in straight lines.
- It assumes that emitter has no motion (for now). In fact, this should be used when there can't be collisions with the emitted particles, and with main emitters only. NB : this has no effect if the emission period is 0 (which mean emit at each frame)
Definition at line 221 of file ps_emitter.h.
References _ConsistentEmission. |
void NL3D::CPSEmitter::enableSpeedBasisEmission |
( |
bool |
enabled = true |
) |
[inline] |
|
|
This use the speed of the emitter to create a basis (like with cameras), and express the emission speed in it.
Definition at line 187 of file ps_emitter.h.
References _SpeedBasisEmission. |
TEmissionType NL3D::CPSEmitter::getEmissionType |
( |
void |
|
) |
const [inline] |
|
float NL3D::CPSEmitter::getEmitDelay |
( |
|
) |
const [inline] |
|
|
Get the delay in seconds before the first emission (regular emitter only).
Definition at line 139 of file ps_emitter.h.
References _EmitDelay. |
const CPSLocated* NL3D::CPSEmitter::getEmittedType |
( |
void |
|
) |
const [inline] |
|
CPSLocated* NL3D::CPSEmitter::getEmittedType |
( |
void |
|
) |
[inline] |
|
uint NL3D::CPSEmitter::getGenNb |
( |
void |
|
) |
const [inline] |
|
|
Retrieve the GenNb for emission, valid only if a GenNb scheme is used.
Definition at line 153 of file ps_emitter.h.
References _GenNb. |
|
Retrieve the GenNb scheme, or null, if there'isnt (const version).
Definition at line 165 of file ps_emitter.h.
References _GenNbScheme. |
uint8 NL3D::CPSEmitter::getMaxEmissionCount |
( |
|
) |
const [inline] |
|
|
Get the max. number of particle emission (0 means no limit and is the default). Applies with regular emitter only.
Definition at line 145 of file ps_emitter.h.
References _MaxEmissionCount. |
float NL3D::CPSEmitter::getPeriod |
( |
void |
|
) |
const [inline] |
|
|
Retrieve the period for emission, valid only if a period scheme is used.
Definition at line 121 of file ps_emitter.h.
References _Period. |
const CPSAttribMaker<float>* NL3D::CPSEmitter::getPeriodScheme |
( |
void |
|
) |
const [inline] |
|
CPSAttribMaker<float>* NL3D::CPSEmitter::getPeriodScheme |
( |
void |
|
) |
[inline] |
|
virtual uint32 NL3D::CPSEmitter::getPriority |
( |
void |
|
) |
const [inline, virtual] |
|
float NL3D::CPSEmitter::getSpeedInheritanceFactor |
( |
void |
|
) |
const [inline] |
|
uint32 NL3D::CPSEmitter::getType |
( |
void |
|
) |
const [inline, virtual] |
|
virtual bool NL3D::CPSEmitter::hasEmitters |
( |
void |
|
) |
[inline, virtual] |
|
bool NL3D::CPSEmitter::isConsistentEmissionEnabled |
( |
|
) |
const [inline] |
|
bool NL3D::CPSEmitter::isSpeedBasisEmissionEnabled |
( |
void |
|
) |
const [inline] |
|
bool NL3D::CPSEmitter::isSpeedVectorInEmitterBasis |
( |
void |
|
) |
const [inline] |
|
void NL3D::CPSEmitter::newElement |
( |
CPSLocated * |
emitterLocated, |
|
|
uint32 |
emitterIndex |
|
) |
[protected, virtual] |
|
void NL3D::CPSEmitter::notifyTargetRemoved |
( |
CPSLocated * |
ptr |
) |
[virtual] |
|
void NL3D::CPSEmitter::processEmit |
( |
uint32 |
index, |
|
|
sint |
nbToGenerate |
|
) |
[inline, protected] |
|
|
==========================================================================.
Definition at line 89 of file ps_emitter.cpp.
References _EmittedType, NL3D::CPSLocatedBindable::_Owner, _SpeedBasisEmission, _SpeedInheritanceFactor, emit, and index.
Referenced by bounceOccured, deleteElement, processRegularEmission, processRegularEmissionConsistent, singleEmit, and step. |
void NL3D::CPSEmitter::processRegularEmission |
( |
TAnimationTime |
ellapsedTime |
) |
[protected] |
|
|
==========================================================================.
Definition at line 413 of file ps_emitter.cpp.
References _EmitDelay, _GenNb, _GenNbScheme, _MaxEmissionCount, _NumEmission, NL3D::CPSLocatedBindable::_Owner, _Period, _PeriodScheme, _Phase, NL3D::emitterBuffSize, nlassert, processEmit, and NL3D::TAnimationTime.
Referenced by step. |
void NL3D::CPSEmitter::processRegularEmissionConsistent |
( |
TAnimationTime |
ellapsedTime, |
|
|
float |
realEllapsedTimeRatio |
|
) |
[protected] |
|
|
==========================================================================.
Definition at line 601 of file ps_emitter.cpp.
References _EmitDelay, _EmittedType, _GenNb, _GenNbScheme, _MaxEmissionCount, _NumEmission, NL3D::CPSLocatedBindable::_Owner, _Period, _PeriodScheme, _Phase, NL3D::emitterBuffSize, NL3D::GenEmitterPositions, min, processEmit, processEmitConsistent, and NL3D::TAnimationTime.
Referenced by step. |
void NL3D::CPSEmitter::releaseAllRef |
( |
|
) |
[virtual] |
|
void NL3D::CPSEmitter::resize |
( |
uint32 |
size |
) |
[protected, virtual] |
|
void NL3D::CPSEmitter::setEmissionType |
( |
TEmissionType |
freqType |
) |
|
|
|
==========================================================================.
Please note that if the type is externEmit, this located need to have been attached to the system (the system is holding the ID-Located map)
Definition at line 295 of file ps_emitter.cpp.
References _EmissionType. |
void NL3D::CPSEmitter::setEmitDelay |
( |
float |
delay |
) |
[inline] |
|
|
Set a delay in seconds before the first emission (regular emitter only).
Definition at line 136 of file ps_emitter.h.
References _EmitDelay. |
void NL3D::CPSEmitter::setEmittedType |
( |
CPSLocated * |
et |
) |
|
|
void NL3D::CPSEmitter::setGenNb |
( |
uint32 |
GenNb |
) |
|
|
void NL3D::CPSEmitter::setMaxEmissionCount |
( |
uint8 |
count |
) |
|
|
void NL3D::CPSEmitter::setPeriod |
( |
float |
period |
) |
|
|
void NL3D::CPSEmitter::setPeriodScheme |
( |
CPSAttribMaker< float > * |
scheme |
) |
|
|
void NL3D::CPSEmitter::setSpeedInheritanceFactor |
( |
float |
fact |
) |
[inline] |
|
void NL3D::CPSEmitter::setSpeedVectorInEmitterBasis |
( |
bool |
enable |
) |
[inline] |
|
|
Set the basis for the direction of emission.
When set to true, the direction is in the emitter basis (this is the default), otherwise it is used directly as the world basis speed vector if the emitter it is the system basis, and vice-versa. NB : if 'speedBasisEmission' is enabled , or if the speed inheritance factor is not null, it has no effect.
Definition at line 204 of file ps_emitter.h.
References _EmitDirBasis. |
void NL3D::CPSEmitter::showTool |
( |
void |
|
) |
[virtual] |
|
|
==========================================================================.
Reimplemented in NL3D::CPSEmitterRectangle.
Definition at line 361 of file ps_emitter.cpp.
References NL3D::CPSLocatedBindable::_Owner, NL3D::CPSLocatedBindable::computeI, NL3D::CPSLocatedBindable::computeK, NL3D::CPSLocatedBindable::CPSLocated, NL3D::CPSLocatedBindable::CPSLocatedBindable, NL3D::CPSLocatedBindable::getDriver, index, NLAISCRIPT::l, NL3D::CPSLocatedBindable::setupDriverModelMatrix, NLMISC::CLine::V0, and NLMISC::CLine::V1.
Referenced by step. |
void NL3D::CPSEmitter::singleEmit |
( |
uint32 |
index, |
|
|
uint |
quantity |
|
) |
|
|
|
==========================================================================.
The standard behaviuour will call "emit" each time is needed. So you don't need to redefine this most of the time
Implements NL3D::CPSLocatedBindable.
Definition at line 900 of file ps_emitter.cpp.
References _ConsistentEmission, _EmittedType, _GenNb, _GenNbScheme, NL3D::CPSLocatedBindable::_Owner, _Phase, processEmit, processRegularEmission, processRegularEmissionConsistent, NL3D::PSEmit, NL3D::PSToolRender, showTool, NL3D::TAnimationTime, and NL3D::TPSProcessPass. |
void NL3D::CPSEmitter::updateMaxCountVect |
( |
|
) |
[protected] |
|
bool NL3D::CPSEmitter::useGenNbScheme |
( |
void |
|
) |
[inline] |
|
bool NL3D::CPSEmitter::usePeriodScheme |
( |
void |
|
) |
[inline] |
|
Member Data Documentation
bool NL3D::CPSEmitter::_ConsistentEmission [protected]
|
|
float NL3D::CPSEmitter::_EmitDelay [protected]
|
|
bool NL3D::CPSEmitter::_EmitDirBasis [protected]
|
|
CPSLocated* NL3D::CPSEmitter::_EmittedType [protected]
|
|
|
A pointer on the type to be emitted.
Definition at line 288 of file ps_emitter.h.
Referenced by deleteElement, NL3D::CPSRadialEmitter::emit, NL3D::CPSEmitterConic::emit, NL3D::CPSEmitterDirectionnal::emit, getEmittedType, notifyTargetRemoved, processEmit, processEmitConsistent, processRegularEmissionConsistent, releaseRefTo, setEmittedType, step, and ~CPSEmitter. |
uint32 NL3D::CPSEmitter::_GenNb [protected]
|
|
|
Definition at line 300 of file ps_emitter.h.
Referenced by bounceOccured, deleteElement, getGenNbScheme, newElement, processRegularEmission, processRegularEmissionConsistent, resize, setGenNb, setGenNbScheme, singleEmit, step, useGenNbScheme, and ~CPSEmitter. |
uint8 NL3D::CPSEmitter::_MaxEmissionCount [protected]
|
|
float NL3D::CPSEmitter::_Period [protected]
|
|
bool NL3D::CPSEmitter::_SpeedBasisEmission [protected]
|
|
float NL3D::CPSEmitter::_SpeedInheritanceFactor [protected]
|
|
The documentation for this class was generated from the following files:
|
|