Skip to content

MeshFilter Extensions

Andrzej Kebab edited this page Jan 23, 2024 · 1 revision

UtilityLibrary.Unity.Runtime

This utility library, part of the MeshFilterExtensions namespace, provides an extension method for Unity's MeshFilter class, offering additional functionality for obtaining the bounds of a mesh filter.

GetBounds

Gets the bounds of the MeshFilter. If includeChildren is set to true, the bounds encapsulate the bounds of child mesh filters.

// Example usage
MeshFilter myMeshFilter = /* Instantiate or reference a MeshFilter */;
Bounds bounds = myMeshFilter.GetBounds();
Debug.Log($"Bounds of the MeshFilter: {bounds}");

Parameters:

  • meshFilter (MeshFilter): The mesh filter to get the bounds from.
  • includeChildren (bool): Whether to include the bounds of child mesh filters. Default is true.

Returns:

  • Bounds: The bounds of the MeshFilter. If includeChildren is true, the bounds encapsulate the bounds of child mesh filters.

Clone this wiki locally