Subversion Repositories gelsvn

Rev

Rev 5 | Rev 144 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 10
Line 3... Line 3...
3
namespace CGLA 
3
namespace CGLA 
4
{
4
{
5
 
5
 
6
	Mat4x4f rotation_Mat4x4f(Axis axis, float angle)
6
	Mat4x4f rotation_Mat4x4f(Axis axis, float angle)
7
	{
7
	{
8
		Mat4x4f m;
8
		Mat4x4f m(0.0f);
9
 
9
 
10
		switch(axis)
10
		switch(axis)
11
			{
11
			{
12
			case XAXIS:
12
			case XAXIS:
13
				m[0][0] = 1.0;
13
				m[0][0] = 1.0;
Line 38... Line 38...
38
		return m;
38
		return m;
39
	}
39
	}
40
 
40
 
41
	Mat4x4f translation_Mat4x4f(const Vec3f& v)
41
	Mat4x4f translation_Mat4x4f(const Vec3f& v)
42
	{
42
	{
43
		Mat4x4f m;
43
		Mat4x4f m(0.0f);
44
 
44
 
45
		m[0][0] = 1.0;
45
		m[0][0] = 1.0;
46
		m[1][1] = 1.0;
46
		m[1][1] = 1.0;
47
		m[2][2] = 1.0;
47
		m[2][2] = 1.0;
48
		m[3][3] = 1.0;
48
		m[3][3] = 1.0;
Line 54... Line 54...
54
		return m;
54
		return m;
55
	}
55
	}
56
 
56
 
57
	Mat4x4f scaling_Mat4x4f(const Vec3f& v)
57
	Mat4x4f scaling_Mat4x4f(const Vec3f& v)
58
	{
58
	{
59
		Mat4x4f m;
59
		Mat4x4f m(0.0f);
60
 
60
 
61
		m[0][0] = v[0];
61
		m[0][0] = v[0];
62
		m[1][1] = v[1];
62
		m[1][1] = v[1];
63
		m[2][2] = v[2];
63
		m[2][2] = v[2];
64
		m[3][3] = 1.0;
64
		m[3][3] = 1.0;
Line 66... Line 66...
66
		return m;
66
		return m;
67
	}
67
	}
68
 
68
 
69
	Mat4x4f perspective_Mat4x4f(float d)
69
	Mat4x4f perspective_Mat4x4f(float d)
70
	{
70
	{
71
		Mat4x4f m;
71
		Mat4x4f m(0.0f);
72
  
72
  
73
		/* Eye at the origin, looking down the negative z axis */
73
		/* Eye at the origin, looking down the negative z axis */
74
 
74
 
75
		m[0][0] = 1.0;
75
		m[0][0] = 1.0;
76
		m[1][1] = 1.0;
76
		m[1][1] = 1.0;