| 161 | } |
| 162 | |
| 163 | EulerF MatrixF::toEuler() const |
| 164 | { |
| 165 | const F32 * mat = m; |
| 166 | |
| 167 | EulerF r; |
| 168 | r.x = mAsin(mClampF(mat[MatrixF::idx(2,1)], -1.0, 1.0)); |
| 169 | |
| 170 | if(mCos(r.x) != 0.f) |
| 171 | { |
| 172 | r.y = mAtan2(-mat[MatrixF::idx(2,0)], mat[MatrixF::idx(2,2)]); |
| 173 | r.z = mAtan2(-mat[MatrixF::idx(0,1)], mat[MatrixF::idx(1,1)]); |
| 174 | } |
| 175 | else |
| 176 | { |
| 177 | r.y = 0.f; |
| 178 | r.z = mAtan2(mat[MatrixF::idx(1,0)], mat[MatrixF::idx(0,0)]); |
| 179 | } |
| 180 | |
| 181 | return r; |
| 182 | } |
| 183 | |
| 184 | void MatrixF::dumpMatrix(const char *caption /* =NULL */) const |
| 185 | { |
no test coverage detected