| 623 | //---------------------------------------------------------------------------- |
| 624 | |
| 625 | void Item::setTransform(const MatrixF& mat) |
| 626 | { |
| 627 | Point3F pos; |
| 628 | mat.getColumn(3,&pos); |
| 629 | MatrixF tmat; |
| 630 | if (!mRotate) { |
| 631 | // Forces all rotation to be around the z axis |
| 632 | VectorF vec; |
| 633 | mat.getColumn(1,&vec); |
| 634 | tmat.set(EulerF(0,0,-mAtan2(-vec.x,vec.y))); |
| 635 | } |
| 636 | else |
| 637 | tmat.identity(); |
| 638 | tmat.setColumn(3,pos); |
| 639 | Parent::setTransform(tmat); |
| 640 | if (!mStatic) |
| 641 | { |
| 642 | mAtRest = false; |
| 643 | mAtRestCounter = 0; |
| 644 | } |
| 645 | |
| 646 | if ( mPhysicsRep ) |
| 647 | mPhysicsRep->setTransform( getTransform() ); |
| 648 | |
| 649 | setMaskBits(RotationMask | PositionMask | NoWarpMask); |
| 650 | } |
| 651 | |
| 652 | |
| 653 | //---------------------------------------------------------------------------- |
no test coverage detected