public readonly struct BoundingFrustumThe six planes of a view volume, all facing inward, extracted from a view-projection matrix. The first thing every visibility query asks.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Extraction is Gribb–Hartmann: each plane is a sum or difference of two *columns* of the matrix, which for our row-vector convention is what a clip-space inequality turns into. Because every plane faces inward, "inside" is DotCoordinate(p) >= 0 for all six.
Reverse-Z is not cosmetic here. Depth runs near → 1 and far → 0, so the plane that a forward-Z projection would call *near* is this one's far plane and vice versa. Getting that backwards produces a frustum that culls everything close to the camera, which looks like a bug in the renderer rather than in the maths.
Fields and properties (8)
public const int PlaneCountHow many planes bound a frustum.
public const int CornerCountHow many corners a frustum has.
public readonly Plane NearThe near plane, facing away from the camera.
public readonly Plane FarThe far plane, facing back toward the camera.
public readonly Plane LeftThe left plane, facing right.
public readonly Plane RightThe right plane, facing left.
public readonly Plane TopThe top plane, facing down.
public readonly Plane BottomThe bottom plane, facing up.
Methods (16)
public BoundingFrustum(in Matrix4x4 viewProjection)Extracts the six planes from a combined view-projection transform.
public ReadOnlySpan<Plane> AsSpan()The six planes as a span, in the order near, far, left, right, top, bottom. Valid as long as the frustum it came from.
public bool Contains(Vector3 point)Whether a point is inside the frustum.
public ContainmentType Contains(BoundingBox box)How a box sits relative to the frustum.
public ContainmentType Contains(BoundingSphere sphere)How a sphere sits relative to the frustum.
public bool Intersects(BoundingBox box)Whether a box is at least partly visible.
public bool Intersects(BoundingSphere sphere)Whether a sphere is at least partly visible.
public void GetCorners(Span<Vector3> destination)The eight corners, near face first: bottom-left, bottom-right, top-right, top-left, then the same four on the far face. Shadow cascade fitting and frustum debug drawing both want these.
public static Vector3 Intersection(Plane a, Plane b, Plane c)The single point where three planes meet.
public static bool NearEqual(in BoundingFrustum left, in BoundingFrustum right, float tolerance = 1E-06)Whether two frusta agree to within a tolerance, plane by plane.
public static bool operator ==(BoundingFrustum left, BoundingFrustum right)Exact equality, IEEE semantics. See NearEqual.
public static bool operator !=(BoundingFrustum left, BoundingFrustum right)The negation of op_Equality.
public bool Equals(BoundingFrustum other)Indicates whether the current object is equal to another object of the same type.
public override bool Equals(object? obj)Indicates whether this instance and a specified object are equal.
public override int GetHashCode()Returns the hash code for this instance.
public override string ToString()Returns the fully qualified type name of this instance.
Used by (37)
- CameraExtractionTestsVixen.Rendering.Tests
- CameraMathVixen.Engine
- ClusterRoutingTestsVixen.Rendering.Tests
- CullJobVixen.Rendering
- DebugDrawVixen.Engine
- DebugDrawShapeTestsVixen.Engine.Tests
- FoliageCullParityTestsVixen.Rendering.Terrain.Tests
- FoliageCullPassVixen.Rendering.Terrain
- FoliageCullPassTestsVixen.Rendering.Terrain.Tests
- FoliageCullViewRecordVixen.Rendering.Terrain
- FoliageRendererVixen.Rendering.Terrain
- FoliageRendererTestsVixen.Rendering.Terrain.Tests
- GpuClusterCullingVixen.Rendering
- GpuClusterCullingTestsVixen.Rendering.Tests
- GpuCullingVixen.Rendering
- GpuVisibilityGroupTestsVixen.Rendering.Tests
- GrassRendererVixen.Rendering.Terrain
- GrassRendererTestsVixen.Rendering.Terrain.Tests
- InstanceCullSettingsVixen.Rendering
- InstanceCullerVixen.Rendering
- InstanceCullingTestsVixen.Rendering.Tests
- PlaneArrayVixen.Rendering
- PunctualShadowTestsVixen.Rendering.Tests
- RenderViewVixen.Rendering
- ShadowCascadeTestsVixen.Rendering.Tests
- ShadowMapRendererTestsVixen.Rendering.Tests
- TerrainLodTestsVixen.Terrain.Tests
- TerrainLodTreeVixen.Terrain
- TerrainRendererVixen.Rendering.Terrain
- TerrainViewVixen.Rendering.Terrain
- TypeRegistrationVixen.Core.Mathematics
- ViewConstantsTestsVixen.Rendering.Tests
- VirtualGeometryFrameTestsVixen.Rendering.Tests
- VisibilityGroupTestsVixen.Rendering.Tests
- Vixen_Core_Mathematics_BoundingFrustumSerializerVixen.Core.Mathematics
- VolumeTestsVixen.Core.Mathematics.Tests
- EditorCameraVixen.Editor.SceneView