Namespace: | dmTransform |
Include: | #include <> |
STRUCTS | |
---|---|
struct Transform | Transform with non-uniform (3-component) scale |
dmVMath::Point3 Apply(dmTransform::Transform& t, dmVMath::Point3& p)
Apply the transform on a point (includes the transform translation).
PARAMETERS
dmTransform::Transform& |
t |
Transform |
dmVMath::Point3& |
p |
Point |
RETURNS
dmVMath::Point3 |
Transformed point |
dmVMath::Vector3 Apply(dmTransform::Transform& t, dmVMath::Vector3& v)
Apply the transform on a vector (excludes the transform translation).
PARAMETERS
dmTransform::Transform& |
t |
Transform |
dmVMath::Vector3& |
v |
Vector |
RETURNS
dmVMath::Vector3 |
Transformed vector |
dmVMath::Point3 ApplyNoScaleZ(dmTransform::Transform& t, dmVMath::Point3& p)
Apply the transform on a point, but without scaling the Z-component of the point (includes the transform translation).
PARAMETERS
dmTransform::Transform& |
t |
Transform |
dmVMath::Point3& |
p |
Point |
RETURNS
dmVMath::Point3 |
Transformed point |
dmVMath::Vector3 ApplyNoScaleZ(dmTransform::Transform& t, dmVMath::Vector3& v)
Apply the transform on a vector, but without scaling the Z-component of the vector (excludes the transform translation).
PARAMETERS
dmTransform::Transform& |
t |
Transform |
dmVMath::Vector3& |
v |
Vector |
RETURNS
dmVMath::Vector3 |
Transformed vector |
ExtractScale( mtx)
Extract the absolute values of the scale component from a matrix.
PARAMETERS
|
mtx |
Source matrix |
RETURNS
|
with scale values for x,y,z |
dmVMath::Quat GetRotation()
get rotatiom
PARAMETERS
RETURNS
dmVMath::Quat |
dmVMath::Vector3 GetScale()
get scale
PARAMETERS
RETURNS
dmVMath::Vector3 |
dmVMath::Vector3 GetTranslation()
get translation
PARAMETERS
RETURNS
dmVMath::Vector3 |
float 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
RETURNS
float |
the uniform scale associated with this transform. |
dmTransform::Transform Inv(const dmTransform::Transform& t)
Invert a transform
PARAMETERS
const dmTransform::Transform& |
t |
RETURNS
dmTransform::Transform |
inverted transform |
dmTransform::Transform Mul(const dmTransform::Transform& lhs, const dmTransform::Transform& rhs)
Transforms the right-hand transform by the left-hand transform
PARAMETERS
const dmTransform::Transform& |
lhs |
|
const dmTransform::Transform& |
rhs |
RETURNS
dmTransform::Transform |
Transformed transform |
dmTransform::Transform MulNoScaleZ(const dmTransform::Transform& lhs, const dmTransform::Transform& rhs)
Transforms the right-hand transform by the left-hand transform, without scaling the Z-component of the transition of the transformed transform
PARAMETERS
const dmTransform::Transform& |
lhs |
|
const dmTransform::Transform& |
rhs |
RETURNS
dmTransform::Transform |
Transformed transform |
dmVMath::Matrix MulNoScaleZ(const dmVMath::Matrix& m1, const dmVMath::Matrix& m2)
Multiply two matrices without z-scaling the translation in m2
PARAMETERS
const dmVMath::Matrix& |
m1 |
First matrix |
const dmVMath::Matrix& |
m2 |
Second matrix |
RETURNS
dmVMath::Matrix |
The resulting transform |
void NormalizeZScale( mtx)
Eliminate the z scaling components in a matrix
PARAMETERS
|
mtx |
Matrix to operate on |
void NormalizeZScale(const dmVMath::Matrix& source, dmVMath::Matrix* target)
Eliminate the z scaling components in a matrix
PARAMETERS
const dmVMath::Matrix& |
source |
Source matrix |
dmVMath::Matrix* |
target |
Target matrix |
ResetScale( mtx)
Eliminate the scaling components in a matrix
PARAMETERS
|
mtx |
Matrix to operate on |
RETURNS
|
containing the scaling by component |
void SetIdentity()
initialize to identity transform
PARAMETERS
void SetRotation(dmVMath::Quat rotation)
set rotatiom
PARAMETERS
dmVMath::Quat |
rotation |
dmVMath::Vector3 SetScale()
set scale
PARAMETERS
RETURNS
dmVMath::Vector3 |
void SetTranslation(dmVMath::Vector3 translation)
set translation
PARAMETERS
dmVMath::Vector3 |
translation |
void SetUniformScale(float scale)
set uniform scale
PARAMETERS
float |
scale |
ToMatrix4( t)
Convert a transform into a 4-dim matrix
PARAMETERS
|
t |
Transform to convert |
RETURNS
|
representing the same transform |
ToTransform( mtx)
Convert a matrix into a transform
PARAMETERS
|
mtx |
Matrix4 to convert |
RETURNS
|
representing the same transform |
void Transform()
Constructor. Leaves the struct in an uninitialized state
PARAMETERS
void Transform(dmVMath::Vector3 translation, dmVMath::Quat rotation, dmVMath::Vector3 scale)
constructor
PARAMETERS
dmVMath::Vector3 |
translation |
|
dmVMath::Quat |
rotation |
|
dmVMath::Vector3 |
scale |
void Transform(dmVMath::Vector3 translation, dmVMath::Quat rotation, dmVMath::Vector3 scale)
constructor
PARAMETERS
dmVMath::Vector3 |
translation |
|
dmVMath::Quat |
rotation |
|
dmVMath::Vector3 |
scale |
TYPE
struct Transform
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)