code: public Quaterniond integrate(double dt, double vx, double vy, double vz, Quaterniond dest) {
          double thetaX = dt * vx * 0.5;
          double thetaY = dt * vy * 0.5;
          double thetaZ = dt * vz * 0.5;
          double thetaMagSq = thetaX * thetaX + thetaY * thetaY + thetaZ * thetaZ;
          double s;
          double dqX, dqY, dqZ, dqW;
          if (thetaMagSq * thetaMagSq / 24.0 < 1E-8) {
              dqW = 1.0 - thetaMagSq * 0.5;
              s = 1.0 - thetaMagSq / 6.0;
          } else {
              double thetaMag = Math.sqrt(thetaMagSq);
              double sin = Math.sin(thetaMag);
              s = sin / thetaMag;
              dqW = Math.cosFromSin(sin, thetaMag);
          }
          dqX = thetaX * s;
          dqY = thetaY * s;
          dqZ = thetaZ * s;
          /* Pre-multiplication */
          dest.set(dqW * x + dqX * w + dqY * z - dqZ * y,
                   dqW * y - dqX * z + dqY * w + dqZ * x,
                   dqW * z + dqX * y - dqY * x + dqZ * w,
                   dqW * w - dqX * x - dqY * y - dqZ * z);
          return dest;
      }
docs: /* (non-Javadoc)
  @see org.joml.Quaterniondc#integrate(double, double, double, double, org.joml.Quaterniond)