committed by
Adrián Insaurralde Avalos
parent
edf1bbf6f4
commit
7fdfdcde49
@@ -622,7 +622,10 @@ void NavigationStyle::reorientCamera(SoCamera * cam, const SbRotation & rot)
|
||||
|
||||
// Set new orientation value by accumulating the new rotation.
|
||||
cam->orientation = rot * cam->orientation.getValue();
|
||||
|
||||
// Fix issue with near clipping in orthogonal view
|
||||
if (cam->getTypeId().isDerivedFrom(SoOrthographicCamera::getClassTypeId())) {
|
||||
cam->focalDistance = static_cast<SoOrthographicCamera*>(cam)->height;
|
||||
}
|
||||
// Reposition camera so we are still pointing at the same old focal point.
|
||||
cam->orientation.getValue().multVec(SbVec3f(0, 0, -1), direction);
|
||||
cam->position = focalpoint - cam->focalDistance.getValue() * direction;
|
||||
|
||||
Reference in New Issue
Block a user