rotateTowards method

Quaternion rotateTowards(
  1. Quaternion q,
  2. double step
)

Implementation

Quaternion rotateTowards(Quaternion q, double step) {
  var angle = angleTo(q);

  if (angle == 0) return this;

  var t = Math.min(1, step / angle);

  slerp(q, t);

  return this;
}