From 1533af6dfd58cd6b87da9d72453afd02fa1ed8e5 Mon Sep 17 00:00:00 2001 From: Roger Caplan Date: Tue, 16 Jan 2018 10:33:30 -0500 Subject: [PATCH] use correct starting angle for initial user pan check --- Sources/NYT360CameraController.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/NYT360CameraController.m b/Sources/NYT360CameraController.m index a76920b..9b84127 100644 --- a/Sources/NYT360CameraController.m +++ b/Sources/NYT360CameraController.m @@ -10,6 +10,8 @@ #import "NYT360EulerAngleCalculations.h" #import "NYT360CameraPanGestureRecognizer.h" +static const CGPoint kStartingPosition = { 3.14, 0 }; + static inline CGFloat distance(CGPoint a, CGPoint b) { return sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2)); } @@ -48,7 +50,7 @@ - (instancetype)initWithView:(SCNView *)view motionManager:(id minimalRotationDistanceToReport) { + if (distance(kStartingPosition, self.currentPosition) > minimalRotationDistanceToReport) { [self reportInitialCameraMovementIfNeededViaMethod:NYT360UserInteractionMethodGyroscope]; } }