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

A new LiquidFun integration #115

Open
ThomasVogelpohl opened this issue Feb 17, 2017 · 2 comments
Open

A new LiquidFun integration #115

ThomasVogelpohl opened this issue Feb 17, 2017 · 2 comments

Comments

@ThomasVogelpohl
Copy link
Contributor

Hi all,

I really like the water simulation LiquidFun from Google and therefore I have tried a new integration into qmlbox2d.
I have taken the excellent work of Vikke Matikainen on https://github.com/vmatikainen/qml-box2d (See issue #58 #58) and tried to improve the CPU cycles needed.
The original software of Vikke does not run on an iPad Air and quite bad on a Google Nexus 9.
Vikke used a QML Particle system with a manual update of the positions, which is quite slow.

So I have created a lot of QML Rectangles ( in form ofQQuickItems) and set the position of the items in the update C++ update function. The identification works with attaching the pointer of the QQuickItem to the corresponding Box2D Particle.
I have only done rough profiling (just CPU cycles on the Mac) and QQuickItems version seems to be 40% to 45% faster than the QML Particle version.
I can run this version even on the tablets and they run just about OK, depending on the number of box2d-Particles.

I have also implemented debug draw for the box2d Particles.

Missing:

  • check if NEON extensions are enabled.
  • Debug Draw DrawPoint not implemented

You can find the fork on: git@github.com:ThomasVogelpohl/qml-box2d.git
Branch: LiquidFun

You find an example: wavemachine.qml

Please let me know what you think.
Maybe you have suggestions for speed enhancements.

Best regards,
Thomas

@ThomasVogelpohl
Copy link
Contributor Author

Hi, just enabled SIMD instructions for Arm Neon and the example wavemachine runs really well with more than 5300 particles on the Google Nexus 9. Very neat.
I have not tried on the iPad, as currently it does not compile.

Will check-in the changes soon.

BR,
Thomas

@bjorn
Copy link
Member

bjorn commented Feb 20, 2017

@ThomasVogelpohl This sounds really awesome! I'll be sure to try it out sometime soon.

Since unfortunately I have very little time for this project, as you've already noticed of course, I've just invited you to the qml-box2d organization so that you can feel free to push changes yourself that you are comfortable with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants