setAxisAngle method

void setAxisAngle(
  1. Vector3 axis,
  2. double radians
)

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