Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use negative value of acc.z #2231

merged 1 commit into from Mar 7, 2020


Copy link

@PatriceJiang PatriceJiang commented Mar 5, 2020

ref cocos/2d-tasks#2532

Android 重力感应 acc.z 和 iOS 中的同一值相反

minggo approved these changes Mar 5, 2020
Copy link

jareguo commented Mar 7, 2020

我不知道这三个朝向是如何定义的。但从 Creator 开发者的角度考虑,以右手坐标系算的话,如果手机屏幕正面就是手机的正面。听筒指向手机的 Y 轴。手机平放在桌面上时,重力朝向手机的背面,那么获得的 z 确实应该是负的,所以应该是以 iOS 为准。

@jareguo jareguo merged commit 73f51d2 into cocos:v2.4.0 Mar 7, 2020
1 check passed
@PatriceJiang PatriceJiang deleted the v2.3.2-fix-acc.z branch Jun 15, 2020
PatriceJiang added a commit to PatriceJiang/cocos2d-x-lite that referenced this issue Sep 30, 2020
minggo pushed a commit that referenced this issue Sep 30, 2020
* use negative value of acc.z #2231

* fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants