Remove normal force from acceleration magnitude

This commit is contained in:
Valerie Young 2019-01-10 12:09:44 -05:00
parent 92e1f040c3
commit 7a1b6d4f60

View file

@ -596,12 +596,15 @@ class Scratch3GdxForBlocks {
}
whenAccelerationCompare (args) {
const currentVal = this.magnitude(
let currentVal = this.magnitude(
this._peripheral.getAccelerationX(),
this._peripheral.getAccelerationY(),
this._peripheral.getAccelerationZ()
);
// Remove acceleration due to gravity
currentVal = currentVal - 9.8;
switch (args.COMPARE) {
case ComparisonOptions.LESS_THAN:
return currentVal < Cast.toNumber(args.VALUE);