TransformBuilder

TransformBuilder class

The TransformBuilder is used to build transform matrix by a chain of transformations.

Methods

constructor

NameDescription
constructor(initial, order)Construct a TransformBuilder with initial transform matrix and specified compose order

Parameters:

NameTypeDescription
initiaMatrix4null
orderComposeOrderComposeOrder

Result:


constructor_overload

NameDescription
constructor_overload(order)Construct a TransformBuilder with initial identity transform matrix and specified compose order

Parameters:

NameTypeDescription
orderComposeOrderComposeOrder

Result:


getMatrix

NameDescription
getMatrix()Gets or sets the current matrix value

Result:


setMatrix

NameDescription
setMatrix(value)Gets or sets the current matrix value

Result:


getComposeOrder

NameDescription
getComposeOrder()Gets or sets the chain compose order. The value of the property is ComposeOrder integer constant.

Result:


setComposeOrder

NameDescription
setComposeOrder(value)Gets or sets the chain compose order. The value of the property is ComposeOrder integer constant.

Result:


compose

NameDescription
compose(m)Append or prepend the argument to internal matrix.

Parameters:

NameTypeDescription
Matrix4null

Result:


append

NameDescription
append(m)Append the new transform matrix to the transform chain.

Parameters:

NameTypeDescription
Matrix4null

Result:


prepend

NameDescription
prepend(m)Prepend the new transform matrix to the transform chain.

Parameters:

NameTypeDescription
Matrix4null

Result:


rearrange

NameDescription
rearrange(newX, newY, newZ)Rearrange the layout of the axis.

Parameters:

NameTypeDescription
newXAxisAxis
newYAxisAxis
newZAxisAxis

Result:


scale

NameDescription
scale(s)Chain a scaling transform matrix with a component scaled by s

Parameters:

NameTypeDescription
Numbernull

Result:


scale

NameDescription
scale(x, y, z)Chain a scaling transform matrix

Parameters:

NameTypeDescription
Numbernull
Numbernull
Numbernull

Result:


scale

NameDescription
scale(s)Chain a scale transform

Parameters:

NameTypeDescription
Vector3null

Result:


rotateDegree

NameDescription
rotateDegree(angle, axis)Chain a rotation transform in degree

Parameters:

NameTypeDescription
angleNumberThe angle to rotate in degree
axisVector3The axis to rotate

Result:


rotateRadian

NameDescription
rotateRadian(angle, axis)Chain a rotation transform in radian

Parameters:

NameTypeDescription
angleNumberThe angle to rotate in radian
axisVector3The axis to rotate

Result:


rotate

NameDescription
rotate(q)Chain a rotation by a quaternion

Parameters:

NameTypeDescription
Quaternionnull

Result:


rotateEulerDegree

NameDescription
rotateEulerDegree(degX, degY, degZ)Chain a rotation by Euler angles in degree

Parameters:

NameTypeDescription
degNumbernull
degNumbernull
degNumbernull

Result:


rotateEulerRadian

NameDescription
rotateEulerRadian(x, y, z)Chain a rotation by Euler angles in radian

Parameters:

NameTypeDescription
Numbernull
Numbernull
Numbernull

Result:


rotateEulerRadian

NameDescription
rotateEulerRadian(r)Chain a rotation by Euler angles in radian

Parameters:

NameTypeDescription
Vector3null

Result:


translate

NameDescription
translate(tx, ty, tz)Chain a translation transform

Parameters:

NameTypeDescription
tNumbernull
tNumbernull
tNumbernull

Result:


translate

NameDescription
translate(v)Chain a translation transform

Parameters:

NameTypeDescription
Vector3null

Result:


reset

NameDescription
reset()Reset the transform to identity matrix

Result:


rotateDegree

NameDescription
rotateDegree(rot, order)Append rotation with specified order

Parameters:

NameTypeDescription
rotVector3Rotation in degrees
orderRotationOrderRotationOrder

Result:


rotateRadian

NameDescription
rotateRadian(rot, order)Append rotation with specified order

Parameters:

NameTypeDescription
rotVector3Rotation in radian
orderRotationOrderRotationOrder

Result: