Could someone please help me understand what data is stored in each of the vector components of the ‘get input motion state’ i.e in Tilt, Acceleration, Gravity, Rotation rate? As far as I know(please correct me if I am wrong!) they are rotation angles around each axis of the device’s ‘transform’ but I don’t know in which order. And why for example the ‘y’ component of Tilt always returns zero( at least when I was playing with it ) I would be glad if you guys explain this or point me to an article or even the relevant parts of the engine’s source code where I can examine it for myself
Tilt: Obviously to do with the current rotated position of the device.
Acceleration: The acceleration of the rotation.
Gravity: A unit(?) vector pointing in the direction of gravity.
I thought rotation rate was the same as acceleration, but perhaps it’s the velocity? I.e. acceleration might be zero at a point in time, but there could still be a velocity.
I was actually trying to figure it out by looking at the values and make sense of them. I think you’re right about the rotation rate, that it’s actually the velocity. But I still don’t understand why the second component of the Tilt is always zero. Shouldn’t it show the amount of rotation around the “y axis” on which I rotate my device and therefore spit out some values other than zero? Sorry I am just a beginner UE guy trying to understand how this works! I hope my questions are clear
Your questions are crystal clear. I haven’t got a lot of experience with mobile so I can’t comment on what the problem is.
Thinking about it however… how would the device know the absolute tilt of the device when turning it clockwise and anti-clockwise on a table for example. Perhaps it’s normal for that value to be zero and instead you can only rely on the other two axis of rotation?
I was once reading an article on how the browsers provide rotation info of mobile devices and I thought maybe UE provides the info in a similar way. Using that API you can actually get the rotation values around each “axis” of the device and then use it in your application. To make it clear here is the link to that article.