コード例 #1
0
 @Override
 public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) {
   final Vector2 gravity =
       Vector2Pool.obtain(pAccelerometerData.getX(), pAccelerometerData.getY());
   this.mPhysicsWorld.setGravity(gravity);
   Vector2Pool.recycle(gravity);
 }
コード例 #2
0
 @Override
 public void onAccelerometerChanged(final AccelerometerData pAccelerometerData) {
   mTempVector.set(pAccelerometerData.getY(), pAccelerometerData.getX());
   mPhysicsWorld.setGravity(mTempVector);
 }