Cameras for rendering.
Extending from the rendering project, an extension method is available to fetch
the projection and view matrices from a Camera:
using World world = new World();
Camera mainCamera = new(world, CameraFieldOfView.FromDegrees(90f));
CameraProjection cameraProjection = mainCamera.GetProjection();
(Matrix4x4 projection, Matrix4x4 view) = cameraProjection;When a screen point is available, a ray can be calculated from the camera's perspective:
Vector2 mousePosition = ...
Vector2 screenPoint = camera.Destination.GetScreenPointFromPosition(mousePosition);
(Vector3 origin, Vector3 direction) = cameraProjection.GetRayFromScreenPoint(screenPoint);