+ fix issue with rotation enter with panning
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5103 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
@@ -281,6 +281,32 @@ void NavigationStyle::seekToPoint(const SbVec3f& scenepos)
|
||||
viewer->seekToPoint(scenepos);
|
||||
}
|
||||
|
||||
SbBool NavigationStyle::moveToPoint(const SbVec2s screenpos)
|
||||
{
|
||||
SoCamera* cam = viewer->getCamera();
|
||||
if (cam == 0) return FALSE;
|
||||
|
||||
SoRayPickAction rpaction(viewer->getViewportRegion());
|
||||
rpaction.setPoint(screenpos);
|
||||
rpaction.setRadius(2);
|
||||
rpaction.apply(viewer->getSceneManager()->getSceneGraph());
|
||||
|
||||
SoPickedPoint * picked = rpaction.getPickedPoint();
|
||||
if (!picked) {
|
||||
this->interactiveCountInc();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SbVec3f hitpoint;
|
||||
hitpoint = picked->getPoint();
|
||||
|
||||
SbVec3f direction;
|
||||
cam->orientation.getValue().multVec(SbVec3f(0, 0, -1), direction);
|
||||
cam->focalDistance = viewer->getSeekDistance();
|
||||
cam->position = hitpoint - cam->focalDistance.getValue() * direction;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void NavigationStyle::setCameraOrientation(const SbRotation& rot)
|
||||
{
|
||||
SoCamera* cam = viewer->getCamera();
|
||||
|
||||
Reference in New Issue
Block a user