Subversion Repositories gelsvn

Rev

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

Rev 89 Rev 501
Line 40... Line 40...
40
  Mat4x4f scaling_Mat4x4f(const Vec3f&);
40
  Mat4x4f scaling_Mat4x4f(const Vec3f&);
41
 
41
 
42
  /// Create an identity matrix.
42
  /// Create an identity matrix.
43
  inline Mat4x4f identity_Mat4x4f()
43
  inline Mat4x4f identity_Mat4x4f()
44
    {
44
    {
45
      return Mat4x4f(Vec4f(1,0,0,0), 
45
      return Mat4x4f(Vec4f(1.0f,0.0f,0.0f,0.0f), 
46
		     Vec4f(0,1,0,0), 
46
		     Vec4f(0.0f,1.0f,0.0f,0.0f), 
47
		     Vec4f(0,0,1,0), 
47
		     Vec4f(0.0f,0.0f,1.0f,0.0f), 
48
		     Vec4f(0,0,0,1));
48
		     Vec4f(0.0f,0.0f,0.0f,1.0f));
49
    }
49
    }
50
 
50
 
51
  /** Compute inverse assuming that the upper-left 3x3 sub-matrix is
51
  /** Compute inverse assuming that the upper-left 3x3 sub-matrix is
52
      orthonormal (which is the case if the transformation is only
52
      orthonormal (which is the case if the transformation is only
53
      a concatenation of rotations and translations).
53
      a concatenation of rotations and translations).
Line 60... Line 60...
60
    Vec3f t(m[0][3], m[1][3], m[2][3]);
60
    Vec3f t(m[0][3], m[1][3], m[2][3]);
61
 
61
 
62
    return Mat4x4f(Vec4f(rx, -dot(t, rx)),
62
    return Mat4x4f(Vec4f(rx, -dot(t, rx)),
63
		   Vec4f(ry, -dot(t, ry)),
63
		   Vec4f(ry, -dot(t, ry)),
64
		   Vec4f(rz, -dot(t, rz)),
64
		   Vec4f(rz, -dot(t, rz)),
65
		   Vec4f(0.0, 0.0, 0.0, 1.0));
65
		   Vec4f(0.0f, 0.0f, 0.0f, 1.0f));
66
  }   
66
  }   
67
}
67
}
68
#endif
68
#endif
69
 
69
 
70
 
70