Changeset 651 for trunk/src/matrix.h
 Timestamp:
 Feb 16, 2011, 7:04:05 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/matrix.h
r648 r651 179 179 { 180 180 inline Mat4() { } 181 inline Mat4(T val) { for (int i = 0; i < 4; i++) v[i] = val; } 181 inline Mat4(T val) 182 { 183 for (int j = 0; j < 4; j++) 184 for (int i = 0; i < 4; i++) 185 v[i][j] = (i == j) ? val : 0; 186 } 182 187 inline Mat4(Vec4<T> v0, Vec4<T> v1, Vec4<T> v2, Vec4<T> v3) 183 { v[0] = v0; v[1] = v1; v[2] = v2; v[3] = v3; } 188 { 189 v[0] = v0; v[1] = v1; v[2] = v2; v[3] = v3; 190 } 184 191 185 192 inline Vec4<T>& operator[](int n) { return v[n]; } 186 193 inline Vec4<T> const& operator[](int n) const { return v[n]; } 187 188 static inline Mat4<T> identity()189 {190 Mat4<T> ret;191 for (int j = 0; j < 4; j++)192 for (int i = 0; i < 4; i++)193 ret[i][j] = i == j;194 return ret;195 }196 194 197 195 T det() const;
Note: See TracChangeset
for help on using the changeset viewer.