/// <summary> /// Animate camera so that centerPt moves to center of camera, and height is visible. /// Camera target is also set to centerPt /// </summary> public void AnimateFitHeightToView(Vector3f centerPt, float height, CoordSpace eSpace, float duration) { if (eSpace != CoordSpace.WorldCoords) { height = UseScene.ToWorldDimension(height); } float fFitDistW = UseCamera.Manipulator().GetFitHeightCameraDistance(height); Vector3f focusPointW = (eSpace == CoordSpace.WorldCoords) ? centerPt : UseScene.ToWorldP(centerPt); AnimatePanZoomFocus(focusPointW, CoordSpace.WorldCoords, fFitDistW, duration); }
/// <summary> /// Animate camera so that centerPt moves to center of camera, and width is visible. /// Camera target is also set to centerPt /// </summary> public void AnimateFitWidthToView(Vector3f centerPt, float width, CoordSpace eSpace, float duration) { if (eSpace != CoordSpace.WorldCoords) { width = UseScene.ToWorldDimension(width); } Vector3f focusPointW = (eSpace == CoordSpace.WorldCoords) ? centerPt : UseScene.ToWorldP(centerPt); if (UseCamera.IsOrthographic) { float targetHeight = UseCamera.AspectRatio * width; AnimatePanZoomFocusOrtho(focusPointW, CoordSpace.WorldCoords, targetHeight, duration); } else { float fFitDistW = UseCamera.Manipulator().GetFitWidthCameraDistance(width); AnimatePanZoomFocus(focusPointW, CoordSpace.WorldCoords, fFitDistW, duration); } }