Getting rotation rate of actor component?
This question is a bit hard to explain what I'm running into, so bare with me if I don't describe it correctly!
I have an actor component that executes some functions based on the rate of change of rotation. Currently, to get this rate of change, I get the actors GetComponentRotation() to get the current rotation in world space, and then the next frame, I get it again and get the difference in the pitch/roll/yaw to determine the change in degrees per frame, which I can then divide by deltaTime to get change in degrees per second.
This works decently well until pitch approaches 90/-90. The problem here is that as pitch approaches this value, the roll value in the actor component's rotation starts to rise. My gyroscope implementation then sees this as a rotation of 20-30 degrees per frame, causing unintended behavior in the component. This is troublesome, because the actor, in its own reference frame, only changed pitch by 1 degree.
I'm pretty stumped on how to resolve this issue. For my implementation, I don't actually care what the pitch/roll/yaw values are, only the components change in reference to itself since last frame. Any ideas on pushing forward with this?
asked Mar 08 '16 at 03:29 PM in C++ Programming
This was finally resolved by using the component's FTransform:
These rates are now correct and in reference to the body-frame of the component
answered Mar 10 '16 at 01:17 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here