summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorNiclas Kellgren <niclas.kellgren@sonyericsson.com>2011-01-14 09:11:35 +0100
committerDianne Hackborn <hackbod@google.com>2011-01-14 16:01:20 -0800
commitfcbbb31f27f00efe7314031bac23e1e011954ad6 (patch)
treeae17234f6e405644d9850bef6791962631a591ad /graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
parent0b08c5cb14e848f41eb33093c3e8198ab416e0ab (diff)
DO NOT MERGE 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: I7b61b77c8a9d4e137bf6352b84f0c358d93c82ae
Diffstat (limited to 'graphics/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions