Scripting API

GeometryUtility

class in UnityEngine · UnityEngine.CoreModule

5 of 5 of Unity's membersUnity's documentation
In Tassix

Frustum planes, bounds tests and planes from polygons.

Methods 4

static Bounds CalculateBounds(Vector3[] positions, Matrix4x4 transform)
static Bounds CalculateBounds(Vector3[] positions, in Matrix4x4 transform)

The bounds of the points after the matrix.

static Plane[] CalculateFrustumPlanes(Camera camera)
static Plane[] CalculateFrustumPlanes(Matrix4x4 worldToProjectionMatrix)
static Plane[] CalculateFrustumPlanes(in Matrix4x4 worldToProjectionMatrix)
static void CalculateFrustumPlanes(Camera camera, Plane[] planes)
static void CalculateFrustumPlanes(Camera camera, Span<Plane> planes)
static void CalculateFrustumPlanes(Matrix4x4 worldToProjectionMatrix, Plane[] planes)
static void CalculateFrustumPlanes(in Matrix4x4 worldToProjectionMatrix, Plane[] planes)
static void CalculateFrustumPlanes(in Matrix4x4 worldToProjectionMatrix, Span<Plane> planes)
static void CalculateFrustumPlanes(Matrix4x4 worldToProjectionMatrix, Span<Plane> planes)

A camera's six frustum planes: left, right, bottom, top, near, far; normals point inward.

static bool TestPlanesAABB(Plane[] planes, Bounds bounds)
static bool TestPlanesAABB(Plane[] planes, in Bounds bounds)
static bool TestPlanesAABB(ReadOnlySpan<Plane> planes, in Bounds bounds)

Whether the box is inside or crosses every plane (on its positive side).

static bool TryCreatePlaneFromPolygon(Vector3[] vertices, out Plane plane)

The plane through a polygon's vertices (Newell's normal); false when they don't span one.

Checked against Unity

Conformance scenarios that exercise it, recorded in Unity and compared event by event.