Class Transform

Represents the values in a 4x4 transform matrix.

Hierarchy

  • Transform

Constructors

  • Create a new matrix from an array of 16 values.

    Parameters

    • m: Array16Number

      Value to assign to the matrix using [n11, n21, n31, n41, n12, n22, n32, n42, n13, n23, n33, n43, n14, n24, n34, n44] format.

    Returns Transform

Properties

Accessors

  • get Determinant(): number
  • The determinant of this 4x4 matrix.

    Returns number

  • get IsIdentity(): boolean
  • Return true if this Transform is the identity transform

    Returns boolean

  • get IsZeroTransformation(): boolean
  • True if all values are 0, except for M33 which is 1.

    Returns boolean

  • get Identity(): Transform
  • Gets a new identity transform matrix. An identity matrix defines no transformation.

    Returns Transform

  • get ZeroTransformation(): Transform
  • ZeroTransformation diagonal = (0,0,0,1)

    Returns Transform

Methods

  • Returns a copy of the transform.

    Returns Transform

  • Determines if another transform equals this transform value.

    Parameters

    Returns boolean

  • Multiplies (combines) two transformations.

    Returns

    The result of the multiplication.

    Parameters

    Returns Transform

  • Multiplies a transformation by a scalar.

    Returns

    The result of the multiplication.

    Parameters

    • scalar: number

      The scalar.

    Returns Transform

  • Transpose the matrix and return a new one.

    Returns Transform

  • Attempts to get the inverse transform of this transform.

    Returns null | Transform

  • override toString

    Returns string

  • Constructs a new transform by combining given transforms in order Note: as transforms multiplication is not commutative, the order matters. If none given, identity transform is returned.

    Returns

    The combined transform.

    Parameters

    • transforms: Transform[]

      The transforms array.

    Returns Transform

  • Constructs a new Mirror transformation.

    Returns

    A transformation matrix which mirrors geometry in a specified plane.

    Parameters

    • plane: Plane

      Plane that defines the mirror orientation and position.

    Returns Transform

  • Multiplies a transformation by a scalar.

    Returns

    The result of the multiplication.

    Parameters

    • a: Transform

      The transform.

    • s: number

      The scalar.

    Returns Transform

  • Constructs a projection transformation.

    Returns

    A transformation matrix which projects geometry onto a specified plane.

    Parameters

    • plane: Plane

      Plane onto which everything will be perpendicularly projected.

    Returns Transform

  • Create a transformation that orients plane0 to plane1. If you want to orient objects from one plane to another, use this form of transformation.

    Returns

    A transformation matrix which orients from fromPlane to toPlane

    Parameters

    • fromPlane: Plane

      The plane to orient from.

    • toPlane: Plane

      the plane to orient to.

    Returns Transform

  • Constructs a new rotation transformation with specified angle and rotation axis. This function assume the rotation origin is the world origin.

    Parameters

    • angle: number

      Angle (in Radians) of the rotation.

    • axis: Vector3d

      The axis to ratate around

    Returns Transform

  • Constructs a new rotation transformation with specified angle and rotation axis.

    Parameters

    • angle: number

      Angle (in Radians) of the rotation.

    • rotationAxis: Vector3d = Vector3d.ZAxis

      The axis to ratate around, default Vector3D.ZAxis

    • rotationCenter: Point3d = Point3d.Origin

      The center of the rotation, default (0,0,0).

    Returns Transform

  • Constructs a new rotation transformation that rotates around X axis. this is also called "roll"

    Parameters

    • angle: number

      Angle (in Radians) of the rotation.

    Returns Transform

  • Constructs a new rotation transformation that rotates around Y axis. this is also called "pitch"

    Parameters

    • angle: number

      Angle (in Radians) of the rotation.

    Returns Transform

  • Constructs a new rotation transformation that rotates around Z axis. this is also called "yaw"

    Parameters

    • angle: number

      Angle (in Radians) of the rotation.

    Returns Transform

  • Create rotation transformation From ZYX angles.

    Parameters

    • z: number

      Yaw: Angle in radians to rotate around Z axis.

    • y: number

      Pitch: Angle in radians to rotate around Y axis.

    • x: number

      Roll: Angle in radians to rotate around X axis.

    Returns Transform

  • Constructs a new uniform scaling transformation with a specified scaling anchor point.

    Returns

    The scaled transform

    Parameters

    • location: Point3d

      The location to scale from

    • scalar: number

      The scaling factor

    Returns Transform

  • Constructs a new uniform scaling transformation. a sacle matrix looks like [ sx 0 0 0] [ 0 sy 0 0] [ 0 0 sz 0] [ 0 0 0 1]

    Returns

    The scaled transform

    Parameters

    • sx: number

      The scaling factor in the x dimension

    • sy: number

      The scaling factor in the y dimension

    • sz: number

      The scaling factor in the z dimension

    Returns Transform

  • Constructs a new translation (move) transformation. a translation matrix looks like [ 1 0 0 tx] [ 0 1 0 ty] [ 0 0 1 tz] [ 0 0 0 1]

    Returns

    The translated transform

    Parameters

    Returns Transform

  • Constructs a rotation transformation that rotates one vecor to another

    Returns

    A rotation matrix which rotates fromVector to toVector

    Parameters

    Returns Transform

Generated using TypeDoc