seon
August 4, 2009, 5:59am
1
I am trying to get a value for how fast a user has tiled a device… on a per axis basis.
I have looked at the PhoneAccelerationEvent but dont see how I can use it to do something like…
if the user has tilted on X axis more than 0.5 in less than 0.1 deltaTime then do something cool.
doing it with position is easy, but I just cant get my mind around implementing it on the accelerometer input.
Any ideas?
seon
August 5, 2009, 1:29am
2
Is it just the time of day I post these questions… or do I smell bad?
Anyone have an idea on this?
pete_1
August 5, 2009, 3:11am
3
well i can’t smell you but it is an odd time here.
not quite sure you’re exact goal but iPhoneInput might work better. something like the docs have here:
file:///Applications/Unity%20iPhone/Documentation/ScriptReference/iPhoneInput-accelerationEvents.html
from Input you can split up acceleration.x .y and manipulate the values with deltaTime etc.
hth…
seon
August 5, 2009, 6:30am
4
Hey Pete, already doing that… but it doesn’t give me a rate of change… I need to know how fast the change has happened…
rate of change = change over time
so to get the data you want, you will have to store the old accelerator data and the new one and react basing on the difference.
The accelerator can’t give you “acceleration of acceleration” data
People tend to forget that all the accelerator actually is measuring is acceleration, it does not measure orientation or speed.
seon
August 5, 2009, 6:41am
6
I understand I cant get accel of accel… but I was hoping for a deltaAccel atleast so I didn’t have to store previous and compare as I am dong now.
I actually don’t like that Unity creates any delta data.
They cost time to calculate and many don’t need them …