Closed ifero closed 9 years ago
This is something generally interesting so it should end up in code in the plugin. But first I'm working on coregistration with the Oculus Rift DK2 HMD.
In the meantime, you can try something like the following:
If you do try this out, I'd like to know what worked for you. It'll make it faster for me to put it into the plugin. (Edited to use yaw only)
Ok, it was my idea from the beginning. I was just curiose to know if you had already implemented it.
Tomorrow I'll work on it and I'll let you know
Thanks man
I should add that you probably don't really want to reset the full orientation. You probably just want to reset the Yaw. I edited the above description to use Yaws. Breaking a Rotator out into Euler angles will lead to singularities, so really this should be done in code with the quaternions. In fact, I think I will implement this in the psmoveapi.
I've created a UFUNCTION in my character c++ class, It work like a charm for resetting FRotator.Yaw
FRotator setPSMoveRotationWithOffset (FRotator PSMoveRotation, float yawOffset) { if (yawOffset > 0) { if (PSMoveRotation.Yaw >= (-180 + yawOffset)) { PSMoveRotation.Yaw -= yawOffset; } else { PSMoveRotation.Yaw = 360 - yawOffset + PSMoveRotation.Yaw; } } else { if (PSMoveRotation.Yaw <= (180 + yawOffset)) { PSMoveRotation.Yaw -= yawOffset; } else { PSMoveRotation.Yaw = -360 - yawOffset + PSMoveRotation.Yaw; } } return PSMoveRotation; }
However it could be nice to receive also the data of the quaternion and not only the rotator.
I would like to help you improving the code, I'll contact you by mail one of this days
From my searches through AnswerHub and the Unreal Engine forums, it seems Epic purposely does not want Quaternions exposed to Blueprints. I agree I would like access to the Quaternions in Blueprints too. It would have made it much easier to figure out commit 683bf04b218e14e2657bc71564c8dadb5407d51d.
Hey,
I was curiose to know if did you thought about a function that reset orientation and position in blueprint instead of only getting the data.
Thanks
Andrea