operator * method Null safety
- Quaternion other
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);
}