Hi, I upgraded to cocos2d-1.0.1-x-0.9.2 (from cocos2d-1.0.1-x-0.9.1) and I found out, that axis of accelerometer has different orientations than in previous version of cocos.
I tested it on iphone and ipad.
It looks that status bar orientation isn’t updated properly, because when I changed axis according to
Well, I will be more talkative.
I develop a minigame that uses accelerometer.
When I upgraded to version 0.9.2 it stopped working properly.
Values that I receive in function void CFishingMiniGame::didAccelerate(CCAcceleration* pAccelerationValue) are different than values in version of cocos 0.9.1.
Axis of that CCAcceleration* pAccelerationValue were mixed.
When I applied transformation that is written in function (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
…
case UIInterfaceOrientationLandscapeRight:
acceleration_->x = -acceleration_->y;
acceleration_->y = tmp;
break;
and
case UIInterfaceOrientationLandscapeLeft:
acceleration_->x = acceleration_->y;
acceleration_->y = -tmp;
break;
(I support only landscape orientation of this game), game started to work properly again.
Therefore I deduced that this code in function (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
didn’t perform this transformation.
Why? Probably because of statusBarOrientation isn’t set properly. - But it is only my deduction.
Oh, because we translate the axis according the orientation, then the developer don’t have to care about it.
Did your code written in 0.9.1 doing the translating by your self?
If so, I think you can delete the codes and use the axis dispatched from engine, because it is done by engine.
Oh, because we translate the axis according the orientation, then the developer don’t have to care about it.
Did your code written in 0.9.1 doing the translating by your self?
If so, I think you can delete the codes and use the axis dispatched from engine, because it is done by engine.
Now the axis of your codes is:
Engine translate the axis according the orientation.
Your code translate the axis to original value(the coordinate direction is not changed though the orientation changed).
Your code translate axis according the orientation.