TransformBuilder
Contents
[
Hide
]TransformBuilder class
The TransformBuilder is used to build transform matrix by a chain of transformations.
Methods
constructor
| Name | Description |
|---|---|
| constructor(initial, order) | Construct a TransformBuilder with initial transform matrix and specified compose order |
Parameters:
| Name | Type | Description |
|---|---|---|
| initia | Matrix4 | null |
| order | ComposeOrder | ComposeOrder |
Result:
constructor_overload
| Name | Description |
|---|---|
| constructor_overload(order) | Construct a TransformBuilder with initial identity transform matrix and specified compose order |
Parameters:
| Name | Type | Description |
|---|---|---|
| order | ComposeOrder | ComposeOrder |
Result:
getMatrix
| Name | Description |
|---|---|
| getMatrix() | Gets or sets the current matrix value |
Result:
setMatrix
| Name | Description |
|---|---|
| setMatrix(value) | Gets or sets the current matrix value |
Result:
getComposeOrder
| Name | Description |
|---|---|
| getComposeOrder() | Gets or sets the chain compose order. The value of the property is ComposeOrder integer constant. |
Result:
setComposeOrder
| Name | Description |
|---|---|
| setComposeOrder(value) | Gets or sets the chain compose order. The value of the property is ComposeOrder integer constant. |
Result:
compose
| Name | Description |
|---|---|
| compose(m) | Append or prepend the argument to internal matrix. |
Parameters:
| Name | Type | Description |
|---|---|---|
| Matrix4 | null |
Result:
append
| Name | Description |
|---|---|
| append(m) | Append the new transform matrix to the transform chain. |
Parameters:
| Name | Type | Description |
|---|---|---|
| Matrix4 | null |
Result:
prepend
| Name | Description |
|---|---|
| prepend(m) | Prepend the new transform matrix to the transform chain. |
Parameters:
| Name | Type | Description |
|---|---|---|
| Matrix4 | null |
Result:
rearrange
| Name | Description |
|---|---|
| rearrange(newX, newY, newZ) | Rearrange the layout of the axis. |
Parameters:
| Name | Type | Description |
|---|---|---|
| newX | Axis | Axis |
| newY | Axis | Axis |
| newZ | Axis | Axis |
Result:
scale
| Name | Description |
|---|---|
| scale(s) | Chain a scaling transform matrix with a component scaled by s |
Parameters:
| Name | Type | Description |
|---|---|---|
| Number | null |
Result:
scale
| Name | Description |
|---|---|
| scale(x, y, z) | Chain a scaling transform matrix |
Parameters:
| Name | Type | Description |
|---|---|---|
| Number | null | |
| Number | null | |
| Number | null |
Result:
scale
| Name | Description |
|---|---|
| scale(s) | Chain a scale transform |
Parameters:
| Name | Type | Description |
|---|---|---|
| Vector3 | null |
Result:
rotateDegree
| Name | Description |
|---|---|
| rotateDegree(angle, axis) | Chain a rotation transform in degree |
Parameters:
| Name | Type | Description |
|---|---|---|
| angle | Number | The angle to rotate in degree |
| axis | Vector3 | The axis to rotate |
Result:
rotateRadian
| Name | Description |
|---|---|
| rotateRadian(angle, axis) | Chain a rotation transform in radian |
Parameters:
| Name | Type | Description |
|---|---|---|
| angle | Number | The angle to rotate in radian |
| axis | Vector3 | The axis to rotate |
Result:
rotate
| Name | Description |
|---|---|
| rotate(q) | Chain a rotation by a quaternion |
Parameters:
| Name | Type | Description |
|---|---|---|
| Quaternion | null |
Result:
rotateEulerDegree
| Name | Description |
|---|---|
| rotateEulerDegree(degX, degY, degZ) | Chain a rotation by Euler angles in degree |
Parameters:
| Name | Type | Description |
|---|---|---|
| deg | Number | null |
| deg | Number | null |
| deg | Number | null |
Result:
rotateEulerRadian
| Name | Description |
|---|---|
| rotateEulerRadian(x, y, z) | Chain a rotation by Euler angles in radian |
Parameters:
| Name | Type | Description |
|---|---|---|
| Number | null | |
| Number | null | |
| Number | null |
Result:
rotateEulerRadian
| Name | Description |
|---|---|
| rotateEulerRadian(r) | Chain a rotation by Euler angles in radian |
Parameters:
| Name | Type | Description |
|---|---|---|
| Vector3 | null |
Result:
translate
| Name | Description |
|---|---|
| translate(tx, ty, tz) | Chain a translation transform |
Parameters:
| Name | Type | Description |
|---|---|---|
| t | Number | null |
| t | Number | null |
| t | Number | null |
Result:
translate
| Name | Description |
|---|---|
| translate(v) | Chain a translation transform |
Parameters:
| Name | Type | Description |
|---|---|---|
| Vector3 | null |
Result:
reset
| Name | Description |
|---|---|
| reset() | Reset the transform to identity matrix |
Result:
rotateDegree
| Name | Description |
|---|---|
| rotateDegree(rot, order) | Append rotation with specified order |
Parameters:
| Name | Type | Description |
|---|---|---|
| rot | Vector3 | Rotation in degrees |
| order | RotationOrder | RotationOrder |
Result:
rotateRadian
| Name | Description |
|---|---|
| rotateRadian(rot, order) | Append rotation with specified order |
Parameters:
| Name | Type | Description |
|---|---|---|
| rot | Vector3 | Rotation in radian |
| order | RotationOrder | RotationOrder |
Result: