Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace TransformationDelta

Index

Variables

ALMOST_ONE: 0.9999 = 0.9999

Functions

  • calculateOrthogonalCoordinate(norm: Vector3): Vector3.Vector3
  • For any single normal vector, there are an infinite number of potential orthogonal vectors. This function will calculate a single vector evaluating the length of two candidates, and picking the one with the higher squared magnitude

    Parameters

    • norm: Vector3

    Returns Vector3.Vector3

  • computeRotationMatrix(normal1: Vector3, normal2: Vector3): Matrix4.Matrix4
  • Computes the rotation matrix for two normals. If both normals are neither parallel or anti-parallel, this will compute the rotation matrix delta based on the angle from both normals. If the normals are anti-parallel, the identity matrix will be returned, as no rotation is necessary in this case. If the normals are parallel, an axis direction based on a chosen orthogonal vector will be used to compute the rotation matrix to rotate the plane 180 degrees.

    Parameters

    • normal1: Vector3
    • normal2: Vector3

    Returns Matrix4.Matrix4

    an anti-parallel rotation Matrix4 betwen the given normals

  • computeTransformationDelta(normal1: Vector3, position1: Vector3, normal2: Vector3, position2: Vector3): Matrix4.Matrix4
  • Computes the translation & rotation matrix delta between two world positions and two normals. such that the computed translation matrix will be the delta between position 1 and position 2, and the rotation will be rotated to be anti-parallel.

    Parameters

    • normal1: Vector3
    • position1: Vector3
    • normal2: Vector3
    • position2: Vector3

    Returns Matrix4.Matrix4

    Matrix4 translation matrix delta from position1 to position2 & an anti-parallel rotation delta.