Пример #1
0
        void SetCameraClippingPlanes(ICamera camera)
        {
            // TODO: we could probably do a better job of estimating
            // what the near plane should be so that it optimizes the
            // z buffer while not accidentally clipping anything we
            // care about.
            float nearPlane;
            if (_clippingPlanes.Near < 50)
            {
                nearPlane = 2f;
            }
            else if (_clippingPlanes.Near < 20000)
            {
                nearPlane = (float) _clippingPlanes.Near * 0.50f;
            }
            else
            {
                nearPlane = (float)_clippingPlanes.Near * 0.90f;
            }

            float farPlane = (float) _clippingPlanes.Far * 1.1f;

            camera.SetClippingPlanes(nearPlane, farPlane);
        }