Auf Englisch lesen Bearbeiten

Freigeben über


BoundsExtensions Class

Definition

Extension methods for Unity's Bounds struct

C++
public ref class BoundsExtensions abstract sealed
Inheritance
BoundsExtensions

Fields

Methods

CloserToPoint(Bounds, Vector3, Bounds)

Checks to see whether point is closer to bounds or otherBounds

ContainsBounds(Bounds, Bounds)

Checks to see if bounds contains the other bounds completely.

DebugDraw(Bounds, Color, Single, Boolean)

Draws a wire frame Bounds object using Debug.DrawLine.

ExpandToContain(Bounds, Bounds)

Returns bounds that contain both this bounds and the bounds passed in.

GetColliderBounds(GameObject, Bounds, LayerMask)

Method to get bounds using collider method.

GetColliderBoundsPoints(Collider, List<Vector3>, LayerMask, Transform)

Method to get bounds from a single Collider

GetColliderBoundsPoints(GameObject, List<Vector3>, LayerMask, Transform)

Method to get bounding box points using Collider method.

GetCornerAndMidPointPositions(Bounds, Transform, Vector3[])

Gets all the corner points and mid points from Renderer's Bounds

GetCornerAndMidPointPositions2D(Bounds, Transform, Vector3[], BoundsExtensions+Axis)

Gets all the corner points and mid points from Renderer's Bounds, ignoring the z axis

GetCornerPositions(Bounds, Transform, Vector3[])

Gets all the corner points of the bounds in world space by transforming input bounds using the given transform

GetCornerPositions(Bounds, Vector3[])

Gets all the corner points of the bounds

GetCornerPositionsFromRendererBounds(Bounds, Vector3[])

Gets all the corner points from Renderer's Bounds

GetFacePositions(Bounds, Transform, Vector3[])
GetInvalidBoundsInstance()

Returns an instance of the 'Bounds' class which is invalid. An invalid 'Bounds' instance is one which has its size vector set to 'float.MaxValue' for all 3 components. The center of an invalid bounds instance is the zero vector.

GetMeshFilterBounds(GameObject, Bounds, LayerMask)

Method to get bounds using mesh filters method.

GetMeshFilterBoundsPoints(GameObject, List<Vector3>, LayerMask)

GetMeshFilterBoundsPoints - gets bounding box points using MeshFilter method.

GetPointsBounds(List<Vector3>, Bounds)

Method to get bounds from a collection of points.

GetRenderBounds(GameObject, Bounds, LayerMask)

Method to get bounds using renderer method.

GetRenderBoundsPoints(GameObject, List<Vector3>, LayerMask)

GetRenderBoundsPoints gets bounding box points using Render method.

GetScaleToFitInside(Bounds, Bounds)

Calculates how much scale is required for this Bounds to fit inside another bounds without stretching.

GetScaleToMatchBounds(Bounds, Bounds, Vector3)

Calculates how much scale is required for this Bounds to match another Bounds.

GetScreenRectangle(Bounds, Camera)

Returns the rectangle which encloses the specifies 'Bounds' instance in screen space.

GetScreenSpaceCornerPoints(Bounds, Camera)

Returns the screen space corner points of the specified 'Bounds' instance.

IsValid(Bounds)

Checks if the specified bounds instance is valid. A valid 'Bounds' instance is one whose size vector does not have all 3 components set to 'float.MaxValue'.

Transform(Bounds, Matrix4x4)

Transforms 'bounds' using the specified transform matrix.

Volume(Bounds)

Returns the volume of the bounds.

Applies to

Produkt Versionen
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0