Look into integrating LiquidFun #58

Open
bjorn opened this Issue Apr 25, 2014 · 8 comments

Comments

Projects
None yet
4 participants
Owner

bjorn commented Apr 25, 2014

It would be nice to look into integrating LiquidFun and see how we can make this work nicely with fast scene-graph based rendering.

Project page:
http://google.github.io/liquidfun/

Repository:
https://github.com/google/liquidfun

Some useful information could be found here:
http://towp8.com/2014/04/23/integrating-liquidfun-with-cocos2d-x-part-i/

Contributor

ElderOrb commented Apr 25, 2014

Cool, I was going to bring this up as well :) The first issue which needs to be solved is how to combine Box2D we are using at the moment with liquidfun, which consists of modified Box2D (not sure which version) and 'Particles' extension. I see at least two approaches:

  • continue using the latest Box2D, merge 'Particles' and related code from 'liquidfun' to 'our' version of Box2D
    OR
  • just take liquidfun as it is instead of Box2D

To understand better if the first approach is applicable at all I was going to compare upstream Box2D with liquidfun long ago but.. you know :) lack of time blah-blah-blah.

Contributor

folibis commented Apr 26, 2014

It's really mpressive! Since it's based on Box2D I hope it will be easy to adapt it to qml-box2d (will it still qml-box2d? :) )
But first we have to finish with current version, at least we have to bring it to some working state.

Hi, I got this working on a proof-of-concept level. The LiquidFun fork of Box2D compiles with minimal hassle when merging into qml-box2d and the QML ParticleSystem was able to render the particles efficiently although I just used a custom Affector to sync with the physics-engine state.

Owner

bjorn commented Apr 1, 2015

@vmatikainen That's great news! Did you push your patches somewhere?

Contributor

folibis commented Apr 1, 2015

@vmatikainen it's very interesting. Some time ago I also tried to do that but stuck in visualization. It would be great to test your patch.

Contributor

folibis commented Apr 2, 2015

Good work, @vmatikainen. I've compiled your patch and also tested wavemachine example. I see a bit confusing me changes in Box2DWorld. What, for example, was a reason to change parent of Box2DWorld from QObject to QQuickItem?

Hi, I tried to explain the changes in README. The fork I'm using is also for other purposes and didn't have a clean a merge at hand, with just the liquidfun patch.

The main changes result from the motivation to handle Kinematic bodies with QML animations, which in my opinion is more QML style. That adds a requirement that the physics must be updated right after the QML animations, but before the rendering. The QQuickItem change enables just that. Althought there are other solutions for it. Regarding the Kinematic bodies its no more API compliant with Box2D, but other than that, it should work as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment