CSharpGL.CameraHelper.ZoomCamera C# (CSharp) Method

ZoomCamera() public static method

Zoom camera to fit in specified boundingBox.
public static ZoomCamera ( this camera, IBoundingBox boundingBox ) : void
camera this
boundingBox IBoundingBox
return void
        public static void ZoomCamera(this ICamera camera, IBoundingBox boundingBox)
        {
            if (boundingBox == null || camera == null) { throw new ArgumentNullException(); }

            switch (camera.CameraType)
            {
                case CameraType.Perspecitive:
                    ((IPerspectiveViewCamera)camera).ZoomCamera(boundingBox);
                    break;

                case CameraType.Ortho:
                    ((IOrthoViewCamera)camera).ZoomCamera(boundingBox);
                    break;

                default:
                    throw new NotImplementedException();
            }
        }