rotateTowards method

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

Implementation

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

  if (angle == 0) return this;

  final t = math.min<double>(1, step / angle);

  slerp(q, t);

  return this;
}