返回介绍

Bounds 边界盒

发布于 2019-12-18 15:37:27 字数 4151 浏览 1004 评论 0 收藏 0

struct in UnityEngine

Description 描述

Represents an axis aligned bounding box.

表示一个轴对齐边界盒。

An axis-aligned bounding box, or AABB for short, is a box aligned with coordinate axes and fully enclosing some object. Because the box is never rotated with respect to the axes, it can be defined by just its center and extents, or alternatively by min and max points.

一个轴对齐边界盒,或简称AABB,是一个对齐坐标轴的盒子并完全包围某些物体。由于这个盒子不会相对于轴旋转,它只可以通过center和extents定义,或者由min和max点定义。

Bounds is used by Collider.bounds, Mesh.bounds and Renderer.bounds.

Bounds用于Collider.boundsMesh.boundsRenderer.bounds

Variables 变量

centerThe center of the bounding box.
边界盒的中心。
extentsThe extents of the box. This is always half of the size.
边界框的实际范围。这个总是size的一半。
maxThe maximal point of the box. This is always equal to center+extents.
边界盒的最大点,这个总是等于center + extents。
minThe minimal point of the box. This is always equal to center-extents.
边界盒的最小点,这个总是等于center-extents。
sizeThe total size of the box. This is always twice as large as the extents.
边界盒的总大小。这个总是extents的两倍大。

Constructors 构造器

BoundsCreates new Bounds with a given center and total size. Bound extents will be half the given size.
用给定的中心和总大小,创建一个新的边界盒。边界盒的extents将是给定size的一半。

Public Functions 共有函数

ClosestPointThe closest point on the bounding box.
边界盒上最近的点。
ContainsIs point contained in the bounding box?
这个点包含在边界盒中么?
EncapsulateGrows the Bounds to include the point.
生长该边界框以包含这个点。
ExpandExpand the bounds by increasing its size by amount along each side.
通过amount沿着每条边增加边界盒的size来扩展边界盒。
IntersectRayDoes ray intersect this bounding box?
射线与该边界盒相交么?
IntersectsDoes another bounding box intersect with this bounding box?
该边界框是否和另一个边界框相交?
SetMinMaxSets the bounds to the min and max value of the box.
设置边界盒的最小和最大值。
SqrDistanceThe smallest squared distance between the point and this bounding box.
点和该边界盒之间的最小平方距离。
ToStringReturns a nicely formatted string for the bounds.
返回边界盒已格式化好的字符串。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文