Fixed screen distance setting

This commit is contained in:
Simon 2022-12-18 11:43:49 +00:00
parent 5acd17a9df
commit 3d6af564c8

View file

@ -2466,9 +2466,9 @@ void JKVR_submitFrame()
quad_layer.subImage.imageArrayIndex = 0; quad_layer.subImage.imageArrayIndex = 0;
const XrVector3f axis = {0.0f, 1.0f, 0.0f}; const XrVector3f axis = {0.0f, 1.0f, 0.0f};
XrVector3f pos = { XrVector3f pos = {
gAppState.xfStageFromHead.position.x - sin(radians(vr.hmdorientation_snap[YAW])) * 4.0f, gAppState.xfStageFromHead.position.x - sin(radians(vr.hmdorientation_snap[YAW])) * (2.0f + vr_screen_dist->value),
1.0f, 1.0f,
gAppState.xfStageFromHead.position.z - cos(radians(vr.hmdorientation_snap[YAW])) * 4.0f gAppState.xfStageFromHead.position.z - cos(radians(vr.hmdorientation_snap[YAW])) * (2.0f + vr_screen_dist->value)
}; };
quad_layer.pose.orientation = XrQuaternionf_CreateFromVectorAngle(axis, radians(vr.hmdorientation_snap[YAW])); quad_layer.pose.orientation = XrQuaternionf_CreateFromVectorAngle(axis, radians(vr.hmdorientation_snap[YAW]));
quad_layer.pose.position = pos; quad_layer.pose.position = pos;