| 1721 | //----------------------------------------------------------------------------- |
| 1722 | |
| 1723 | void Camera::setEditOrbitPoint( const Point3F& pnt ) |
| 1724 | { |
| 1725 | // Change the point that we orbit in EditOrbitMode. |
| 1726 | // We'll also change the facing and distance of the |
| 1727 | // camera so that it doesn't jump around. |
| 1728 | Point3F currentPos; |
| 1729 | mObjToWorld.getColumn(3,¤tPos); |
| 1730 | |
| 1731 | Point3F dir = pnt - currentPos; |
| 1732 | mCurrentEditOrbitDist = dir.len(); |
| 1733 | |
| 1734 | if(mMode == EditOrbitMode) |
| 1735 | { |
| 1736 | dir.normalize(); |
| 1737 | |
| 1738 | F32 yaw, pitch; |
| 1739 | MathUtils::getAnglesFromVector(dir, yaw, pitch); |
| 1740 | mRot.x = -pitch; |
| 1741 | mRot.z = yaw; |
| 1742 | } |
| 1743 | |
| 1744 | mEditOrbitPoint = pnt; |
| 1745 | |
| 1746 | setMaskBits(EditOrbitMask); |
| 1747 | } |
| 1748 | |
| 1749 | //---------------------------------------------------------------------------- |
| 1750 |
no test coverage detected