setFromTranslationRotation method

void setFromTranslationRotation(
  1. Vector3 arg0,
  2. Quaternion arg1
)

Sets the matrix from translation arg0 and rotation arg1.

Implementation

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

  final 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;
}