diff options
author | John Cochran | 2012-01-03 11:38:38 -0600 |
---|---|---|
committer | Melanie | 2012-01-06 21:30:51 +0000 |
commit | e9b9eb6a4c6eaf161532994414f524e823d15120 (patch) | |
tree | 28b27e978e2c9ddf45c6aa583050fe468c7f960e /OpenSim/Tools/Compiler | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC-e9b9eb6a4c6eaf161532994414f524e823d15120.zip opensim-SC-e9b9eb6a4c6eaf161532994414f524e823d15120.tar.gz opensim-SC-e9b9eb6a4c6eaf161532994414f524e823d15120.tar.bz2 opensim-SC-e9b9eb6a4c6eaf161532994414f524e823d15120.tar.xz |
Replaced llRot2Euler function.
The original function suffered from unexpected results due to rounding
errors. An error of only 1 or 2 ulps would cause the code to not detect
a singularity at Y rotation +/- PI/2 and take the non-singularity code
path. The replacement code does not suffer from wildly inaccurate
results at the +/- PI/2 singularity. The check in the code for the
singularity isn't strictly needed, but gives more consistent results
At the singularity, the X and Z rotations add. The if check simply
forces the X rotation to be zero so the entirety of the X+Z rotation is
carried by Z.
Additionally, the test code has been updated to include test cases that
caused the old code to fail. The test algorithm is also updated to
perform a more meaningful test. The original code checked if the values
against expected values. This could fail at +/- PI rotations since a
rotation around an axis by PI causes the identical effect as a rotation
by -PI. The new test code checks that the returned angles can be used
to recreate a quaternion that causes the same rotation.
Diffstat (limited to 'OpenSim/Tools/Compiler')
0 files changed, 0 insertions, 0 deletions