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