Showing the changes to libraries/script-engine/src/EventTypes.cpp (1 of 1 file). Show all
Unified · Split
| @@ -343,36 +343,6 @@ TouchEvent::TouchEvent(const QTouchEvent& event, const TouchEvent& other) { · 342 unmodified lines | ||
| 343 | 343 | calculateMetaAttributes(other); |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | −#if 0 //////////////////////////////////////////////////////////////////////// | |
| 347 | − | |
| 348 | −-- returns the smallest angle between the two angles | |
| 349 | −-- ie: the difference between the two angles via the shortest distance | |
| 350 | −function smallestAngleDiff( target, source ) | |
| 351 | − local a = target - source | |
| 352 | − | |
| 353 | − if (a > 180) then | |
| 354 | − a = a - 360 | |
| 355 | − elseif (a < -180) then | |
| 356 | − a = a + 360 | |
| 357 | − end | |
| 358 | − | |
| 359 | − return a | |
| 360 | −end | |
| 361 | − | |
| 362 | −-- calculates rotation amount based on the average change in tracking point rotation | |
| 363 | −local function calcAverageRotation( points ) | |
| 364 | − | |
| 365 | − local total = 0 | |
| 366 | − for i=1, #points do | |
| 367 | − local point = points[i] | |
| 368 | − total = total + smallestAngleDiff( point.angle, point.prevAngle ) | |
| 369 | − end | |
| 370 | − | |
| 371 | − return total / #points | |
| 372 | −end | |
| 373 | − | |
| 374 | −#endif //////////////////////////////////////////////////////////////////////// | |
| 375 | − | |
| 376 | 346 | // returns the degrees between two points (note: 0 degrees is 'east') |
| 377 | 347 | float angleBetweenPoints(const glm::vec2& a, const glm::vec2& b ) { |
| 378 | 348 | glm::vec2 length = b - a; |