Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a particles helper library #2445

Closed
deltakosh opened this issue Jul 6, 2017 · 15 comments · Fixed by #4288
Closed

Create a particles helper library #2445

deltakosh opened this issue Jul 6, 2017 · 15 comments · Fixed by #4288

Comments

@deltakosh
Copy link
Contributor

Something like createFire or createSmoke

@deltakosh deltakosh added this to the Future milestone Jul 6, 2017
@deltakosh deltakosh self-assigned this Jul 11, 2017
@deltakosh deltakosh modified the milestones: 3.1, Future Jul 11, 2017
@deltakosh
Copy link
Contributor Author

https://playground.babylonjs.com/#PSK6N1

@deltakosh deltakosh modified the milestones: 3.1, Future Oct 30, 2017
@yovanoc
Copy link
Contributor

yovanoc commented May 3, 2018

I can do that.
/src/Helpers is this the right place for that?
I will start this very soon.

I'm open for more create methods like that :)

@deltakosh
Copy link
Contributor Author

The idea is to create one-liner for smoke, fire, etc...
I think we can have it in helpers folder with a static class named ParticleHelper or something along this line
Assets should default to ressources saved to assets.babylonjs.com (which is mapped to the /assets folder)
The idea is not to have particles setup hard written in the helper.
I suggest to set up a folder in /assets named particles where particles textures and a json file describing each setup should be

The json file could describe all parameters of each particle setup

From a user standpoint, I see it like that:

var system = ParticleHelper.Create("fire", true);

The first parameter will look for a configuration named fire in the central json. The second one indicates that I want a GPU system (if the configuration allows it)

I hope this makes sense:)
Thanks a lot for your appreciated help!

@yovanoc
Copy link
Contributor

yovanoc commented May 3, 2018

Ok, nice, but the third argument for the ParticleSystem constructor is the Scene, so, Is there a way to get the scene, or we have to pass it to the main create() method too?

@deltakosh
Copy link
Contributor Author

Right:) we need a third one (optional as Engine.LastCreatedScene can be used)

@yovanoc
Copy link
Contributor

yovanoc commented May 3, 2018

Great, I'll make a first try. Then we can discuss around that

@deltakosh
Copy link
Contributor Author

Wonderful!!

@yovanoc
Copy link
Contributor

yovanoc commented May 3, 2018

Also, how can I correctly read a .json file in the /assets/particles folder, knowing that it becomes the domain name you told me?

For now, I've already put that for basic textures that I will use but can I use it for the json file properly?

private static _baseAssetsUrl = "https://assets.babylonjs.com/particles/";

@deltakosh
Copy link
Contributor Author

This is fine!

@yovanoc
Copy link
Contributor

yovanoc commented May 3, 2018

Where do you want I add a unit test for that?

@deltakosh
Copy link
Contributor Author

in /tests/unit please :)

@yovanoc
Copy link
Contributor

yovanoc commented May 3, 2018

Yeah, of course, but i add a new file?

@deltakosh
Copy link
Contributor Author

Sure thing!

@yovanoc
Copy link
Contributor

yovanoc commented May 3, 2018

But why there are no scripts in package.json to run tests? how do I launch these tests so?

@deltakosh
Copy link
Contributor Author

just go to /tools/gulp and run gulp tests-unit

@deltakosh deltakosh modified the milestones: Future, 3.3 May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants