private void CalculateViewMatrix(CameraComponent camera, Vector3 position, Matrix rotationMatrix) { Vector3 camUp = Vector3.Transform(CameraComponent.BaseReference, rotationMatrix); Vector3 lookAt = camera.LookAt = position + Vector3.Transform(CameraComponent.BaseReference, rotationMatrix); camera.ViewMatrix = Matrix.CreateLookAt(position, camera.LookAt, Vector3.Up); camera.NeedsViewUpdate = false; }
private void CalculateFOVMatrix(CameraComponent camera, Vector3 position) { camera.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver2, camera.AspectRatio, camera.NearClip, camera.FarClip); camera.NeedsFOVUpdate = false; }