From 10c6cd29f12418a33e36ecb25b52045a98dfe425 Mon Sep 17 00:00:00 2001 From: natural-law Date: Tue, 16 Nov 2010 09:09:12 +0000 Subject: [PATCH] issue #189 add support of Accelerometer sensor --- tests/tests/AccelerometerTest/AccelerometerTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tests/AccelerometerTest/AccelerometerTest.cpp b/tests/tests/AccelerometerTest/AccelerometerTest.cpp index a1f4f05447..90586fe2ef 100644 --- a/tests/tests/AccelerometerTest/AccelerometerTest.cpp +++ b/tests/tests/AccelerometerTest/AccelerometerTest.cpp @@ -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));