void accelerateWithX float float float Use double filtering for passed

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
- (void)accelerateWithX:(float)x Y:(float)y Z:(float)z
{
// Use double filtering for passed coords
acceleration[0] = x * kFilteringFactor + acceleration[0] * (1.0 - kFilteringFactor);
x = x - acceleration[0];
acceleration[1] = y * kFilteringFactor + acceleration[1] * (1.0 - kFilteringFactor);
y = y - acceleration[1];
acceleration[2] = z * kFilteringFactor + acceleration[2] * (1.0 - kFilteringFactor);
z = z - acceleration[2];
}