d/psvr: Add hacked mesh distortion

This commit is contained in:
pblack 2019-10-08 12:12:06 +13:00 committed by Jakob Bornecrantz
parent e86628884b
commit 1dacea071d
4 changed files with 1556 additions and 5 deletions

View file

@ -67,6 +67,7 @@ endif()
if(BUILD_DRIVER_PSVR)
set(PSVR_SOURCE_FILES
psvr/psvr_both_uvs.h
psvr/psvr_device.c
psvr/psvr_device.h
psvr/psvr_interface.h

View file

@ -54,6 +54,7 @@ lib_drv_psmv = static_library(
lib_drv_psvr = static_library(
'drv_psvr',
files(
'psvr/psvr_both_uvs.h',
'psvr/psvr_device.c',
'psvr/psvr_device.h',
'psvr/psvr_interface.h',

File diff suppressed because it is too large Load diff

View file

@ -30,6 +30,7 @@
#include <unistd.h>
#include "psvr_device.h"
#include "psvr_both_uvs.h"
/*
@ -755,6 +756,14 @@ psvr_device_create(struct hid_device_info *hmd_handle_info,
psvr->base.destroy = psvr_device_destroy;
psvr->base.inputs[0].name = XRT_INPUT_GENERIC_HEAD_RELATION;
psvr->base.name = XRT_DEVICE_GENERIC_HMD;
psvr->base.hmd->distortion.models = XRT_DISTORTION_MODEL_MESHUV;
psvr->base.hmd->distortion.preferred = XRT_DISTORTION_MODEL_MESHUV;
psvr->base.hmd->distortion.mesh.data = &psvr_both_uvs[0];
psvr->base.hmd->distortion.mesh.stride = sizeof(float) * 4;
psvr->base.hmd->distortion.mesh.num_uv_channels = 1;
psvr->base.hmd->distortion.mesh.num_vertex =
ARRAY_SIZE(psvr_both_uvs) / 4;
psvr->fusion.rot.w = 1.0f;
snprintf(psvr->base.str, XRT_DEVICE_NAME_LEN, "PS VR Headset");
@ -794,11 +803,11 @@ psvr_device_create(struct hid_device_info *hmd_handle_info,
info.display.w_pixels = 1920;
info.display.h_pixels = 1080;
info.display.w_meters = 0.126; // from calculated specs
info.display.h_meters = 0.071;
info.lens_horizontal_separation_meters = 0.0630999878f;
info.lens_vertical_position_meters = 0.0394899882f;
info.views[0].fov = 103.57f * M_PI / 180.0f;
info.views[1].fov = 103.57f * M_PI / 180.0f;
info.display.h_meters = 0.068;
info.lens_horizontal_separation_meters = 0.062f;
info.lens_vertical_position_meters = 0.07 / 2.0f; // 94899882f;
info.views[0].fov = 96.0f * (M_PI / 180.0f);
info.views[1].fov = 96.0f * (M_PI / 180.0f);
if (!u_device_setup_split_side_by_side(&psvr->base, &info)) {
PSVR_ERROR(psvr, "Failed to setup basic device info");