-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlays in world space are in wrong position when going from Standing to Seated Tracking Space #830
Comments
Most likely a duplicate of #790. |
I guess it's the same issue, but there's no way to apply that fix to my case. My case is that an overlay gets placed in Unity's world space. Then the switch from Standing to Seated occurs moving the Tracking Universe's Origin to the Seated Zero Pose, but not affecting the Unity's coordinate system. From then on, even if I create a new overlay the position remains incorrect as the coordinate systems aren't aligned anymore. This is what I tried in the script that that creates and places a new overlay: GameObject overlay = new GameObject();
/* add Overlay component to gameobject and what not */
/* overlay.transform.pos = arbitrary location*/
if(OpenVR.Compositor.GetTrackingSpace() == ETrackingUniverseOrigin.TrackingUniverseSeated) {
SteamVR_Utils.RigidTransform overlayRT = new SteamVR_Utils.RigidTransform(overlay.transform);
SteamVR_Utils.RigidTransform seated2StandingRT = new SteamVR_Utils.RigidTransform(OpenVR.System.GetSeatedZeroPoseToStandingAbsoluteTrackingPose());
seated2StandingRT.Inverse();
overlay.transform.position = (overlayRT * seated2StandingRT).pos;
} using the RigidTransform struct found in SteamVR_Utils.cs of the SteamVR Unity3D plugin. But it's not giving the intended output, still just giving wonky positions to the overlays. |
Has anyone had this kind of problem before? |
different issue than #790, this shouldn't be happening since your overlay specifies its tracking origin. |
I'm still having a similar issue to this. |
Yeah that was my case too. I think I ended up saving the position of the overlay relative to the head each frame and when a universe change was detected I would use the last saved position to reposition the overlay in the world (using Transform.TransformPoint and the likes in case you aren't familiar with these sort of things). There were some issues with the asynchronous nature of the OpenVR callbacks though, so I had to set up more than one buffer and use values that were saved more than one frame ago to be sure to avoid spurious values. |
If I create an overlay in Unity3D not set to track a device (so just positioned in the world at arbitrary coordinates) and the universe is set to standing, when I open a VR app that uses seated tracking universe while my app is still running the overlay changes position. Also, recreating the overlay while this second app is open still places it at the incorrect location. If the second app I open is instead a standing universe app this behavior is not observed.
The text was updated successfully, but these errors were encountered: