⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.
|
Axmol Engine 3.0.0-84160d4
|
Particle emission mask cache. More...
#include <ParticleSystem.h>
Public Member Functions | |
| void | bakeEmissionMask (std::string_view maskId, std::string_view texturePath, float alphaThreshold=0.5F, bool inverted=false, int inbetweenSamples=1) |
| Bakes a particle emission mask from texture data on cpu and stores it in memory by it's name. | |
| void | bakeEmissionMask (std::string_view maskId, Image *imageTexture, float alphaThreshold=0.5F, bool inverted=false, int inbetweenSamples=1) |
| Bakes a particle emission mask from texture data on cpu and stores it in memory by it's name. | |
| const ParticleEmissionMaskDesc & | getEmissionMask (uint32_t fourccId) |
| Returns a baked mask with the specified name if it exists. | |
| const ParticleEmissionMaskDesc & | getEmissionMask (std::string_view maskId) |
| Returns a baked mask with the specified name if it exists. | |
| void | removeMask (std::string_view maskId) |
| Removes a baked mask and releases the data from memory with the specified name if it exists. | |
| void | removeAllMasks () |
| Remove all baked masks and releases their data from memory. | |
Particle emission mask cache.
| void bakeEmissionMask | ( | std::string_view | maskId, |
| std::string_view | texturePath, | ||
| float | alphaThreshold = 0.5F, | ||
| bool | inverted = false, | ||
| int | inbetweenSamples = 1 ) |
Bakes a particle emission mask from texture data on cpu and stores it in memory by it's name.
If the mask already exists then it will be overwritten.
| maskId | The id of the mask, FOURCC starts with '#', such as "#abcd" |
| texturePath | Path of the texture that holds alpha data. |
| alphaThreshold | The threshold at which pixels are picked, If a pixel's alpha channel is greater than alphaThreshold then it will be picked. |
| inverted | Inverts the pick condition so that If a pixel's alpha channel is lower than alphaThreshold then it will be picked. |
| inbetweenSamples | How many times should pixels be filled inbetween, this value should be increased If you're planning to scale the emission shape up. WARNING: it will use more memory. |
| void bakeEmissionMask | ( | std::string_view | maskId, |
| Image * | imageTexture, | ||
| float | alphaThreshold = 0.5F, | ||
| bool | inverted = false, | ||
| int | inbetweenSamples = 1 ) |
Bakes a particle emission mask from texture data on cpu and stores it in memory by it's name.
If the mask already exists then it will be overwritten.
| maskId | The id of the mask, FOURCC starts with '#', such as "#abcd" |
| imageTexture | Image object containing texture data with alpha channel. |
| alphaThreshold | The threshold at which pixels are picked, If a pixel's alpha channel is greater than alphaThreshold then it will be picked. |
| inverted | Inverts the pick condition so that If a pixel's alpha channel is lower than alphaThreshold then it will be picked. |
| inbetweenSamples | How many times should pixels be filled inbetween, this value should be increased If you're planning to scale the emission shape up. WARNING: it will use more memory. |
| const ParticleEmissionMaskDesc & getEmissionMask | ( | uint32_t | fourccId | ) |
Returns a baked mask with the specified name if it exists.
otherwise, it will return a dummy mask.
| fourccId | The unsigned integer id of the mask. |
| const ParticleEmissionMaskDesc & getEmissionMask | ( | std::string_view | maskId | ) |
Returns a baked mask with the specified name if it exists.
otherwise, it will return a dummy mask.
| maskId | The id of the mask, FOURCC starts with '#', such as "#abcd" |
| void removeMask | ( | std::string_view | maskId | ) |
Removes a baked mask and releases the data from memory with the specified name if it exists.
| maskId | The id of the mask, FOURCC starts with '#', such as "#abcd" |