mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-02-15 08:40:40 +00:00
Ensure menu cursor is correctly aligned
store the yaw at which the menu is invoked to calculate correct X slightly increased the cursor movement scale as it was a little too much wrist turning required to reach outer edges of screen
This commit is contained in:
parent
14cf79c585
commit
56d1334007
4 changed files with 11 additions and 9 deletions
|
@ -57,6 +57,7 @@ typedef struct {
|
|||
|
||||
vec2_t thumbstick_location[2]; //left / right thumbstick locations - used in cgame
|
||||
|
||||
float menuYaw;
|
||||
int *menuCursorX;
|
||||
int *menuCursorY;
|
||||
qboolean menuLeftHanded;
|
||||
|
|
|
@ -477,8 +477,8 @@ static void IN_VRController( qboolean isRightController, ovrTracking remoteTrack
|
|||
yaw = (vr_righthanded->integer != 0) ? vr.weaponangles[YAW] : vr.offhandangles[YAW];
|
||||
pitch = (vr_righthanded->integer != 0) ? vr.weaponangles[PITCH] : vr.offhandangles[PITCH];
|
||||
}
|
||||
int x = 320 - tan(yaw * (M_PI*2 / 360)) * 300;
|
||||
int y = 240 + tan((pitch + vr_weaponPitch->value) * (M_PI*2 / 360)) * 300;
|
||||
int x = 320 - tan((yaw - vr.menuYaw) * (M_PI*2 / 360)) * 400;
|
||||
int y = 240 + tan((pitch + vr_weaponPitch->value) * (M_PI*2 / 360)) * 400;
|
||||
*vr.menuCursorX = x;
|
||||
*vr.menuCursorY = y;
|
||||
Com_QueueEvent(in_vrEventTime, SE_MOUSE, 0, 0, 0, NULL);
|
||||
|
|
|
@ -286,8 +286,6 @@ void VR_DrawFrame( engine_t* engine ) {
|
|||
const ovrMatrix4f projectionMatrix = ovrMatrix4f_CreateProjectionFov(
|
||||
fov_x / vr.weapon_zoomLevel, fov_y / vr.weapon_zoomLevel, 0.0f, 0.0f, 1.0f, 0.0f );
|
||||
|
||||
static float playerYaw = 0;
|
||||
|
||||
int eyeW, eyeH;
|
||||
VR_GetResolution(engine, &eyeW, &eyeH);
|
||||
|
||||
|
@ -299,7 +297,7 @@ void VR_DrawFrame( engine_t* engine ) {
|
|||
|
||||
// Add a simple cylindrical layer
|
||||
cylinderLayer.Cylinder =
|
||||
BuildCylinderLayer(engine, eyeW, eyeW * 0.75f, &engine->tracking, radians(playerYaw) );
|
||||
BuildCylinderLayer(engine, eyeW, eyeW * 0.75f, &engine->tracking, radians(vr.menuYaw) );
|
||||
|
||||
const ovrLayerHeader2* layers[] = {
|
||||
&cylinderLayer.Header
|
||||
|
@ -332,7 +330,7 @@ void VR_DrawFrame( engine_t* engine ) {
|
|||
}
|
||||
else
|
||||
{
|
||||
playerYaw = vr.hmdorientation[YAW];
|
||||
vr.menuYaw = vr.hmdorientation[YAW];
|
||||
|
||||
ovrLayerProjection2 layer = vrapi_DefaultLayerProjection2();
|
||||
layer.HeadPose = engine->tracking.HeadPose;
|
||||
|
|
|
@ -3,9 +3,12 @@
|
|||
setlocal
|
||||
|
||||
set BUILD_TYPE=release
|
||||
set KEYSTORE=
|
||||
set KEYSTORE_PASS=
|
||||
set VERSION=0.21.1
|
||||
set VERSION=0.27.1
|
||||
|
||||
@REM Define the following environment variables to sign a release build
|
||||
@REM set KEYSTORE=
|
||||
@REM set KEYSTORE_PASS=
|
||||
|
||||
|
||||
set ANDROID_SDK_ROOT=%AppData%\..\Local\Android\Sdk
|
||||
set adb="%ANDROID_SDK_ROOT%\platform-tools\adb.exe"
|
||||
|
|
Loading…
Reference in a new issue