You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2015/03/17 12:14:54 UTC

cordova-plugin-device-motion git commit: CB-8312 Multiply accelerometer values by -g on Windows

Repository: cordova-plugin-device-motion
Updated Branches:
  refs/heads/master a943b4c1f -> 49a436cd9


CB-8312 Multiply accelerometer values by -g on Windows


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/49a436cd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/49a436cd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/49a436cd

Branch: refs/heads/master
Commit: 49a436cd9a42fee0ace5046c90c482e19ad8be7b
Parents: a943b4c
Author: daserge <da...@yandex.ru>
Authored: Thu Jan 15 13:00:32 2015 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Tue Mar 17 14:13:24 2015 +0300

----------------------------------------------------------------------
 src/windows/AccelerometerProxy.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/49a436cd/src/windows/AccelerometerProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/AccelerometerProxy.js b/src/windows/AccelerometerProxy.js
index d65764b..d275f8b 100644
--- a/src/windows/AccelerometerProxy.js
+++ b/src/windows/AccelerometerProxy.js
@@ -26,6 +26,7 @@ var cordova = require('cordova'),
 
 /* This is the actual implementation part that returns the result on Windows 8
 */
+var gConstant = -9.81;
 
 module.exports = {
     onDataChanged:null,
@@ -42,13 +43,13 @@ module.exports = {
             // store our bound function
             this.onDataChanged = function(e) {
                 var a = e.reading;
-                win(new Acceleration(a.accelerationX, a.accelerationY, a.accelerationZ), {keepCallback: true});
+                win(new Acceleration(a.accelerationX * gConstant, a.accelerationY * gConstant, a.accelerationZ * gConstant), {keepCallback: true});
             };
             accel.addEventListener("readingchanged",this.onDataChanged);
 
             setTimeout(function(){
                 var a = accel.getCurrentReading();
-                win(new Acceleration(a.accelerationX, a.accelerationY, a.accelerationZ), {keepCallback: true});
+                win(new Acceleration(a.accelerationX * gConstant, a.accelerationY * gConstant, a.accelerationZ * gConstant), {keepCallback: true});
             },0); // async do later
         }
     },


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org