(#168) Parallel walk navigation working. Still things to fix

This commit is contained in:
Jacob Støren
2015-12-07 15:54:44 +01:00
parent bbb0a5e993
commit afe84ce75e
8 changed files with 147 additions and 53 deletions

View File

@@ -69,8 +69,7 @@ bool RiuRmsNavigation::handleInputEvent(QInputEvent* inputEvent)
if (hitSomething)
{
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
m_trackball->setRotationPoint(pointOfInterest);
m_pointOfInterest = pointOfInterest;
this->setPointOfInterest(pointOfInterest);
}
else
{
@@ -202,11 +201,16 @@ bool RiuRmsNavigation::handleInputEvent(QInputEvent* inputEvent)
//--------------------------------------------------------------------------------------------------
void RiuRmsNavigation::initializeRotationCenter()
{
if(m_isRotCenterInitialized || m_trackball.isNull() || !m_viewer->mainScene() || !m_viewer->currentScene()->boundingBox().isValid()) return;
m_pointOfInterest = m_viewer->currentScene()->boundingBox().center();
if (m_isRotCenterInitialized
|| m_trackball.isNull()
|| !m_viewer->currentScene()->boundingBox().isValid())
{
return;
}
m_trackball->setRotationPoint(m_pointOfInterest);
m_isRotCenterInitialized = true;
cvf::Vec3d pointOfInterest = m_viewer->currentScene()->boundingBox().center();
this->setPointOfInterest(pointOfInterest);
}
//--------------------------------------------------------------------------------------------------
@@ -251,6 +255,8 @@ void RiuRmsNavigation::setPointOfInterest(cvf::Vec3d poi)
m_pointOfInterest = poi;
m_trackball->setRotationPoint(poi);
m_isRotCenterInitialized = true;
m_viewer->updateParallelProjectionCameraPosFromPointOfInterestMove(m_pointOfInterest);
}
//--------------------------------------------------------------------------------------------------
@@ -269,7 +275,7 @@ void RiuRmsNavigation::zoomAlongRay(cvf::Ray* ray, int delta)
cvf::Vec3d newVrp = vrp + trans;
m_viewer->mainCamera()->setFromLookAt(newPos, newVrp, up );
m_viewer->updateParallelProjectionHeight(m_pointOfInterest);
m_viewer->updateParallelProjectionHeightFromMoveZoom(m_pointOfInterest);
m_viewer->navigationPolicyUpdate();
}