KBoundingBox2d interface
KBoundingBox2d类代表着二维空间中的一个包围盒。
The KBoundingBox2d class represents a bounding box in 2d space.
Signature:
export interface KBoundingBox2d
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
| 获取包围盒的中心点。 Get bounding box' center point. | ||
| number | 获取包围盒的高度(y方向)。 Get bounding box' height (y direction). | |
| 获取包围盒的右上端点。 Get bounding box' maximum point. | ||
| 获取包围盒的左下端点。 Get bounding box' minimum point. | ||
| number | 获取包围盒的宽度(x方向)。 Get bounding box' width (x direction). |
Methods
Method | Description |
---|---|
包围盒加入一个点,包围盒的表征范围会改变。 Add point into bounding box, bounding box's min and max will maybe be changed. | |
包围盒的范围各向扩大一个Δ。 注意:如何Δ是一个负数,则包围盒的控制范围会减小,甚至会反转。 Expand the bounding box by a delta value. NOTE: if delta is a minus value, bounding box will be shrunk or even be reversed. | |
在指定的容差下检查两个包围盒是否相等。 Check whether two bounding boxes are equal with specified tolerances. | |
检查输入包围盒在指定容差下是否落在包围盒中。 注意:包围盒的区域范围包括包围盒边界。 Check whether this bounding box is in the input bounding box with specified tolerance. NOTE: boundary is included. | |
检查传入包围盒在指定容差下,与当前包围盒是否有重叠区域。 注意:重叠区域的子集包括两个包围盒为嵌套关系。 Check whether this input bounding box and this bounding box share the same space with specified tolerance. NOTE: 'inside' relationship is included. | |
检查输入点在指定容差下是否落在包围盒中。 注意:包围盒的区域范围包括包围盒边界。 Check whether the input point is in this bounding box with specified tolerance. NOTE: boundary is included. | |
包围盒是否有效。 Whether this bounding box is valid. | |
合并另外一个包围盒,使得当前包围盒可以包围传入包围盒。 Merge another bounding box, thus this bounding box is able to contain the another box. |