The Point Cloud Particle System
A PCS is a single updatable mesh with the the
PointsCloud property of its material set to
true. The point particles are simply the vertices of the mesh. As a mesh a PCS has most of the properties of a mesh, The exceptions are those related to its material which is already set and cannot be changed and also anything related to its vertex normals and indices as it does not have any set.
As a particle system the PCS provides some methods to manage the particles. However it is behavior agnostic. This means it has no emitter, no particle physics, no particle recycler. You have to implement your own behavior.
Particles can be added to a PCS with a function or using an existing mesh as a model, where particles are randomly evenly distributed on either the surface of the model or inside the model.
The expected usage is:
- First, create your PCS with
- Then, add particles in the PCS, using one of
addSurfacePoints(mesh, number, method)or
addVolumePoints(mesh, number, method).
- Redo the additions as many times as needed. Each addition creates a new group of particles identified by
- When done, build the PCS mesh with
- Changes to particle properties can be achieved with the
updateParticle(particle)methods and a call to
- Particle animation can be accomplished by defining their individual behavior in
setParticles()within the render loop.
The way the PCS is created using vertex points with a pre-applied material with
PointsCloud set to true means that:
- Particles cannot be destroyed and particles off screen are still enabled;
- Transparency does not work on individual particles.