Gui: Improve lookAtPoint (#13556)
* Gui: Rename NavigationStyle::pan to setupPanningPlane * Gui: Replace duplicate code with NavigationStyle::setupPanningPlane * Gui: Use panning plane when hit point not found in lookAtPoint Also enables navigation animations when pressing MMB while the mouse is not over an object * Gui: Remove unused methods
This commit is contained in:
@@ -126,9 +126,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
if (press && ev->wasShiftDown() &&
|
||||
(this->currentmode != NavigationStyle::SELECTION)) {
|
||||
this->centerTime = ev->getTime();
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||
setupPanningPlane(getCamera());
|
||||
this->lockrecenter = false;
|
||||
}
|
||||
else if (!press && ev->wasShiftDown() &&
|
||||
@@ -137,10 +135,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
float dci = (float)QApplication::doubleClickInterval()/1000.0f;
|
||||
// is it just a left click?
|
||||
if (tmp.getValue() < dci && !this->lockrecenter) {
|
||||
if (!this->lookAtPoint(pos)) {
|
||||
panToCenter(panningplane, posn);
|
||||
this->interactiveCountDec();
|
||||
}
|
||||
lookAtPoint(pos);
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
@@ -191,9 +186,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
case SoMouseButtonEvent::BUTTON3:
|
||||
if (press) {
|
||||
this->centerTime = ev->getTime();
|
||||
float ratio = vp.getViewportAspectRatio();
|
||||
SbViewVolume vv = viewer->getSoRenderManager()->getCamera()->getViewVolume(ratio);
|
||||
this->panningplane = vv.getPlane(viewer->getSoRenderManager()->getCamera()->focalDistance.getValue());
|
||||
setupPanningPlane(getCamera());
|
||||
this->lockrecenter = false;
|
||||
}
|
||||
else {
|
||||
@@ -201,10 +194,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
float dci = (float)QApplication::doubleClickInterval()/1000.0f;
|
||||
// is it just a middle click?
|
||||
if (tmp.getValue() < dci && !this->lockrecenter) {
|
||||
if (!this->lookAtPoint(pos)) {
|
||||
panToCenter(panningplane, posn);
|
||||
this->interactiveCountDec();
|
||||
}
|
||||
lookAtPoint(pos);
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user