Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename T>
- struct matrix4 {
- T
- x1, y1, z1, w1,
- x2, y2, z2, w2,
- x3, y3, z3, w3,
- x4, y4, z4, w4;
- matrix4(const T* f){
- x1 = f[0], y1 = f[1], z1 = f[2], w1 = f[3];
- x2 = f[4], y2 = f[5], z2 = f[6], w2 = f[7];
- x3 = f[8], y3 = f[9], z3 = f[10], w3 = f[11];
- x4 = f[12], y4 = f[13], z4 = f[14], w4 = f[15];
- }
- static const matrix4<T> identity(){
- static T tmp[4*4] = {
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1
- };
- static matrix4<T> id = matrix4<T>(tmp);
- return id;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement