SRTValue3D
¶
A structure that describes the scale, rotation and translation transformation in 3D space. Rotation is stored as quaternion, with the angle in radians.
Functions which can be used to create new instances of SRTValue3D.
SRTValue3D() | Default constructor |
SRTValue3D() | Constructor with the supplied scale, rotation angle, and translation |
SRTValue3D() | Constructor with the supplied scale, rotation as a quaternion, and translation |
Default constructor.
local srtvalue3d = SRTValue3D()
Constructor with the supplied scale, rotation angle, and translation.
local srtvalue3d = SRTValue3D(scale, eulerAnglesInRadians, translation)
scale | (Vector3) | The scale. |
eulerAnglesInRadians | (Vector3) | The rotation in Euler angles (radians). |
translation | (Vector3) | The translation. |
Constructor with the supplied scale, rotation as a quaternion, and translation.
local srtvalue3d = SRTValue3D(scale, rotation, translation)
scale | (Vector3) | The scale. |
rotation | (Quaternion) | The rotation. |
translation | (Vector3) | The translation. |
Methods of SRTValue3D class.
SRTValue3D:getScale() | Returns the scale |
SRTValue3D:setScale() | Sets the scale |
SRTValue3D:getScaleX() | Returns the scale along the x-axis |
SRTValue3D:setScaleX() | Sets the scale along the x-axis |
SRTValue3D:getScaleY() | Returns the scale along the y-axis |
SRTValue3D:setScaleY() | Sets the scale along the y-axis |
SRTValue3D:getScaleZ() | Returns the scale along the z-axis |
SRTValue3D:setScaleZ() | Sets the scale along the z-axis |
SRTValue3D:scale() | Multiplies the current scale with the provided scaling factor |
SRTValue3D:getRotation() | Returns the rotation as a quaternion |
SRTValue3D:setRotation() | Sets the rotation |
SRTValue3D:setRotation() | Sets the rotation |
SRTValue3D:getTranslation() | Returns the translation |
SRTValue3D:setTranslation() | Sets the translation |
SRTValue3D:translate() | Adds the provided translation to the current translation |
SRTValue3D:getTranslationX() | Returns the translation along the x-axis |
SRTValue3D:setTranslationX() | Sets the translation along the x-axis |
SRTValue3D:getTranslationY() | Returns the translation along the y-axis |
SRTValue3D:setTranslationY() | Sets the translation along the y-axis |
SRTValue3D:getTranslationZ() | Returns the translation along the z-axis |
SRTValue3D:setTranslationZ() | Sets the translation along the z-axis |
SRTValue3D:rotate() | Applies a rotation to the current rotation |
SRTValue3D:toMatrix() | Converts the SRT representation to Matrix4x4 transform |
SRTValue3D.create() | Attempts to create an SRT object from a given transformation 4x4 matrix |
SRTValue3D.createScale() | Creates a scale SRT |
SRTValue3D.createUniformScale() | Creates a uniform scale SRT |
SRTValue3D.createTranslation() | Creates a translation SRT |
SRTValue3D:translated() | Translates the SRT object |
SRTValue3D:scaled() | Scales the SRT object |
SRTValue3D:rotated() | Rotates the SRT object |
Returns the scale.
(Vector3) | The scale. |
Sets the scale.
value | (Vector3) | The scale. |
Returns the scale along the x-axis.
(float) | The x component of the scale. |
Sets the scale along the x-axis.
value | (float) | The x component of the scale. |
Returns the scale along the y-axis.
(float) | The y component of the scale. |
Sets the scale along the y-axis.
value | (float) | The y component of the scale. |
Returns the scale along the z-axis.
(float) | The z component of the scale. |
Sets the scale along the z-axis.
value | (float) | The z component of the scale. |
Multiplies the current scale with the provided scaling factor.
factor | (Vector3) | The scaling factor. |
Returns the rotation as a quaternion.
(Quaternion) | The rotation. |
Sets the rotation.
value | (Quaternion) | Rotation as a quaternion. |
Sets the rotation.
eulerAnglesInRadians | (Vector3) | Rotation angle as Euler angle in radians. |
Returns the translation.
(Vector3) | The translation. |
Sets the translation.
value | (Vector3) | The translation. |
Adds the provided translation to the current translation.
translation | (Vector3) | The translation term. |
Returns the translation along the x-axis.
(float) | The x component of the translation. |
Sets the translation along the x-axis.
value | (float) | The x component of the translation. |
Returns the translation along the y-axis.
(float) | The y component of the translation. |
Sets the translation along the y-axis.
value | (float) | The y component of the translation. |
Returns the translation along the z-axis.
(float) | The z component of the translation. |
Sets the translation along the z-axis.
value | (float) | The z component of the translation. |
Applies a rotation to the current rotation.
rotation | (Quaternion) | Rotation quaternion. |
Converts the SRT representation to Matrix4x4 transform.
(Matrix4x4) | A matrix representation of the SRT object. |
Attempts to create an SRT object from a given transformation 4x4 matrix. Note that you can decompose a matrix into SRT only if its column vectors are orthogonal to each other.
matrix | (Matrix4x4) | The transformation 4x4 matrix. |
(SRTValue3D or nil) | If the matrix is decomposable, returns an SRTValue3D object, otherwise nil. |
Creates a scale SRT.
scale | (Vector3) | The scale. |
(SRTValue3D) | An SRT object with scale. |
Creates a uniform scale SRT.
scale | (float) | The scale. |
(SRTValue3D) | An SRT object with scale. |
Creates a translation SRT.
translation | (Vector3) | The translation. |
(SRTValue3D) | An SRT object with translation. |
Translates the SRT object.
translation | (Vector3) | The translation term. |
(SRTValue3D) | A new SRT object with the translation applied. |
Scales the SRT object.
scale | (Vector3) | The scaling factor. |
(SRTValue3D) | A new SRT object with the scale applied. |
Rotates the SRT object.
rotation | (Quaternion) | The rotation. |
(SRTValue3D) | A new SRT object with the rotation applied. |
SRTValue3D specific standalone functions, which are not a part of the SRTValue3D class.