transformDirection method

Vector3 transformDirection(
  1. Matrix4 m
)

Implementation

Vector3 transformDirection(Matrix4 m) {
  // input: three.Matrix4 affine matrix
  // vector interpreted as a direction

  var x = this.x, y = this.y, z = this.z;
  var e = m.elements;

  this.x = e[0] * x + e[4] * y + e[8] * z;
  this.y = e[1] * x + e[5] * y + e[9] * z;
  this.z = e[2] * x + e[6] * y + e[10] * z;

  return normalize();
}