Advertisement
Guest User

Untitled

a guest
May 24th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. quat targetQuat = target->getOrientation();
  2. quat currentQuat = getOrientation();
  3.  
  4. quat lerpQuat = glm::lerp(currentQuat, targetQuat, 0.05f);
  5.  
  6. setOrientation(lerpQuat);
  7.  
  8. quat targetQuat = target->getOrientation();
  9. quat currentQuat = getOrientation();
  10.  
  11. quat lerpQuat = glm::lerp(currentQuat, targetQuat, 0.05f);
  12. quat maximumQuat = targetQuat*quat(0.707, 0, -0.3535, 0);
  13.  
  14. quat desiredQuat = min(lerpQuat, maximumQuat);
  15.  
  16. setOrientation(desiredQuat);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement