setAxisAngle method
Set the quaternion with rotation of radians
around axis
.
Implementation
void setAxisAngle(Vector3 axis, double radians) {
final len = axis.length;
if (len == 0.0) {
return;
}
final halfSin = math.sin(radians * 0.5) / len;
final axisStorage = axis.storage;
_qStorage[0] = axisStorage[0] * halfSin;
_qStorage[1] = axisStorage[1] * halfSin;
_qStorage[2] = axisStorage[2] * halfSin;
_qStorage[3] = math.cos(radians * 0.5);
}