找回密碼
 注冊帳號

掃一掃,訪問微社區

bounds 邊界框

2015-1-3 19:57| 發布者: 楊炎| 查看: 3216| 評論: 0|原作者: 蠻牛|來自: unity3d腳本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.

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

相關閱讀

文章點評
相關文章
女校游泳队彩金