Namespace: dmTransform
Language: C++
Type: Defold C++
File: transform.h
Source: engine/dlib/src/dmsdk/dlib/transform.h
Include: dmsdk/dlib/transform.h
Api for transforms with rotation, scale and translation
Type: FUNCTION Apply the transform on a point (includes the transform translation).
Parameters
t (dmTransform::Transform&) - Transformp (dmVMath::Point3&) - PointReturns
point (dmVMath::Point3) - Transformed pointType: FUNCTION Apply the transform on a vector (excludes the transform translation).
Parameters
t (dmTransform::Transform&) - Transformv (dmVMath::Vector3&) - VectorReturns
point (dmVMath::Vector3) - Transformed vectorType: FUNCTION Extract the absolute values of the scale component from a matrix.
Parameters
mtx (dmVMath::Matrix4) - Source matrixReturns
Vector3 - with scale values for x,y,zType: FUNCTION get rotatiom
Returns
rotation (dmVMath::Quat)Type: FUNCTION get scale
Returns
scale (dmVMath::Vector3)Type: FUNCTION get translation
Returns
translation (dmVMath::Vector3)Type: FUNCTION Compute a ‘uniform’ scale for this transform. In the event that the scale applied to this transform is not uniform then the value is arbitrary: we make a selection that will not introduce any floating point rounding errors.
Returns
scale (float) - the uniform scale associated with this transform.Type: FUNCTION Invert a transform
Parameters
t (const dmTransform::Transform&)Returns
result (dmTransform::Transform) - inverted transformType: FUNCTION Transforms the right-hand transform by the left-hand transform
Parameters
lhs (const dmTransform::Transform&)rhs (const dmTransform::Transform&)Returns
result (dmTransform::Transform) - Transformed transformType: FUNCTION Eliminate the z scaling components in a matrix
Parameters
mtx (dmVMath::Matrix4) - Matrix to operate onType: FUNCTION Eliminate the z scaling components in a matrix
Parameters
source (const dmVMath::Matrix&) - Source matrixtarget (dmVMath::Matrix*) - Target matrixType: FUNCTION Eliminate the scaling components in a matrix
Parameters
mtx (dmVMath::Matrix4) - Matrix to operate onReturns
Vector - containing the scaling by componentType: FUNCTION initialize to identity transform
Type: FUNCTION set rotatiom
Parameters
rotation (dmVMath::Quat)Type: FUNCTION set scale
Returns
scale (dmVMath::Vector3)Type: FUNCTION set scale for x and y
Parameters
scale_x (float)scale_y (float)Type: FUNCTION set translation
Parameters
translation (dmVMath::Vector3)Type: FUNCTION set uniform scale
Parameters
scale (float)Type: FUNCTION Convert a transform into a 4-dim matrix
Parameters
t (Transform) - Transform to convertReturns
Matrix - representing the same transformType: FUNCTION Convert a matrix into a transform
Parameters
mtx (dmVMath::Matrix4) - Matrix4 to convertReturns
Transform - representing the same transformType: STRUCT Transform with non-uniform (3-component) scale. Transform applied as: T(p) = translate(rotate(scale(p))) = p’ The scale is non-rotated to avoid shearing in the transform. Two transforms are applied as: T1(T2(p)) = t1(r1(t2(r2(s1(s2(p)))))) = p’ This means that the transform is not associative: T1(T2(p)) != (T1*T2)(P)
Type: FUNCTION Constructor. Leaves the struct in an uninitialized state
Type: FUNCTION constructor
Parameters
translation (dmVMath::Vector3)rotation (dmVMath::Quat)scale (dmVMath::Vector3)Type: FUNCTION constructor
Parameters
translation (dmVMath::Vector3)rotation (dmVMath::Quat)scale (dmVMath::Vector3)