fromVector3ToVector3 static method

Returns the shortest-arc quaternion rotating from to to.

Implementation

static QuaternionBase fromVector3ToVector3(Vector3Base from, Vector3Base to) {
  final cross = from.crossProduct(to);
  return createFactory(
    cross.x,
    cross.y,
    cross.z,
    1.0 + from.dotProduct(to),
  ).normalize() as QuaternionBase;
}