Transform

Api for transforms with rotation, scale and translation

Transform()

Transform with non-uniform (3-component) scale

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()

Constructor. Leaves the struct in an uninitialized...

Constructor. Leaves the struct in an uninitialized state


Transform(translation, rotation, scale)

constructor

constructor

PARAMETERS

translation -

rotation -

scale -


Transform(translation, rotation, scale)

constructor

constructor

PARAMETERS

translation -

rotation -

scale -


SetIdentity()

initialize to identity transform

initialize to identity transform


GetTranslation()

get translation

get translation

RETURN

translation -


SetTranslation(translation)

set translation

set translation

PARAMETERS

translation -


GetScale()

get scale

get scale

RETURN

scale -


SetScale()

set scale

set scale

RETURN

scale -


GetUniformScale()

Compute a 'uniform' scale for this transform. In t...

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.

RETURN

scale - the uniform scale associated with this transform.


SetUniformScale(scale)

set uniform scale

set uniform scale

PARAMETERS

scale -


GetRotation()

get rotatiom

get rotatiom

RETURN

rotation -


SetRotation(rotation)

set rotatiom

set rotatiom

PARAMETERS

rotation -


Apply(t, p)

Apply the transform on a point (includes the trans...

Apply the transform on a point (includes the transform translation).

PARAMETERS

t - Transform

p - Point

RETURN

point - Transformed point


ApplyNoScaleZ(t, p)

Apply the transform on a point, but without scalin...

Apply the transform on a point, but without scaling the Z-component of the point (includes the transform translation).

PARAMETERS

t - Transform

p - Point

RETURN

point - Transformed point


Apply(t, v)

Apply the transform on a vector (excludes the tran...

Apply the transform on a vector (excludes the transform translation).

PARAMETERS

t - Transform

v - Vector

RETURN

point - Transformed vector


ApplyNoScaleZ(t, v)

Apply the transform on a vector, but without scali...

Apply the transform on a vector, but without scaling the Z-component of the vector (excludes the transform translation).

PARAMETERS

t - Transform

v - Vector

RETURN

point - Transformed vector


Mul(lhs, rhs)

Transforms the right-hand transform by the left-ha...

Transforms the right-hand transform by the left-hand transform

PARAMETERS

lhs -

rhs -

RETURN

result - Transformed transform


MulNoScaleZ(lhs, rhs)

Transforms the right-hand transform by the left-ha...

Transforms the right-hand transform by the left-hand transform, without scaling the Z-component of the transition of the transformed transform

PARAMETERS

lhs -

rhs -

RETURN

result - Transformed transform


Inv(t)

Invert a transform

Invert a transform

PARAMETERS

t -

RETURN

result - inverted transform


ToMatrix4(t)

Convert a transform into a 4-dim matrix

Convert a transform into a 4-dim matrix

PARAMETERS

t - Transform to convert

RETURN

Matrix - representing the same transform


ExtractScale(mtx)

Extract the absolute values of the scale component...

Extract the absolute values of the scale component from a matrix.

PARAMETERS

mtx - Source matrix

RETURN

Vector3 - with scale values for x,y,z


ResetScale(mtx)

Eliminate the scaling components in a matrix

Eliminate the scaling components in a matrix

PARAMETERS

mtx - Matrix to operate on

RETURN

Vector - containing the scaling by component


ToTransform(mtx)

Convert a matrix into a transform

Convert a matrix into a transform

PARAMETERS

mtx - Matrix4 to convert

RETURN

Transform - representing the same transform


NormalizeZScale(mtx)

Eliminate the z scaling components in a matrix

Eliminate the z scaling components in a matrix

PARAMETERS

mtx - Matrix to operate on


NormalizeZScale(source, target)

Eliminate the z scaling components in a matrix

Eliminate the z scaling components in a matrix

PARAMETERS

source - Source matrix

target - Target matrix


MulNoScaleZ(m1, m2)

Multiply two matrices without z-scaling the transl...

Multiply two matrices without z-scaling the translation in m2

PARAMETERS

m1 - First matrix

m2 - Second matrix

RETURN

result - The resulting transform