summary refs log tree commit diff stats
path: root/Classes/Cart.m
diff options
context:
space:
mode:
Diffstat (limited to 'Classes/Cart.m')
-rw-r--r--Classes/Cart.m13
1 files changed, 6 insertions, 7 deletions
diff --git a/Classes/Cart.m b/Classes/Cart.m index 979226b..f9da181 100644 --- a/Classes/Cart.m +++ b/Classes/Cart.m
@@ -62,15 +62,14 @@
62 } 62 }
63} 63}
64 64
65- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration 65#define kFilterFactor 0.05f
66
67- (void)deviceDidRotate:(double)pitch
66{ 68{
67 static float prevY=0; 69 static float prevY=0;
68 70 float accelY = -((float) pitch * kFilterFactor + (1- kFilterFactor)*prevY);
69#define kFilterFactor 0.05f 71
70 72 prevY = accelY;
71 float accelY = -((float) acceleration.y * kFilterFactor + (1- kFilterFactor)*prevY);
72
73 prevY = accelY;
74 accelX = accelY * 750; 73 accelX = accelY * 750;
75} 74}
76 75