| 120 | } |
| 121 | |
| 122 | void mat4::set_from_srt(const float scaleX, |
| 123 | const float scaleY, |
| 124 | const float scaleZ, |
| 125 | const float rZ, |
| 126 | const float x, |
| 127 | const float y, |
| 128 | const float z) { |
| 129 | using Eigen::Affine3f; |
| 130 | using Eigen::AngleAxisf; |
| 131 | using Eigen::Vector3f; |
| 132 | |
| 133 | auto t = Affine3f::Identity(); |
| 134 | t.translate(Vector3f(x, y, z)) |
| 135 | .rotate(AngleAxisf(rZ, Vector3f(0.0f, 0.0f, 1.0f))) |
| 136 | .scale(Vector3f(scaleX, scaleY, scaleZ)); |
| 137 | this->mat_ = t.matrix(); |
| 138 | } |
| 139 | |
| 140 | float* mat4::data() { |
| 141 | return mat_.data(); |