summaryrefslogtreecommitdiff
path: root/indra/llui/llvirtualtrackball.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llvirtualtrackball.cpp')
-rw-r--r--indra/llui/llvirtualtrackball.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp
index 8166afc89b..273a1d7bde 100644
--- a/indra/llui/llvirtualtrackball.cpp
+++ b/indra/llui/llvirtualtrackball.cpp
@@ -217,19 +217,19 @@ void LLVirtualTrackball::draw()
S32 halfwidth = mTouchArea->getRect().getWidth() / 2;
S32 halfheight = mTouchArea->getRect().getHeight() / 2;
- draw_point.mV[VX] = (draw_point.mV[VX] + 1.0) * halfwidth + mTouchArea->getRect().mLeft;
- draw_point.mV[VY] = (draw_point.mV[VY] + 1.0) * halfheight + mTouchArea->getRect().mBottom;
+ draw_point.mV[VX] = (draw_point.mV[VX] + 1.0f) * halfwidth + mTouchArea->getRect().mLeft;
+ draw_point.mV[VY] = (draw_point.mV[VY] + 1.0f) * halfheight + mTouchArea->getRect().mBottom;
bool upper_hemisphere = (draw_point.mV[VZ] >= 0.f);
mImgSphere->draw(mTouchArea->getRect(), upper_hemisphere ? UI_VERTEX_COLOR : UI_VERTEX_COLOR % 0.5f);
- drawThumb(draw_point.mV[VX], draw_point.mV[VY], mThumbMode, upper_hemisphere);
+ drawThumb((S32)draw_point.mV[VX], (S32)draw_point.mV[VY], mThumbMode, upper_hemisphere);
if (LLView::sDebugRects)
{
gGL.color4fv(LLColor4::red.mV);
- gl_circle_2d(mTouchArea->getRect().getCenterX(), mTouchArea->getRect().getCenterY(), mImgSphere->getWidth() / 2, 60, false);
- gl_circle_2d(draw_point.mV[VX], draw_point.mV[VY], mImgSunFront->getWidth() / 2, 12, false);
+ gl_circle_2d((F32)mTouchArea->getRect().getCenterX(), (F32)mTouchArea->getRect().getCenterY(), (F32)mImgSphere->getWidth() / 2.f, 60, false);
+ gl_circle_2d(draw_point.mV[VX], draw_point.mV[VY], (F32)mImgSunFront->getWidth() / 2.f, 12, false);
}
// hide the direction labels when disabled
@@ -392,20 +392,20 @@ bool LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask)
{ // trackball (move to roll) mode
LLQuaternion delta;
- F32 rotX = x - mPrevX;
- F32 rotY = y - mPrevY;
+ F32 rotX = (F32)(x - mPrevX);
+ F32 rotY = (F32)(y - mPrevY);
if (abs(rotX) > 1)
{
- F32 direction = (rotX < 0) ? -1 : 1;
- delta.setAngleAxis(mIncrementMouse * abs(rotX), 0, direction, 0); // changing X - rotate around Y axis
+ F32 direction = (rotX < 0) ? -1.f : 1.f;
+ delta.setAngleAxis(mIncrementMouse * abs(rotX), 0.f, direction, 0.f); // changing X - rotate around Y axis
mValue *= delta;
}
if (abs(rotY) > 1)
{
- F32 direction = (rotY < 0) ? 1 : -1; // reverse for Y (value increases from bottom to top)
- delta.setAngleAxis(mIncrementMouse * abs(rotY), direction, 0, 0); // changing Y - rotate around X axis
+ F32 direction = (rotY < 0) ? 1.f : -1.f; // reverse for Y (value increases from bottom to top)
+ delta.setAngleAxis(mIncrementMouse * abs(rotY), direction, 0.f, 0.f); // changing Y - rotate around X axis
mValue *= delta;
}
}
@@ -416,10 +416,10 @@ bool LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask)
return true; // don't drag outside the circle
}
- F32 radius = mTouchArea->getRect().getWidth() / 2;
- F32 xx = x - mTouchArea->getRect().getCenterX();
- F32 yy = y - mTouchArea->getRect().getCenterY();
- F32 dist = sqrt(pow(xx, 2) + pow(yy, 2));
+ F32 radius = (F32)mTouchArea->getRect().getWidth() / 2.f;
+ F32 xx = (F32)(x - mTouchArea->getRect().getCenterX());
+ F32 yy = (F32)(y - mTouchArea->getRect().getCenterY());
+ F32 dist = (F32)(sqrt(pow(xx, 2) + pow(yy, 2)));
F32 azimuth = llclamp(acosf(xx / dist), 0.0f, F_PI);
F32 altitude = llclamp(acosf(dist / radius), 0.0f, F_PI_BY_TWO);