//===========================================================================// // File: rotation.tst // // Project: MUNGA Brick: Math Library // // Contents: Verify code for rotation classes // //---------------------------------------------------------------------------// // Date Who Modification // // -------- --- ---------------------------------------------------------- // // 11/20/94 JMA Initial coding. // // 12/01/94 JMA Made compatible with SGI CC // //---------------------------------------------------------------------------// // Copyright (C) 1994-1995, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #include "StuffHeaders.hpp" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EulerAngles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // //############################################################################# //############################################################################# // bool EulerAngles::TestClass() { SPEW((GROUP_STUFF_TEST, "Starting EulerAngle test...")); const EulerAngles a(Identity); EulerAngles b; const EulerAngles c(Pi_Over_4,Pi_Over_6,Pi_Over_3); Verify(!a.pitch && !a.yaw && !a.roll); Verify(c.pitch == Pi_Over_4 && c.yaw == Pi_Over_6 && c.roll == Pi_Over_3); Verify(!a); b = c; Verify(b == c); Verify(b != a); Verify(b[Y_Axis] == b.yaw); Verify(c[Z_Axis] == c.roll); b.Lerp(a,c,0.5f); Verify(b == EulerAngles(Stuff::Lerp(a.pitch,c.pitch,0.5f),Stuff::Lerp(a.yaw,c.yaw,0.5f),Stuff::Lerp(a.roll,c.roll,0.5f))); LinearMatrix4D m; m.BuildRotation(c); b = m; Verify(b == c); return true; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UnitQuaternion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // //############################################################################# //############################################################################# // #define NUMBER_OF_MULTIPLICATIONS 30 #include "random.hpp" class fstream; bool UnitQuaternion::TestClass() { SPEW((GROUP_STUFF_TEST, "Starting UnitQuaternion Test...")); #if 0 // ofstream testout("gene.tst",ios::app); //GY Vector3D r_vec; UnitQuaternion // q[2], q[NUMBER_OF_MULTIPLICATIONS+1], multiplied_q(Identity), converted_q; LinearMatrix4D // lm[2], lm[NUMBER_OF_MULTIPLICATIONS+1], multiplied_lm(true); Scalar r_float; //DEBUG_STREAM<<"Starting UnitQuaternion::TestClass()\n"; for (int k=0; k