| 468 | } |
| 469 | |
| 470 | void BitStream::readAffineTransform(MatrixF* matrix) |
| 471 | { |
| 472 | Point3F pos; |
| 473 | QuatF q; |
| 474 | |
| 475 | mathRead(*this, &pos); |
| 476 | read(&q.x); |
| 477 | read(&q.y); |
| 478 | read(&q.z); |
| 479 | q.w = mSqrt(1.0 - getMin(F32(((q.x * q.x) + (q.y * q.y) + (q.z * q.z))), 1.f)); |
| 480 | if (readFlag()) |
| 481 | q.w = -q.w; |
| 482 | |
| 483 | q.setMatrix(matrix); |
| 484 | matrix->setColumn(3, pos); |
| 485 | // AssertFatal(matrix->isAffine() == true, |
| 486 | // "BitStream::readAffineTransform: Error, transform should be affine after this function!"); |
| 487 | } |
| 488 | |
| 489 | void BitStream::writeQuat( const QuatF& quat, U32 bitCount ) |
| 490 | { |
no test coverage detected