Show
Ignore:
Timestamp:
08/27/07 11:51:24 (7 years ago)
Author:
robert
Message:

From David Spilling, tweaked quat tests to reproduce getRotate errors.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgunittests/osgunittests.cpp

    r6941 r7300  
    276276                out_quat2 = out_mat.getRotate(); 
    277277                 
     278                // If the quaternion W is <0, then we should reflect 
     279                // to get it into the positive W 
     280                if(out_quat1.w()<0) out_quat1 = out_quat1 * -1.0; 
     281                if(out_quat2.w()<0) out_quat2 = out_quat2 * -1.0; 
     282 
     283 
    278284                // if the output quat length is not one  
    279                 // or if the component magnitudes do not match, 
     285                // or if the components do not match, 
    280286                // something is amiss 
    281287                if (fabs(1.0-out_quat2.length()) > eps || 
    282                 (fabs(out_quat1.x())-fabs(out_quat2.x())) > eps || 
    283                 (fabs(out_quat1.y())-fabs(out_quat2.y())) > eps || 
    284                 (fabs(out_quat1.z())-fabs(out_quat2.z())) > eps || 
    285                 (fabs(out_quat1.w())-fabs(out_quat2.w())) > eps) { 
     288                (fabs(out_quat1.x()-out_quat2.x())) > eps || 
     289                (fabs(out_quat1.y()-out_quat2.y())) > eps || 
     290                (fabs(out_quat1.z()-out_quat2.z())) > eps || 
     291                (fabs(out_quat1.w()-out_quat2.w())) > eps) { 
    286292                std::cout << __FUNCTION__ << " problem at: \n" 
    287293                      << " r1=" << rol1