aouellets of Academic Technical Team Code Base
5/1/2018 - 2:27 PM

The ability to continuously move a 3D widget in a direction, and stop in from moving

The ability to continuously move a 3D widget in a direction, and stop in from moving

var timerId = -1;
var timingInterval = 30; //frequency at which position of widget is updated

//starts moving the model forward
$scope.moveForward = function() {
    timerId = setInterval(function () {
      $scope.$apply(function () {     
        $scope.view.wdg[__studioIDofWidget__]['x'] -= .01;
        });
    }, timingInterval);
}

//stops the position from being updated
$scope.stop = function() {
clearInterval(timerId);
}