Spherical particle system with initial velocity

I am feeling sullied and unusual. Trying to have a spherical explosion in space, but the entire explosion moves with an initial velocity. I tried using particle_system.direction1 and 2 to give it this velocity, but nothing happens. Through the BJS source code I discovered the internal _inheritedVelocityOffset, and that is exactly what I needed, but it feels dirty.

What is a better solution? https://playground.babylonjs.com/#MRRGXL#872

Added bonus question: what are the “units” of that _inheritedVelocityOffset?


cc @PatrickRyan

If there’s no solution, I guess we can make _inheritedVelocityOffset visible by the user and rename it to something like initialVelocity?

1 Like

@jimmejardine, in looking at your particle system, hijacking _inheritedVelocityOffset was just turning your sphere emitter into a cone emitter. Changing your emitter to a wider cone and then using some velocity gradients are what you are looking for. The velocity gradients are what I believe are seeding _inheritedVelocityOffset so just changing the shape of your emitter and adding velocity gradients should get you where you want to go. Here’s the updated PG.

Particles Emitted from Given Shape | Babylon.js Playground (babylonjs.com)