Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
shehan committed Mar 9, 2017
1 parent 7eebb3d commit 0b486fa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/js/group-chat-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@
$scope.deviceOrientation.alpha=event.alpha;
$scope.deviceOrientation.beta=event.beta;
$scope.deviceOrientation.gamma=event.gamma;

if (event.beta > 90) { $scope.deviceOrientation.beta = 90};
if (event.beta < -90) { $scope.deviceOrientation.beta = -90};

$scope.deviceOrientation.beta += 90;
$scope.deviceOrientation.gamma += 90;

$scope.$apply();

}
Expand All @@ -80,9 +87,10 @@
if($scope.deviceOrientation.alpha >= -30 && $scope.deviceOrientation.alpha<=-15)
pos = "DOWN";
if($scope.deviceOrientation.beta >= 30 && $scope.deviceOrientation.beta<=80)
pos = "RIGHT";
pos = "DOWN" +
"";
if($scope.deviceOrientation.beta >= -80 && $scope.deviceOrientation.beta<=-30)
pos = "LEFT";
pos = "DOWN";

if (pos != ''){
if(pos != $scope.prevAction)
Expand Down

0 comments on commit 0b486fa

Please sign in to comment.