natiny_particles_set_shape
C
void natiny_particles_set_shape(NatinyParticles particles, uint32_t shape,
float x, float y, float z);
Sets where particles are born and which way they start moving, in the emitter's own space.
Parameters
| Name |
Type |
Description |
particles |
NatinyParticles |
Particle system handle from natiny_particles_create |
shape |
uint32_t |
One of the shape constants below |
x |
float |
First size; meaning depends on the shape |
y |
float |
Second size |
z |
float |
Third size |
Constants
| Constant |
Value |
x, y, z |
Particles start |
NATINY_PARTICLES_SHAPE_POINT |
0 |
unused |
At the emitter, heading within spread of +Y |
NATINY_PARTICLES_SHAPE_SPHERE |
1 |
x radius |
Inside a sphere, heading straight out |
NATINY_PARTICLES_SHAPE_SHELL |
2 |
x radius |
On the surface of a sphere, heading straight out |
NATINY_PARTICLES_SHAPE_HEMISPHERE |
3 |
x radius |
Inside the upper half of a sphere, heading out |
NATINY_PARTICLES_SHAPE_CONE |
4 |
x angle in degrees, y base radius |
On a disc in the XZ plane, heading within x degrees of +Y |
NATINY_PARTICLES_SHAPE_BOX |
5 |
full width, height, depth |
Inside a box, heading within spread of +Y |
NATINY_PARTICLES_SHAPE_CIRCLE |
6 |
x radius |
Inside a disc in the XY plane, heading straight out |
NATINY_PARTICLES_SHAPE_EDGE |
7 |
x length |
On a line along X, heading within spread of +Y |
Example
C
natiny_particles_set_shape(snow, NATINY_PARTICLES_SHAPE_BOX, 20.0f, 0.1f, 20.0f);