Change pitch and roll rotation of universe
I'm trying to rotate seat position by
vr::VRChaperoneSetup()->GetWorkingStandingZeroPoseToRawTrackingPose(&curPos);
vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose(&newPos);
If I rotate by Y-axis everything fine. But if I try rotate by X-axis or Z-axis, SetPose do not save new position
Any ideas?
Another try
vr::TrackedDevicePose_t trackedDevicePose_all_devices[16];
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(universe, 0, trackedDevicePose_all_devices, 16);
vr::TrackedDevicePose_t newPose;
vr::VRSystem()->ApplyTransform(&newPose, &trackedDevicePose_all_devices[0], &rotMat);
ApplyTransform change newPose, but not current device position and rotation
There is no API to change the pitch and roll of the universe. Pitch and roll is determined by the driver (Lighthouse, Oculus, Windows MR, etc).
The second API ("ApplyTransform") is a utility function to ensure that all of the parts of the pose (velocity, acceleration, angular velocity, etc) are updated appropriately for you given a desired transformation. It is a pure function that does not affect the results of any other API call.
Thanks for answer. One more question..
Can I use
virtual uint32_t DriverDebugRequest( vr::TrackedDeviceIndex_t unDeviceIndex, const char *pchRequest, VR_OUT_STRING() char *pchResponseBuffer, uint32_t unResponseBufferSize ) = 0;
to change driver data?
I can't find usage example for this function
That call is just for the convenience of driver writers to be able to talk to their drivers in driver-specific ways.
Bad news. But still thanks
This is not trivial. You'll need to develop a 'hook' driver that intercepts the TrackedDevicePoseUpdated() method of the VRServerDriverHost and modify it before passing it to the original VRServerDriverHost method. You are going to have to figure out how to do that yourself. Use the PseudoVive project as a starting point for developing a 'hook' driver.
For some reasons I need use oculus or same devices with they motion controllers.
If I create my own driver, I'll need to represent all behavior of current oculus driver. This is really not good way for me
Can I somehow use current VR driver and make something like "patch" for it?
That is what a 'hook' driver is, one that patches an existing driver. Now go and do your research... ;)
Thanks, man. Now i understand what it does
https://github.com/schellingb/PseudoVive/blob/master/Source/driver_2vive.cpp
I'm trying to make it real.. but something went wrong
I create my own TrackedDevicePoseUpdated method, and trying to set pose.
In SteamVR headset mirror everything as i want. but in oculus rift I see "real" space rotation with black border
something like that

Why this happens?
Code
virtual void TrackedDevicePoseUpdated(uint32_t unWhichDevice, const vr::DriverPose_t & newPose, uint32_t unPoseStructSize)
{
auto* self = (vr::IVRServerDriverHost*)this;
vr::DriverPose_t pose = {0};
if (unWhichDevice == vr::k_unTrackedDeviceIndex_Hmd)
{
pose.poseIsValid = true;
pose.result = vr::TrackingResult_Running_OK;
pose.deviceIsConnected = true;
pose.qWorldFromDriverRotation = HmdQuaternion_Init(1, 0, 0, 0);
pose.qDriverFromHeadRotation = HmdQuaternion_Init(1, 0, 0, 0);
//tmp rotate by 30 degree by X axis
auto baseRotation = HmdQuaternion_Init(0.966, 0.259, 0.0, 0.0);
pose.qRotation = QuaternionMultiple(baseRotation, newPose.qRotation);
}
else
{
pose = newPose;
}
Org_TrackedDevicePoseUpdated(self, unWhichDevice, pose, unPoseStructSize);
}
You're tricking the game into rendering the tilted image, but the Oculus SW knows what the latest true pose is (internally) and is doing rotational reprojection ("async timewarp" I think they call it) to correct the image.
I don't think oculus use some timewarp, b/c I made change every function call But definitely somewhere has one more place with change space
I really want to find it
By the way.. If i run steam vr room settings, i see correct space rotation in my glasses. But only for short time when i make room setup
Is it a specific oculus behavior? Maybe if i try to use Vive or another glasses everything was fine.. But how to know that before buy new device?
This is a really Oculus bug ̷o̷r̷ ̷f̷e̷a̷t̷u̷r̷e̷ Everything fine with MS Mixed Reality
Thanks all