title: How to extract yaw pitch roll from glm::quat and glm::mat4
body: <p>Is it possible to extract the <strong>yaw</strong>, <strong>pitch</strong> and <strong>roll</strong> information from the <code>glm::mat4</code>? 
  (<em>That is a  world transformation matrix with the translation, rotation and scale already applied</em>) </p>
  
  <p>Here is some code that I'm experimenting with:</p>
  
  <pre><code>    float yawDeg = 0;
      float pitchDeg = 20;
      float rollDeg = 80;
  
      glm::mat4 transform = glm::eulerAngleYXZ(glm::radians(yawDeg), glm::radians(pitchDeg), glm::radians(rollDeg));
  
      glm::quat rotation(transform); // Is this a correct way?
   // glm::quat rotation(glm::quat_cast(transform)); // Gives the same results.
  
      printf("pitch: %f\n", glm::degrees(glm::pitch(rotation))); // Output:   3.616443
      printf("yaw:   %f\n", glm::degrees(glm::yaw(rotation)));   // Output: -19.683496
      printf("roll:  %f\n", glm::degrees(glm::roll(rotation)));  // Output:  79.372414
  </code></pre>
  
  <p>But I'm getting some strange results, here are some values:</p>
  
  <p><code>yawDeg=92, pitchDeg=0, rollDeg=0</code> results <code>yaw: 88.0, pitch: 180.0, roll: 180.0</code></p>
  
  <p><code>yawDeg=0, pitchDeg=92, rollDeg=0</code> results  <code>yaw: 0.0, pitch: 92.0, roll: 0.0</code> - Looks ok.</p>
  
  <p><code>yawDeg=0, pitchDeg=0, rollDeg=92</code> results  <code>yaw: 0.0, pitch: 0.0, roll: 92.0</code> - Looks ok.</p>
  
  <p><code>yawDeg=0, pitchDeg=10, rollDeg=92</code> results  <code>yaw: -9.993845, pitch: -0.352578, roll: 92.030830</code></p>
  
  <p>I think maybe my <code>glm::mat4</code> to <code>glm::quat</code> conversion is incorrect?</p>