diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-12-01 16:21:52 -0500 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-12-01 16:21:52 -0500 |
| commit | fe5ff3e74a69bb7ede65d7d5865325c0a771eca6 (patch) | |
| tree | fbc52c83af483daaa9586aaa8ec6527a478a2cdb /indra/newview/llmaniprotate.cpp | |
| parent | 38a258d04a98939e12bb2cfce6caea288a7fc3a5 (diff) | |
| parent | d960676c5af26b299166bdd74744a7f513b45541 (diff) | |
merge
Diffstat (limited to 'indra/newview/llmaniprotate.cpp')
| -rwxr-xr-x | indra/newview/llmaniprotate.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 7861573908..b2350e5a75 100755 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1240,10 +1240,10 @@ LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y ) F32 dist_from_sphere_center = sqrt(delta_x * delta_x + delta_y * delta_y); LLVector3 axis = mMouseDown % mMouseCur; + F32 angle = atan2(sqrtf(axis * axis), mMouseDown * mMouseCur); axis.normVec(); - F32 angle = acos(mMouseDown * mMouseCur); LLQuaternion sphere_rot( angle, axis ); - + if (is_approx_zero(1.f - mMouseDown * mMouseCur)) { return LLQuaternion::DEFAULT; @@ -1638,9 +1638,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) mInSnapRegime = FALSE; } - angle = acos(mMouseCur * mMouseDown); - - F32 dir = (mMouseDown % mMouseCur) * constraint_axis; // cross product + LLVector3 cross_product = mMouseDown % mMouseCur; + angle = atan2(sqrtf(cross_product * cross_product), mMouseCur * mMouseDown); + F32 dir = cross_product * constraint_axis; // cross product if( dir < 0.f ) { angle *= -1.f; |
