bounds 边界框

2015-1-3 19:57| 发布者: 杨炎| 查看: 2981| 评论: 0|原作者: 蛮牛|来自: yzc88亚洲城脚本manual

摘要: bounds 边界框structrepresents 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. ...

bounds 边界框

struct

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 itscenterandextents, or alternatively byminandmaxpoints.

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

边界框用于collider.bounds,mesh.bounds,renderer.bounds.

variables变量

center

the center of the bounding box.

边界框的中心。

size

the total size of the box. this is always twice as large as the extents.

包围和的总大小。这个总是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构造器

bounds

creates new bounds with a given center and total size. bound extents will be half the given size.

用给定的中心和总大小,创建一个新的边界框。边界框extents将是给定size的一半。

functions函数

setminmax

sets the bounds to the min and max value of the box.

设置边界框的最小和最大值。

encapsulate

grows the bounds to include the point.

增大边界框以包含这个点。

expand

expand the bounds by increasing its size by amount along each side.

通过增加amount的大小沿着每条边扩大边界框。

intersects

does another bounding box intersect with this bounding box?

这个边界框是否和另一个边界框相交?

contains

is point contained in the bounding box?

这个点包含在包含盒中么?

sqrdistance

the smallest squared distance between the point and this bounding box.

点和这个边界框之间的最小平方距离。

intersectray

does ray intersect this bounding box?

射线与这个边界框相交么?

tostring

returns a nicely formatted string for the bounds.

返回边界框格式化好的字符串

相关阅读

文章点评
相关文章