| 146 | } |
| 147 | |
| 148 | mat4 mat4::rotation(const float angle) { |
| 149 | using Eigen::Affine3f; |
| 150 | using Eigen::AngleAxisf; |
| 151 | using Eigen::Vector3f; |
| 152 | |
| 153 | auto result = mat4{}; |
| 154 | auto t = Affine3f::Identity(); |
| 155 | t.rotate(AngleAxisf(angle, Vector3f(0.0f, 0.0f, 1.0f))); |
| 156 | |
| 157 | result.mat_ = t.matrix(); |
| 158 | return result; |
| 159 | } |
| 160 | |
| 161 | mat4 mat4::translation(const vec4& vector) { |
| 162 | using Eigen::Affine3f; |