1. Home
  2. Docs
  3. PopcornFX v2.7
  4. Scripting reference
  5. Namespaces
  6. self

self

The self namespace contains all particle-related functions and variables.

 

Return typeDescription
floatself.lifeRatio
Normalized age of the particle, in the [0, 1] range.
When the particle is spawned, the lifeRatio is 0.0.
When the particle dies, the lifeRatio is 1.0.
floatself.invLife
Inverse life of the particle: life = 1.0f / self.invLife.
The simulation internally stores the inverse life for performance reasons, and this is kept explicit with self.invLife, which will produce an efficient direct memory read. If you need the life instead of inverse life, you can use rcp(self.invLife) or 1 / self.invLife.
voidself.kill(bool condition)
if condition is true, kills the particle this frame.
boolself.wasKilled()
returns true if the current frame is the particle’s death frame, and the particle was killed via an explicit self.kill().
returns false otherwise, including if the particle died of natural cause.
boolself.readKillBit()
Advanced usage.
Reads the internal simulation kill-bit for this particle.
If true is returned, it does not necessarily mean self.isDead() or self.wasKilled() are true this frame.
boolself.isDead()
returns true if the current frame is the particle’s death frame, otherwise returns false
boolself.isDeterministic()
Returns true if the simulation for this particle is running in deterministic mode, false otherwise.
Was this article helpful to you? Yes No

How can we help?