(#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

@@ -81,8 +81,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
if (hitSomething)
{
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
m_trackball->setRotationPoint(pointOfInterest);
m_pointOfInterest = pointOfInterest;
this->setPointOfInterest(pointOfInterest);
}
else
{
@@ -170,7 +169,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
m_viewer->mainCamera()->setFromLookAt(newPos,newVrp, up );
m_viewer->updateParallelProjectionHeight(m_pointOfInterest);
m_viewer->updateParallelProjectionHeightFromMoveZoom(m_pointOfInterest);
m_viewer->navigationPolicyUpdate();
}
}
@@ -188,11 +187,16 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
//--------------------------------------------------------------------------------------------------
void RiuCadNavigation::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);
}
//--------------------------------------------------------------------------------------------------
@@ -237,4 +241,6 @@ void RiuCadNavigation::setPointOfInterest(cvf::Vec3d poi)
m_pointOfInterest = poi;
m_trackball->setRotationPoint(poi);
m_isRotCenterInitialized = true;
m_viewer->updateParallelProjectionCameraPosFromPointOfInterestMove(m_pointOfInterest);
}