Hi, as the holidays are approaching, someone asked if we could do a snowglobe on Playcanvas, and I said I’d look into it. Seems like the built-in particles component doesn’t quite cut it as it says this:
Note that particles are not physically simulated. They do not interact or collide with each other. They will pass through surfaces in your scene.
What we’re after is some particles being interacted on by forces, contained within a mesh and resting on hard surfaces. I know this is a lot to ask of Playcanvas (and on devices), just wondering if anyone has had any luck with other particle systems like particles.js, particulate.js or any other physics engine which might do the trick…
Indeed something like that isn’t supported and from my understanding it’s not trivial to add.
Your best is to simulate those particles as regular entities and leverage real physics. If the number of bodies is small you can get relatively decent performance and real interactions between particles and geometry.
Just make sure to enable some form of batching / instancing on your particle models to reduce the number of draw calls.
The CPU runs a simple physics simulation using Verlet integration, and implements a sphere with particles inside. When they move and reach the sphere boundary, they bounce back. This could be easily extended to handle bouncing off of additional spheres / planes for example.