mjmfighter Posted September 2, 2017 Share Posted September 2, 2017 Is it possible to call addShape on a Solid Particle System after creation? For example, I am using the following playground example: https://www.babylonjs-playground.com/#2BXZC#2 I am modifying it so only one shape is spawned in the beginning and whenever that particle touches the ground I want it to spawn a new one (as well as reset the old one). I have tried adding a addShape call within the "recycle if touched the ground" if statement, but it errors out every time. Quote Link to comment Share on other sites More sharing options...
JohnK Posted September 3, 2017 Share Posted September 3, 2017 Hi and welcome to the forum. A forum search of addShapes yields which should help you jerome 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 3, 2017 Share Posted September 3, 2017 For now, you can't add shapes nor particles once the call to .buildMesh(). You have to fill your SPS with all the expected shapes and particles, then disable or hide (alive = false or isVisible = false) the unneeded ones until you need them back. This way is quite performant because dead or invisible particles aren't processed. I intend to add the ability to extend the SPS one created in a decent delay (currently working on a prototype of SPS with concurrency using workers and sharedArrayBuffers to check if it's worth it, what requires a deep refactor to replace arrays of objects by arrays of floats only) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.