开发者

Force Calculate using UIAcceleration values in iphone

开发者 https://www.devze.com 2023-01-01 15:27 出处:网络
How to calculate force value of iphone using UIAcceleration values.... Can anyone help me? What i want is ? When user moves slowly from one regionto ot开发者_如何转开发heri want to do some taskor th

How to calculate force value of iphone using UIAcceleration values....

Can anyone help me?

What i want is ? When user moves slowly from one region to ot开发者_如何转开发her i want to do some task or they move faster i want to do some other task ....

Can anyone help me ?

Thanks in advance.....


force creates acceleration. if you're really looking for force, you need to account for the mass of the iphone. but I'm just being pedantic here :)

so you want to accomplish different actions based on the acceleration?

what you'll need to do is register yourself as a delegate of UIAccelerator. whenever didAccelerate fires off, it'll give you the [x,y,z] and the timestamp of the event.

so if you care about the X direction, the x property will have the acceleration in gravities (i.e. 1 = 9.8 meters per seconds squared).

you'll need gyroscopes for any more (orientation, etc).

source: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIAcceleration_Class/Reference/UIAcceleration.html

0

精彩评论

暂无评论...
验证码 换一张
取 消