Header menu logo Mibo.Raylib

Culling Module

Generic helper functions for visibility culling.

These helpers operate on the custom frustum/primitives 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 : Frustum
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).

frustum : Frustum
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 width height
 if Culling.isVisible2D viewBounds sprite.Bounds then
     // Render sprite
val viewBounds: obj

Type something to start searching.