| 248 | } |
| 249 | |
| 250 | MatrixF RotationF::asMatrixF() const |
| 251 | { |
| 252 | MatrixF returnMat; |
| 253 | if (mRotationType == Euler) |
| 254 | { |
| 255 | MatrixF imat, xmat, ymat, zmat; |
| 256 | xmat.set(EulerF(x, 0, 0)); |
| 257 | ymat.set(EulerF(0.0f, y, 0.0f)); |
| 258 | zmat.set(EulerF(0, 0, z)); |
| 259 | imat.mul(zmat, xmat); |
| 260 | returnMat.mul(imat, ymat); |
| 261 | } |
| 262 | else |
| 263 | { |
| 264 | AngAxisF aa; |
| 265 | aa.set(Point3F(x, y, z), w); |
| 266 | |
| 267 | MatrixF tempMat; |
| 268 | aa.setMatrix(&tempMat); |
| 269 | |
| 270 | EulerF eul = tempMat.toEuler(); |
| 271 | |
| 272 | MatrixF imat, xmat, ymat, zmat; |
| 273 | xmat.set(EulerF(eul.x, 0, 0)); |
| 274 | ymat.set(EulerF(0.0f, eul.y, 0.0f)); |
| 275 | zmat.set(EulerF(0, 0, eul.z)); |
| 276 | imat.mul(zmat, xmat); |
| 277 | returnMat.mul(imat, ymat); |
| 278 | } |
| 279 | |
| 280 | return returnMat; |
| 281 | } |
| 282 | |
| 283 | QuatF RotationF::asQuatF() const |
| 284 | { |
no test coverage detected