mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-25 13:31:10 +00:00
OpenXR do not recenter on renderer reload
This commit is contained in:
parent
7072b0b89e
commit
3ee3f59058
2 changed files with 10 additions and 8 deletions
|
@ -294,6 +294,13 @@ void VR_EnterVR( engine_t* engine, ovrJava java ) {
|
||||||
ALOGE("Failed to create XR session: %d.", initResult);
|
ALOGE("Failed to create XR session: %d.", initResult);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a space to the first path
|
||||||
|
XrReferenceSpaceCreateInfo spaceCreateInfo = {};
|
||||||
|
spaceCreateInfo.type = XR_TYPE_REFERENCE_SPACE_CREATE_INFO;
|
||||||
|
spaceCreateInfo.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_VIEW;
|
||||||
|
spaceCreateInfo.poseInReferenceSpace.orientation.w = 1.0f;
|
||||||
|
OXR(xrCreateReferenceSpace(engine->appState.Session, &spaceCreateInfo, &engine->appState.HeadSpace));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VR_LeaveVR( engine_t* engine ) {
|
void VR_LeaveVR( engine_t* engine ) {
|
||||||
|
|
|
@ -285,14 +285,9 @@ void VR_InitRenderer( engine_t* engine ) {
|
||||||
|
|
||||||
free(referenceSpaces);
|
free(referenceSpaces);
|
||||||
|
|
||||||
// Create a space to the first path
|
if (engine->appState.CurrentSpace == XR_NULL_HANDLE) {
|
||||||
XrReferenceSpaceCreateInfo spaceCreateInfo = {};
|
|
||||||
spaceCreateInfo.type = XR_TYPE_REFERENCE_SPACE_CREATE_INFO;
|
|
||||||
spaceCreateInfo.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_VIEW;
|
|
||||||
spaceCreateInfo.poseInReferenceSpace.orientation.w = 1.0f;
|
|
||||||
OXR(xrCreateReferenceSpace(engine->appState.Session, &spaceCreateInfo, &engine->appState.HeadSpace));
|
|
||||||
|
|
||||||
VR_Recenter(engine);
|
VR_Recenter(engine);
|
||||||
|
}
|
||||||
|
|
||||||
projections = (XrView*)(malloc(ovrMaxNumEyes * sizeof(XrView)));
|
projections = (XrView*)(malloc(ovrMaxNumEyes * sizeof(XrView)));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue