3D Transformation. 3x4 matrix.
public struct Transform : IEquatable<Transform>

Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a Basis “basis” and an Vector3 “origin”. It is similar to a 3x4 matrix.

Constructors

public Transform(Vector3 xAxis, Vector3 yAxis, Vector3 zAxis, Vector3 origin)

Constructs the Transform from four Vector3. Each axis corresponds to local basis vectors (some of which may be scaled).

public Transform(Quat quat, Vector3 origin)

public Transform(Basis basis, Vector3 origin)

Constructs the Transform from a Basis and Vector3.

public Transform()

Fields

public Basis basis

The basis is a matrix containing 3 Vector3 as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.

public Vector3 origin

The translation offset of the transform.

Methods

public Transform AffineInverse()

Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation.

public override bool Equals(object obj)

public bool Equals(Transform other)

public override int GetHashCode()

public Transform Inverse()

Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling).

public Transform LookingAt(Vector3 target, Vector3 up)

Rotate the transform around the up vector to face the target.

public Transform Orthonormalized()

Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.

public Transform Rotated(Vector3 axis, float phi)

Rotates the transform around given axis by phi. The axis must be a normalized vector.

public Transform Scaled(Vector3 scale)

Scales the transform by the specified 3D scaling factors.

public void set_look_at(Vector3 eye, Vector3 target, Vector3 up)

public override string ToString()

public string ToString(string format)

public Transform Translated(Vector3 ofs)

Translates the transform by the specified offset.

public Vector3 Xform(Vector3 v)

public Vector3 XformInv(Vector3 v)

Operators

public static bool operator ==(Transform left, Transform right)

public static bool operator !=(Transform left, Transform right)

public static Transform operator *(Transform left, Transform right)
Tags: