Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. diff -r f747bb29e454 indra/newview/llmaniprotate.cpp
  2. --- a/indra/newview/llmaniprotate.cpp Mon Aug 18 14:36:17 2014 -0400
  3. +++ b/indra/newview/llmaniprotate.cpp Wed Aug 20 19:29:53 2014 +0100
  4. @@ -1239,12 +1239,12 @@
  5.  
  6. F32 dist_from_sphere_center = sqrt(delta_x * delta_x + delta_y * delta_y);
  7.  
  8. - LLVector3 axis = mMouseDown % mMouseCur;
  9. - axis.normVec();
  10. - F32 angle = acos(mMouseDown * mMouseCur);
  11. - LLQuaternion sphere_rot( angle, axis );
  12. -
  13. - if (is_approx_zero(1.f - mMouseDown * mMouseCur))
  14. + LLVector3 axis = mMouseDown % mMouseCur;
  15. + axis.normVec();
  16. + F32 angle = atan2(sqrtf(axis * axis), mMouseDown * mMouseCur);
  17. + LLQuaternion sphere_rot( angle, axis );
  18. +
  19. + if (is_approx_zero(1.f - mMouseDown * mMouseCur))
  20. {
  21. return LLQuaternion::DEFAULT;
  22. }
  23. @@ -1638,9 +1638,9 @@
  24. mInSnapRegime = FALSE;
  25. }
  26.  
  27. - angle = acos(mMouseCur * mMouseDown);
  28. -
  29. - F32 dir = (mMouseDown % mMouseCur) * constraint_axis; // cross product
  30. + LLVector3 cross_product = mMouseDown % mMouseCur;
  31. + angle = atan2(sqrtf(cross_product * cross_product), mMouseCur * mMouseDown);
  32. + F32 dir = cross_product * constraint_axis; // cross product
  33. if( dir < 0.f )
  34. {
  35. angle *= -1.f;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement