title: How to scale the rotation of a quaternion
body: <p>I am trying to do the equivalent of multiplying the velocity by the time between frames.  I would imagine that doing this for quaternions would be done by raising them to a power.  I have code to rotate an object based on my mouse movements.  It has a main loop running at one frame rate and a physics loop running at a fixed frame rate.  Here is the relevant part of the main loop:</p>
  
  <pre><code>glfwPollEvents();
  Input::update();
  window.clear(0,0,0,1);
  
  rigidBody.angularVelocity *= glm::angleAxis(0.001f * Input::deltaMouse().x, glm::vec3(0,1,0));
  rigidBody.angularVelocity *= glm::angleAxis(0.001f * Input::deltaMouse().y, glm::vec3(1,0,0));
  
  if(Input::getKey(Input::KEY_A))
  {
      rigidBody.velocity -= float(Time::getDelta()) * glm::vec3(1,0,0);
  }
  if(Input::getKey(Input::KEY_D))
  {
      rigidBody.velocity += float(Time::getDelta()) * glm::vec3(1,0,0);
  }
  if(Input::getKey(Input::KEY_W))
  {
      rigidBody.velocity -= float(Time::getDelta()) * glm::vec3(0,0,1);
  }
  if(Input::getKey(Input::KEY_S))
  {
      rigidBody.velocity += float(Time::getDelta()) * glm::vec3(0,0,1);
  }
  if(Input::getKey(Input::KEY_LCONTROL))
  {
      rigidBody.velocity -= float(Time::getDelta()) * glm::vec3(0,1,0);
  }
  if(Input::getKey(Input::KEY_LSHIFT))
  {
      rigidBody.velocity += float(Time::getDelta()) * glm::vec3(0,1,0);
  }
  </code></pre>
  
  <p>Here is the relevant part of the physics loop:</p>
  
  <pre><code>for(int i = 0; i &lt; *numRigidBodies; i++)
  {
      rigidBodies[i].transform-&gt;getPos() += rigidBodies[i].velocity;
      rigidBodies[i].transform-&gt;getRot() *= rigidBodies[i].angularVelocity;
  }
  rigidBodies[0].angularVelocity = glm::quat();
  rigidBodies[0].velocity = glm::vec3();
  </code></pre>
  
  <p>This works fine, but when I try raising angular velocity to a power with glm::pow, the object rotates randomly and does not follow my mouse.  I realize I could do this with a line of code like</p>
  
  <pre><code>rigidBodies[i].transform-&gt;getRot() *= glm::angleAxis((float)Time::getFixedDelta() * glm::angle(rigidBodies[i].angularVelocity), glm::axis(rigidBodies[i].angularVelocity));
  </code></pre>
  
  <p>but this seems needlessly complicated for the task.  What is causing this issue, and how can I fix it?</p>