Merge pull request #3710 from Dhilan007/develop

restore AccelerometerTest
This commit is contained in:
James Chen 2013-09-19 07:20:23 -07:00
commit dadf6b3d0b
2 changed files with 3 additions and 3 deletions

View File

@ -598,7 +598,7 @@ void android_main(struct android_app* state) {
// ACONFIGURATION_ORIENTATION_PORT
// ACONFIGURATION_ORIENTATION_SQUARE
cocos2d::Acceleration acc;
acc.x = event.acceleration.x/10;
acc.x = -event.acceleration.x/10;
acc.y = -event.acceleration.y/10;
acc.z = event.acceleration.z/10;
acc.timestamp = 0;
@ -609,7 +609,7 @@ void android_main(struct android_app* state) {
// ACONFIGURATION_ORIENTATION_LAND
// swap x and y parameters
cocos2d::Acceleration acc;
acc.x = -event.acceleration.y/10;
acc.x = event.acceleration.y/10;
acc.y = -event.acceleration.x/10;
acc.z = event.acceleration.z/10;
acc.timestamp = 0;

View File

@ -69,7 +69,7 @@ void AccelerometerTest::onAcceleration(Acceleration* acc, Event* event)
auto ptNow = _ball->getPosition();
auto ptTemp = pDir->convertToUI(ptNow);
ptTemp.x -= acc->x * 9.81f;
ptTemp.x += acc->x * 9.81f;
ptTemp.y -= acc->y * 9.81f;
auto ptNext = pDir->convertToGL(ptTemp);