| 1644 | //----------------------------------------------------------------------------- |
| 1645 | |
| 1646 | void Camera::setEditOrbitMode() |
| 1647 | { |
| 1648 | mMode = EditOrbitMode; |
| 1649 | |
| 1650 | if (bool(mOrbitObject)) |
| 1651 | { |
| 1652 | clearProcessAfter(); |
| 1653 | clearNotify(mOrbitObject); |
| 1654 | } |
| 1655 | mOrbitObject = NULL; |
| 1656 | |
| 1657 | // If there is a valid orbit point, then point to it |
| 1658 | // rather than move the camera. |
| 1659 | if(mValidEditOrbitPoint) |
| 1660 | { |
| 1661 | Point3F currentPos; |
| 1662 | mObjToWorld.getColumn(3,¤tPos); |
| 1663 | |
| 1664 | Point3F dir = mEditOrbitPoint - currentPos; |
| 1665 | mCurrentEditOrbitDist = dir.len(); |
| 1666 | dir.normalize(); |
| 1667 | |
| 1668 | F32 yaw, pitch; |
| 1669 | MathUtils::getAnglesFromVector(dir, yaw, pitch); |
| 1670 | mRot.x = -pitch; |
| 1671 | mRot.z = yaw; |
| 1672 | } |
| 1673 | } |
| 1674 | |
| 1675 | //----------------------------------------------------------------------------- |
| 1676 |
no test coverage detected