Ejemplo n.º 1
0
        public void Render()
        {
            switch (m_mode)
            {
            case Mode.BackCamera:
                ViewMatrix = MySession.PlayerShip.GetViewMatrix() * Matrix.CreateRotationY(MathHelper.Pi);
                break;

            case Mode.PlayerShip:
                ViewMatrix = MySession.PlayerShip.GetViewMatrix();
                break;

            case Mode.Entity:
                ViewMatrix = Matrix.CreateLookAt(
                    m_cameraSource.GetPosition(),
                    m_cameraSource.GetPosition() +
                    m_cameraSource.WorldMatrix.Forward,
                    m_cameraSource.WorldMatrix.Up);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            SecondaryCameraRenderer.ViewMatrix = ViewMatrix;
            this.IsCurrentlyRendering          = true;
            SecondaryCameraRenderer.Render();
            this.IsCurrentlyRendering = false;
            ProjectionMatrix          = SecondaryCameraRenderer.ProjectionMatrix;

            BoundingFrustum.Matrix = ViewMatrix * ProjectionMatrix;
        }
Ejemplo n.º 2
0
 public Texture GetRenderedTexture()
 {
     return(SecondaryCameraRenderer.GetRenderedTexture());
 }