ViewFrustum

Description

sealed class Tinman.Terrain.Meshing.ViewFrustum

Derived from

Frustum
INearAtZero

A typical view frustum with left, right, top, bottom, near and far planes.

Public / Constructors

View​Frustum


public constructor ViewFrustum → ()

Creates a new instance of ViewFrustum.

Public / Methods

Extract​From​Matrix


public static method ExtractFromMatrix → (3)

matrix in : Mat4D

The input matrix.

plane in : ViewFrustumPlane

The view frustum plane to extract.

nearAtZero in : bool

Is the near clipping plane at C = 0 (e.g. Direct3D), or is it at C = -w (e.g. OpenGL)?

returns → Plane

The view frustum plane.

Extracts a view frustum plane from the unit cube in homogeneous clip space that is defined by the given matrix.

The following inequalities are used to extract the view frustum planes from the given matrix:

-w < x < w
-w < y < w
C < z < w

where x, y, z and w are the coordinates of a transformed vertex in homogeneous clip space (as produced by the given matrix). The value C affects the near clipping plane. Its value depends on the used graphics API and can be 0 (e.g. Direct3D) or -w (e.g. OpenGL).


public method ExtractFromMatrix → (1)

matrix in : Mat4D

The input matrix.

Extracts the view frustum planes from the unit cube in homogeneous clip space that is defined by the given matrix.

The following inequalities are used to extract the view frustum planes from the given matrix:

-w < x < w
-w < y < w
C < z < w

where x, y, z and w are the coordinates of a transformed vertex in homogeneous clip space (as produced by the given matrix). The value C affects the near clipping plane. Its value depends on the used graphics API and can be 0 (e.g. Direct3D) or -w (e.g. OpenGL).

Calling this method will update all planes of this frustum.

Inside​Mask


public static method InsideMask → (1)

planes in : ViewFrustumPlane

The view frustum planes that will be tested.

returns → int32

The inside mask value.

Computes an inside mask (see FrustumCulling.InsideMask) for the given set of active view frustum planes.

Plane​For

2 overloads


public method PlaneFor1 → (1)

frustumPlane in : ViewFrustumPlane

The view frustum plane.

returns → Plane

The plane.

Returns a view frustum plane.


public method PlaneFor2 → (2)

frustumPlane in : ViewFrustumPlane

The view frustum plane.

plane in : Plane

The frustum plane.

Sets a view frustum plane.