C4 Engine
C4 Engine API Documentation

class BlobParticleSystem

Defined in:  C4Particles.h
The BlobParticleSystem class represents a blob-based particle system node in a world.
Definition

class BlobParticleSystem : public ParticleSystem

Constructor

BlobParticleSystem(ParticleSystemType type, ParticlePoolBase *pool, float scale, float maxRadius);

Parameters
type The type of particle system.
pool The particle pool from which this effect creates particles. The particles in this pool must use the BlobParticle structure.
scale The size of the voxels used to render the blob particles.
maxRadius The maximum radius of any single blob particle in the particle system.
Description
The BlobParticleSystem class is the base class for all blob-based particle effects. Blob particles are rendered into a set of voxel maps that are then triangulated with a fixed-polarity marching cubes implementation. A separate triangulation job is run for each connected island of blobs, and these jobs are distributed among all available processor cores.

The value of the scale parameter specifies the distance between voxels. A smaller value produces more highly-tessellated triangle meshes, which can reduce performance if the scale is too small. A higher value increases performance, but at the cost of surface smoothness. The value of scale should generally be about the same as the smallest radius that will be used by any particle in the system.

The maxRadius parameter specifies the maximum radius that any particle in the system will have. This should generally be a multiple of the scale parameter for best memory utilization. If any single particle has a radius larger than maxRadius, then the results are undefined. However, multiple particles can combine to form islands that are much larger than this maximum.

The values of the scale and maxRadius parameters must together satisfy the following restriction, or the particle system may not render correctly:

18 × totalParticleCount × (⌈maxRadius / scale⌉)2 < 65535

Here, the value of totalParticleCount is the number of particles available in the particle pool.
Base Classes
ParticleSystem A BlobParticleSystem node is a specific type of particle system.
See Also

ParticlePool

BlobParticle