Open erikwatson opened 1 year ago
This now gets set in the gravity config setting:
snowfall.start({ gravity: { respectOrientation: true } })
Reopening this, it isn't as simple as it looked. It seemed to work okay in the simulator, but on a real device it's obviously buggy.
The 3 angles you get out of the device orientation events are not directly usable for our needs. This will require some on-device testing to make sure it's working properly.
We can track the users device orientation and use that information to set the gravity vector. This will make it so that the snow always falls towards Earth, no matter the rotation of the phone/tablet/whatever.
I think this sounds like a fun feature but it should be optional. Stick it behind a setting like
{ trackDeviceOrientation: false }
or something.