Class: Transform3D
Defined in: src/sdk/math/Transform3D.ts:9
A 3D affine transformation. By default, Transform3D objects are initially created as identity transformations.
Constructors
Constructor
new Transform3D():
Transform3D
Returns
Transform3D
Methods
addRotation()
Call Signature
addRotation(
theta,axisX,axisY,axisZ,order?):this
Defined in: src/sdk/math/Transform3D.ts:705
Adds a rotation about an arbitrary axis passing through the origin (0, 0, 0) to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
axisX | number | The x component of the vector defining the direction of the rotation axis. |
axisY | number | The y component of the vector defining the direction of the rotation axis. |
axisZ | number | The z component of the vector defining the direction of the rotation axis. |
order? | "before" | "after" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
Call Signature
addRotation(
theta,axisX,axisY,axisZ,originX,originY,originZ,order?):this
Defined in: src/sdk/math/Transform3D.ts:719
Adds a rotation about an arbitrary axis passing through an arbitrary point to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
axisX | number | The x component of the vector defining the direction of the rotation axis. |
axisY | number | The y component of the vector defining the direction of the rotation axis. |
axisZ | number | The z component of the vector defining the direction of the rotation axis. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
order? | "before" | "after" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
addRotationX()
Call Signature
addRotationX(
theta,order?):this
Defined in: src/sdk/math/Transform3D.ts:573
Adds a rotation about an axis parallel to the x axis passing through the origin (0, 0, 0) to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
order? | "before" | "after" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
Call Signature
addRotationX(
theta,originX,originY,originZ,order?):this
Defined in: src/sdk/math/Transform3D.ts:584
Adds a rotation about an axis parallel to the x axis passing through an arbitrary point to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
order? | "before" | "after" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
addRotationY()
Call Signature
addRotationY(
theta,order?):this
Defined in: src/sdk/math/Transform3D.ts:616
Adds a rotation about an axis parallel to the y axis passing through the origin (0, 0, 0) to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
order? | "before" | "after" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
Call Signature
addRotationY(
theta,originX,originY,originZ,order?):this
Defined in: src/sdk/math/Transform3D.ts:627
Adds a rotation about an axis parallel to the y axis passing through an arbitrary point to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
order? | "before" | "after" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
addRotationZ()
Call Signature
addRotationZ(
theta,order?):this
Defined in: src/sdk/math/Transform3D.ts:659
Adds a rotation about an axis parallel to the z axis passing through the origin (0, 0, 0) to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
order? | "before" | "after" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
Call Signature
addRotationZ(
theta,originX,originY,originZ,order?):this
Defined in: src/sdk/math/Transform3D.ts:670
Adds a rotation about an axis parallel to the z axis passing through an arbitrary point to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
order? | "before" | "after" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
addScale()
Call Signature
addScale(
x,y,z,order?):this
Defined in: src/sdk/math/Transform3D.ts:528
Adds a scaling about the origin (0, 0, 0) to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x scaling factor. |
y | number | The y scaling factor. |
z | number | The z scaling factor. |
order? | "before" | "after" | The order in which to add the scaling, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
Call Signature
addScale(
x,y,z,originX,originY,originZ,order?):this
Defined in: src/sdk/math/Transform3D.ts:541
Adds a scaling about an arbitrary origin to this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x scaling factor. |
y | number | The y scaling factor. |
z | number | The z scaling factor. |
originX | number | The x-coordinate of the scaling origin. |
originY | number | The y-coordinate of the scaling origin. |
originZ | number | The z-coordinate of the scaling origin. |
order? | "before" | "after" | The order in which to add the scaling, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
addTranslation()
addTranslation(
x,y,z,order):this
Defined in: src/sdk/math/Transform3D.ts:507
Adds a translation to this transformation.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
x | number | undefined | The x translation. |
y | number | undefined | The y translation. |
z | number | undefined | The z translation. |
order | "before" | "after" | 'after' | The order in which to add the translation, relative to this existing transformation, either 'before' or 'after'. Defaults to 'after'. |
Returns
this
This transformation, after it has been changed.
apply()
apply(
vec,out):Float64Array
Defined in: src/sdk/math/Transform3D.ts:294
Applies this transformation to a 3D vector.
Parameters
| Parameter | Type | Description |
|---|---|---|
vec | ReadonlyFloat64Array | A 3D vector. |
out | Float64Array | The vector to which to write the result. |
Returns
Float64Array
The result of applying this transformation to vec.
copy()
copy():
Transform3D
Defined in: src/sdk/math/Transform3D.ts:284
Copies this transformation.
Returns
Transform3D
A copy of this transformation.
getParameters()
getParameters():
Readonly<Float64Array>
Defined in: src/sdk/math/Transform3D.ts:21
Gets the parameters of this transformation as a 12-tuple:
[scaleX, skewX(Y), skewX(Z), translateX, skewY(X), scaleY, skewY(Z), translateY, skewZ(X), skewZ(Y), scaleZ, translateZ].
Returns
Readonly<Float64Array>
The parameters of this transformation.
invert()
invert():
this
Defined in: src/sdk/math/Transform3D.ts:225
Inverts this transformation.
Returns
this
This transformation, after it has been inverted.
Throws
Error if this transformation cannot be inverted.
offsetOrigin()
offsetOrigin(
x,y,z):this
Defined in: src/sdk/math/Transform3D.ts:312
Changes this transformation to the one that is the result of offsetting this transformation's origin.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x-coordinate of the offset origin. |
y | number | The y-coordinate of the offset origin. |
z | number | The z-coordinate of the offset origin. |
Returns
this
This transformation, after it has been changed.
set()
Call Signature
set(
scaleX,skewXY,skewXZ,translateX,skewYX,scaleY,skewYZ,translateY,skewZX,skewZY,scaleZ,translateZ):this
Defined in: src/sdk/math/Transform3D.ts:41
Sets the parameters of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
scaleX | number | The x scaling factor. |
skewXY | number | The x skew factor along the y axis. |
skewXZ | number | The x skew factor along the z axis. |
translateX | number | The x translation. |
skewYX | number | The y skew factor along the x axis. |
scaleY | number | The y scaling factor. |
skewYZ | number | The y skew factor along the z axis. |
translateY | number | The y translation. |
skewZX | number | The z skew factor along the x axis. |
skewZY | number | The z skew factor along the y axis. |
scaleZ | number | The z scaling factor. |
translateZ | number | The z translation. |
Returns
this
This transformation, after it has been changed.
Call Signature
set(
transform):this
Defined in: src/sdk/math/Transform3D.ts:59
Sets the parameters of this transformation from another transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
transform | ReadonlyTransform3D | The transformation from which to take parameters. |
Returns
this
setScale()
setScale(
x,y,z):this
Defined in: src/sdk/math/Transform3D.ts:133
Sets the x and y scaling factors of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The new x scaling factor. |
y | number | The new y scaling factor. |
z | number | The new z scaling factor. |
Returns
this
This transformation, after it has been changed.
setScaleX()
setScaleX(
value):this
Defined in: src/sdk/math/Transform3D.ts:101
Sets the x scaling factor of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | The new x scaling factor. |
Returns
this
This transformation, after it has been changed.
setScaleY()
setScaleY(
value):this
Defined in: src/sdk/math/Transform3D.ts:111
Sets the y scaling factor of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | The new y scaling factor. |
Returns
this
This transformation, after it has been changed.
setScaleZ()
setScaleZ(
value):this
Defined in: src/sdk/math/Transform3D.ts:121
Sets the z scaling factor of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | The new z scaling factor. |
Returns
this
This transformation, after it has been changed.
setSkewX()
setSkewX(
y,z):this
Defined in: src/sdk/math/Transform3D.ts:146
Sets the x skew factor of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
y | number | The new x skew factor along the y axis. |
z | number | The new x skew factor along the z axis. |
Returns
this
This transformation, after it has been changed.
setSkewY()
setSkewY(
x,z):this
Defined in: src/sdk/math/Transform3D.ts:158
Sets the y skew factor of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The new y skew factor along the x axis. |
z | number | The new y skew factor along the z axis. |
Returns
this
This transformation, after it has been changed.
setSkewZ()
setSkewZ(
x,y):this
Defined in: src/sdk/math/Transform3D.ts:170
Sets the z skew factor of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The new z skew factor along the x axis. |
y | number | The new z skew factor along the y axis. |
Returns
this
This transformation, after it has been changed.
setTranslate()
setTranslate(
x,y,z):this
Defined in: src/sdk/math/Transform3D.ts:213
Sets the x and y translations of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The new x translation. |
y | number | The new y translation. |
z | number | The new z translation. |
Returns
this
This transformation, after it has been changed.
setTranslateX()
setTranslateX(
value):this
Defined in: src/sdk/math/Transform3D.ts:181
Sets the x translation of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | The new x translation. |
Returns
this
This transformation, after it has been changed.
setTranslateY()
setTranslateY(
value):this
Defined in: src/sdk/math/Transform3D.ts:191
Sets the y translation of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | The new y translation. |
Returns
this
This transformation, after it has been changed.
setTranslateZ()
setTranslateZ(
value):this
Defined in: src/sdk/math/Transform3D.ts:201
Sets the z translation of this transformation.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | The new z translation. |
Returns
this
This transformation, after it has been changed.
toIdentity()
toIdentity():
this
Defined in: src/sdk/math/Transform3D.ts:324
Sets this transformation to the identity transformation.
Returns
this
This transformation, after it has been changed.
toRotation()
Call Signature
toRotation(
theta,axisX,axisY,axisZ):this
Defined in: src/sdk/math/Transform3D.ts:456
Sets this transformation to a rotation about an arbitrary axis passing through the origin (0, 0, 0).
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
axisX | number | The x component of the vector defining the direction of the rotation axis. |
axisY | number | The y component of the vector defining the direction of the rotation axis. |
axisZ | number | The z component of the vector defining the direction of the rotation axis. |
Returns
this
This transformation, after it has been changed.
Call Signature
toRotation(
theta,axisX,axisY,axisZ,originX,originY,originZ):this
Defined in: src/sdk/math/Transform3D.ts:468
Sets this transformation to a rotation about an arbitrary axis passing through an arbitrary point.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
axisX | number | The x component of the vector defining the direction of the rotation axis. |
axisY | number | The y component of the vector defining the direction of the rotation axis. |
axisZ | number | The z component of the vector defining the direction of the rotation axis. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
Returns
this
This transformation, after it has been changed.
toRotationX()
Call Signature
toRotationX(
theta):this
Defined in: src/sdk/math/Transform3D.ts:372
Sets this transformation to a rotation about an axis parallel to the x axis passing through the origin (0, 0, 0).
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
Returns
this
This transformation, after it has been changed.
Call Signature
toRotationX(
theta,originX,originY,originZ):this
Defined in: src/sdk/math/Transform3D.ts:381
Sets this transformation to a rotation about an axis parallel to the x axis passing through an arbitrary point.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
Returns
this
This transformation, after it has been changed.
toRotationY()
Call Signature
toRotationY(
theta):this
Defined in: src/sdk/math/Transform3D.ts:399
Sets this transformation to a rotation about an axis parallel to the y axis passing through the origin (0, 0, 0).
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
Returns
this
This transformation, after it has been changed.
Call Signature
toRotationY(
theta,originX,originY,originZ):this
Defined in: src/sdk/math/Transform3D.ts:408
Sets this transformation to a rotation about an axis parallel to the y axis passing through an arbitrary point.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
Returns
this
This transformation, after it has been changed.
toRotationZ()
Call Signature
toRotationZ(
theta):this
Defined in: src/sdk/math/Transform3D.ts:426
Sets this transformation to a rotation about an axis parallel to the z axis passing through the origin (0, 0, 0).
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
Returns
this
This transformation, after it has been changed.
Call Signature
toRotationZ(
theta,originX,originY,originZ):this
Defined in: src/sdk/math/Transform3D.ts:435
Sets this transformation to a rotation about an axis parallel to the z axis passing through an arbitrary point.
Parameters
| Parameter | Type | Description |
|---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
Returns
this
This transformation, after it has been changed.
toScale()
Call Signature
toScale(
x,y,z):this
Defined in: src/sdk/math/Transform3D.ts:346
Sets this transformation to a scaling about the origin (0, 0, 0).
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x scaling factor. |
y | number | The y scaling factor. |
z | number | The z scaling factor. |
Returns
this
This transformation, after it has been changed.
Call Signature
toScale(
x,y,z,originX,originY,originZ):this
Defined in: src/sdk/math/Transform3D.ts:357
Sets this transformation to a scaling about an arbitrary origin.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x scaling factor. |
y | number | The y scaling factor. |
z | number | The z scaling factor. |
originX | number | The x-coordinate of the scaling origin. |
originY | number | The y-coordinate of the scaling origin. |
originZ | number | The z-coordinate of the scaling origin. |
Returns
this
This transformation, after it has been changed.
toTranslation()
toTranslation(
x,y,z):this
Defined in: src/sdk/math/Transform3D.ts:335
Sets this transformation to a translation.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x translation. |
y | number | The y translation. |
z | number | The z translation. |
Returns
this
This transformation, after it has been changed.
concat()
staticconcat<T>(out,transforms):T
Defined in: src/sdk/math/Transform3D.ts:761
Concatenates one or more transformations and returns the result. Concatenating transformations [A, B, ...]
results in a transformation that is equivalent to first applying A, then applying B, etc. Note that this order
is the opposite of the one resulting from multiplying the individual transformation matrices
M_A * M_B * ....
If the number of transformations to concatenate equals zero, the identity matrix is returned.
Type Parameters
| Type Parameter |
|---|
T extends Transform3D |
Parameters
| Parameter | Type | Description |
|---|---|---|
out | T | The transformation to which to write the result. |
transforms | readonly ReadonlyTransform3D[] | The transformations to concatenate, in order. |
Returns
T
The result of concatenating all transformations in transforms.