Merge pull request #111 from mcclure/oculus-fix-19feb

Fix Oculus driver compilation
This commit is contained in:
Bjorn Swenson 2019-03-06 22:25:31 -08:00 committed by GitHub
commit 86ef954287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -266,7 +266,7 @@ if(LOVR_ENABLE_HEADSET AND LOVR_USE_OPENVR)
)
endif()
# Oculus SDK
# Oculus SDK -- expects Oculus SDK 1.26.0 or later
if (LOVR_ENABLE_HEADSET AND LOVR_USE_OCULUS)
if(NOT LOVR_OCULUS_PATH)
message(FATAL_ERROR "LOVR_USE_OCULUS requires the LOVR_OCULUS_PATH to be set to the location of the Oculus Desktop SDK")

View File

@ -251,7 +251,7 @@ static void oculusControllerGetPose(Controller* controller, float* x, float* y,
static void oculusControllerGetVelocity(Controller* controller, float* vx, float* vy, float* vz) {
ovrTrackingState *ts = refreshTracking();
ovrVector3f vel = ts->HandPoses[controller->id].ThePose.LinearVelocity;
ovrVector3f vel = ts->HandPoses[controller->id].LinearVelocity;
*vx = vel.x;
*vy = vel.y;
*vz = vel.z;
@ -259,7 +259,7 @@ static void oculusControllerGetVelocity(Controller* controller, float* vx, float
static void oculusControllerGetAngularVelocity(Controller* controller, float* vx, float* vy, float* vz) {
ovrTrackingState *ts = refreshTracking();
ovrVector3f vel = ts->HandPoses[controller->id].ThePose.AngularVelocity;
ovrVector3f vel = ts->HandPoses[controller->id].AngularVelocity;
*vx = vel.x;
*vy = vel.y;
*vz = vel.z;
@ -342,7 +342,7 @@ static void oculusRenderTo(void (*callback)(void*), void* userdata) {
};
lovrAssert(OVR_SUCCESS(ovr_CreateMirrorTextureWithOptionsGL(state.session, &mdesc, &state.mirror)), "Unable to create mirror texture");
CanvasFlags flags = { .depth = FORMAT_D24S8, .stereo = true };
CanvasFlags flags = { .depth = { .enabled = true, .format = FORMAT_D24S8 }, .stereo = true };
state.canvas = lovrCanvasCreate(2 * state.size.w, state.size.h, flags);
}
@ -375,7 +375,7 @@ static void oculusRenderTo(void (*callback)(void*), void* userdata) {
mat4_identity(transform);
mat4_rotateQuat(transform, orient);
transform[12] = -(transform[0] * pos[0] + transform[4] * pos[1] + transform[8] * pos[2]);
transform[13] = -(transform[1] * pos[0] + transform[5] * pos[1] + transform[9] * pos[2] + state.offset);
transform[13] = -(transform[1] * pos[0] + transform[5] * pos[1] + transform[9] * pos[2]);
transform[14] = -(transform[2] * pos[0] + transform[6] * pos[1] + transform[10] * pos[2]);
ovrMatrix4f projection = ovrMatrix4f_Projection(desc.DefaultEyeFov[eye], state.clipNear, state.clipFar, ovrProjection_ClipRangeOpenGL);