Bounds边界框

转载自:http://game.ceeger.com/Script/Bounds/Bounds.html

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的简称,是一个坐标轴对齐的盒子并完全包围某些物体。由于这个盒子不会相对于轴旋转,它只可以通过centerextents定义,或者由minmax点定义。

边界框用于Collider.boundsMesh.boundsRenderer.bounds.

Variables变量

  • The center of the bounding box.
    边界框的中心。 
  • The total size of the box. This is always twice as large as the extents.
    包围和的总大小。这个总是 extents的两倍大。 
  • The extents of the box. This is always half of the size.
    边界框的广度。这个总是 size 的一半。 
  • min
    The minimal point of the box. This is always equal to center-extents.
    边界框的最小点,这个总是等于center-extents。 
  • max
    The maximal point of the box. This is always equal to center+extents.
    边界框的最大点,这个总是等于center + extents。 

Constructors构造器

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

Functions函数

  • Sets the bounds to the min and max value of the box.
    设置边界框的最小和最大值。 
  • Grows the Bounds to include the point.
    增大边界框以包含这个点。 
  • Expand the bounds by increasing its size by amount along each side.
    通过增加amount的大小沿着每条边扩大边界框。 
  • Does another bounding box intersect with this bounding box?
    这个边界框是否和另一个边界框相交? 
  • Is point contained in the bounding box?
    这个点包含在包含盒中么? 
  • The smallest squared distance between the point and this bounding box.
    点和这个边界框之间的最小平方距离。 
  • Does ray intersect this bounding box?
    射线与这个边界框相交么? 
  • Returns a nicely formatted string for the bounds.
    返回边界框格式化好的字符串。 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值