Example #1
0
        public void UpdateCamera()
        {
            _aspectRatio = (float)Window.Instance.Width / (float)Window.Instance.Height;
            _projection  = Matrix4.CreatePerspectiveFieldOfView(MathHelper.DegreesToRadians(_fildOfView), _aspectRatio, _nearPlane, _farPlane);

            /*cameraTarget = Vector3.Zero;
             * cameraDirection = Vector3.Normalize(_cameraTrnasform.Position - cameraTarget);
             * up = Vector3.UnitY;
             * cameraRight = Vector3.Normalize(Vector3.Cross(up, cameraDirection));
             * cameraUp = Vector3.Cross(cameraDirection, cameraRight);*/

            UpdateViewMatrix();
            _audioListener.UpdatePosition(-viewMatrix.ExtractTranslation());
        }