mirror of
https://github.com/DrBeef/QuakeQuest.git
synced 2024-11-25 13:31:48 +00:00
Multiple Enhancements
* 3DoF tracking mode for those that don't like the movement that 6DoF introduces * BULLET-TIME mode (think SUPERHOT), time moves when you move
This commit is contained in:
parent
ebdcff18a9
commit
3f10549ded
7 changed files with 123 additions and 98 deletions
|
@ -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="3"
|
||||
android:versionName="1.1.0" android:installLocation="auto" >
|
||||
android:versionCode="4"
|
||||
android:versionName="1.2.0" android:installLocation="auto" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="25" />
|
||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||
|
|
|
@ -447,6 +447,7 @@ cvar_t cl_pitchmult = {CVAR_SAVE, "cl_pitchmult","1.0","Multiplier for yaw (leav
|
|||
cvar_t cl_controllerdeadzone = {0, "cl_controllerdeadzone","0.05","Amount of deadzone to prevent movement drift due to badly calibrated controller (0.0 to 1.0)"};
|
||||
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)"};
|
||||
|
@ -2272,6 +2273,7 @@ void CL_InitInput (void)
|
|||
Cvar_RegisterVariable(&cl_weapon_offset_lr);
|
||||
Cvar_RegisterVariable(&cl_weapon_offset_fb);
|
||||
Cvar_RegisterVariable(&cl_weaponpitchadjust);
|
||||
Cvar_RegisterVariable(&cl_trackingmode);
|
||||
|
||||
Cvar_RegisterVariable(&cl_movecliptokeyboard);
|
||||
Cvar_RegisterVariable(&cl_movement);
|
||||
|
|
|
@ -57,8 +57,6 @@ cvar_t m_side = {CVAR_SAVE, "m_side","0.8","mouse side speed multiplier"};
|
|||
cvar_t freelook = {CVAR_SAVE, "freelook", "1","mouse controls pitch instead of forward/back"};
|
||||
|
||||
cvar_t cl_nosplashscreen = {CVAR_SAVE, "cl_nosplashscreen", "0", "prevents the credits splashscreen from being displayed on game start" };
|
||||
cvar_t cl_positionaltrackingmode = {CVAR_SAVE, "cl_positionaltrackingmode", "2", "0 - Pos Tracking Disabled, 1 - Camera Translation, 2 - Player Movement"};
|
||||
cvar_t cl_postrackmultiplier = {CVAR_SAVE, "cl_postrackmultiplier", "1.0", "Multiplies movement by a factor"};
|
||||
|
||||
cvar_t cl_autodemo = {CVAR_SAVE, "cl_autodemo", "0", "records every game played, using the date/time and map name to name the demo file" };
|
||||
cvar_t cl_autodemo_nameformat = {CVAR_SAVE, "cl_autodemo_nameformat", "autodemos/%Y-%m-%d_%H-%M", "The format of the cl_autodemo filename, followed by the map name (the date is encoded using strftime escapes)" };
|
||||
|
@ -2510,8 +2508,6 @@ void CL_Init (void)
|
|||
|
||||
|
||||
Cvar_RegisterVariable (&cl_nosplashscreen);
|
||||
Cvar_RegisterVariable (&cl_positionaltrackingmode);
|
||||
Cvar_RegisterVariable (&cl_postrackmultiplier);
|
||||
|
||||
Cvar_RegisterVariable (&cl_autodemo);
|
||||
Cvar_RegisterVariable (&cl_autodemo_nameformat);
|
||||
|
|
|
@ -31,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
static cvar_t forceqmenu = { 0, "forceqmenu", "0", "enables the quake menu instead of the quakec menu.dat (if present)" };
|
||||
static cvar_t menu_progs = { 0, "menu_progs", "menu.dat", "name of quakec menu.dat file" };
|
||||
extern cvar_t cl_positionaltrackingmode;
|
||||
|
||||
static int NehGameType;
|
||||
|
||||
|
@ -53,6 +52,8 @@ extern cvar_t r_worldscale;
|
|||
extern cvar_t r_lasersight;
|
||||
extern cvar_t cl_righthanded;
|
||||
extern cvar_t cl_walkdirection;
|
||||
extern cvar_t cl_trackingmode;
|
||||
extern cvar_t bullettime;
|
||||
|
||||
extern void BigScreenMode(int mode);
|
||||
|
||||
|
@ -308,7 +309,6 @@ static void M_DrawTextBox(float x, float y, float width, float height)
|
|||
//int m_save_demonum;
|
||||
|
||||
extern cvar_t cl_nosplashscreen;
|
||||
extern cvar_t cl_autocentreoffset;
|
||||
|
||||
/*
|
||||
================
|
||||
|
@ -1733,16 +1733,7 @@ static void M_Menu_Options_AdjustSliders (int dir)
|
|||
{
|
||||
Cvar_SetValueQuick (&r_lasersight, (r_lasersight.integer+1) % 3);
|
||||
}
|
||||
else if (options_cursor == optnum++)
|
||||
{
|
||||
int newMode = cl_positionaltrackingmode.integer + dir;
|
||||
if (newMode == 3)
|
||||
newMode = 0;
|
||||
if (newMode == -1)
|
||||
newMode = 2;
|
||||
|
||||
Cvar_SetValueQuick(&cl_positionaltrackingmode, newMode);
|
||||
}
|
||||
else if (options_cursor == optnum++) ;
|
||||
else if (options_cursor == optnum++)
|
||||
{
|
||||
cl_forwardspeed.value += dir * 10;
|
||||
|
@ -1849,7 +1840,7 @@ static void M_Options_Draw (void)
|
|||
M_Options_PrintCommand( " Controller Settings", true);
|
||||
M_Options_PrintCommand( " Open Quake Console", true);
|
||||
M_Options_PrintCommand( " Reset to defaults", true);
|
||||
M_Options_PrintCommand( " ", false);
|
||||
M_Options_PrintCheckbox(" BULLET-TIME Mode", true, bullettime.integer);
|
||||
M_Options_PrintCommand( " Key/Button Bindings", true);
|
||||
switch (r_lasersight.integer)
|
||||
{
|
||||
|
@ -1864,18 +1855,7 @@ static void M_Options_Draw (void)
|
|||
break;
|
||||
}
|
||||
|
||||
switch (cl_positionaltrackingmode.integer)
|
||||
{
|
||||
case 0:
|
||||
M_Options_PrintCommand( " Positional Tracking: Disabled", true);
|
||||
break;
|
||||
case 1:
|
||||
M_Options_PrintCommand( " Positional Tracking: Camera Translate", true);
|
||||
break;
|
||||
case 2:
|
||||
M_Options_PrintCommand( " Positional Tracking: Player Movement", true);
|
||||
break;
|
||||
}
|
||||
M_Options_PrintCommand( " Positional Tracking: Enabled", false);
|
||||
|
||||
M_Options_PrintSlider( " Player Movement Speed", true, cl_forwardspeed.value, 10, 500);
|
||||
M_Options_PrintCheckbox(" Show Framerate", true, showfps.integer);
|
||||
|
@ -1923,19 +1903,9 @@ static void M_Options_Key (int k, int ascii)
|
|||
case 3:
|
||||
M_Menu_Reset_f ();
|
||||
break;
|
||||
case 4: {
|
||||
if (bufOption==0) {
|
||||
Cbuf_AddText("deathmatch 1;map dpdm1");
|
||||
bufOption++;
|
||||
}
|
||||
else if (bufOption==1) {
|
||||
Cbuf_AddText("bots 3");
|
||||
bufOption++;
|
||||
}
|
||||
if (bufOption==2) {
|
||||
Cbuf_AddText("bots 0");
|
||||
bufOption=0;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
Cvar_SetValueQuick (&bullettime, (1-bullettime.integer));
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
|
@ -2211,7 +2181,7 @@ static void M_Menu_Options_Graphics_AdjustSliders (int dir)
|
|||
|
||||
optnum = 0;
|
||||
|
||||
if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&cl_autocentreoffset, bound(-200, cl_autocentreoffset.integer + dir * 5, 200));
|
||||
if (options_graphics_cursor == optnum++) ;
|
||||
else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_coronas, bound(0, r_coronas.value + dir * 0.125, 4));
|
||||
else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&gl_flashblend, !gl_flashblend.integer);
|
||||
else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_gloss, bound(0, r_shadow_gloss.integer + dir, 2));
|
||||
|
@ -2249,7 +2219,7 @@ static void M_Options_Graphics_Draw (void)
|
|||
visible = (int)((menu_height - 32) / 8);
|
||||
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_GRAPHICS_ITEMS - visible)) * 8;
|
||||
|
||||
M_Options_PrintSlider( " Lens Centre Offset", true, cl_autocentreoffset.integer, -200, 200);
|
||||
M_Options_PrintCommand( " ", false);
|
||||
M_Options_PrintSlider( " Corona Intensity", true, r_coronas.value, 0, 4);
|
||||
M_Options_PrintCheckbox(" Use Only Coronas", true, gl_flashblend.integer);
|
||||
M_Options_PrintSlider( " Gloss Mode", true, r_shadow_gloss.integer, 0, 2);
|
||||
|
@ -2989,7 +2959,7 @@ static void M_Reset_Draw (void)
|
|||
M_Print(8 + 4 * (linelength - 11), 16, "Press y / n");
|
||||
}
|
||||
|
||||
#define YAWCONTROL_ITEMS 5
|
||||
#define YAWCONTROL_ITEMS 6
|
||||
|
||||
static int controllermode_cursor;
|
||||
|
||||
|
@ -3007,7 +2977,8 @@ static void M_Menu_Controller_AdjustSliders (int dir)
|
|||
|
||||
optnum = 0;
|
||||
|
||||
if (controllermode_cursor == optnum++) ;
|
||||
if (controllermode_cursor == optnum++) ;
|
||||
else if (controllermode_cursor == optnum++) ;
|
||||
else if (controllermode_cursor == optnum++) ;
|
||||
else if (controllermode_cursor == optnum++) ;
|
||||
else if (controllermode_cursor == optnum++ && cl_yawmode.integer == 1)
|
||||
|
@ -3069,15 +3040,19 @@ static void M_Menu_Controller_Key (int key, int ascii)
|
|||
|
||||
case 'a':
|
||||
case K_LEFTARROW:
|
||||
if (controllermode_cursor == 0)
|
||||
if (controllermode_cursor == 0)
|
||||
{
|
||||
Cvar_SetValueQuick (&cl_trackingmode, 1 - cl_trackingmode.integer);
|
||||
}
|
||||
else if (controllermode_cursor == 1)
|
||||
{
|
||||
Cvar_SetValueQuick (&cl_walkdirection, 1 - cl_walkdirection.integer);
|
||||
}
|
||||
else if (controllermode_cursor == 1)
|
||||
else if (controllermode_cursor == 2)
|
||||
{
|
||||
Cvar_SetValueQuick (&cl_righthanded, 1 - cl_righthanded.integer);
|
||||
}
|
||||
else if (controllermode_cursor == 2)
|
||||
else if (controllermode_cursor == 3)
|
||||
{
|
||||
int newYawMode = cl_yawmode.integer;
|
||||
if (--newYawMode < 0)
|
||||
|
@ -3091,15 +3066,19 @@ static void M_Menu_Controller_Key (int key, int ascii)
|
|||
|
||||
case 'd':
|
||||
case K_RIGHTARROW:
|
||||
if (controllermode_cursor == 0)
|
||||
if (controllermode_cursor == 0)
|
||||
{
|
||||
Cvar_SetValueQuick (&cl_trackingmode, 1 - cl_trackingmode.integer);
|
||||
}
|
||||
else if (controllermode_cursor == 1)
|
||||
{
|
||||
Cvar_SetValueQuick (&cl_walkdirection, 1 - cl_walkdirection.integer);
|
||||
}
|
||||
else if (controllermode_cursor == 1)
|
||||
else if (controllermode_cursor == 2)
|
||||
{
|
||||
Cvar_SetValueQuick (&cl_righthanded, 1 - cl_righthanded.integer);
|
||||
}
|
||||
else if (controllermode_cursor == 2)
|
||||
else if (controllermode_cursor == 3)
|
||||
{
|
||||
int newYawMode = cl_yawmode.integer;
|
||||
if (++newYawMode > 2)
|
||||
|
@ -3133,6 +3112,11 @@ static void M_Menu_Controller_Draw (void)
|
|||
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, YAWCONTROL_ITEMS - visible)) * 8;
|
||||
|
||||
|
||||
if (cl_trackingmode.integer == 0)
|
||||
M_Options_PrintCommand("Tracking Mode: 3DoF Weapon", true);
|
||||
else
|
||||
M_Options_PrintCommand("Tracking Mode: 6DoF Weapon", true);
|
||||
|
||||
if (cl_walkdirection.integer == 0)
|
||||
M_Options_PrintCommand("Heading Mode: Off-hand Controller", true);
|
||||
else
|
||||
|
@ -3582,7 +3566,7 @@ static void M_Credits_Draw (void)
|
|||
" QQQQQQQQ QQQQQQQQ ",
|
||||
" QQQ QQQ ",
|
||||
" Q Q ",
|
||||
" Q Q v1.1.0 ");
|
||||
" Q Q v1.2.0 ");
|
||||
|
||||
int i, l, linelength, firstline, lastline, lines;
|
||||
for (i = 0, linelength = 0, firstline = 9999, lastline = -1;m_credits_message[i];i++)
|
||||
|
|
|
@ -48,6 +48,7 @@ cvar_t pr_checkextension = {CVAR_READONLY, "pr_checkextension", "1", "indicates
|
|||
cvar_t samelevel = {CVAR_NOTIFY, "samelevel","0", "repeats same level if level ends (due to timelimit or someone hitting an exit)"};
|
||||
cvar_t skill = {0, "skill","1", "difficulty level of game, affects monster layouts in levels, 0 = easy, 1 = normal, 2 = hard, 3 = nightmare (same layout as hard but monsters fire twice)"};
|
||||
cvar_t slowmo = {0, "slowmo", "1.0", "controls game speed, 0.5 is half speed, 2 is double speed"};
|
||||
cvar_t bullettime = {0, "bullettime", "0", "Whether bullet-time mode is enabled"};
|
||||
|
||||
cvar_t sv_accelerate = {0, "sv_accelerate", "1000", "rate at which a player accelerates to sv_maxspeed"};
|
||||
cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"};
|
||||
|
@ -458,6 +459,7 @@ void SV_Init (void)
|
|||
Cvar_RegisterVariable (&samelevel);
|
||||
Cvar_RegisterVariable (&skill);
|
||||
Cvar_RegisterVariable (&slowmo);
|
||||
Cvar_RegisterVariable (&bullettime);
|
||||
Cvar_RegisterVariable (&sv_accelerate);
|
||||
Cvar_RegisterVariable (&sv_aim);
|
||||
Cvar_RegisterVariable (&sv_airaccel_qw);
|
||||
|
|
|
@ -32,8 +32,6 @@ when crossing a water boudnary.
|
|||
|
||||
*/
|
||||
|
||||
cvar_t cl_autocentreoffset = {CVAR_SAVE, "cl_autocentreoffset", "0", "Additional lens offset (for difficult headets) from the centre to get images converging ok"};
|
||||
|
||||
cvar_t cl_rollspeed = {0, "cl_rollspeed", "200", "how much strafing is necessary to tilt the view"};
|
||||
cvar_t cl_rollangle = {0, "cl_rollangle", "0.0", "how much to tilt the view when strafing"};
|
||||
|
||||
|
@ -109,6 +107,8 @@ 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"};
|
||||
|
||||
// Prophecy camera pitchangle by Alexander "motorsep" Zubov
|
||||
cvar_t chase_pitchangle = {CVAR_SAVE, "chase_pitchangle", "55", "chase cam pitch angle"};
|
||||
|
||||
|
@ -122,7 +122,8 @@ extern float hmdPosition[3];
|
|||
extern float playerHeight;
|
||||
|
||||
extern cvar_t r_worldscale;
|
||||
extern cvar_t cl_positionaltrackingmode;
|
||||
extern cvar_t cl_trackingmode;
|
||||
extern cvar_t cl_righthanded;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -569,12 +570,6 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
|
|||
viewheightavg = viewheightavg * (1 - viewheight) + clstatsviewheight * viewheight;
|
||||
vieworg[2] += viewheightavg;
|
||||
|
||||
//OLD not required
|
||||
/* if (cl_positionaltrackingmode.integer == 2) {
|
||||
//Modify view origin with our positional offsets (multiplied by our world scale
|
||||
vieworg[2] += (worldPosition[1] * r_worldscale.value); // Up/Down
|
||||
}
|
||||
*/
|
||||
|
||||
if (chase_active.value) {
|
||||
// observing entity from third person. Added "campitch" by Alexander "motorsep" Zubov
|
||||
|
@ -711,8 +706,8 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
|
|||
VectorCopy(viewangles, cl.gunangles_prev);
|
||||
VectorSubtract(cl.gunangles_highpass, cl.gunangles_prev, cl.gunangles_highpass);
|
||||
|
||||
// 3. calculate the RAW adjustment vectors
|
||||
/* gunorg[0] *= (cl_followmodel.value ? -cl_followmodel_side_speed.value : 0);
|
||||
// 3calculate the RAW adjustment vectors
|
||||
gunorg[0] *= (cl_followmodel.value ? -cl_followmodel_side_speed.value : 0);
|
||||
gunorg[1] *= (cl_followmodel.value ? -cl_followmodel_side_speed.value : 0);
|
||||
gunorg[2] *= (cl_followmodel.value ? -cl_followmodel_up_speed.value : 0);
|
||||
|
||||
|
@ -731,13 +726,13 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
|
|||
|
||||
|
||||
// 5. use the adjusted vectors
|
||||
VectorAdd(vieworg, gunorg, gunorg);*/
|
||||
VectorAdd(vieworg, gunorg, gunorg);
|
||||
|
||||
// bounded XY speed, used by several effects below
|
||||
xyspeed = bound (0, sqrt(clvelocity[0] * clvelocity[0] +
|
||||
clvelocity[1] * clvelocity[1]), 400);
|
||||
|
||||
/* // vertical view bobbing code
|
||||
// vertical view bobbing code
|
||||
if (cl_bob.value && cl_bobcycle.value) {
|
||||
// LordHavoc: this code is *weird*, but not replacable (I think it
|
||||
// should be done in QC on the server, but oh well, quake is quake)
|
||||
|
@ -863,7 +858,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
|
|||
VectorMA (gunorg, bob, right, gunorg);
|
||||
bob = bspeed * cl_bobmodel_up.value * cl_viewmodel_scale.value * cos(s * 2) * t;
|
||||
VectorMA (gunorg, bob, up, gunorg);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
// calculate a view matrix for rendering the scene
|
||||
|
@ -876,24 +871,6 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
|
|||
v_idlescale.value * sin(cl.time * v_iroll_cycle.value) * v_iroll_level.value;
|
||||
}
|
||||
|
||||
//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);
|
||||
|
||||
// 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] * r_worldscale.value,
|
||||
vieworg[1] - weaponOffset[0] * r_worldscale.value,
|
||||
vieworg[2] + weaponOffset[1] * r_worldscale.value);
|
||||
|
||||
//Custom scaling required
|
||||
float weaponScale = cl_viewmodel_scale.value;
|
||||
if (cl.stats[STAT_ACTIVEWEAPON] == IT_ROCKET_LAUNCHER ||
|
||||
|
@ -914,13 +891,58 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
|
|||
weaponScale = 0.5f;
|
||||
}
|
||||
|
||||
Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix_withbob, gunorg[0],
|
||||
gunorg[1],
|
||||
gunorg[2],
|
||||
if (cl_trackingmode.integer == 0) //3DoF
|
||||
{
|
||||
{
|
||||
//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_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);
|
||||
}
|
||||
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);
|
||||
|
||||
// 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] * 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);
|
||||
|
||||
|
||||
VectorCopy(vieworg, cl.csqc_vieworiginfromengine);
|
||||
VectorCopy(viewangles, cl.csqc_viewanglesfromengine);
|
||||
|
||||
|
@ -1140,8 +1162,6 @@ void V_Init (void)
|
|||
Cvar_RegisterVariable (&v_idlescale);
|
||||
Cvar_RegisterVariable (&crosshair);
|
||||
|
||||
Cvar_RegisterVariable (&cl_autocentreoffset);
|
||||
|
||||
Cvar_RegisterVariable (&cl_rollspeed);
|
||||
Cvar_RegisterVariable (&cl_rollangle);
|
||||
Cvar_RegisterVariable (&cl_bob);
|
||||
|
@ -1199,6 +1219,8 @@ void V_Init (void)
|
|||
Cvar_RegisterVariable (&chase_pitchangle);
|
||||
Cvar_RegisterVariable (&chase_stevie);
|
||||
|
||||
Cvar_RegisterVariable (&cl_weaponoffset);
|
||||
|
||||
Cvar_RegisterVariable (&v_deathtilt);
|
||||
Cvar_RegisterVariable (&v_deathtiltangle);
|
||||
}
|
||||
|
|
|
@ -118,7 +118,6 @@ float positionDeltaThisFrame[3];
|
|||
extern cvar_t r_worldscale;
|
||||
extern cvar_t r_lasersight;
|
||||
extern cvar_t cl_forwardspeed;
|
||||
extern cvar_t cl_postrackmultiplier;
|
||||
extern cvar_t cl_walkdirection;
|
||||
extern cvar_t cl_controllerdeadzone;
|
||||
extern cvar_t cl_righthanded;
|
||||
|
@ -126,6 +125,9 @@ 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;
|
||||
extern cvar_t cl_trackingmode;
|
||||
|
||||
extern int key_consoleactive;
|
||||
|
||||
|
@ -1113,6 +1115,11 @@ static ovrLayerProjection2 ovrRenderer_RenderFrame( ovrRenderer * renderer, cons
|
|||
QuatToYawPitchRoll(quatHmd, 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);
|
||||
}
|
||||
|
||||
ALOGE(" HMD-Yaw: %f", hmdorientation[YAW]);
|
||||
ALOGE(" HMD-Position: %f, %f, %f", positionHmd.x, positionHmd.y, positionHmd.z);
|
||||
|
||||
|
@ -1701,9 +1708,12 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
weaponOffset[1] = dominantRemoteTracking->HeadPose.Pose.Position.y - hmdPosition[1];
|
||||
weaponOffset[2] = dominantRemoteTracking->HeadPose.Pose.Position.z - hmdPosition[2];
|
||||
|
||||
setWorldPosition(dominantRemoteTracking->HeadPose.Pose.Position.x,
|
||||
dominantRemoteTracking->HeadPose.Pose.Position.y,
|
||||
dominantRemoteTracking->HeadPose.Pose.Position.z);
|
||||
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;
|
||||
|
@ -1770,7 +1780,7 @@ 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_postrackmultiplier.value) / cl_forwardspeed.value;
|
||||
2200.0f / cl_forwardspeed.value;
|
||||
|
||||
vec2_t v;
|
||||
rotateAboutOrigin(-positionDeltaThisFrame[0] * multiplier,
|
||||
|
@ -1932,6 +1942,15 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
|
||||
QC_Analog(true, remote_movementSideways + positional_movementSideways,
|
||||
remote_movementForward + positional_movementForward);
|
||||
|
||||
|
||||
if (bullettime.integer)
|
||||
{
|
||||
float speed = sqrtf(powf(leftTrackedRemoteState_new.Joystick.x, 2) + powf(leftTrackedRemoteState_new.Joystick.y, 2));
|
||||
float movement = sqrtf(powf(positionDeltaThisFrame[0] * 50.0f, 2) + powf(positionDeltaThisFrame[2] * 50.0f, 2));
|
||||
speed = bound(0.04f, (speed > movement) ? speed : movement, 1.0f);
|
||||
Cvar_SetValueQuick(&slowmo, speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue