Header menu logo Mibo

Culling Module

Generic helper functions for visibility culling.

These helpers operate on standard MonoGame primitives (BoundingFrustum, BoundingSphere, etc) to separate spatial partitioning logic from rendering logic.

Functions and values

Function or value Description

isGenericVisible frustum box

Full Usage: isGenericVisible frustum box

Parameters:
Returns: bool
Modifiers: inline

Checks if a bounding box is within the view frustum.

Returns true if fully inside or intersecting (partially visible). Useful for culling axis-aligned geometry or spatial partition nodes.

frustum : BoundingFrustum
box : BoundingBox
Returns: bool

isVisible frustum sphere

Full Usage: isVisible frustum sphere

Parameters:
Returns: bool
Modifiers: inline

Checks if a bounding sphere is within the view frustum.

Returns true if fully inside or intersecting (partially visible). Use with Camera3D.boundingFrustum to get the frustum.

frustum : BoundingFrustum
sphere : BoundingSphere
Returns: bool

isVisible2D viewBounds itemBounds

Full Usage: isVisible2D viewBounds itemBounds

Parameters:
Returns: bool
Modifiers: inline

Checks if a 2D rectangle intersects with the visible camera bounds.

Use with Camera2D.viewportBounds to get the view bounds.

viewBounds : Rectangle
itemBounds : Rectangle
Returns: bool
Example

 let viewBounds = Camera2D.viewportBounds camera viewport
 if Culling.isVisible2D viewBounds sprite.Bounds then
     // Render sprite
val viewBounds: obj

Type something to start searching.