summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorNiclas Kellgren <niclas.kellgren@sonyericsson.com>2011-01-14 09:11:35 +0100
committerJohan Redestig <johan.redestig@sonyericsson.com>2011-01-14 09:11:35 +0100
commit494565ad1b0efe8ab70d23c61866748a9de66337 (patch)
tree4996d72cb19190112ad03bd77582a77423025ee8 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parentcb8427538dfdc5eae941e377b11bfd11a95fc5a5 (diff)
Added check to make orientation calculations more robust
Added check avoid a division by zero resulting in NaN which in turn makes checkFullyTilted to ignore high tilt angles from then on. If (x, y, z) == (0, 0, 0) then there is no tilt or rotation and this vector must be ignored. This check is extended to ignore all small acceleration values where noise can be of big influence. Low or zero readings can happen when space travelling free falling, but more commonly when shaking or getting bad readings from the sensor. The accelerometer is turned off when not used and polling it too soon after it is turned on may result in (0, 0, 0). Change-Id: I19aec653abb8ab6f7126778035c8c96449f1326f
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions