Multiple Fixes..

* weapon placement is now perfect
* 6DoF reimplemented so there is no "swim" as it uses a completely different approach
* 3DoF should work much better
* Hopefully warping is reduced further
* when "Bullet time" mode is selected, gl_lightmaps is automatically set to 2
This commit is contained in:
Simon 2019-08-17 23:51:07 +01:00
parent 79fab86297
commit 93fd53334f
12 changed files with 172 additions and 93 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.quakequest"
android:versionCode="9"
android:versionName="1.3.1" android:installLocation="auto" >
android:versionCode="10"
android:versionName="1.4.0" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>

View file

@ -430,9 +430,9 @@ float CL_KeyState (kbutton_t *key)
//==========================================================================
cvar_t cl_upspeed = {CVAR_SAVE, "cl_upspeed","400","vertical movement speed (while swimming or flying)"};
cvar_t cl_forwardspeed = {CVAR_SAVE, "cl_forwardspeed","200","forward movement speed"};
cvar_t cl_backspeed = {CVAR_SAVE, "cl_backspeed","200","backward movement speed"};
cvar_t cl_sidespeed = {CVAR_SAVE, "cl_sidespeed","200","strafe movement speed"};
cvar_t cl_forwardspeed = {CVAR_SAVE, "cl_forwardspeed","150","forward movement speed"};
cvar_t cl_backspeed = {CVAR_SAVE, "cl_backspeed","150","backward movement speed"};
cvar_t cl_sidespeed = {CVAR_SAVE, "cl_sidespeed","150","strafe movement speed"};
cvar_t cl_movespeedkey = {CVAR_SAVE, "cl_movespeedkey","2.0","how much +speed multiplies keyboard movement speed"};
cvar_t cl_movecliptokeyboard = {0, "cl_movecliptokeyboard", "0", "if set to 1, any move is clipped to the nine keyboard states; if set to 2, only the direction is clipped, not the amount"};
@ -449,10 +449,6 @@ cvar_t cl_righthanded = {CVAR_SAVE, "cl_righthanded","1","right-handed?"};
cvar_t cl_weaponpitchadjust = {CVAR_SAVE, "cl_weaponpitchadjust","8.0","Weapon pitch adjustment"};
cvar_t cl_trackingmode = {CVAR_SAVE, "cl_trackingmode","1","Tracking Mode:- 1 - 6DoF or 0 - 3DoF"};
cvar_t cl_weapon_offset_ud = {CVAR_SAVE, "cl_weapon_offset_ud","0.0","up/down weapon offset (+ve move up)"};
cvar_t cl_weapon_offset_lr = {CVAR_SAVE, "cl_weapon_offset_lr","0.0","left/right weapon offset (+ve move right)"};
cvar_t cl_weapon_offset_fb = {CVAR_SAVE, "cl_weapon_offset_fb","0.15","front/back weapon offset (+ve move back)"};
cvar_t cl_anglespeedkey = {CVAR_SAVE, "cl_anglespeedkey","1.5","how much +speed multiplies keyboard turning speed"};
@ -2269,9 +2265,6 @@ void CL_InitInput (void)
Cvar_RegisterVariable(&cl_yawmult);
Cvar_RegisterVariable(&cl_controllerdeadzone);
Cvar_RegisterVariable(&cl_righthanded);
Cvar_RegisterVariable(&cl_weapon_offset_ud);
Cvar_RegisterVariable(&cl_weapon_offset_lr);
Cvar_RegisterVariable(&cl_weapon_offset_fb);
Cvar_RegisterVariable(&cl_weaponpitchadjust);
Cvar_RegisterVariable(&cl_trackingmode);

View file

@ -1699,8 +1699,8 @@ static void CL_RelinkEffects(void)
extern float gunangles[3];
extern float gunorg[3];
extern float vieworg[3];
extern cvar_t r_worldscale;
extern cvar_t vr_worldscale;
extern cvar_t cl_trackingmode;
void CL_Beam_CalculatePositions(const beam_t *b, vec3_t start, vec3_t end)
{
@ -1723,7 +1723,11 @@ void CL_Beam_CalculatePositions(const beam_t *b, vec3_t start, vec3_t end)
//Use gun location as beam origin
VectorCopy(gunorg, start);
start[2] -= 5.0f; // Hack to align lightning with gun
if (cl_trackingmode.integer == 0) //3DoF
{
start[2] -= 5.0f; // Hack to align lightning with gun
}
if (cl_beams_instantaimhack.integer)
{
@ -1757,7 +1761,6 @@ void CL_LaserSight_CalculatePositions(vec3_t start, vec3_t end)
VectorCopy(trace.endpos, end);
VectorCopy(gunorg, start);
start[2] -= 7.0f;
}
extern cvar_t r_lasersight;

View file

@ -14,7 +14,7 @@
#include "snd_main.h"
cvar_t scr_viewsize = {CVAR_SAVE, "viewsize","100", "how large the view should be, 110 disables inventory bar, 120 disables status bar"};
cvar_t scr_fov = {CVAR_SAVE, "vr_fov","108", "field of vision for VR - defaulted to 108"};
cvar_t scr_fov = {CVAR_SAVE, "vr_fov","109", "field of vision for VR - defaulted to 109"};
cvar_t scr_conalpha = {CVAR_SAVE, "scr_conalpha", "0.85", "opacity of console background gfx/conback"};
cvar_t scr_conalphafactor = {CVAR_SAVE, "scr_conalphafactor", "1", "opacity of console background gfx/conback relative to scr_conalpha; when 0, gfx/conback is not drawn"};
cvar_t scr_conalpha2factor = {CVAR_SAVE, "scr_conalpha2factor", "0", "opacity of console background gfx/conback2 relative to scr_conalpha; when 0, gfx/conback2 is not drawn"};

View file

@ -46,11 +46,14 @@ static qboolean r_loaddds;
static qboolean r_savedds;
static qboolean r_gpuskeletal;
cvar_t r_worldscale = {CVAR_SAVE, "r_worldscale", "30", "World scale multiplier (default is 30)"};
// Wolfenstein 3D, DOOM and QUAKE use the same coordinate/unit system:
// 8 foot (96 inch) height wall == 64 units, 1.5 inches per pixel unit
// 1.0 pixel unit / 1.5 inch == 0.666666 pixel units per inch
cvar_t vr_worldscale = {CVAR_SAVE, "vr_worldscale", "26.2467", "VR World scale multiplier"};
float GetStereoSeparation()
{
return r_worldscale.value * 0.065f;
return vr_worldscale.value * 0.065f;
}
@ -4213,7 +4216,7 @@ void GL_Main_Init(void)
Cvar_RegisterVariable (&gl_fogend);
Cvar_RegisterVariable (&gl_skyclip);
}
Cvar_RegisterVariable(&r_worldscale);
Cvar_RegisterVariable(&vr_worldscale);
Cvar_RegisterVariable(&r_motionblur);
Cvar_RegisterVariable(&r_damageblur);
Cvar_RegisterVariable(&r_motionblur_averaging);

View file

@ -48,7 +48,7 @@ char m_return_reason[128];
extern vec3_t hmdorientation;
extern char *strGameFolder;
extern cvar_t r_worldscale;
extern cvar_t vr_worldscale;
extern cvar_t r_lasersight;
extern cvar_t cl_righthanded;
extern cvar_t cl_walkdirection;
@ -1765,14 +1765,14 @@ static void M_Menu_Options_AdjustSliders (int dir)
else if (options_cursor == optnum++) Cvar_SetValueQuick(&v_gamma, bound(0.5, v_gamma.value + dir * 0.0625, 3));
else if (options_cursor == optnum++)
{
if (r_worldscale.value < 200.0f)
if (vr_worldscale.value < 200.0f)
{
Cvar_SetValueQuick (&r_worldscale, 400.0f);
Cvar_SetValueQuick (&vr_worldscale, 400.0f);
Cvar_SetValueQuick (&chase_active, 1);
}
else
{
Cvar_SetValueQuick (&r_worldscale, 30.0f);
Cvar_SetValueQuick (&vr_worldscale, 30.0f);
Cvar_SetValueQuick (&chase_active, 0);
}
}
@ -1877,6 +1877,7 @@ static void M_Options_Draw (void)
}
int bufOption = 0;
extern cvar_t gl_lightmaps;
static void M_Options_Key (int k, int ascii)
{
switch (k)
@ -1909,6 +1910,11 @@ static void M_Options_Key (int k, int ascii)
if (bullettime.integer == 0)
{
Cvar_SetValueQuick(&slowmo, 1.0f);
Cvar_SetValueQuick(&gl_lightmaps, 0.0f);
}
else
{
Cvar_SetValueQuick(&gl_lightmaps, 2.0f);
}
}
break;
@ -3570,7 +3576,7 @@ static void M_Credits_Draw (void)
" QQQQQQQQ QQQQQQQQ ",
" QQQ QQQ ",
" Q Q ",
" Q Q v1.3.1 ");
" Q Q v1.4.0 ");
int i, l, linelength, firstline, lastline, lines;
for (i = 0, linelength = 0, firstline = 9999, lastline = -1;m_credits_message[i];i++)

View file

@ -121,7 +121,7 @@ static void Sbar_FinaleOverlay (void);
extern qboolean vrMode;
extern vec3_t hmdorientation;
extern cvar_t r_worldscale;
extern cvar_t vr_worldscale;
//Calculate the y-offset of the status bar dependent on where the user is looking
int Sbar_GetYOffset()
@ -1744,8 +1744,8 @@ void Sbar_Draw (void)
if (cl.csqc_vidvars.drawcrosshair && crosshair.integer >= 1 && !cl.intermission && !r_letterbox.value)
{
pic = Draw_CachePic (va(vabuf, sizeof(vabuf), "gfx/crosshair%i", crosshair.integer));
int stereoOffset = r_worldscale.value > 200.0f ? 12 : 5;
int yOffset = (r_worldscale.value > 200.0f ? 20 : 5);
int stereoOffset = vr_worldscale.value > 200.0f ? 12 : 5;
int yOffset = (vr_worldscale.value > 200.0f ? 20 : 5);
DrawQ_Pic((vid_conwidth.integer - pic->width * crosshair_size.value) * 0.5f + (r_stereo_side ? -stereoOffset : stereoOffset),
(vid_conheight.integer - pic->height * crosshair_size.value) * 0.5f + yOffset,
pic, pic->width * crosshair_size.value, pic->height * crosshair_size.value,

View file

@ -96,7 +96,7 @@ cvar_t sv_fixedframeratesingleplayer = {0, "sv_fixedframeratesingleplayer", "1",
cvar_t sv_freezenonclients = {CVAR_NOTIFY, "sv_freezenonclients", "0", "freezes time, except for players, allowing you to walk around and take screenshots of explosions"};
cvar_t sv_friction = {CVAR_NOTIFY, "sv_friction","4", "how fast you slow down"};
cvar_t sv_gameplayfix_blowupfallenzombies = {0, "sv_gameplayfix_blowupfallenzombies", "1", "causes findradius to detect SOLID_NOT entities such as zombies and corpses on the floor, allowing splash damage to apply to them"};
cvar_t sv_gameplayfix_consistentplayerprethink = {0, "sv_gameplayfix_consistentplayerprethink", "0", "improves fairness in multiplayer by running all PlayerPreThink functions (which fire weapons) before performing physics, then running all PlayerPostThink functions"};
cvar_t sv_gameplayfix_consistentplayerprethink = {0, "sv_gameplayfix_consistentplayerprethink", "1", "improves fairness in multiplayer by running all PlayerPreThink functions (which fire weapons) before performing physics, then running all PlayerPostThink functions"};
cvar_t sv_gameplayfix_delayprojectiles = {0, "sv_gameplayfix_delayprojectiles", "1", "causes entities to not move on the same frame they are spawned, meaning that projectiles wait until the next frame to perform their first move, giving proper interpolation and rocket trails, but making weapons harder to use at low framerates"};
cvar_t sv_gameplayfix_droptofloorstartsolid = {0, "sv_gameplayfix_droptofloorstartsolid", "1", "prevents items and monsters that start in a solid area from falling out of the level (makes droptofloor treat trace_startsolid as an acceptable outcome)"};
cvar_t sv_gameplayfix_droptofloorstartsolid_nudgetocorrect = {0, "sv_gameplayfix_droptofloorstartsolid_nudgetocorrect", "1", "tries to nudge stuck items and monsters out of walls before droptofloor is performed"};

View file

@ -2953,6 +2953,8 @@ static void SV_Physics_Entity (prvm_edict_t *ent)
}
}
extern float gunorg[3];
void SV_Physics_ClientMove(void)
{
prvm_prog_t *prog = SVVM_prog;
@ -2980,8 +2982,16 @@ void SV_Physics_ClientMove(void)
PRVM_serverglobalfloat(time) = sv.time;
PRVM_serverglobalfloat(frametime) = 0;
PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(ent);
vec3_t backup;
VectorCopy(PRVM_serveredictvector(ent, origin), backup);
VectorCopy(gunorg, PRVM_serveredictvector(ent, origin));
PRVM_serveredictvector(ent, origin)[2] -= 20.0f;
prog->ExecuteProgram(prog, PRVM_serverfunction(PlayerPostThink), "QC function PlayerPostThink is missing");
PRVM_serverglobalfloat(frametime) = sv.frametime;
VectorCopy(backup, PRVM_serveredictvector(ent, origin));
if(PRVM_serveredictfloat(ent, fixangle))
{
@ -2995,6 +3005,35 @@ void SV_Physics_ClientMove(void)
}
}
vec3_t origin_b, oldorigin_b;
extern cvar_t cl_trackingmode;
static void SV_SetWeapon_ClientOrigin(prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
VectorCopy(PRVM_serveredictvector(ent, origin), origin_b);
VectorCopy(PRVM_serveredictvector(ent, oldorigin), oldorigin_b);
VectorCopy(gunorg, PRVM_serveredictvector(ent, origin));
VectorCopy(gunorg, PRVM_serveredictvector(ent, oldorigin));
if (cl_trackingmode.integer != 0) //6DoF
{
PRVM_serveredictvector(ent, origin)[2] -= 16.0f;
PRVM_serveredictvector(ent, oldorigin)[2] -= 16.0f;
} else { //3DoF
PRVM_serveredictvector(ent, origin)[2] -= 23.0f;
PRVM_serveredictvector(ent, oldorigin)[2] -= 23.0f;
}
}
static void SV_Restore_ClientOrigin(prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
VectorCopy(origin_b, PRVM_serveredictvector(ent, origin));
VectorCopy(oldorigin_b, PRVM_serveredictvector(ent, oldorigin));
}
static void SV_Physics_ClientEntity_PreThink(prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
@ -3015,15 +3054,21 @@ static void SV_Physics_ClientEntity_PreThink(prvm_edict_t *ent)
// make sure the velocity is still sane (not a NaN)
SV_CheckVelocity(ent);
// call standard client pre-think
SV_SetWeapon_ClientOrigin(ent);
// call standard client pre-think
PRVM_serverglobalfloat(time) = sv.time;
PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(ent);
prog->ExecuteProgram(prog, PRVM_serverfunction(PlayerPreThink), "QC function PlayerPreThink is missing");
SV_Restore_ClientOrigin(ent);
// make sure the velocity is still sane (not a NaN)
SV_CheckVelocity(ent);
}
extern int breakHere;
static void SV_Physics_ClientEntity_PostThink(prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
@ -3034,11 +3079,15 @@ static void SV_Physics_ClientEntity_PostThink(prvm_edict_t *ent)
// make sure the velocity is sane (not a NaN)
SV_CheckVelocity(ent);
// call standard player post-think
SV_SetWeapon_ClientOrigin(ent);
// call standard player post-think
PRVM_serverglobalfloat(time) = sv.time;
PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(ent);
prog->ExecuteProgram(prog, PRVM_serverfunction(PlayerPostThink), "QC function PlayerPostThink is missing");
SV_Restore_ClientOrigin(ent);
// make sure the velocity is still sane (not a NaN)
SV_CheckVelocity(ent);
@ -3091,14 +3140,17 @@ static void SV_Physics_ClientEntity(prvm_edict_t *ent)
case MOVETYPE_NOCLIP:
SV_RunThink(ent);
SV_CheckWater(ent);
VectorMA(PRVM_serveredictvector(ent, origin), sv.frametime, PRVM_serveredictvector(ent, velocity), PRVM_serveredictvector(ent, origin));
VectorMA(PRVM_serveredictvector(ent, origin), sv.frametime, PRVM_serveredictvector(ent, velocity), PRVM_serveredictvector(ent, origin));
VectorMA(PRVM_serveredictvector(ent, angles), sv.frametime, PRVM_serveredictvector(ent, avelocity), PRVM_serveredictvector(ent, angles));
break;
case MOVETYPE_STEP:
SV_Physics_Step (ent);
break;
case MOVETYPE_WALK:
//Need to do this for the nail gun nails!
SV_SetWeapon_ClientOrigin(ent);
SV_RunThink (ent);
SV_Restore_ClientOrigin(ent);
// don't run physics here if running asynchronously
if (host_client->clmovement_inputtimeout <= 0)
SV_WalkMove (ent);

View file

@ -107,7 +107,7 @@ cvar_t chase_stevie = {0, "chase_stevie", "0", "(GOODVSBAD2 only) chase cam view
cvar_t v_deathtilt = {0, "v_deathtilt", "1", "whether to use sideways view when dead"};
cvar_t v_deathtiltangle = {0, "v_deathtiltangle", "0", "what roll angle to use when tilting the view while dead"};
cvar_t cl_weaponoffset = {CVAR_SAVE, "cl_weaponoffset", "0.15", "gun handedness offset"};
cvar_t cl_weaponoffset = {CVAR_SAVE, "cl_weaponoffset", "0.4", "gun handedness offset"};
// Prophecy camera pitchangle by Alexander "motorsep" Zubov
cvar_t chase_pitchangle = {CVAR_SAVE, "chase_pitchangle", "55", "chase cam pitch angle"};
@ -121,7 +121,7 @@ extern float weaponOffset[3];
extern float hmdPosition[3];
extern float playerHeight;
extern cvar_t r_worldscale;
extern cvar_t vr_worldscale;
extern cvar_t cl_trackingmode;
extern cvar_t cl_righthanded;
@ -872,44 +872,80 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
}
//Custom scaling required
matrix4x4_t weapon_position_adjust;
Matrix4x4_CreateTranslate(&weapon_position_adjust, -6.0f, 0.0f, 7.0f);
float weaponScale = cl_viewmodel_scale.value;
if (cl.stats[STAT_ACTIVEWEAPON] == IT_ROCKET_LAUNCHER ||
cl.stats[STAT_ACTIVEWEAPON] == IT_AXE)
// fb / lr / ud
if (cl.stats[STAT_ACTIVEWEAPON] == IT_ROCKET_LAUNCHER)
{
Matrix4x4_CreateTranslate(&weapon_position_adjust, -16.0f, 0.0f, 11.0f);
weaponScale = 0.45f;
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_GRENADE_LAUNCHER)
{
Matrix4x4_CreateTranslate(&weapon_position_adjust, -8.0f, 0.0f, 10.0f);
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_AXE)
{
Matrix4x4_CreateTranslate(&weapon_position_adjust, -22.0f, 12.0f, 28.0f);
weaponScale = 0.5f;
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_SUPER_SHOTGUN)
{
weaponScale = 0.8f;
Matrix4x4_CreateTranslate(&weapon_position_adjust, -7.0f, 0.0f, 8.0f);
weaponScale = 0.9f;
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_SUPER_NAILGUN)
{
Matrix4x4_CreateTranslate(&weapon_position_adjust, -16.0f, 0.0f, 16.0f);
weaponScale = 0.4f;
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_NAILGUN)
{
Matrix4x4_CreateTranslate(&weapon_position_adjust, -12.0f, 0.0f, 14.0f);
weaponScale = 0.5f;
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_LIGHTNING)
{
Matrix4x4_CreateTranslate(&weapon_position_adjust, -8.0f, 0.0f, 9.0f);
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_SUPER_LIGHTNING)
{
Matrix4x4_CreateTranslate(&weapon_position_adjust, -8.0f, 0.0f, 9.0f);
}
{
vieworg[2] += ((hmdPosition[1] - playerHeight) * vr_worldscale.value); // Up/Down
}
if (cl_trackingmode.integer == 0) //3DoF
{
VectorCopy(vieworg, gunorg);
{
//Move gun to left or right depending on handedness
vec3_t temp;
vec3_t v;
temp[0] = -0.3f * r_worldscale.value;
temp[1] = ((cl_righthanded.integer ? 1.0f : -1.0f) * cl_weaponoffset.value * r_worldscale.value);
temp[2] = 0.3f * r_worldscale.value;
matrix4x4_t matrix;
Matrix4x4_CreateFromQuakeEntity(&matrix, 0.0f, 0.0f, 0.0f, 0.0f, viewangles[1], 0.0f, 1.0f);
Matrix4x4_Transform(&matrix, temp, v);
vieworg[0] += v[0];
vieworg[1] += v[1];
vieworg[2] += v[2];
matrix4x4_t temp;
Matrix4x4_CreateTranslate(&temp, 10.0f, ((cl_righthanded.integer ? -1.0f : 1.0f) * cl_weaponoffset.value * vr_worldscale.value), -10.0f);
matrix4x4_t temp2;
Matrix4x4_Concat(&temp2, &weapon_position_adjust, &temp);
Matrix4x4_Copy(&weapon_position_adjust, &temp2);
}
//viewmodelmatrix_withbob
matrix4x4_t temp;
Matrix4x4_CreateFromQuakeEntity(&temp, vieworg[0],
vieworg[1],
vieworg[2],
gunangles[0],
gunangles[1],
//No roll
0.0f, weaponScale);
Matrix4x4_Concat(&viewmodelmatrix_withbob, &temp, &weapon_position_adjust);
//Now set the gun origin from the matrix for use later
Matrix4x4_OriginFromMatrix(&viewmodelmatrix_withbob, gunorg);
Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, vieworg[0], vieworg[1], vieworg[2], viewangles[0], viewangles[1], viewangles[2], 1);
// calculate a viewmodel matrix for use in view-attached entities
@ -917,31 +953,29 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
Matrix4x4_ConcatScale(&viewmodelmatrix_nobob, cl_viewmodel_scale.value);
}
else //6DoF
{
//Offset the camera
{
vieworg[0] += (weaponOffset[2] * r_worldscale.value); // Forward/Back
vieworg[1] += (weaponOffset[0] * r_worldscale.value); // Left/Right
vieworg[2] += ((hmdPosition[1] - playerHeight) * r_worldscale.value); // Up/Down
}
{
Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, vieworg[0], vieworg[1],
vieworg[2],
viewangles[0], viewangles[1], viewangles[2], 1);
Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, vieworg[0], vieworg[1], vieworg[2],
viewangles[0], viewangles[1], viewangles[2], 1);
// calculate a viewmodel matrix for use in view-attached entities
Matrix4x4_Copy(&viewmodelmatrix_nobob, &r_refdef.view.matrix);
Matrix4x4_ConcatScale(&viewmodelmatrix_nobob, cl_viewmodel_scale.value);
// calculate a viewmodel matrix for use in view-attached entities
Matrix4x4_Copy(&viewmodelmatrix_nobob, &r_refdef.view.matrix);
Matrix4x4_ConcatScale(&viewmodelmatrix_nobob, cl_viewmodel_scale.value);
VectorSet(gunorg, vieworg[0] - weaponOffset[2] * vr_worldscale.value,
vieworg[1] - weaponOffset[0] * vr_worldscale.value,
vieworg[2] + weaponOffset[1] * vr_worldscale.value);
VectorSet(gunorg, vieworg[0] - weaponOffset[2] * r_worldscale.value,
vieworg[1] - weaponOffset[0] * r_worldscale.value,
vieworg[2] + weaponOffset[1] * r_worldscale.value);
}
Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix_withbob, gunorg[0],
gunorg[1],
gunorg[2],
gunangles[0] - 3.0f,
gunangles[1], 0.0f, weaponScale);
//viewmodelmatrix_withbob
matrix4x4_t temp;
Matrix4x4_CreateFromQuakeEntity(&temp, gunorg[0],
gunorg[1],
gunorg[2],
gunangles[0],
gunangles[1],
gunangles[2], weaponScale);
Matrix4x4_Concat(&viewmodelmatrix_withbob, &temp, &weapon_position_adjust);
}
VectorCopy(vieworg, cl.csqc_vieworiginfromengine);
VectorCopy(viewangles, cl.csqc_viewanglesfromengine);

View file

@ -115,15 +115,12 @@ float hmdPosition[3];
float playerHeight;
float positionDeltaThisFrame[3];
extern cvar_t r_worldscale;
extern cvar_t vr_worldscale;
extern cvar_t r_lasersight;
extern cvar_t cl_forwardspeed;
extern cvar_t cl_walkdirection;
extern cvar_t cl_controllerdeadzone;
extern cvar_t cl_righthanded;
extern cvar_t cl_weapon_offset_ud;
extern cvar_t cl_weapon_offset_lr;
extern cvar_t cl_weapon_offset_fb;
extern cvar_t cl_weaponpitchadjust;
extern cvar_t slowmo;
extern cvar_t bullettime;
@ -1197,10 +1194,8 @@ static ovrLayerProjection2 ovrRenderer_RenderFrame( ovrRenderer * renderer, cons
QuatToYawPitchRoll(quatHmd, 0.0f, hmdorientation);
setHMDPosition(positionHmd.x, positionHmd.y, positionHmd.z);
if (cl_trackingmode.integer == 0) {
//Use hmd position for world position
setWorldPosition(positionHmd.x, positionHmd.y, positionHmd.z);
}
//Use hmd position for world position
setWorldPosition(positionHmd.x, positionHmd.y, positionHmd.z);
ALOGV(" HMD-Yaw: %f", hmdorientation[YAW]);
ALOGV(" HMD-Position: %f, %f, %f", positionHmd.x, positionHmd.y, positionHmd.z);
@ -1629,6 +1624,8 @@ static int getCharacter(float x, float y)
return c;
}
int breakHere = 0;
static void ovrApp_HandleInput( ovrApp * app )
{
float remote_movementSideways = 0.0f;
@ -1780,13 +1777,6 @@ static void ovrApp_HandleInput( ovrApp * app )
weaponOffset[1] = dominantRemoteTracking->HeadPose.Pose.Position.y - hmdPosition[1];
weaponOffset[2] = dominantRemoteTracking->HeadPose.Pose.Position.z - hmdPosition[2];
if (cl_trackingmode.integer == 1) {
//Use controller position for world position
setWorldPosition(dominantRemoteTracking->HeadPose.Pose.Position.x,
dominantRemoteTracking->HeadPose.Pose.Position.y,
dominantRemoteTracking->HeadPose.Pose.Position.z);
}
///Weapon location relative to view
vec2_t v;
rotateAboutOrigin(weaponOffset[0], weaponOffset[2], -yawOffset, v);
@ -1842,11 +1832,11 @@ static void ovrApp_HandleInput( ovrApp * app )
//This section corrects for the fact that the controller actually controls direction of movement, but we want to move relative to the direction the
//player is facing for positional tracking
float multiplier = /*arbitrary value that works ->*/
2200.0f / cl_forwardspeed.value;
2200.0f / (cl_forwardspeed.value * ((offHandTrackedRemoteState->Buttons & ovrButton_Trigger) ? cl_movespeedkey.value : 1.0f));
vec2_t v;
rotateAboutOrigin(-positionDeltaThisFrame[0] * multiplier,
positionDeltaThisFrame[2] * multiplier, -hmdorientation[YAW], v);
positionDeltaThisFrame[2] * multiplier, yawOffset - gunangles[YAW], v);
positional_movementSideways = v[0];
positional_movementForward = v[1];
@ -1987,6 +1977,7 @@ static void ovrApp_HandleInput( ovrApp * app )
(leftTrackedRemoteState_old.Buttons & ovrButton_X)) {
Cbuf_InsertText("God\n");
Cbuf_InsertText("Impulse 9\n");
breakHere = 1;
}
#endif

View file

@ -53,9 +53,6 @@ bind MOUSE2 "+forward"
bind MOUSE3 "+mlook"
"cl_particles_quality" "2"
"cl_stainmaps" "1"
"vr_fov" "108"
"vr_fov" "109"
"sensitivity" "4"
"snd_speed" "44100"
"cl_weapon_offset_ud" "0.1"
"cl_weapon_offset_lr" "0.0"
"cl_weapon_offset_fb" "0.16"