Transform API documentation

Version: stable

FUNCTION
Transform() Constructor. Leaves the struct in an uninitialized...
Transform() constructor
Transform() constructor
SetIdentity() initialize to identity transform
GetTranslation() get translation
SetTranslation() set translation
GetScale() get scale
SetScale() set scale
GetUniformScale() Compute a 'uniform' scale for this transform. In t...
SetUniformScale() set uniform scale
GetRotation() get rotatiom
SetRotation() set rotatiom
Apply() Apply the transform on a point (includes the trans...
ApplyNoScaleZ() Apply the transform on a point, but without scalin...
Apply() Apply the transform on a vector (excludes the tran...
ApplyNoScaleZ() Apply the transform on a vector, but without scali...
Mul() Transforms the right-hand transform by the left-ha...
MulNoScaleZ() Transforms the right-hand transform by the left-ha...
Inv() Invert a transform
ToMatrix() Convert a transform into a 4-dim matrix
ExtractScale() Extract the absolute values of the scale component...
ResetScale() Eliminate the scaling components in a matrix
ToTransform() Convert a matrix into a transform
NormalizeZScale() Eliminate the z scaling components in a matrix
NormalizeZScale() Eliminate the z scaling components in a matrix
MulNoScaleZ() Multiply two matrices without z-scaling the transl...

Functions

Transform()

Transform()

Constructor. Leaves the struct in an uninitialized state

PARAMETERS

None


Transform()

Transform(translation,rotation,scale)

constructor

PARAMETERS

translation dmVMath::Vector3
rotation dmVMath::Quat
scale dmVMath::Vector3

Transform()

Transform(translation,rotation,scale)

constructor

PARAMETERS

translation dmVMath::Vector3
rotation dmVMath::Quat
scale dmVMath::Vector3

SetIdentity()

SetIdentity()

initialize to identity transform

PARAMETERS

None


GetTranslation()

GetTranslation()

get translation

PARAMETERS

None

RETURNS

translation dmVMath::Vector3

SetTranslation()

SetTranslation(translation)

set translation

PARAMETERS

translation dmVMath::Vector3

GetScale()

GetScale()

get scale

PARAMETERS

None

RETURNS

scale dmVMath::Vector3

SetScale()

SetScale()

set scale

PARAMETERS

None

RETURNS

scale dmVMath::Vector3

GetUniformScale()

GetUniformScale()

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.

PARAMETERS

None

RETURNS

scale float the uniform scale associated with this transform.

SetUniformScale()

SetUniformScale(scale)

set uniform scale

PARAMETERS

scale float

GetRotation()

GetRotation()

get rotatiom

PARAMETERS

None

RETURNS

rotation dmVMath::Quat

SetRotation()

SetRotation(rotation)

set rotatiom

PARAMETERS

rotation dmVMath::Quat

Apply()

Apply(t,p)

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

PARAMETERS

t dmTransform::Transform& Transform
p dmVMath::Point3& Point

RETURNS

point dmVMath::Point3 Transformed point

ApplyNoScaleZ()

ApplyNoScaleZ(t,p)

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

PARAMETERS

t dmTransform::Transform& Transform
p dmVMath::Point3& Point

RETURNS

point dmVMath::Point3 Transformed point

Apply()

Apply(t,v)

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

PARAMETERS

t dmTransform::Transform& Transform
v dmVMath::Vector3& Vector

RETURNS

point dmVMath::Vector3 Transformed vector

ApplyNoScaleZ()

ApplyNoScaleZ(t,v)

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

PARAMETERS

t dmTransform::Transform& Transform
v dmVMath::Vector3& Vector

RETURNS

point dmVMath::Vector3 Transformed vector

Mul()

Mul(lhs,rhs)

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

PARAMETERS

lhs const dmTransform::Transform&
rhs const dmTransform::Transform&

RETURNS

result dmTransform::Transform Transformed transform

MulNoScaleZ()

MulNoScaleZ(lhs,rhs)

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

PARAMETERS

lhs const dmTransform::Transform&
rhs const dmTransform::Transform&

RETURNS

result dmTransform::Transform Transformed transform

Inv()

Inv(t)

Invert a transform

PARAMETERS

t const dmTransform::Transform&

RETURNS

result dmTransform::Transform inverted transform

ToMatrix()

ToMatrix(t)

Convert a transform into a 4-dim matrix

PARAMETERS

t Transform to convert

RETURNS

Matrix representing the same transform

ExtractScale()

ExtractScale(mtx)

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

PARAMETERS

mtx Source matrix

RETURNS

Vector3 with scale values for x,y,z

ResetScale()

ResetScale(mtx)

Eliminate the scaling components in a matrix

PARAMETERS

mtx Matrix to operate on

RETURNS

Vector containing the scaling by component

ToTransform()

ToTransform(mtx)

Convert a matrix into a transform

PARAMETERS

mtx Matrix4 to convert

RETURNS

Transform representing the same transform

NormalizeZScale()

NormalizeZScale(mtx)

Eliminate the z scaling components in a matrix

PARAMETERS

mtx Matrix to operate on

NormalizeZScale()

NormalizeZScale(source,target)

Eliminate the z scaling components in a matrix

PARAMETERS

source const dmVMath::Matrix& Source matrix
target dmVMath::Matrix* Target matrix

MulNoScaleZ()

MulNoScaleZ(m1,m2)

Multiply two matrices without z-scaling the translation in m2

PARAMETERS

m1 const dmVMath::Matrix& First matrix
m2 const dmVMath::Matrix& Second matrix

RETURNS

result dmVMath::Matrix The resulting transform