| 1497 | } |
| 1498 | |
| 1499 | void RenderManager::moveCursor(float relX, float relY) |
| 1500 | { |
| 1501 | Ogre::Camera* cam = mViewport->getCamera(); |
| 1502 | if(cam->getFOVy() != mCurrentFOVy) |
| 1503 | { |
| 1504 | mCurrentFOVy = cam->getFOVy(); |
| 1505 | Ogre::Radian angle = cam->getFOVy() * 0.5f; |
| 1506 | Ogre::Real tan = Ogre::Math::Tan(angle); |
| 1507 | Ogre::Real shortestSize = KEEPER_HAND_POS_Z * tan * 2.0f; |
| 1508 | Ogre::Real width = mViewport->getActualWidth(); |
| 1509 | Ogre::Real height = mViewport->getActualHeight(); |
| 1510 | if(width > height) |
| 1511 | { |
| 1512 | mFactorHeight = shortestSize; |
| 1513 | mFactorWidth = shortestSize * width / height; |
| 1514 | } |
| 1515 | else |
| 1516 | { |
| 1517 | mFactorWidth = shortestSize; |
| 1518 | mFactorHeight = shortestSize * height / width; |
| 1519 | } |
| 1520 | } |
| 1521 | |
| 1522 | mHandKeeperNode->setPosition(mFactorWidth * (relX - 0.5f), mFactorHeight * (0.5f - relY), -KEEPER_HAND_POS_Z); |
| 1523 | } |
| 1524 | |
| 1525 | void RenderManager::moveWorldCoords(Ogre::Real x, Ogre::Real y) |
| 1526 | { |
no test coverage detected