dword type
float minX, minY, minZ
float maxX, maxY, maxZ
float sideLength
float sphereRadius
dword sphereEdge
float cylinderRadius
dword cylinderEdge
float cylinderHeight
float valX, valY, valZ
A property group describes a range of possible values a particle property can assume. When a particle is spawned, a value is chosen by random from
the range and set as the particle's position or speed, depending on the group.
The group contains several mutually exclusive fields that define the range of possible values depending on the type of range.
The possible types (as stored in the 'type' field) are:
Exact
When the 'type' field is 0, (valX, valY, valZ) describes the exact value this property should be.
Example usage:
value = vector3(valX, valY, valZ);
Box
When the 'type' field is 1, the sideLength value describes the size of a cube centered at (0,0,0)
within which the value for the property should be chosen
Example usage:
float half = sideLength / 2;
value = vector3(rnd(-half, half), rnd(-half, half), rnd(-half, half));
Cube
When the 'type' field is 2, (minX, minY, minZ) and (maxX, maxY, maxZ) describe the bounds of a box
within which the value for the property should be chosen
Example usage:
value = vector3(rnd(minX, maxX), rnd(minY, maxY), rnd(minZ, maxZ));
Sphere
When the 'type' field is 3, the sphereRadius indicates the radius of a sphere. If sphereEdge is zero,
the value can be any value contained within the sphere. If sphereEdge is non-zero, the value can only be
a value on the edge of the sphere (i.e. length(value) = sphereRadius)
Example usage:
float t = rnd(-PI , PI );
float p = rnd(-PI/2, PI/2);
float r = sphereEdge ? sphereRadius : rnd(0, sphereRadius);
value = vector3(r*cos(p)*cos(t), r*cos(p)*sin(t), r*sin(p));
Cylinder
When the 'type' field is 4, the cylinderRadius and cylinderHeight values define a cylinder. If cylinderEdge is zero,
the value can be any value contained within the cylinder. If cylinderEdge is non-zero, the value can only be
a value on the (curved) edge of the cylinder (i.e., sqrt(x*x + y*y) = cylinderRadius)
Example usage:
float t = rnd(-PI, PI);
float r = cylinderEdge ? cylinderRadius : rnd(0, cylinderRadius);
value = vector3(r*cos(t), r*sin(t), rnd(0, cylinderHeight));