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 double len = axis.length;
  if (len == 0.0) {
    return;
  }
  final double halfSin = math.sin(radians * 0.5) / len;
  final Float64List 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);
}