MatteoBattilana / WeatherView

WeatherView is an Android Library let you make cool weather animations for your app
Apache License 2.0
514 stars 80 forks source link

Improvement: add gravity #2

Closed HugoGresse closed 7 years ago

HugoGresse commented 7 years ago

It will be awesome to add gravity to each particle. Changing angle is a quick idea but by adding an independant gravity using device sensor on each particle we will respond perfectly and the animation will also be perfect.

MatteoBattilana commented 7 years ago

I was working on it but during the last period I was busy with some university exams. I'll continue this feature as soon as possibile.

Thank for the advice

HugoGresse commented 7 years ago

w00t, good luck, if you need some let me know.

MatteoBattilana commented 7 years ago

Hi, I've added this feature but it is only in the beta version. I have to fix some little graphic bugs.

Link to Beta section in ReadMe: Beta

HugoGresse commented 7 years ago

just tested it, it seems to works great, you've added a limit to the rotation which seems a bit low, will be cool to have almost 90° rotation. Also, the gravity is fixed for each particle, it should change in live according the the orientationSensor

MatteoBattilana commented 7 years ago

I've created a static variable called Constants.angleRangeRead. It is set to 20, the acc reads values between 70° - 110°. I can build a beta version with it set to 90, it will read (0° - 180°).

Also, the gravity is fixed for each particle, it should change in live according the the orientationSensor

I can't understand what you want. Can you explain it better, please? Since my last beta release, when the accelerometer intercepts a variation between Constants.angleRangeUpdate (set to 2°), the manager updates the particle angle and the gravity orientation force.

MatteoBattilana commented 7 years ago

I've added this feature in the 1.2.0 version, please check the new release.