gpt4 book ai didi

android - 传感器_延迟_游戏 : how much is it?

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:32:43 28 4
gpt4 key购买 nike

我正在开发一款游戏,我需要同步两个玩家对象控制机制:一个是屏幕触摸 Controller ,另一个是 G-Sensor。屏幕 Controller 必须以秒为单位进行初始化,所以我需要知道 SENSOR_DELAY_GAME 是多少秒。提前致谢。

最佳答案

取自http://developer.android.com/guide/topics/sensors/sensors_overview.html

The default data delay is suitable for monitoring typical screen orientation changes and uses a delay of 200,000 microseconds. You can specify other data delays, such as SENSOR_DELAY_GAME (20,000 microsecond delay), SENSOR_DELAY_UI (60,000 microsecond delay), or SENSOR_DELAY_FASTEST (0 microsecond delay). As of Android 3.0 (API Level 11) you can also specify the delay as an absolute value (in microseconds).

The delay that you specify is only a suggested delay. The Android system and other applications can alter this delay. As a best practice, you should specify the largest delay that you can because the system typically uses a smaller delay than the one you specify (that is, you should choose the slowest sampling rate that still meets the needs of your application). Using a larger delay imposes a lower load on the processor and therefore uses less power.

关于android - 传感器_延迟_游戏 : how much is it?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11685400/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com