Transform

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

API

Apply

Type: FUNCTION Apply the transform on a point (includes the transform translation).

Parameters

Returns

Apply

Type: FUNCTION Apply the transform on a vector (excludes the transform translation).

Parameters

Returns

ExtractScale

Type: FUNCTION Extract the absolute values of the scale component from a matrix.

Parameters

Returns

GetRotation

Type: FUNCTION get rotatiom

Returns

GetScale

Type: FUNCTION get scale

Returns

GetTranslation

Type: FUNCTION get translation

Returns

GetUniformScale

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

Inv

Type: FUNCTION Invert a transform

Parameters

Returns

Mul

Type: FUNCTION Transforms the right-hand transform by the left-hand transform

Parameters

Returns

NormalizeZScale

Type: FUNCTION Eliminate the z scaling components in a matrix

Parameters

NormalizeZScale

Type: FUNCTION Eliminate the z scaling components in a matrix

Parameters

ResetScale

Type: FUNCTION Eliminate the scaling components in a matrix

Parameters

Returns

SetIdentity

Type: FUNCTION initialize to identity transform

SetRotation

Type: FUNCTION set rotatiom

Parameters

SetScale

Type: FUNCTION set scale

Returns

SetScaleXY

Type: FUNCTION set scale for x and y

Parameters

SetTranslation

Type: FUNCTION set translation

Parameters

SetUniformScale

Type: FUNCTION set uniform scale

Parameters

ToMatrix4

Type: FUNCTION Convert a transform into a 4-dim matrix

Parameters

Returns

ToTransform

Type: FUNCTION Convert a matrix into a transform

Parameters

Returns

Transform

Type: 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)

Transform

Type: FUNCTION Constructor. Leaves the struct in an uninitialized state

Transform

Type: FUNCTION constructor

Parameters

Transform

Type: FUNCTION constructor

Parameters