|
@@ -1,7 +1,7 @@
|
|
|
#!/usr/bin/env python
|
|
#!/usr/bin/env python
|
|
|
from events import TapEvent, FlickEvent, RotateEvent, PinchEvent, PanEvent
|
|
from events import TapEvent, FlickEvent, RotateEvent, PinchEvent, PanEvent
|
|
|
import time
|
|
import time
|
|
|
-from math import atan2, PI
|
|
|
|
|
|
|
+from math import atan2, pi
|
|
|
from threading import Thread
|
|
from threading import Thread
|
|
|
from OSC import OSCServer
|
|
from OSC import OSCServer
|
|
|
|
|
|
|
@@ -137,11 +137,11 @@ class MultiTouchListener(object):
|
|
|
p.set_angle(atan2(p.y - cy, p.x - cx))
|
|
p.set_angle(atan2(p.y - cy, p.x - cx))
|
|
|
da = p.angle_diff()
|
|
da = p.angle_diff()
|
|
|
|
|
|
|
|
- # Assert that angle is in [-PI, PI]
|
|
|
|
|
- if da > PI:
|
|
|
|
|
- da -= 2 * PI
|
|
|
|
|
- elif da < PI:
|
|
|
|
|
- da += 2 * PI
|
|
|
|
|
|
|
+ # Assert that angle is in [-pi, pi]
|
|
|
|
|
+ if da > pi:
|
|
|
|
|
+ da -= 2 * pi
|
|
|
|
|
+ elif da < pi:
|
|
|
|
|
+ da += 2 * pi
|
|
|
|
|
|
|
|
rotation += da
|
|
rotation += da
|
|
|
|
|
|