mirror of https://github.com/bjornbytes/lovr.git
Disable LOCAL reference space on SteamVR;
Recent SteamVR versions have bugs with it, especially after triggering a recenter operation. In SteamVR, recentering fires referenceSpaceChangePending for the LOCAL space, then the STAGE space, then the LOCAL space again, all with different changeTimes. No poseInPreviousSpace is given. Recreating the main reference space whenever this event is received leads to strange, inconsistent issues. Sometimes the local/stage spaces end up on top of each other, other times one or both will be way up in the air (putting the headset at negative y coordinates). This bug is even present when recentering in the compositor, so it's not an issue with lovr. Cautiously disabling the local-floor emulation on SteamVR runtimes and just always using the STAGE space until things are sorted out.
This commit is contained in:
parent
83d6e64c6e
commit
61ffd5716f
|
@ -265,6 +265,7 @@ static XrTime getCurrentXrTime(void) {
|
|||
return time;
|
||||
}
|
||||
|
||||
static bool openxr_getDriverName(char* name, size_t length);
|
||||
static void createReferenceSpace(XrTime time) {
|
||||
XrReferenceSpaceCreateInfo info = {
|
||||
.type = XR_TYPE_REFERENCE_SPACE_CREATE_INFO,
|
||||
|
@ -277,6 +278,12 @@ static void createReferenceSpace(XrTime time) {
|
|||
return;
|
||||
}
|
||||
|
||||
char name[256];
|
||||
if (openxr_getDriverName(name, sizeof(name)) && !memcmp(name, "SteamVR", strlen("SteamVR"))) {
|
||||
state.referenceSpace = state.spaces[DEVICE_FLOOR];
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.features.localFloor) {
|
||||
info.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR_EXT;
|
||||
} else if (state.config.seated) {
|
||||
|
|
Loading…
Reference in New Issue