Show
Ignore:
Timestamp:
06/07/07 13:05:59 (8 years ago)
Author:
robert
Message:

Added support for using quat_scaled sx sy sz for testing getting quats from scaled
matrices. Removed broken Matrixd/quat test

Files:
1 modified

Legend:

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

    r6810 r6879  
    151151///  (mat(q1)*mat(q2)*scale).getRotate() 
    152152/// for a range of rotations 
    153 void testGetQuatFromMatrix() { 
     153void testGetQuatFromMatrix(const osg::Vec3d& scale)  
     154{ 
    154155     
    155156    // Options 
     
    162163    // Not sure if 0's or negative values are acceptable 
    163164    osg::Matrixd scalemat; 
    164     scalemat.makeScale(osg::Vec3d(0.9,0.5,0.1)); 
     165    scalemat.makeScale(scale); 
    165166     
    166167    // range of rotations 
     
    301302} 
    302303 
    303 void testQuat() 
     304void testQuat(const osg::Vec3d& quat_scale) 
    304305{ 
    305306    osg::Quat q1; 
     
    343344 
    344345    // Test a range of rotations 
    345     testGetQuatFromMatrix(); 
     346    testGetQuatFromMatrix(quat_scale); 
    346347 
    347348    // This is a specific test case for a matrix containing scale and rotation 
     
    367368    arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 
    368369    arguments.getApplicationUsage()->addCommandLineOption("qt","Display qualified tests."); 
     370    arguments.getApplicationUsage()->addCommandLineOption("quat","Display extended quaternion tests."); 
     371    arguments.getApplicationUsage()->addCommandLineOption("quat_scaled sx sy sz","Display extended quaternion tests of pre scaled matrix."); 
    369372    arguments.getApplicationUsage()->addCommandLineOption("sizeof","Display sizeof tests."); 
    370373    arguments.getApplicationUsage()->addCommandLineOption("matrix","Display qualified tests."); 
     
    390393    while (arguments.read("quat")) printQuatTest = true;  
    391394 
     395    osg::Vec3d quat_scale(1.0,1.0,1.0);  
     396    while (arguments.read("quat_scaled", quat_scale.x(), quat_scale.y(), quat_scale.z() )) printQuatTest = true;  
     397 
    392398    bool performanceTest = false;  
    393399    while (arguments.read("p") || arguments.read("performance")) performanceTest = true;  
     
    413419    if (printQuatTest) 
    414420    { 
    415         testQuat(); 
     421        testQuat(quat_scale); 
    416422    } 
    417423