operator * method
this rotated by other
.
Implementation
Quaternion operator *(Quaternion other) {
final w = _qStorage[3];
final z = _qStorage[2];
final y = _qStorage[1];
final x = _qStorage[0];
final otherStorage = other._qStorage;
final ow = otherStorage[3];
final oz = otherStorage[2];
final oy = otherStorage[1];
final ox = otherStorage[0];
return Quaternion(
w * ox + x * ow + y * oz - z * oy,
w * oy + y * ow + z * ox - x * oz,
w * oz + z * ow + x * oy - y * ox,
w * ow - x * ox - y * oy - z * oz);
}