/// <summary> /// Get the vector shift which when added to camera position will do the effect of zoom to extents (zoom to fit) operation, /// so all the passed points will fit in the current view. /// </summary> /// <param name="boundingBox">The bounding box.</param> /// <returns>The zoom to fit vector</returns> public Vector3 GetZoomToExtentsShiftVector(ref BoundingBox boundingBox) { return(GetZoomToExtentsShiftDistance(boundingBox.GetCorners()) * pNear.Normal); }
/// <summary> /// Get the distance which when added to camera position along the lookat direction will do the effect of zoom to extents (zoom to fit) operation, /// so all the passed points will fit in the current view. /// if the returned value is poistive, the camera will move toward the lookat direction (ZoomIn). /// if the returned value is negative, the camera will move in the revers direction of the lookat direction (ZoomOut). /// </summary> /// <param name="boundingBox">The bounding box.</param> /// <returns>The zoom to fit distance</returns> public float GetZoomToExtentsShiftDistance(ref BoundingBox boundingBox) { return(GetZoomToExtentsShiftDistance(boundingBox.GetCorners())); }