|
|
|
@ -143,12 +143,11 @@ public final class InputOverlayDrawableJoystick {
|
|
|
|
|
// Clamp the circle pad input to a circle
|
|
|
|
|
final float angle = (float) Math.atan2(AxisY, AxisX);
|
|
|
|
|
float radius = (float) Math.sqrt(AxisX * AxisX + AxisY * AxisY);
|
|
|
|
|
if(radius > 1.0f)
|
|
|
|
|
{
|
|
|
|
|
if (radius > 1.0f) {
|
|
|
|
|
radius = 1.0f;
|
|
|
|
|
}
|
|
|
|
|
axises[0] = ((float)Math.cos(angle) * radius);
|
|
|
|
|
axises[1] = ((float)Math.sin(angle) * radius);
|
|
|
|
|
axises[0] = ((float) Math.cos(angle) * radius);
|
|
|
|
|
axises[1] = ((float) Math.sin(angle) * radius);
|
|
|
|
|
SetInnerBounds();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|