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

[feature request] liquidfun support #8

Open
tempral opened this issue Dec 1, 2019 · 18 comments
Open

[feature request] liquidfun support #8

tempral opened this issue Dec 1, 2019 · 18 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tempral
Copy link

tempral commented Dec 1, 2019

If is possible to implement it, would be a great option...
thanks to all the Devs involved

@erickzanardo
Copy link
Member

Can you please provide some links and material about this? so we can understand better your request?

@tempral
Copy link
Author

tempral commented Dec 1, 2019

http://google.github.io/liquidfun/
At this link you can find the documentation.
LiquidFun is an extension of Box2D. It adds a particle based fluid and soft body simulation to the rigid body functionality of Box2D.

@feroult
Copy link
Contributor

feroult commented Dec 2, 2019

I really think it would be awesome to have Liquidfun! I can definitely help!

Sometime ago I gave some thoughts on doing this... Since it is a C++ lib it was a bit harder than integrating Box2D (already in Dart).

The link below gives info on how to build it for different platforms.

We could integrate it as a channel and create a Dart generator to expose the C++ API on Dart. Can be hard but maybe it can be done.

Thoughts?

https://google.github.io/liquidfun/Building/html/index.html

@erickzanardo
Copy link
Member

It seems to be supported on both Android and iOS, as well as desktop, my only concern on using channel APIs is that we will have some trouble porting to desktop and maybe web.

I see two paths:

  • implementing this using the channel APIs like @feroult suggested, but not directly on Flame, we could have a flame_liquidfun package

  • porting the c++ code to dart (kind like how box2d is ported)

I have no idea which idea would be better, or easier, I know the recent dart versions has the possibility to integrated with native stuff easily using ffi, but I never tried it myself. And I don’t know how complicated this library code is to have it ported to dart, the good thing about this approach is that we wouldn’t need to change anything for desktop and web.

@renancaraujo
Copy link
Member

There is the DART native FFI which as an interface between dart code and c++. I got this sample running:
Dart code: https://github.com/renancaraujo/bitmap/blob/master/lib/transformations/brightness.dart#L35
c code: https://github.com/renancaraujo/bitmap/blob/9cd10ebf045858067542d5c55c39246db17d9678/ios/Classes/bitmap.cpp#L26

We can do something like that perhaps.

@billy1380
Copy link

Jbox2d https://github.com/jbox2d/jbox2d/tree/master/jbox2d-library/src/main/java/org/jbox2d already seems to have particle ported... does the dart port of box2d predate that or was it omitted?

@luanpotter
Copy link
Member

@billy1380 I was unaware that particle means liquidfun. we do have some particle related classes on box2d.dart from when it was ported.

@renancaraujo @spydon do you know anything about this? maybe we had liquidfun support all along and didn't know?

@spydon
Copy link
Member

spydon commented May 31, 2020

No, we don't have liquidfun support.
Liquidfun is a larger extension of box2d than just the particle afaik.

@spydon
Copy link
Member

spydon commented Jun 6, 2020

Actually I think I was wrong, I think we have liquidfun support.
According to jbox2d which the dart port comes from it says:

It's technically more accurate to say it's just a port of LiquidFun now, and LiquidFun is fork of Box2D, but the library started as a Box2D port.

@luanpotter
Copy link
Member

Maybe what we need them is just an example to showcase some liquidfun specific functionality? That will also ensure our port of a port works as intended. @renancaraujo or @spydon would you like to think of something? I myself am a bit unclear on the exact distinction of both, I originally thought it was a totally different project but it seems it was something that was eventually merged into box2d itself.

@spydon
Copy link
Member

spydon commented Oct 14, 2020

Alright, so I did some more investigation regarding this and we have liquidfun support in the world, but we have no support to render the particle system yet.

@luanpotter luanpotter transferred this issue from flame-engine/flame Jan 5, 2021
@thevikke
Copy link

Hey, what is the situation with the Liquid fun support? 🤔

@spydon
Copy link
Member

spydon commented Feb 11, 2021

It depends on what part of LiquidFun you mean, I am updating the particle system at the moment in #7

@thevikke
Copy link

I'm not very familiar with the project specifics. I was wondering if it was possible to use LiquidFun with Forge2D? Or rather after you are done with updating the particle system?

@spydon
Copy link
Member

spydon commented Feb 11, 2021

LiquidFun is built on top of Box2D in C++, and Forge2D is a Dart port of jbox2d, to simplify it.
So you can never use LiquidFun directly with Forge2D, but we have some features that are included in LiquidFun.

@JCzz
Copy link

JCzz commented Apr 25, 2022

Would be cool to be able to do:
https://github.com/diwi/LiquidFunProcessing/tree/master/examples

@spydon
Copy link
Member

spydon commented Apr 26, 2022

Would be cool to be able to do: https://github.com/diwi/LiquidFunProcessing/tree/master/examples

To do what? There are a lot of examples under that link, some which can already be done, some which has functionality that aren't implemented yet.

@ehartford
Copy link

I would like to have all the functionality of liquidfun

I want to implement fluid dynamics in my 2d game

@spydon spydon added enhancement New feature or request help wanted Extra attention is needed labels Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

10 participants