| 46 | } |
| 47 | |
| 48 | void DirectionSelector::SetSnapPoints(int newSnapPointEffectRadius, int points, float maxMagnitude) |
| 49 | { |
| 50 | snapPointEffectRadius = newSnapPointEffectRadius; |
| 51 | snapPoints.clear(); |
| 52 | snapPoints.push_back(GravityValueToValue(0, 0)); |
| 53 | for (int i = 1; i < points; i++) |
| 54 | { |
| 55 | auto dist = i / float(points - 1) * maxMagnitude; |
| 56 | snapPoints.push_back(GravityValueToValue( dist, 0)); |
| 57 | snapPoints.push_back(GravityValueToValue( 0, dist)); |
| 58 | snapPoints.push_back(GravityValueToValue(-dist, 0)); |
| 59 | snapPoints.push_back(GravityValueToValue( 0, -dist)); |
| 60 | } |
| 61 | useSnapPoints = true; |
| 62 | } |
| 63 | |
| 64 | void DirectionSelector::ClearSnapPoints() |
| 65 | { |
no test coverage detected