Plush

Frustum#

PlushEngine · Type index

Namespace: PlushEngine

The six planes of a view-projection (row vectors, as System.Numerics multiplies), for culling bounding spheres. GL-free; the planes follow the -w..w depth range, which also conservatively covers a 0..1 projection.

public readonly struct Frustum

Members: Everything · Frustum · Intersects · Margin

Everything#

public static readonly Frustum Everything;

A frustum that holds everything (an orthographic box a billion metres across), for callers with no view.

Frustum#

public Frustum(Matrix4x4 viewProjection);

Intersects#

public bool Intersects(MeshAsset mesh, Matrix4x4 world);

A mesh's bounding sphere under a world matrix, including shear from rotated children under nonuniformly scaled parents. A small margin covers numeric and minor displacement error; material-specific motion needs its own padding.

public bool Intersects(Vector3 center, float radius);

Whether a world-space sphere may be visible (false only when it lies entirely outside one plane).

Margin#

public const float Margin = 1.1f;

Bounds come from the stored vertices; shaders may move them a little (wind, waves).

MeshAsset

Source#