setFromTranslationRotation method

void setFromTranslationRotation (Vector3 arg0, Quaternion arg1)

Sets the matrix from translation arg0 and rotation arg1.

Implementation

void setFromTranslationRotation(Vector3 arg0, Quaternion arg1) {
  final Float64List arg1Storage = arg1._qStorage;
  final double x = arg1Storage[0];
  final double y = arg1Storage[1];
  final double z = arg1Storage[2];
  final double w = arg1Storage[3];
  final double x2 = x + x;
  final double y2 = y + y;
  final double z2 = z + z;
  final double xx = x * x2;
  final double xy = x * y2;
  final double xz = x * z2;
  final double yy = y * y2;
  final double yz = y * z2;
  final double zz = z * z2;
  final double wx = w * x2;
  final double wy = w * y2;
  final double wz = w * z2;

  final Float64List arg0Storage = arg0._v3storage;
  _m4storage[0] = 1.0 - (yy + zz);
  _m4storage[1] = xy + wz;
  _m4storage[2] = xz - wy;
  _m4storage[3] = 0.0;
  _m4storage[4] = xy - wz;
  _m4storage[5] = 1.0 - (xx + zz);
  _m4storage[6] = yz + wx;
  _m4storage[7] = 0.0;
  _m4storage[8] = xz + wy;
  _m4storage[9] = yz - wx;
  _m4storage[10] = 1.0 - (xx + yy);
  _m4storage[11] = 0.0;
  _m4storage[12] = arg0Storage[0];
  _m4storage[13] = arg0Storage[1];
  _m4storage[14] = arg0Storage[2];
  _m4storage[15] = 1.0;
}