Subversion Repositories gelsvn

Rev

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

Rev 43 Rev 50
Line 45... Line 45...
45
      return Mat4x4d(Vec4d(1,0,0,0), 
45
      return Mat4x4d(Vec4d(1,0,0,0), 
46
		     Vec4d(0,1,0,0), 
46
		     Vec4d(0,1,0,0), 
47
		     Vec4d(0,0,1,0), 
47
		     Vec4d(0,0,1,0), 
48
		     Vec4d(0,0,0,1));
48
		     Vec4d(0,0,0,1));
49
    }
49
    }
-
 
50
 
-
 
51
  /** Compute inverse assuming that the upper-left 3x3 sub-matrix is
-
 
52
      orthonormal (which is the case if the transformation is only
-
 
53
      a concatenation of rotations and translations).
-
 
54
  */
-
 
55
  inline Mat4x4d invert_ortho(const Mat4x4d& m)
-
 
56
  {
-
 
57
    Vec3d rx(m[0][0], m[1][0], m[2][0]);
-
 
58
    Vec3d ry(m[0][1], m[1][1], m[2][1]);
-
 
59
    Vec3d rz(m[0][2], m[1][2], m[2][2]);
-
 
60
    Vec3d t(m[0][3], m[1][3], m[2][3]);
-
 
61
 
-
 
62
    return Mat4x4d(Vec4d(rx, -dot(t, rx)),
-
 
63
		   Vec4d(ry, -dot(t, ry)),
-
 
64
		   Vec4d(rz, -dot(t, rz)),
-
 
65
		   Vec4d(0.0, 0.0, 0.0, 1.0));
-
 
66
  }   
50
}
67
}
51
#endif
68
#endif
52
 
69
 
53
 
70
 
54
 
71