add support of Accelerometer sensor
This commit is contained in:
natural-law 2010-11-16 09:09:12 +00:00
parent c74e987af1
commit 10c6cd29f1
1 changed files with 2 additions and 2 deletions

View File

@ -65,8 +65,8 @@ void AccelerometerTest::didAccelerate(UIAcceleration* pAccelerationValue)
CGPoint ptNow = m_pBall->getPosition();
CGPoint ptTemp = pDir->convertToUI(ptNow);
ptTemp.x += pAccelerationValue->x * TG3_GRAVITY_EARTH;
ptTemp.y -= pAccelerationValue->y * TG3_GRAVITY_EARTH;
ptTemp.x += pAccelerationValue->x * 9.81f;
ptTemp.y -= pAccelerationValue->y * 9.81f;
CGPoint ptNext = pDir->convertToGL(ptTemp);
FIX_POS(ptNext.x, (ballSize.width / 2.0), (winSize.width - ballSize.width / 2.0));