Click or drag to resize
DigitalRuneSrtTransform Structure
Defines a transformation that scales, rotates and translates (SRT) an object.

Namespace: DigitalRune.Animation.Character
Assembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax
[SerializableAttribute]
public struct SrtTransform : IEquatable<SrtTransform>

The SrtTransform type exposes the following members.

Constructors
  NameDescription
Public methodSrtTransform(Matrix33F)
Initializes a new instance of the SrtTransform struct with the given rotation.
Public methodSrtTransform(QuaternionF)
Initializes a new instance of the SrtTransform struct with the given rotation.
Public methodSrtTransform(Matrix33F, Vector3F)
Initializes a new instance of the SrtTransform struct with the given rotation and translation.
Public methodSrtTransform(QuaternionF, Vector3F)
Initializes a new instance of the SrtTransform struct with the given rotation and translation.
Public methodSrtTransform(Vector3F, Matrix33F, Vector3F)
Initializes a new instance of the SrtTransform struct with the given scale, rotation and translation.
Public methodSrtTransform(Vector3F, QuaternionF, Vector3F)
Initializes a new instance of the SrtTransform struct with the given scale, rotation and translation.
Top
Methods
  NameDescription
Public methodStatic memberAreNumericallyEqual
Determines whether two SRT transforms are equal (within a numerical tolerance).
Public methodEquals(Object)
Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(SrtTransform)
Indicates whether the current object is equal to another object of the same type.
Public methodStatic memberFromMatrix(Matrix)
Creates an SrtTransform from a matrix that contains a scale, a rotation and a translation. (Only available in the XNA-compatible build.)
Public methodStatic memberFromMatrix(Matrix44F)
Creates an SrtTransform from a matrix that contains a scale, a rotation, and a translation.
Public methodStatic memberFromPose
Creates an SrtTransform from a Pose.
Public methodGetHashCode
Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberInterpolate(SrtTransform, SrtTransform, Single)
Interpolates two SRT transforms.
Public methodStatic memberInterpolate(SrtTransform, SrtTransform, Single, SrtTransform)
Interpolates two SRT transforms.
Public methodInvert
Inverts the SRT transform.
Public methodStatic memberIsValid
Determines whether the specified matrix is a valid SRT matrix.
Public methodStatic memberMultiply(SrtTransform, SrtTransform)
Multiplies two SRT transforms.
Public methodStatic memberMultiply(SrtTransform, Vector4F)
Multiplies an SrtTransform with a vector.
Public methodStatic memberMultiply(SrtTransform, SrtTransform, SrtTransform)
Multiplies two SRT transforms.
Public methodStatic memberMultiply(SrtTransform, SrtTransform, Matrix44F)
Multiplies two SRT transforms.
Public methodStatic memberMultiply(SrtTransform, SrtTransform, Matrix)
Multiplies two SRT transforms. (Only available in the XNA-compatible build.)
Public methodToLocalDirection
Converts a direction vector from parent space to local space.
Public methodToLocalPosition
Converts a position vector from parent space to local space.
Public methodToMatrix44F
Converts this SRT transform to a 4x4 transformation matrix.
Public methodToParentDirection
Converts a direction vector from local space to parent space.
Public methodToParentPosition
Converts a position vector from local space to parent space.
Public methodToPose
Creates a Pose from an SrtTransform (Scale will be ignored!).
Public methodToString
Returns the string representation of this SRT transform.
(Overrides ValueTypeToString.)
Public methodToString(IFormatProvider)
Returns the string representation of this SRT transform using the specified culture-specific format information.
Public methodToXna
Converts an SRT transform to a 4x4 transformation matrix (XNA Framework). (Only available in the XNA-compatible build.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Compares two SrtTransforms to determine whether they are the same.
Public operatorStatic member(SrtTransform to Pose)
Converts an SRT transform to a Pose. (Scale will be ignored!)
Public operatorStatic member(Pose to SrtTransform)
Converts a Pose to an SRT transform.
Public operatorStatic member(SrtTransform to Matrix44F)
Converts an SRT transform to a 4x4 transformation matrix.
Public operatorStatic member(SrtTransform to Matrix)
Converts a SRT transform to a 4x4 transformation matrix (XNA Framework). (Only available in the XNA-compatible build.)
Public operatorStatic memberInequality
Compares two SrtTransforms to determine whether they are the different.
Public operatorStatic memberMultiply(SrtTransform, SrtTransform)
Multiplies two SRT transforms.
Public operatorStatic memberMultiply(SrtTransform, Vector4F)
Multiplies an SrtTransform with a vector.
Top
Fields
  NameDescription
Public fieldStatic memberIdentity
An SRT transform with no scale, rotation and translation.
Public fieldRotation
The rotation.
Public fieldScale
The scale.
Public fieldTranslation
The translation.
Top
Properties
  NameDescription
Public propertyHasRotation
Gets a value indicating whether the rotation is not the default rotation. (Using a numerical tolerant comparison, see Numeric.)
Public propertyHasScale
Gets a value indicating whether the scale is not (1, 1, 1). (Using a numerical tolerant comparison, see Numeric.)
Public propertyHasTranslation
Gets a value indicating whether the translation is not 0. (Using a numerical tolerant comparison, see Numeric.)
Public propertyInverse
Gets the inverse of this SRT transform.
Top
Remarks

This type represents an affine transformation consisting of a scaling followed by a rotation followed by a translation. Shearing (skewing) is not supported, thus this transformation cannot be used to describe general affine transformations. The SrtTransform is very similar to the Pose type, but it adds a scale factor.

Non-uniform scalings require special attention: When multiplying two SRT matrices, the result can contain a shearing if a non-uniform scaling and a rotation is used. SRT transformations do not support shearing. It is recommended to use this type either only with uniform scalings, or with non-uniform scalings without rotations. It is allowed to set non-uniform scaling and a rotation, but multiplying this transform with other transforms may not give the expected results.

Important: Newly created SrtTransforms should be initialized with Identity. The default constructor of the struct initializes the scale vector and the rotation quaternion elements with 0 and therefore does not create a valid SRT transformation.

C#
// Do not use:
SrtTransform srt = new SrtTransform(); // Not a valid SrtTransform!

// Initialize with identity instead:
SrtTransform srt = SrtTransform.Identity;

See Also