Subversion Repositories gelsvn

Rev

Rev 10 | Rev 43 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 12
Line 7... Line 7...
7
#include "Vec3Hf.h"
7
#include "Vec3Hf.h"
8
#include "Vec4f.h"
8
#include "Vec4f.h"
9
#include "ArithSqMat4x4Float.h"
9
#include "ArithSqMat4x4Float.h"
10
 
10
 
11
 
11
 
12
namespace CGLA {
12
namespace CGLA 
-
 
13
{
13
 
14
 
14
 
15
 
15
	/** Four by four float matrix.
16
  /** Four by four float matrix.
16
			This class is useful for transformations such as perspective projections 
17
      This class is useful for transformations such as perspective projections 
17
			or translation where 3x3 matrices do not suffice. */
18
      or translation where 3x3 matrices do not suffice. */
Line 27... Line 28...
27
		Mat4x4f() {}
28
      Mat4x4f() {}
28
 
29
 
29
		/// Construct a matrix with identical elements.
30
      /// Construct a matrix with identical elements.
30
		Mat4x4f(float a): 
31
      Mat4x4f(float a): 
31
			ArithSqMat4x4Float<Vec4f, Mat4x4f> (a) {}
32
	ArithSqMat4x4Float<Vec4f, Mat4x4f> (a) {}
32
 
-
 
33
		/// Construct from a pointed to array of 16 floats.
-
 
34
		explicit Mat4x4f(const float* sa): 
-
 
35
			ArithSqMat4x4Float<Vec4f, Mat4x4f> (sa) {}
-
 
36
 
-
 
37
	};
33
    };
38
 
34
 
39
	/// Create a rotation _matrix. Rotates about one of the major axes.
35
  /// Create a rotation _matrix. Rotates about one of the major axes.
40
	Mat4x4f rotation_Mat4x4f(CGLA::Axis axis, float angle);
36
  Mat4x4f rotation_Mat4x4f(CGLA::Axis axis, float angle);
41
 
37
 
Line 51... Line 47...
51
		return Mat4x4f(Vec4f(1,0,0,0), 
47
      return Mat4x4f(Vec4f(1,0,0,0), 
52
									 Vec4f(0,1,0,0), 
48
		     Vec4f(0,1,0,0), 
53
									 Vec4f(0,0,1,0), 
49
		     Vec4f(0,0,1,0), 
54
									 Vec4f(0,0,0,1));
50
		     Vec4f(0,0,0,1));
55
	}
51
    }
56
 
-
 
57
	/** Create a perspective matrix. Assumes the eye is at the origin and
-
 
58
			that we are looking down the negative z axis.
-
 
59
    
-
 
60
			ACTUALLY THE EYE IS NOT AT THE ORIGIN BUT BEHIND IT. CHECK UP ON
-
 
61
			THIS ONE */
-
 
62
	Mat4x4f perspective_Mat4x4f(float d);
-
 
63
 
-
 
64
 
-
 
65
}
52
}
66
#endif
53
#endif
67
 
54
 
68
 
55
 
69
 
56