TransformExtensionMethods

public static class TransformExtensionMethods

Methods

IsCorrect

#Example
Test whether this transform genuinely converts one point into another.
public static bool IsCorrect(
this Transform
transform,
Transform to test.
a,
First point.
b,
Suggested location of a once the transformation is applied.
tolerance
Acceptable coincidence tolerance between transformed points.
)
True if all the 'a' points transform onto all the 'b' points within tolerance.

IsQuaternion

#Example
Test whether a specific transform is actually a quaternion in disguise.
public static bool IsQuaternion(
this Transform
transform
)

IsRotation

#Example
Gets whether this transformation matrix represents a rotation about a custom axis.
public static bool IsRotation(
this Transform
transform,
Transform to examine.
out Line
axis,
Rotation axis.
out Angle
angle
Rotation angle.
)
True if the transform represents a rotation.

IsTranslation

#Example
Gets whether this transformation matrix represents only a translation.
public static bool IsTranslation(
this Transform
transform,
Transform to examine.
translation
Translation vector.
)
True if the transform is only a translation.

ToQuaternion

#Example
Convert a Transform into a Quaternion. This is only possible if the transform has been created by the ToTransform(Quaternion) method.
public static Quaternion ToQuaternion(
this Transform
transform
Transform to convert.
)
Quaternion.

ToTransform

#Example
Convert a Quaternion into a Transform which contains the quaternion coefficients. Note that the resulting transform is not valid as such, it merely functions as a way to store quaternion data without the need of the quaternion type.
public static Transform ToTransform(
quaternion
)

ToTransform

#Example
Returns either the transform as is, or, if the transform represents a quaternion, the transform which mimics that quaternion.
public static Transform ToTransform(
this Transform
transform
)