| 705 | } |
| 706 | |
| 707 | double JoyControlStick::getNormalizedAbsoluteDistance() |
| 708 | { |
| 709 | int axis1Value = axisX->getCurrentRawValue(); |
| 710 | int axis2Value = axisY->getCurrentRawValue(); |
| 711 | |
| 712 | int square_dist = (axis1Value * axis1Value) + (axis2Value * axis2Value); |
| 713 | |
| 714 | double distance = sqrt(square_dist) / static_cast<double>(maxZone); |
| 715 | |
| 716 | if (distance > 1.0) |
| 717 | distance = 1.0; |
| 718 | else if (distance < 0.0) |
| 719 | distance = 0.0; |
| 720 | |
| 721 | return distance; |
| 722 | } |
| 723 | |
| 724 | double JoyControlStick::getRadialDistance(int axisXValue, int axisYValue) |
| 725 | { |
nothing calls this directly
no test coverage detected