瀏覽代碼

Fixed superfluous up normalization in glm::lookAt() #114

Christophe Riccio 12 年之前
父節點
當前提交
79405910bb
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      glm/gtc/matrix_transform.inl

+ 3 - 4
glm/gtc/matrix_transform.inl

@@ -419,10 +419,9 @@ namespace glm
 		detail::tvec3<T, P> const & up
 		detail::tvec3<T, P> const & up
 	)
 	)
 	{
 	{
-		detail::tvec3<T, P> f = normalize(center - eye);
-		detail::tvec3<T, P> u = normalize(up);
-		detail::tvec3<T, P> s = normalize(cross(f, u));
-		u = cross(s, f);
+		detail::tvec3<T, P> f(normalize(center - eye));
+		detail::tvec3<T, P> s(normalize(cross(f, up)));
+		detail::tvec3<T, P> u(cross(s, f));
 
 
 		detail::tmat4x4<T, P> Result(1);
 		detail::tmat4x4<T, P> Result(1);
 		Result[0][0] = s.x;
 		Result[0][0] = s.x;