Skip to content

Commit 1d6e17d

Browse files
committed
Merge pull request #11 from dorukeker/FullTilt_upgrade
Full tilt upgrade
2 parents f2df4d9 + 7da04ea commit 1d6e17d

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"license": "MIT",
2525
"devDependencies": {
2626
"bootstrap": "~3.3.2",
27-
"fulltilt": "0.5.2",
27+
"fulltilt": "0.7",
2828
"es6-promise": "*"
2929
}
3030
}

demo/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
}
192192

193193
start_gn();
194+
}).catch(function(e){
195+
196+
console.log(e);
197+
194198
});
195199
}
196200

lib/gyronorm.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,29 +231,34 @@
231231
*/
232232
GyroNorm.prototype.isAvailable = function(_eventType) {
233233

234+
var doSnapShot = _do.getScreenAdjustedEuler();
235+
var accSnapShot = _dm.getScreenAdjustedAcceleration();
236+
var accGraSnapShot = _dm.getScreenAdjustedAccelerationIncludingGravity();
237+
var rotRateSnapShot = _dm.getScreenAdjustedRotationRate();
238+
234239
switch (_eventType) {
235240
case DEVICE_ORIENTATION:
236-
return (_do.isAvailable(_do.ALPHA) && _do.isAvailable(_do.BETA) && _do.isAvailable(_do.GAMMA));
241+
return ((doSnapShot.alpha && doSnapShot.alpha !== null) && (doSnapShot.beta && doSnapShot.beta !== null) && (doSnapShot.gamma && doSnapShot.gamma !== null));
237242
break;
238243

239244
case ACCELERATION:
240-
return (_dm.isAvailable(_dm.ACCELERATION_X) && _dm.isAvailable(_dm.ACCELERATION_Y) && _dm.isAvailable(_dm.ACCELERATION_Z));
245+
return (accSnapShot && accSnapShot.x && accSnapShot.y && accSnapShot.z);
241246
break;
242247

243248
case ACCELERATION_INCLUDING_GRAVITY:
244-
return (_dm.isAvailable(_dm.ACCELERATION_INCLUDING_GRAVITY_X) && _dm.isAvailable(_dm.ACCELERATION_INCLUDING_GRAVITY_Y) && _dm.isAvailable(_dm.ACCELERATION_INCLUDING_GRAVITY_Z));
249+
return (accGraSnapShot && accGraSnapShot.x && accGraSnapShot.y && accGraSnapShot.z);
245250
break;
246251

247252
case ROTATION_RATE:
248-
return (_dm.isAvailable(_dm.ROTATION_RATE_ALPHA) && _dm.isAvailable(_dm.ROTATION_RATE_BETA) && _dm.isAvailable(_dm.ROTATION_RATE_GAMMA));
253+
return (rotRateSnapShot && rotRateSnapShot.alpha && rotRateSnapShot.beta && rotRateSnapShot.gamma);
249254
break;
250255

251256
default:
252257
return {
253-
deviceOrientationAvailable: (_do.isAvailable(_do.ALPHA) && _do.isAvailable(_do.BETA) && _do.isAvailable(_do.GAMMA)),
254-
accelerationAvailable: (_dm.isAvailable(_dm.ACCELERATION_X) && _dm.isAvailable(_dm.ACCELERATION_Y) && _dm.isAvailable(_dm.ACCELERATION_Z)),
255-
accelerationIncludingGravityAvailable: (_dm.isAvailable(_dm.ACCELERATION_INCLUDING_GRAVITY_X) && _dm.isAvailable(_dm.ACCELERATION_INCLUDING_GRAVITY_Y) && _dm.isAvailable(_dm.ACCELERATION_INCLUDING_GRAVITY_Z)),
256-
rotationRateAvailable: (_dm.isAvailable(_dm.ROTATION_RATE_ALPHA) && _dm.isAvailable(_dm.ROTATION_RATE_BETA) && _dm.isAvailable(_dm.ROTATION_RATE_GAMMA))
258+
deviceOrientationAvailable: ((doSnapShot.alpha && doSnapShot.alpha !== null) && (doSnapShot.beta && doSnapShot.beta !== null) && (doSnapShot.gamma && doSnapShot.gamma !== null)),
259+
accelerationAvailable: (accSnapShot && accSnapShot.x && accSnapShot.y && accSnapShot.z),
260+
accelerationIncludingGravityAvailable: (accGraSnapShot && accGraSnapShot.x && accGraSnapShot.y && accGraSnapShot.z),
261+
rotationRateAvailable: (rotRateSnapShot && rotRateSnapShot.alpha && rotRateSnapShot.beta && rotRateSnapShot.gamma)
257262
}
258263
break;
259264
}

0 commit comments

Comments
 (0)