]> git.mxchange.org Git - simgear.git/blob - simgear/scene/sky/clouds3d/mat44test.cpp
Clouds3D crashes because there is no Light
[simgear.git] / simgear / scene / sky / clouds3d / mat44test.cpp
1 //------------------------------------------------------------------------------
2 // File : mat44test.cpp
3 //------------------------------------------------------------------------------
4 // GLVU : Copyright 1997 - 2002 
5 //        The University of North Carolina at Chapel Hill
6 //------------------------------------------------------------------------------
7 // Permission to use, copy, modify, distribute and sell this software and its 
8 // documentation for any purpose is hereby granted without fee, provided that 
9 // the above copyright notice appear in all copies and that both that copyright 
10 // notice and this permission notice appear in supporting documentation. 
11 // Binaries may be compiled with this software without any royalties or 
12 // restrictions. 
13 //
14 // The University of North Carolina at Chapel Hill makes no representations 
15 // about the suitability of this software for any purpose. It is provided 
16 // "as is" without express or implied warranty.
17
18 //----------------------------------------------------------------------------
19 // mat44test  -- test compilation of all the functions in mat44 library
20 //----------------------------------------------------------------------------
21 // $Id$
22 //----------------------------------------------------------------------------
23 #include <iostream.h>
24 #include "vec3f.hpp"
25 #include "mat44.hpp"
26
27 int main(int argc, char *argv[])
28 {
29   cout << "This is not a comprehensive correctness test. " << endl
30        << "It merely tests whether all the functions in mat44 will compile." <<endl;
31
32   Mat44f m;
33   float m2[16];
34   Vec3f v(1.0, 1.0, 1.0);
35   Vec3f up(0.0, 1.0, 0.0);
36
37   m.Identity();
38   m.Transpose();
39   m.Translate(1.0, 1.0, 1.0);
40   m.Translate(v);
41   m.invTranslate(v);
42   m.Scale(1.0, 1.0, 1.0);
43   m.Scale(v);
44   m.invScale(1.0, 1.0, 1.0);
45   m.invScale(v);
46   m.Rotate(90, v);
47   m.invRotate(90, v);
48   m.Frustum(-1.0, 1.0, -1.0, 1.0, 0.01, 20);
49   m.invFrustum(-1.0, 1.0, -1.0, 1.0, 0.01, 20);
50   m.Perspective(60, 1.4, 0.01, 20);
51   m.invPerspective(60, 1.4, 0.01, 20);
52   m.Viewport(200, 200);
53   m.invViewport(200, 200);
54   m.LookAt(Vec3f::ZERO, v, up);
55   m.invLookAt(Vec3f::ZERO, v, up);
56   m.Viewport2(200, 200);
57   m.invViewport2(200, 200);
58   m.Print();
59   m.Transpose();
60   m.Print();
61   // These two should be transpose of one another
62   m.CopyInto(m2);
63
64   cout << "Ok there is this one test to make sure Transpose() is correct.\n"
65     "The above two matricies should be the transpose of one another.\n" << endl;
66 }