mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-03-14 01:09:51 -04:00
Remove normal force from acceleration magnitude
This commit is contained in:
parent
92e1f040c3
commit
7a1b6d4f60
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue