geomUtils.Obb 类型
基础几何 方向包围盒。
索引
属性(properties)
typenumber获取形状的类型。centerVec3本地坐标的中心点。halfExtentsVec3长宽高的一半。orientationMat3方向矩阵。
方法
create创建一个新的 obb 实例。clone克隆一个 obb。copy将从一个 obb 的值复制到另一个 obb。fromPoints用两个点创建一个新的 obb。set将给定 obb 的属性设置为给定的值。getBoundary获取 obb 的最小点和最大点。transform将 out 根据这个 obb 的数据进行变换。translateAndRotate将 out 根据这个 obb 的数据进行变换。setScale将 out 根据这个 obb 的数据进行缩放。
Details
属性(properties)
type
获取形状的类型。
| meta | description |
|---|---|
| 类型 | number |
| 定义于 | cocos2d/core/geom-utils/obb.ts:53 |
center
本地坐标的中心点。
| meta | description |
|---|---|
| 类型 | Vec3 |
| 定义于 | cocos2d/core/geom-utils/obb.ts:185 |
halfExtents
长宽高的一半。
| meta | description |
|---|---|
| 类型 | Vec3 |
| 定义于 | cocos2d/core/geom-utils/obb.ts:194 |
orientation
方向矩阵。
| meta | description |
|---|---|
| 类型 | Mat3 |
| 定义于 | cocos2d/core/geom-utils/obb.ts:203 |
方法
create
创建一个新的 obb 实例。
| meta | description |
|---|---|
| 返回 | Obb |
| 定义于 | cocos2d/core/geom-utils/obb.ts:63 |
参数列表
cxNumber X coordinates of the shape relative to the origin.cyNumber Y coordinates of the shape relative to the origin.czNumber Z coordinates of the shape relative to the origin.hwNumber Obb is half the width.hhNumber Obb is half the height.hlNumber Obb is half the Length.ox_1Number Direction matrix parameter.ox_2Number Direction matrix parameter.ox_3Number Direction matrix parameter.oy_1Number Direction matrix parameter.oy_2Number Direction matrix parameter.oy_3Number Direction matrix parameter.oz_1Number Direction matrix parameter.oz_2Number Direction matrix parameter.oz_3Number Direction matrix parameter.
clone
克隆一个 obb。
| meta | description |
|---|---|
| 返回 | Obb |
| 定义于 | cocos2d/core/geom-utils/obb.ts:95 |
参数列表
aObb The target of cloning.
copy
将从一个 obb 的值复制到另一个 obb。
| meta | description |
|---|---|
| 返回 | Obb |
| 定义于 | cocos2d/core/geom-utils/obb.ts:113 |
参数列表
outObb Obb that accepts the operation.aObb Obb being copied.
fromPoints
用两个点创建一个新的 obb。
| meta | description |
|---|---|
| 返回 | Obb |
| 定义于 | cocos2d/core/geom-utils/obb.ts:131 |
参数列表
outObb Obb that accepts the operation.minPosVec3 The smallest point of obb.maxPosVec3 Obb's maximum point.
set
将给定 obb 的属性设置为给定的值。
| meta | description |
|---|---|
| 返回 | Obb |
| 定义于 | cocos2d/core/geom-utils/obb.ts:149 |
参数列表
cxNumber X coordinates of the shape relative to the origin.cyNumber Y coordinates of the shape relative to the origin.czNumber Z coordinates of the shape relative to the origin.hwNumber Obb is half the width.hhNumber Obb is half the height.hlNumber Obb is half the Length.ox_1Number Direction matrix parameter.ox_2Number Direction matrix parameter.ox_3Number Direction matrix parameter.oy_1Number Direction matrix parameter.oy_2Number Direction matrix parameter.oy_3Number Direction matrix parameter.oz_1Number Direction matrix parameter.oz_2Number Direction matrix parameter.oz_3Number Direction matrix parameter.
getBoundary
获取 obb 的最小点和最大点。
| meta | description |
|---|---|
| 定义于 | cocos2d/core/geom-utils/obb.ts:225 |
参数列表
transform
将 out 根据这个 obb 的数据进行变换。
| meta | description |
|---|---|
| 定义于 | cocos2d/core/geom-utils/obb.ts:240 |
参数列表
mMat4 The transformation matrix.posVec3 The position part of the transformation.rotQuat The rotating part of the transformation.scaleVec3 The scaling part of the transformation.outObb Target of transformation.
translateAndRotate
将 out 根据这个 obb 的数据进行变换。
| meta | description |
|---|---|
| 定义于 | cocos2d/core/geom-utils/obb.ts:258 |
参数列表
mMat4 The transformation matrix.rotQuat The rotating part of the transformation.outObb Target of transformation.
setScale
将 out 根据这个 obb 的数据进行缩放。
| meta | description |
|---|---|
| 定义于 | cocos2d/core/geom-utils/obb.ts:274 |
参数列表
scaleVec3 Scale value.outObb Scaled target.