geomUtils.Obb Class
obb
Index
Properties
typenumbercenterVec3The center of the local coordinate.halfExtentsVec3Half the length, width, and height.orientationMat3Direction matrix.
Methods
createcreate a new obbcloneclone a new obbcopycopy the values from one obb to anotherfromPointscreate a new obb from two corner pointssetSet the components of a obb to the given valuesgetBoundaryGet the bounding points of this shapetransformTransform this shapetranslateAndRotateTransform out based on this obb data.setScaleScale out based on this obb data.
Details
Properties
type
| meta | description |
|---|---|
| Type | number |
| Defined in | cocos2d/core/geom-utils/obb.ts:53 |
center
The center of the local coordinate.
| meta | description |
|---|---|
| Type | Vec3 |
| Defined in | cocos2d/core/geom-utils/obb.ts:185 |
halfExtents
Half the length, width, and height.
| meta | description |
|---|---|
| Type | Vec3 |
| Defined in | cocos2d/core/geom-utils/obb.ts:194 |
orientation
Direction matrix.
| meta | description |
|---|---|
| Type | Mat3 |
| Defined in | cocos2d/core/geom-utils/obb.ts:203 |
Methods
create
create a new obb
| meta | description |
|---|---|
| Returns | Obb |
| Defined in | cocos2d/core/geom-utils/obb.ts:63 |
Parameters
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
clone a new obb
| meta | description |
|---|---|
| Returns | Obb |
| Defined in | cocos2d/core/geom-utils/obb.ts:95 |
Parameters
aObb The target of cloning.
copy
copy the values from one obb to another
| meta | description |
|---|---|
| Returns | Obb |
| Defined in | cocos2d/core/geom-utils/obb.ts:113 |
Parameters
outObb Obb that accepts the operation.aObb Obb being copied.
fromPoints
create a new obb from two corner points
| meta | description |
|---|---|
| Returns | Obb |
| Defined in | cocos2d/core/geom-utils/obb.ts:131 |
Parameters
outObb Obb that accepts the operation.minPosVec3 The smallest point of obb.maxPosVec3 Obb's maximum point.
set
Set the components of a obb to the given values
| meta | description |
|---|---|
| Returns | Obb |
| Defined in | cocos2d/core/geom-utils/obb.ts:149 |
Parameters
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
Get the bounding points of this shape
| meta | description |
|---|---|
| Defined in | cocos2d/core/geom-utils/obb.ts:225 |
Parameters
transform
Transform this shape
| meta | description |
|---|---|
| Defined in | cocos2d/core/geom-utils/obb.ts:240 |
Parameters
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
Transform out based on this obb data.
| meta | description |
|---|---|
| Defined in | cocos2d/core/geom-utils/obb.ts:258 |
Parameters
mMat4 The transformation matrix.rotQuat The rotating part of the transformation.outObb Target of transformation.
setScale
Scale out based on this obb data.
| meta | description |
|---|---|
| Defined in | cocos2d/core/geom-utils/obb.ts:274 |
Parameters
scaleVec3 Scale value.outObb Scaled target.