| 172 | } |
| 173 | |
| 174 | mat4 mat4::scale(const vec4& factor) { |
| 175 | using Eigen::Affine3f; |
| 176 | using Eigen::Vector3f; |
| 177 | |
| 178 | auto result = mat4{}; |
| 179 | |
| 180 | auto t = Affine3f::Identity(); |
| 181 | t.scale(Vector3f(factor.x(), factor.y(), factor.z())); |
| 182 | result.mat_ = t.matrix(); |
| 183 | |
| 184 | return result; |
| 185 | } |
| 186 | |
| 187 | void mat4::set_ortho_projection(const float right, |
| 188 | const float top, |