Ejemplo n.º 1
0
        private void UpdatePropertiesInternal(MatrixD newViewMatrix)
        {
            ViewMatrix = newViewMatrix;
            MatrixD.Invert(ref ViewMatrix, out WorldMatrix);

            //  Projection matrix according to zoom level
            ProjectionMatrix = MatrixD.CreatePerspectiveFieldOfView(FovWithZoom, AspectRatio,
                                                                    GetSafeNear(),
                                                                    FarPlaneDistance);

            ProjectionMatrixFar = MatrixD.CreatePerspectiveFieldOfView(FovWithZoom, AspectRatio,
                                                                       GetSafeNear(),
                                                                       1000000);

            ViewProjectionMatrix    = ViewMatrix * ProjectionMatrix;
            ViewProjectionMatrixFar = ViewMatrix * ProjectionMatrixFar;

            //  Projection matrix according to zoom level
            // float near = System.Math.Min(NearPlaneDistance, NearForNearObjects); //minimum cockpit distance
            // ProjectionMatrixForNearObjects = MatrixD.CreatePerspectiveFieldOfView(FovWithZoomForNearObjects, ForwardAspectRatio,
            //    near,
            //    FarForNearObjects);

            UpdateBoundingFrustum();
        }