Commits

Anonymous committed 6828caf

Fixed a few broken templates that gcc expands earlier. They still need
tests.

Comments (0)

Files changed (1)

neglect/cpplib/include/neglect/matrix.hpp

     matrix<T, M, N> &operator+=(matrix<T, M, N> &lhs,
                                 const matrix<T, M, N> &rhs)
     {
-        TA *ptr_a = lhs.ptr();
-        TB *ptr_b = rhs.ptr();
+        T *ptr_a = lhs.ptr();
+        T *ptr_b = rhs.ptr();
         for (size_t i = 0; i < (M * N); i++)
             ptr_a[i] += ptr_b[i];
         return lhs;
     matrix<T, M, N> &operator-=(matrix<T, M, N> &lhs,
                                 const matrix<T, M, N> &rhs)
     {
-        TA *ptr_a = lhs.ptr();
-        TB *ptr_b = rhs.ptr();
+        T *ptr_a = lhs.ptr();
+        T *ptr_b = rhs.ptr();
         for (size_t i = 0; i < (M * N); i++)
             ptr_a[i] -= ptr_b[i];
         return lhs;
 
     /* creates a scale matrix */
     template <typename T>
-    matrix<T, 4, 4> scale_matrix(T sx, T zy, T sz)
+    matrix<T, 4, 4> scale_matrix(T sx, T sy, T sz)
     {
-        matrix<T, 4, 4> m::zero();
+        matrix<T, 4, 4> m;
+        m.set_zero();
         m[0][0] = sx;
         m[1][1] = sy;
         m[2][2] = sz;
     template <typename T>
     matrix<T, 4, 4> translation_matrix(T tx, T ty, T tz)
     {
-        matrix<T, 4, 4> m::identity();
+        matrix<T, 4, 4> m;
+        m.set_identity();
         vector<T, 4> &last = m[3];
         last[0] = tx;
         last[1] = ty;
         T ic = T(1) - cos;
 
         matrix<T, 4, 4> m;
-        m[0] = vector<T, 4>(ic * x * x + c,
+        m[0] = vector<T, 4>(ic * x * x + cos,
                             ic * x * y + sz,
                             ic * x * z - sy,
                             T());
         m[1] = vector<T, 4>(ic * x * y - sz,
-                            ic * y * y + c,
+                            ic * y * y + cos,
                             ic * y * z + sz,
                             T());
         m[2] = vector<T, 4>(ic * x * z + sy,
                             ic * y * z - sz,
-                            ic * z * z + c,
+                            ic * z * z + cos,
                             T());
         m[3] = vector<T, 4>(T(), T(), T(), T(1));
         return m;
     }
 }
 
-#endif
+#endif