我是 WP7 开发新手,正在开发一个项目(wp7 应用程序),我只需要使用加速 API 获得重力(我想我可以使用 Motion Api 做一些事情),但它需要窗口手机来支持指南针那么有什么方法可以将重力与加速度分开,或者仅使用加速度来获取 X、Y 和 Z 轴上的重力(因为我希望我的应用程序在没有指南针和陀螺仪的 wp 设备上运行)。
在android中还有一些方法,比如
- 线性加速度
- 低通/高通滤波器等 Wp7有这样的支持吗?
谢谢
最佳答案
手机本身并不知道什么力是由加速度引起的,什么是重力引起的。您需要来自其他传感器的信息才能进行数学运算以分离值。这就是 Motion API 的用途。
因此,您唯一的机会就是使用 Motion API。如果设备没有必要的传感器,它会优雅地掉落,但如果有:
The Motion API used by this sample requires all of the supported Windows Phone sensors, and therefore these sample applications will fail gracefully but will not work properly on devices without the necessary sensors or on the device emulator.
关于windows-phone-7 - 在 Wp7 中将重力与加速度分开(仅使用加速度 Api),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11794067/