Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // File: matrix.hpp, created on Sep 8, 2011 by WeltEnSTurm
- #ifndef MATRIX_HPP_
- #define MATRIX_HPP_
- template<typename T>
- struct matrix3 {
- T
- x1, y1, z1,
- x2, y2, z2,
- x3, y3, z3;
- matrix3(const T* f){
- x1 = f[0], x2 = f[1], x3 = f[2];
- y1 = f[4], y2 = f[5], y3 = f[6];
- z1 = f[7], z2 = f[8], z3 = f[9];
- }
- };
- 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];
- }
- };
- #endif /* MATRIX_HPP_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement