Showing the changes to libraries/script-engine/src/EventTypes.cpp (1 of 51 files). Show all
Unified · Split
| @@ -387,11 +387,10 @@ TouchEvent::TouchEvent(const QTouchEvent& event, const TouchEvent& other) { · 386 unmodified lines | ||
| 387 | 387 | calculateMetaAttributes(other); |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | −// returns the degrees between two points (note: 0 degrees is 'east') | |
| 390 | +// returns the angle (in degrees) between two points (note: 0 degrees is 'east') | |
| 391 | 391 | float angleBetweenPoints(const glm::vec2& a, const glm::vec2& b ) { |
| 392 | 392 | glm::vec2 length = b - a; |
| 393 | − float radian = std::atan2(length.y, length.x); | |
| 394 | − float angle = radian * 180.0f / PIE; | |
| 393 | + float angle = DEGREES_PER_RADIAN * std::atan2(length.y, length.x); | |
| 395 | 394 | if (angle < 0) { |
| 396 | 395 | angle += 360.0f; |
| 397 | 396 | }; |