csharp
public static class CameraMathThe matrices a Camera and its transform produce.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Free functions rather than properties on the component, because a component is data and these are derived every frame from two components at once. Keeping them out of the struct is also what stops anyone caching a stale one on the entity.
Methods (4)
public static Matrix4x4 View(in WorldTransform transform)The world-to-view matrix: the inverse of where the camera is.
public static Matrix4x4 Projection(in Camera camera, float aspectRatio = 0)The view-to-clip matrix.
public static Matrix4x4 ViewProjection(in Camera camera, in WorldTransform transform, float aspectRatio = 0)The world-to-clip matrix.
public static BoundingFrustum Frustum(in Camera camera, in WorldTransform transform, float aspectRatio = 0)The volume the camera can see, for culling.
Used by (4)
- CameraExtractionSystemVixen.Rendering
- CameraExtractionTestsVixen.Rendering.Tests
- SceneAndPrefabTestsVixen.Engine.Tests
- HostedRendererTestsVixen.App.Tests