The self namespace contains all particle-related functions and variables.
self.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.
self.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.
self.kill(bool condition) if condition is true, kills the particle this frame.
self.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.
self.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.
self.isDead() returns true if the current frame is the particle’s death frame, otherwise returns false
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
The _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
Set by Google to distinguish users.
Installed by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
YouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.