fixed #25 Orientation with sensors is not working

This commit is contained in:
Thibault Deckers 2022-06-19 17:10:38 +09:00
parent f8f8e905d9
commit 0050dc1aee

View file

@ -279,12 +279,14 @@ class _PanoramaState extends State<Panorama> with SingleTickerProviderStateMixin
motionSensors.orientationUpdateInterval = Duration.microsecondsPerSecond ~/ 60;
_orientationSubscription = motionSensors.orientation.listen((OrientationEvent event) {
orientation.setValues(event.yaw, event.pitch, event.roll);
_updateView();
});
break;
case SensorControl.AbsoluteOrientation:
motionSensors.absoluteOrientationUpdateInterval = Duration.microsecondsPerSecond ~/ 60;
_orientationSubscription = motionSensors.absoluteOrientation.listen((AbsoluteOrientationEvent event) {
orientation.setValues(event.yaw, event.pitch, event.roll);
_updateView();
});
break;
default: