اقرأ باللغة الإنجليزية تحرير

مشاركة عبر


BoundsExtensions Class

Definition

Extensions for Unity's Bounds struct.

C#
public static class BoundsExtensions
Inheritance
BoundsExtensions

Fields

BCK

A value representing the back face on a 3D object.

BOT

A value representing the bottom face on a 3D object.

FWD

A value representing the front face on a 3D object.

LB

A value representing the bottom-left corner of a 2D object.

LB_LT

A value representing the left edge's midpoint on a 2D object.

LBB

A value representing the bottom-left corner on the 3D object's back.

LBF

A value representing the bottom-left corner on the 3D object's front.

LBF_LBB

A value representing the bottom-left edge's midpoint on the 3D object's side.

LBF_RBF

A value representing the bottom edge's midpoint on the 3D object's front.

LFT

A value representing the left face on a 3D object.

LT

A value representing the top-left corner of a 2D object.

LT_RT

A value representing the top edge's midpoint on a 2D object.

LTB

A value representing the top-left corner on the 3D object's back.

LTB_LBB

A value representing the left edge's midpoint on the 3D object's back.

LTF

A value representing the top-left corner on the 3D object's front.

LTF_LBF

A value representing the left edge's midpoint on the 3D object's front.

LTF_LTB

A value representing the top-left edge's midpoint on the 3D object's side.

LTF_RTF

A value representing the top edge on's midpoint the 3D object's front.

RB

A value representing the bottom-right corner of a 2D object.

RB_LB

A value representing the bottom edge's midpoint on a 2D object.

RBB

A value representing the bottom-right corner on the 3D object's back.

RBB_LBB

A value representing the bottom edge's midpoint on the 3D object's back.

RBF

A value representing the bottom-right corner on the 3D object's front.

RBF_RBB

A value representing the bottom-right edge's midpoint on the 3D object's side.

RHT

A value representing the right face on a 3D object.

RT

A value representing the top-right corner of a 2D object.

RT_RB

A value representing the right edge's midpoint on a 2D object.

RTB

A value representing the top-right corner on the 3D object's back.

RTB_LTB

A value representing the top edge's midpoint on the 3D object's back.

RTB_RBB

A value representing the right edge's midpoint on the 3D object's back.

RTF

A value representing the top-right corner on the 3D object's front.

RTF_RBF

A value representing the right edge's midpoint on the 3D object's front.

RTF_RTB

A value representing the top-right edge's midpoint on the 3D object's side.

TOP

A value representing the top face on a 3D object.

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 UnityEngine.Collider methods.

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

Method to get bounds from a single UnityEngine.Collider structure.

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

Method to get bounding box points using UnityEngine.Collider methods.

GetCornerAndMidPointPositions(Bounds, Transform, Vector3[])

Gets all the corner points and mid points from a UnityEngine.Bounds structure.

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

Gets all the corner points and mid points from a UnityEngine.Bounds structure, ignoring the z axis.

GetCornerPositions(Bounds, Transform, Vector3[])

Gets all the corner points of a UnityEngine.Bounds structure.

GetCornerPositions(Bounds, Vector3[])

Gets all the corner points a UnityEngine.Bounds structure.

GetCornerPositionsFromRendererBounds(Bounds, Vector3[])

Gets all the corner points from a UnityEngine.Bounds structure.

GetFacePositions(Bounds, Transform, Vector3[])

Get the 3D positions of faces from a UnityEngine.Bounds structure.

GetInvalidBoundsInstance()

Returns a UnityEngine.Bounds structure that is invalid.

GetMeshFilterBounds(GameObject, Bounds, LayerMask)

Method to get bounds using UnityEngine.MeshFilter methods.

GetMeshFilterBoundsPoints(GameObject, List<Vector3>, LayerMask)

Get the bounding box points using UnityEngine.MeshFilter methods.

GetPointsBounds(List<Vector3>, Bounds)

Method to get bounds from a collection of points.

GetRenderBounds(GameObject, Bounds, LayerMask)

Get the bounds using UnityEngine.Renderer methods.

GetRenderBoundsPoints(GameObject, List<Vector3>, LayerMask)

Gets the bounding box points using UnityEngine.Renderer methods.

GetScaleToFitInside(Bounds, Bounds)

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

GetScaleToMatchBounds(Bounds, Bounds, Vector3)

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

GetScreenRectangle(Bounds, Camera)

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

GetScreenSpaceCornerPoints(Bounds, Camera)

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

Intersects(Rect, Rect, Rect)

Calculate the intersection area between the rectangle and another.

IsValid(Bounds)

Checks if the specified UnityEngine.Bounds is valid.

Transform(Bounds, Matrix4x4)

Transforms a UnityEngine.Bounds using the specified transform matrix.

Volume(Bounds)

Returns the volume of the bounds.

Applies to

منتج الإصدارات
MRTK3 Core Definitions 3.0, 3.1, 3.2